Skip to content

Commit 374db84

Browse files
committed
fix: update dns challenge settings and use cloudflare , restructure sites, use cloudflare dns
1 parent 6785514 commit 374db84

File tree

2 files changed

+26
-41
lines changed

2 files changed

+26
-41
lines changed

Diff for: Caddyfile.cluster

+13-21
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
11
{
22
# Enable admin API for clustering
33
admin off
4-
5-
# Global ACME DNS configuration for all sites
6-
acme_dns cloudns {
7-
auth_id "{$CLOUDNS_AUTH_ID}"
8-
auth_password "{$CLOUDNS_AUTH_PASSWORD}"
9-
}
10-
11-
tls {
12-
acme {
13-
resolvers 1.1.1.1 1.0.0.1
14-
disable_tlsalpn_challenge
15-
disable_http_challenge
16-
dns_ttl 30s
17-
}
18-
}
19-
204
# Configure storage for clustering
215
storage etcd {
226
prefix "{$PORTAL_CORE_CLUSTERED_ETCD_PREFIX}"
@@ -37,12 +21,20 @@
3721
}
3822
}
3923

40-
# Handle all domains matching the PORTAL_CORE_DOMAIN
41-
*.{$PORTAL_CORE_DOMAIN} {
42-
reverse_proxy localhost:{$PORTAL_CORE_PORT}
24+
# HTTP to HTTPS redirect
25+
http://*.{$PORTAL_CORE_DOMAIN}, http://{$PORTAL_CORE_DOMAIN} {
26+
redir https://{host}{uri} permanent
4327
}
4428

45-
# Handle direct domain access
46-
:80, :443 {
29+
# Handle all HTTPS domains
30+
*.{$PORTAL_CORE_DOMAIN}, {$PORTAL_CORE_DOMAIN} {
31+
tls {
32+
dns_ttl 30s
33+
resolvers 1.1.1.1 1.0.0.1
34+
dns cloudns {
35+
auth_id "{$CLOUDNS_AUTH_ID}"
36+
auth_password "{$CLOUDNS_AUTH_PASSWORD}"
37+
}
38+
}
4739
reverse_proxy localhost:{$PORTAL_CORE_PORT}
4840
}

Diff for: Caddyfile.cluster.notls

+13-20
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,6 @@
22
# Enable admin API for clustering
33
admin off
44

5-
# Global ACME DNS configuration for all sites
6-
acme_dns cloudns {
7-
auth_id "{$CLOUDNS_AUTH_ID}"
8-
auth_password "{$CLOUDNS_AUTH_PASSWORD}"
9-
}
10-
11-
tls {
12-
acme {
13-
resolvers 1.1.1.1 1.0.0.1
14-
disable_tlsalpn_challenge
15-
disable_http_challenge
16-
dns_ttl 30s
17-
}
18-
}
19-
205
# Configure storage for clustering
216
storage etcd {
227
prefix "{$PORTAL_CORE_CLUSTERED_ETCD_PREFIX}"
@@ -31,12 +16,20 @@
3116
}
3217
}
3318

34-
# Handle all domains matching the PORTAL_CORE_DOMAIN
35-
*.{$PORTAL_CORE_DOMAIN} {
36-
reverse_proxy localhost:{$PORTAL_CORE_PORT}
19+
# HTTP to HTTPS redirect
20+
http://*.{$PORTAL_CORE_DOMAIN}, http://{$PORTAL_CORE_DOMAIN} {
21+
redir https://{host}{uri} permanent
3722
}
3823

39-
# Handle direct domain access
40-
:80, :443 {
24+
# Handle all HTTPS domains
25+
*.{$PORTAL_CORE_DOMAIN}, {$PORTAL_CORE_DOMAIN} {
26+
tls {
27+
dns_ttl 30s
28+
resolvers 1.1.1.1 1.0.0.1
29+
dns cloudns {
30+
auth_id "{$CLOUDNS_AUTH_ID}"
31+
auth_password "{$CLOUDNS_AUTH_PASSWORD}"
32+
}
33+
}
4134
reverse_proxy localhost:{$PORTAL_CORE_PORT}
4235
}

0 commit comments

Comments
 (0)