From 6b45256839be96be7dbe556102e703d5c409bf32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=E2=80=9CNiols=E2=80=9D=20Jeannerod?= Date: Tue, 24 Sep 2024 14:17:56 +0200 Subject: [PATCH] s/urlFor/urlForBucket --- fediversity/default.nix | 2 +- fediversity/peertube.nix | 6 +++--- fediversity/pixelfed.nix | 4 ++-- tests/pixelfed-garage.nix | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fediversity/default.nix b/fediversity/default.nix index 768fb37..96a3d5b 100644 --- a/fediversity/default.nix +++ b/fediversity/default.nix @@ -68,7 +68,7 @@ in { type = types.int; default = 3902; }; - urlFor = mkOption { + urlForBucket = mkOption { type = types.functionTo types.str; default = bucket: "http://${bucket}.${config.fediversity.internal.garage.web.rootDomain}"; }; diff --git a/fediversity/peertube.nix b/fediversity/peertube.nix index 88d26e1..03e9e71 100644 --- a/fediversity/peertube.nix +++ b/fediversity/peertube.nix @@ -74,17 +74,17 @@ lib.mkIf (config.fediversity.enable && config.fediversity.peertube.enable) { web_videos = rec { bucket_name = "peertube-videos"; prefix = ""; - base_url = config.fediversity.internal.garage.web.urlFor bucket_name; + base_url = config.fediversity.internal.garage.web.urlForBucket bucket_name; }; videos = rec { bucket_name = "peertube-videos"; prefix = ""; - base_url = config.fediversity.internal.garage.web.urlFor bucket_name; + base_url = config.fediversity.internal.garage.web.urlForBucket bucket_name; }; streaming_playlists = rec { bucket_name = "peertube-playlists"; prefix = ""; - base_url = config.fediversity.internal.garage.web.urlFor bucket_name; + base_url = config.fediversity.internal.garage.web.urlForBucket bucket_name; }; }; }; diff --git a/fediversity/pixelfed.nix b/fediversity/pixelfed.nix index c9b48a0..894b99d 100644 --- a/fediversity/pixelfed.nix +++ b/fediversity/pixelfed.nix @@ -52,7 +52,7 @@ lib.mkIf (config.fediversity.enable && config.fediversity.pixelfed.enable) { nginx = { forceSSL = true; enableACME = true; - # locations."/public/".proxyPass = "${config.fediversity.internal.garage.web.urlFor "pixelfed"}/public/"; + # locations."/public/".proxyPass = "${config.fediversity.internal.garage.web.urlForBucket "pixelfed"}/public/"; }; }; @@ -68,7 +68,7 @@ lib.mkIf (config.fediversity.enable && config.fediversity.pixelfed.enable) { AWS_ACCESS_KEY_ID = snakeoil_key.id; AWS_SECRET_ACCESS_KEY = snakeoil_key.secret; AWS_DEFAULT_REGION = "garage"; - AWS_URL = config.fediversity.internal.garage.web.urlFor "pixelfed"; + AWS_URL = config.fediversity.internal.garage.web.urlForBucket "pixelfed"; AWS_BUCKET = "pixelfed"; AWS_ENDPOINT = config.fediversity.internal.garage.api.url; AWS_USE_PATH_STYLE_ENDPOINT = false; diff --git a/tests/pixelfed-garage.nix b/tests/pixelfed-garage.nix index b25bc66..f921c77 100644 --- a/tests/pixelfed-garage.nix +++ b/tests/pixelfed-garage.nix @@ -202,7 +202,7 @@ pkgs.nixosTest { with subtest("Check that image comes from garage"): src = server.succeed("su - selenium -c 'selenium-script-get-src ${email} ${password}'") - if not src.startswith("${nodes.server.fediversity.internal.garage.web.urlFor "pixelfed"}"): + if not src.startswith("${nodes.server.fediversity.internal.garage.web.urlForBucket "pixelfed"}"): raise Exception("image does not come from garage") ''; }