mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-12-02 07:47:58 +00:00
fix(peertube): derive the webserver authority from the TLS lookup
The role set no webserver scheme or port, so PeerTube kept its upstream default
of https on 443 even on an onion node, where the vhost is plaintext and Tor
publishes port 80. redirect_uris.py meanwhile resolves the same deployment
through resolve_enabled and registers http://video.<onion>/* with Keycloak, so
the plugin asked for an https callback against an http registration and Keycloak
answered invalid_redirect_uri four times in its event log.
Both values now come from the tls lookup, which decides scheme and port together
from one resolve_enabled call -- the same predicate redirect_uris.py uses for the
registration and nginx_ssl_header.j2 uses for its listen directive. There is no
second expression left that could drift.
The port is not cosmetic. WEBSERVER.URL is built as scheme://hostname:port and
sanitizeUrl drops the port only for (https,443) and (http,80), so flipping the
scheme alone would have produced http://video.<onion>:443 -- still unmatched
against the portless registration, and against a port Tor never publishes.
095197a65 removed these two variables in 2022 because they were hardcoded to
https=false and port=9000, which is the internal listener and was wrong for every
proxied deployment. That fix stands: the upstream default is correct for clearnet
behind the proxy. It is only wrong where TLS is off, which is what this restores,
conditionally.
Evidence: run 31658270172 job 94319317216, artifact 9171666491 keycloak event log
(error="invalid_redirect_uri", redirect_uri="https://video.<onion>/plugins/
auth-openid-connect/router/code-cb"), and the peertube service log label
[video.<onion>:443] proving PORT was 443 at runtime.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
f7bb608927
commit
bffe4ee04c
1 file changed
+2
@@ -13,6 +13,8 @@ PEERTUBE_REDIS_PORT={{ lookup('engine', 'redis', application_id, 'port') }}
|
||||
PEERTUBE_REDIS_AUTH={{ lookup('engine', 'redis', application_id, 'password') | dotenv_quote }}
|
||||
|
||||
PEERTUBE_WEBSERVER_HOSTNAME={{ lookup('domain',application_id) }}
|
||||
PEERTUBE_WEBSERVER_HTTPS={{ lookup('tls', application_id, 'enabled') | string | lower }}
|
||||
PEERTUBE_WEBSERVER_PORT={{ lookup('tls', application_id, 'ports.web') }}
|
||||
PEERTUBE_TRUST_PROXY=["127.0.0.1", "loopback"]
|
||||
|
||||
{% if PEERTUBE_LIVE_ENABLED | bool %}
|
||||
|
||||
Reference in new issue
Block a user