Actually fix letsencrypt issue.

This commit is contained in:
Greyson Parrelli committed 2026-10-13 15:13:56 -04:00
1 parent 54b640aef0
commit ed7cd764be
3 files changed
+9 -2

No files matched your search

+3
View File
@@ -309,6 +309,9 @@ and sign out at `https://<any-app>/_google-auth/logout`.
`location /foo` prefix blocks will be shadowed by this plugin's catch-all `location /foo` prefix blocks will be shadowed by this plugin's catch-all
regex location — use `location ^~ /foo` in your own snippets if you need regex location — use `location ^~ /foo` in your own snippets if you need
them to win. them to win.
- **dokku-letsencrypt HTTP-01 renewals** keep working: the catch-all skips
`/.well-known/acme-challenge/`, so the challenge location letsencrypt
writes during a renewal is served without a Google session.
- **Non-browser clients** (curl, fetch without `Accept: text/html`) get a - **Non-browser clients** (curl, fetch without `Accept: text/html`) get a
JSON `401` instead of a redirect chain. JSON `401` instead of a redirect chain.
- **Websockets** work — upgrade headers are forwarded exactly like dokku's - **Websockets** work — upgrade headers are forwarded exactly like dokku's
+5 -2
View File
@@ -461,8 +461,11 @@ EOF
cat <<EOF cat <<EOF
# Everything else requires a Google session. # Everything else requires a Google session. The negative lookahead leaves
location ~ ^/ { # /.well-known/acme-challenge to the plain prefix location dokku-letsencrypt
# writes during HTTP-01 renewal; a regex catch-all would otherwise shadow
# it and the challenge would get a 401.
location ~ ^/(?!\.well-known/acme-challenge(/|$)) {
auth_request ${GOOGLE_AUTH_ROUTE_PREFIX}/verify; auth_request ${GOOGLE_AUTH_ROUTE_PREFIX}/verify;
auth_request_set \$google_auth_user \$upstream_http_x_auth_request_user; auth_request_set \$google_auth_user \$upstream_http_x_auth_request_user;
auth_request_set \$google_auth_email \$upstream_http_x_auth_request_email; auth_request_set \$google_auth_email \$upstream_http_x_auth_request_email;
+1
View File
@@ -53,6 +53,7 @@ fn-ga-generate-conf "$APP" >"$CONF" || fail "conf generation failed"
grep -q 'proxy_pass http://myapp-5000;' "$CONF" || fail "conf should proxy to the app upstream" grep -q 'proxy_pass http://myapp-5000;' "$CONF" || fail "conf should proxy to the app upstream"
grep -q 'auth_request /_google-auth/verify;' "$CONF" || fail "conf should gate with auth_request" grep -q 'auth_request /_google-auth/verify;' "$CONF" || fail "conf should gate with auth_request"
grep -qF 'location ~ ^/(?!\.well-known/acme-challenge(/|$)) {' "$CONF" || fail "catch-all should leave the letsencrypt challenge path alone"
grep -q 'location ^~ /api/webhooks {' "$CONF" || fail "conf should contain prefix exclusion" grep -q 'location ^~ /api/webhooks {' "$CONF" || fail "conf should contain prefix exclusion"
grep -q 'location ~ ^/healthz$ {' "$CONF" || fail "conf should contain regex exclusion" grep -q 'location ~ ^/healthz$ {' "$CONF" || fail "conf should contain regex exclusion"
grep -q 'error_page 401 = @google_auth_signin;' "$CONF" || fail "conf should redirect 401s to signin" grep -q 'error_page 401 = @google_auth_signin;' "$CONF" || fail "conf should redirect 401s to signin"