fix(storage01): Fix garage and peertube config

This commit is contained in:
Tom Hubrecht 2023-10-05 23:28:27 +02:00
parent 3785088616
commit de5fe11f84
2 changed files with 19 additions and 5 deletions

View file

@ -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;

View file

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