From de5fe11f847440a8b34447612f302203094fcad7 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Thu, 5 Oct 2023 23:28:27 +0200 Subject: [PATCH] fix(storage01): Fix garage and peertube config --- machines/storage01/garage.nix | 14 ++++++++++++-- machines/storage01/peertube.nix | 10 +++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/machines/storage01/garage.nix b/machines/storage01/garage.nix index 280c100..9d2e53b 100644 --- a/machines/storage01/garage.nix +++ b/machines/storage01/garage.nix @@ -6,6 +6,9 @@ let data_dir = "/data/slow/garage/data"; metadata_dir = "/data/fast/garage/meta"; + + buckets = [ "peertube-videos-dgnum" ]; + in { services.garage = { enable = true; @@ -31,9 +34,9 @@ in { index = "index.html"; }; - k2v_api.api_bind_addr = "[::]:3904"; + k2v_api.api_bind_addr = "[::]:3904"; - admin.api_bind_addr = "0.0.0.0:3903"; + admin.api_bind_addr = "0.0.0.0:3903"; }; environmentFile = config.age.secrets."garage-environment_file".path; @@ -54,18 +57,25 @@ in { ${host} = { enableACME = true; forceSSL = true; + + serverAliases = builtins.map (b: "${b}.${host}") buckets; + locations."/".extraConfig = '' proxy_pass http://127.0.0.1:3900; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; # Disable buffering to a temporary file. proxy_max_temp_file_size 0; + client_max_body_size 200M; ''; }; ${webHost} = { enableACME = true; forceSSL = true; + + serverAliases = builtins.map (b: "${b}.${webHost}") buckets; + locations."/".extraConfig = '' proxy_pass http://127.0.0.1:3902; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/machines/storage01/peertube.nix b/machines/storage01/peertube.nix index 425a561..6d51103 100644 --- a/machines/storage01/peertube.nix +++ b/machines/storage01/peertube.nix @@ -9,17 +9,21 @@ in { object_storage = { enabled = true; - endpoint = "s3.dgnum.eu"; + endpoint = "https://s3.dgnum.eu"; region = "garage"; + max_upload_part = "150MB"; + videos = { bucket_name = "peertube-videos-dgnum"; - prefix = "web-videos"; + prefix = "web-videos/"; + base_url = "https://peertube-videos-dgnum.cdn.dgnum.eu"; }; streaming_playlists = { bucket_name = "peertube-videos-dgnum"; - prefix = "streaming-playlists"; + prefix = "streaming-playlists/"; + base_url = "https://peertube-videos-dgnum.cdn.dgnum.eu"; }; };