From f8d1454d6e93a7dde630b665ebcbb1d2a2c9c42e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sun, 27 Nov 2022 14:43:41 +0100 Subject: [PATCH] fix peertube --- config/services/peertube/default.nix | 3 ++- config/services/reverse-proxy.nix | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/config/services/peertube/default.nix b/config/services/peertube/default.nix index dca117cb..aba99820 100644 --- a/config/services/peertube/default.nix +++ b/config/services/peertube/default.nix @@ -3,7 +3,8 @@ enable = true; localDomain = "peertube.chir.rs"; listenHttp = 5370; - listenWeb = 5370; + listenWeb = 443; + enableWebHttps = true; serviceEnvironmentFile = config.sops.secrets."services/peertube".path; settings = { object_storage = { diff --git a/config/services/reverse-proxy.nix b/config/services/reverse-proxy.nix index 80e6a21c..4af484c0 100644 --- a/config/services/reverse-proxy.nix +++ b/config/services/reverse-proxy.nix @@ -46,20 +46,33 @@ in { method GET } + @options { + method OPTIONS + } + + header { + Access-Control-Allow-Origin * + Access-Control-Allow-Credentials true + Access-Control-Allow-Methods GET + Access-Control-Allow-Headers * + defer + } + reverse_proxy @getOnly { to http://localhost:24155 header_up Host {upstream_hostport} header_up -Authorization header_down -Set-Cookie - header_down Access-Control-Allow-Origin '*' + header_down -Access-Control-Allow-Origin header_down -Access-Control-Allow-Methods - header_down Access-Control-Allow-Headers + header_down -Access-Control-Allow-Headers header_up -Set-Cookie transport http { versions 1.1 2 3 } } + respond @options 204 ''; }; "cache.chir.rs" = {