repos / pico

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

commit
a47f4e7
parent
4a514c1
author
Eric Bower
date
2024-03-09 17:23:50 +0000 UTC
custom caddyfile for pgs
3 files changed,  +71, -2
A caddy/Caddyfile.pgs
+69, -0
 1@@ -0,0 +1,69 @@
 2+{
 3+	on_demand_tls {
 4+		ask http://web:3000/check
 5+		interval 1m
 6+		burst 10
 7+	}
 8+	servers {
 9+		metrics
10+	}
11+}
12+
13+*.{$APP_DOMAIN}, {$APP_DOMAIN} {
14+	reverse_proxy web:3000
15+	tls {$APP_EMAIL} {
16+		dns cloudflare {$CF_API_TOKEN}
17+		resolvers 1.1.1.1
18+	}
19+	encode zstd gzip
20+
21+	header {
22+		# disable FLoC tracking
23+		Permissions-Policy interest-cohort=()
24+
25+		# enable HSTS
26+		Strict-Transport-Security max-age=31536000;
27+
28+		# disable clients from sniffing the media type
29+		X-Content-Type-Options nosniff
30+
31+		# clickjacking protection
32+		X-Frame-Options DENY
33+
34+		# keep referrer data off of HTTP connections
35+		Referrer-Policy no-referrer-when-downgrade
36+
37+		Content-Security-Policy "default-src 'self'; img-src * 'unsafe-inline'; style-src * 'unsafe-inline'"
38+
39+		X-XSS-Protection "1; mode=block"
40+
41+    Access-Control-Allow-Origin *
42+	}
43+
44+	@caddymetrics {
45+		host {$APP_DOMAIN}
46+		path /_caddy/metrics
47+	}
48+
49+	metrics @caddymetrics {
50+		disable_openmetrics
51+	}
52+
53+	@appmetrics {
54+		host {$APP_DOMAIN}
55+		path /_app/metrics
56+	}
57+
58+	handle @appmetrics {
59+		rewrite * /metrics
60+		reverse_proxy ssh:9222
61+	}
62+}
63+
64+:443 {
65+	reverse_proxy web:3000
66+	tls {$APP_EMAIL} {
67+		on_demand
68+	}
69+	encode zstd gzip
70+}
M db/postgres/storage.go
+1, -1
1@@ -1222,7 +1222,7 @@ func (me *PsqlDB) FindFeaturesForUser(userID string) ([]*db.FeatureFlag, error)
2 		if err != nil {
3 			return features, err
4 		}
5-		ff.Name = paymentHistoryID.String
6+		ff.PaymentHistoryID = paymentHistoryID.String
7 
8 		features = append(features, ff)
9 	}
M docker-compose.prod.yml
+1, -1
1@@ -219,7 +219,7 @@ services:
2       APP_DOMAIN: ${PGS_DOMAIN:-pgs.sh}
3       APP_EMAIL: ${PGS_EMAIL:-hello@pico.sh}
4     volumes:
5-      - ${PGS_CADDYFILE}:/etc/caddy/Caddyfile
6+      - ${PGS_CADDYFILE}:/etc/caddy/Caddyfile.pgs
7       - ./data/pgs-caddy/data:/data
8       - ./data/pgs-caddy/config:/config
9     ports: