From a5f06d449088c9dad1dab1bb79ab25e4d720d6dc Mon Sep 17 00:00:00 2001 From: agent Date: Fri, 9 Oct 2026 22:25:32 +0000 Subject: [PATCH 1/3] Pass app variables as KEY: ${KEY} so they merge with compose-set values The env override listed bare keys (- KEY). podman-compose can't merge a bare key with a value the compose file sets for the same variable and fails the deploy: "can't merge value of [KEY] of type str and NoneType". Writing KEY: ${KEY} keeps values out of the YAML (compose interpolates them from its environment) and merges with list- or map-form environment. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF --- README.md | 9 +++++---- panelctl.sh | 9 ++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index bb3529b..19d7cc4 100644 --- a/README.md +++ b/README.md @@ -208,10 +208,11 @@ to every compose command: The UI points out variables the compose file uses without a default that aren't set. - With **Pass to every container** (the default), `deploy`/`restart` also - generate `stacks//.panel-env.yaml`, a compose override that lists the - keys under every service's `environment:`. Compose reads the values from its - own environment, so they are never quoted into YAML, and they take - precedence over values set in the compose file. + generate `stacks//.panel-env.yaml`, a compose override that sets + `KEY: ${KEY}` under every service's `environment:`. Compose fills the values + in from its own environment, so they are never quoted into YAML, and they + take precedence over values set in the compose file (including variables + the compose file sets itself, in list or map form). Values must be single-line. Names that would change how podman/compose run (`PATH`, `HOME`, `XDG_*`, `DOCKER_*`, `COMPOSE_*`, `PODMAN_*`, …) are rejected. diff --git a/panelctl.sh b/panelctl.sh index 0369cc4..947ec87 100644 --- a/panelctl.sh +++ b/panelctl.sh @@ -279,8 +279,11 @@ load_app_env() { # (Re)generate the env override before containers are created. Variables are # always available for ${VAR} interpolation; with APP_ENV_INJECT (default true) -# every service also receives them. Bare keys make compose read the values from -# its own environment, so values never have to be quoted into YAML. +# every service also receives them as `KEY: ${KEY}`, which compose fills in from +# its own environment, so values never have to be quoted into YAML. (Bare keys +# would do the same, but podman-compose can't merge a bare key with a value the +# compose file sets for the same variable: "can't merge value of [KEY] of type +# str and NoneType".) prepare_env_override() { local name="$1" local override services svc key tmp @@ -303,7 +306,7 @@ prepare_env_override() { [[ "${svc}" =~ ^[A-Za-z0-9._-]+$ ]] || continue printf ' "%s":\n environment:\n' "${svc}" for key in "${APP_ENV_KEYS[@]}"; do - printf ' - %s\n' "${key}" + printf ' %s: ${%s}\n' "${key}" "${key}" done done <<<"${services}" } >"${tmp}" From 30dd303189340a47dee258819e043af17b25be1d Mon Sep 17 00:00:00 2001 From: agent Date: Sun, 18 Oct 2026 16:18:08 +0000 Subject: [PATCH 2/3] Put NixOS setuid wrappers on the panel service PATH Deploys failed with 'command required for rootless mode with multiple IDs: exec: "newuidmap": executable file not found in $PATH'. Rootless podman needs the setuid newuidmap/newgidmap, which NixOS only installs in /run/wrappers/bin. Login shells have that on PATH, systemd services do not, so podman worked over SSH but not from panel-api. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018s1T5e2bQY6WrX4JeEyEPM --- nix/module.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/module.nix b/nix/module.nix index 3ad08fb..51a77ee 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -123,6 +123,7 @@ in description = "Panel API"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; + path = [ "/run/wrappers" ]; serviceConfig = { Type = "simple"; From bc3244a022f5acfa6c45fd4fc749901165ce5c0d Mon Sep 17 00:00:00 2001 From: agent Date: Tue, 20 Oct 2026 15:43:02 +0000 Subject: [PATCH 3/3] Run panel-api with reudy's primary group Deploys failed with "newuidmap: Target process is owned by a different user: ... gid:992 pw_gid:100". newuidmap only maps for a process whose gid matches the user's passwd entry, and the unit forced Group=panelroutes. It only worked while a podman pause process from a login shell still held reudy's user namespace. panelroutes is only needed to write the Caddy routes file, which panelctl does with an explicit `install -g`; a supplementary group is enough for that. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018s1T5e2bQY6WrX4JeEyEPM --- nix/module.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/module.nix b/nix/module.nix index 51a77ee..91c7328 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -128,7 +128,7 @@ in serviceConfig = { Type = "simple"; User = cfg.user; - Group = cfg.group; + SupplementaryGroups = [ cfg.group ]; Restart = "always"; RestartSec = 3; WorkingDirectory = cfg.baseDir;