diff --git a/caddy.nix b/caddy.nix index 036e9dd..fc786d1 100755 --- a/caddy.nix +++ b/caddy.nix @@ -5,7 +5,7 @@ email = "admin@srazka.com"; extraConfig = '' # Generated app routes from the panel backend. - import /home/reudy/containers/routes/routes.caddy + import /var/lib/containers/routes/routes.caddy ''; # Authelia's own login portal diff --git a/configuration.nix b/configuration.nix index 9d86f65..001ec8b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -25,7 +25,6 @@ users.users.reudy = { isNormalUser = true; - # Keep home traversable so caddy can import generated snippets from ~/containers/routes. homeMode = "0755"; extraGroups = [ "wheel" "podman" "panelroutes" ]; #sudo openssh.authorizedKeys.keys = [ @@ -40,13 +39,13 @@ users.users.caddy.extraGroups = [ "panelroutes" ]; systemd.tmpfiles.rules = [ - "d /home/reudy/containers 0750 reudy panelroutes -" - "d /home/reudy/containers/stacks 0750 reudy panelroutes -" - "d /home/reudy/containers/volumes 0750 reudy panelroutes -" - "d /home/reudy/containers/routes 0755 reudy panelroutes -" - "d /home/reudy/containers/state 0750 reudy panelroutes -" - "d /home/reudy/containers/state/apps 0750 reudy panelroutes -" - "f /home/reudy/containers/routes/routes.caddy 0640 reudy panelroutes -" + "d /var/lib/containers 0750 reudy panelroutes -" + "d /var/lib/containers/stacks 0750 reudy panelroutes -" + "d /var/lib/containers/volumes 0750 reudy panelroutes -" + "d /var/lib/containers/routes 0755 reudy panelroutes -" + "d /var/lib/containers/state 0750 reudy panelroutes -" + "d /var/lib/containers/state/apps 0750 reudy panelroutes -" + "f /var/lib/containers/routes/routes.caddy 0640 reudy panelroutes -" "f /var/lib/systemd/linger/reudy" ]; @@ -74,7 +73,7 @@ environment = { PANEL_API_BIND = "127.0.0.1"; PANEL_API_PORT = "9911"; - PANEL_BASE_DIR = "/home/reudy/containers"; + PANEL_BASE_DIR = "/var/lib/containers"; PANELCTL_PATH = "/run/current-system/sw/bin/panelctl"; }; }; diff --git a/panel/README.md b/panel/README.md index aeb4a61..c72551b 100644 --- a/panel/README.md +++ b/panel/README.md @@ -3,13 +3,13 @@ This repository now includes a small helper command named panelctl for Phase 2. Base directory: -- /home/reudy/containers +- /var/lib/containers Generated structure: -- /home/reudy/containers/stacks//compose.yaml -- /home/reudy/containers/volumes//data -- /home/reudy/containers/routes/.caddy -- /home/reudy/containers/state/apps/.env +- /var/lib/containers/stacks//compose.yaml +- /var/lib/containers/volumes//data +- /var/lib/containers/routes/.caddy +- /var/lib/containers/state/apps/.env Quick workflow: 1. Create a new app definition: diff --git a/panel/panel-api.py b/panel/panel-api.py index 090b88d..2df33dc 100644 --- a/panel/panel-api.py +++ b/panel/panel-api.py @@ -9,7 +9,7 @@ from urllib.parse import urlparse PANELCTL = os.environ.get("PANELCTL_PATH", "/run/current-system/sw/bin/panelctl") BIND = os.environ.get("PANEL_API_BIND", "127.0.0.1") PORT = int(os.environ.get("PANEL_API_PORT", "9911")) -BASE_DIR = os.environ.get("PANEL_BASE_DIR", "/home/reudy/containers") +BASE_DIR = os.environ.get("PANEL_BASE_DIR", "/var/lib/containers") INDEX_HTML = """ diff --git a/panel/panelctl.sh b/panel/panelctl.sh index 446b22a..14fe331 100644 --- a/panel/panelctl.sh +++ b/panel/panelctl.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -BASE_DIR="${PANEL_BASE_DIR:-/home/reudy/containers}" +BASE_DIR="${PANEL_BASE_DIR:-/var/lib/containers}" STACKS_DIR="${BASE_DIR}/stacks" VOLUMES_DIR="${BASE_DIR}/volumes" ROUTES_DIR="${BASE_DIR}/routes"