From 65f92138c1dc2b0f23f2e9ab7d6b635027054eff Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Wed, 16 Apr 2025 13:54:44 +0200 Subject: [PATCH 1/2] nixos/homepage-dashboard: Set ALLOWED_HOSTS env var. homepage 1.0.0 requires this var to be set, this change allows setting it without building an environmentFile. --- .../modules/services/misc/homepage-dashboard.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/homepage-dashboard.nix b/nixos/modules/services/misc/homepage-dashboard.nix index 72861fdbbe87..1a541963187b 100644 --- a/nixos/modules/services/misc/homepage-dashboard.nix +++ b/nixos/modules/services/misc/homepage-dashboard.nix @@ -4,7 +4,6 @@ lib, ... }: - let cfg = config.services.homepage-dashboard; # Define the settings format used for this program @@ -29,6 +28,19 @@ in description = "Port for Homepage to bind to."; }; + allowedHosts = lib.mkOption { + type = lib.types.str; + default = "localhost:8082,127.0.0.1:8082"; + example = "example.com"; + description = '' + Hosts that homepage-dashboard will be running under. + You will want to change this in order to acess homepage from anything other than localhost. + see the upsream documentation: + + + ''; + }; + environmentFile = lib.mkOption { type = lib.types.str; description = '' @@ -215,6 +227,7 @@ in NIXPKGS_HOMEPAGE_CACHE_DIR = "/var/cache/homepage-dashboard"; PORT = toString cfg.listenPort; LOG_TARGETS = "stdout"; + HOMEPAGE_ALLOWED_HOSTS = cfg.allowedHosts; }; serviceConfig = { From f7c0ca4a82dffe40329d70c1489e5e1a74033c38 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Wed, 16 Apr 2025 14:07:39 +0200 Subject: [PATCH 2/2] nixos/homepage-dashboard: Added release notes about breaking change. --- nixos/doc/manual/release-notes/rl-2505.section.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 3978772d32d8..470c81ab9794 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -416,6 +416,8 @@ - `programs.clash-verge.tunMode` was deprecated and removed because now service mode is necessary to start program. Without `programs.clash-verge.enable`, clash-verge-rev will refuse to start. +- `services.homepage-dashboard` now requires the `allowedHosts` option to be set in accordance with the [documentation](https://gethomepage.dev/installation/#homepage_allowed_hosts). + - `services.netbird.tunnels` was renamed to [`services.netbird.clients`](#opt-services.netbird.clients), hardened (using dedicated less-privileged users) and significantly extended.