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"; }; };