repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
94a5eb0
parent
9ed427a
author
Antonio Mika
date
2022-08-02 16:29:57 +0000 UTC
Added support for custom domains to lists and pastes
2 files changed,  +16, -2
M lists/config.go
+8, -1
 1@@ -11,6 +11,7 @@ func NewConfigSite() *shared.ConfigSite {
 2 	domain := shared.GetEnv("LISTS_DOMAIN", "lists.sh")
 3 	email := shared.GetEnv("LISTS_EMAIL", "support@lists.sh")
 4 	subdomains := shared.GetEnv("LISTS_SUBDOMAINS", "0")
 5+	customdomains := shared.GetEnv("LISTS_CUSTOMDOMAINS", "0")
 6 	port := shared.GetEnv("LISTS_WEB_PORT", "3000")
 7 	protocol := shared.GetEnv("LISTS_PROTOCOL", "https")
 8 	dbURL := shared.GetEnv("DATABASE_URL", "")
 9@@ -19,6 +20,11 @@ func NewConfigSite() *shared.ConfigSite {
10 		subdomainsEnabled = true
11 	}
12 
13+	customdomainsEnabled := false
14+	if customdomains == "1" {
15+		customdomainsEnabled = true
16+	}
17+
18 	intro := "To get started, enter a username.\n"
19 	intro += "Then create a folder locally (e.g. ~/blog).\n"
20 	intro += "Then write your lists in plain text files (e.g. hello-world.txt).\n"
21@@ -26,7 +32,8 @@ func NewConfigSite() *shared.ConfigSite {
22 	intro += fmt.Sprintf("scp ~/blog/*.txt %s:/\n\n", domain)
23 
24 	return &shared.ConfigSite{
25-		SubdomainsEnabled: subdomainsEnabled,
26+		SubdomainsEnabled:    subdomainsEnabled,
27+		CustomdomainsEnabled: customdomainsEnabled,
28 		ConfigCms: config.ConfigCms{
29 			Domain:      domain,
30 			Email:       email,
M pastes/config.go
+8, -1
 1@@ -11,6 +11,7 @@ func NewConfigSite() *shared.ConfigSite {
 2 	domain := shared.GetEnv("PASTES_DOMAIN", "pastes.sh")
 3 	email := shared.GetEnv("PASTES_EMAIL", "hello@pastes.sh")
 4 	subdomains := shared.GetEnv("PASTES_SUBDOMAINS", "0")
 5+	customdomains := shared.GetEnv("PASTES_CUSTOMDOMAINS", "0")
 6 	port := shared.GetEnv("PASTES_WEB_PORT", "3000")
 7 	dbURL := shared.GetEnv("DATABASE_URL", "")
 8 	protocol := shared.GetEnv("PASTES_PROTOCOL", "https")
 9@@ -19,6 +20,11 @@ func NewConfigSite() *shared.ConfigSite {
10 		subdomainsEnabled = true
11 	}
12 
13+	customdomainsEnabled := false
14+	if customdomains == "1" {
15+		customdomainsEnabled = true
16+	}
17+
18 	intro := "To get started, enter a username.\n"
19 	intro += "Then create a folder locally (e.g. ~/pastes).\n"
20 	intro += "Then write your paste post (e.g. feature.patch).\n"
21@@ -26,7 +32,8 @@ func NewConfigSite() *shared.ConfigSite {
22 	intro += fmt.Sprintf("scp ~/pastes/* %s:/", domain)
23 
24 	return &shared.ConfigSite{
25-		SubdomainsEnabled: subdomainsEnabled,
26+		SubdomainsEnabled:    subdomainsEnabled,
27+		CustomdomainsEnabled: customdomainsEnabled,
28 		ConfigCms: config.ConfigCms{
29 			Domain:      domain,
30 			Port:        port,