chore(core): scrub personal domain/username literals and enforce pyright in flake checks
Core Architecture & Invariant CI / validate (pull_request) Failing after 1m16s
Core Architecture & Invariant CI / validate (pull_request) Failing after 1m16s
This commit is contained in:
1 parent
53404914c3
commit
8cc06e2470
15 files changed
+127
-75
No files matched your search
+11
-1
@@ -21,7 +21,17 @@ else
|
||||
echo "⚠️ [pre-commit] Neither ruff nor nix found; skipping ruff"
|
||||
fi
|
||||
|
||||
# 2. Run Pytest Suite
|
||||
# 2. Run Pyright Type Checker
|
||||
echo " ↳ Checking static types with Pyright..."
|
||||
if command -v pyright >/dev/null 2>&1; then
|
||||
pyright
|
||||
elif command -v nix >/dev/null 2>&1 && [ -f flake.nix ]; then
|
||||
nix develop --command pyright
|
||||
else
|
||||
echo "⚠️ [pre-commit] Neither pyright nor nix found; skipping pyright"
|
||||
fi
|
||||
|
||||
# 3. Run Pytest Suite
|
||||
echo " ↳ Running structural and security test suite with Pytest..."
|
||||
if [ -x ".venv/bin/pytest" ]; then
|
||||
.venv/bin/pytest tests/
|
||||
|
||||
@@ -13,7 +13,7 @@ authentication_backend:
|
||||
address: 'ldap://lldap:3890'
|
||||
timeout: 5s
|
||||
start_tls: false
|
||||
base_dn: 'dc=roadtotech,dc=me'
|
||||
base_dn: '{{ env "LLDAP_LDAP_BASE_DN" "dc=example,dc=test" }}'
|
||||
additional_users_dn: 'ou=people'
|
||||
users_filter: '(&({username_attribute}={input})(objectClass=person))'
|
||||
additional_groups_dn: 'ou=groups'
|
||||
@@ -24,7 +24,7 @@ authentication_backend:
|
||||
display_name: 'displayName'
|
||||
mail: 'mail'
|
||||
group_name: 'cn'
|
||||
user: 'uid=admin,ou=people,dc=roadtotech,dc=me'
|
||||
user: 'uid=admin,ou=people,{{ env "LLDAP_LDAP_BASE_DN" "dc=example,dc=test" }}'
|
||||
|
||||
access_control:
|
||||
default_policy: deny
|
||||
|
||||
+10
-10
@@ -6,48 +6,48 @@
|
||||
schemaVersion: "1.0"
|
||||
repositories:
|
||||
snappymail:
|
||||
path: "/home/kiskaadee/Sites/snappymail"
|
||||
path: "~/Sites/snappymail"
|
||||
aliases:
|
||||
- "homelab-snappymail"
|
||||
- "mail"
|
||||
- "webmail"
|
||||
gitea:
|
||||
path: "/home/kiskaadee/Sites/homelab-gitea"
|
||||
path: "~/Sites/homelab-gitea"
|
||||
aliases:
|
||||
- "homelab-gitea"
|
||||
- "git"
|
||||
jellyfin:
|
||||
path: "/home/kiskaadee/Sites/homelab-jellyfin"
|
||||
path: "~/Sites/homelab-jellyfin"
|
||||
aliases:
|
||||
- "homelab-jellyfin"
|
||||
- "media"
|
||||
docs:
|
||||
path: "/home/kiskaadee/Sites/homelab-doc2site"
|
||||
path: "~/Sites/homelab-doc2site"
|
||||
aliases:
|
||||
- "doc2site"
|
||||
- "homelab-doc2site"
|
||||
courses:
|
||||
path: "/home/kiskaadee/Sites/courses"
|
||||
path: "~/Sites/courses"
|
||||
aliases:
|
||||
- "homelab-courses"
|
||||
bdinvite:
|
||||
path: "/home/kiskaadee/Sites/homelab-bdinvite"
|
||||
path: "~/Sites/homelab-bdinvite"
|
||||
aliases:
|
||||
- "homelab-bdinvite"
|
||||
- "birthday"
|
||||
landing:
|
||||
path: "/home/kiskaadee/Sites/homelab-landing"
|
||||
path: "~/Sites/homelab-landing"
|
||||
aliases:
|
||||
- "homelab-landing"
|
||||
mermaid:
|
||||
path: "/home/kiskaadee/Sites/homelab-mermaid"
|
||||
path: "~/Sites/homelab-mermaid"
|
||||
aliases:
|
||||
- "homelab-mermaid"
|
||||
excalidraw:
|
||||
path: "/home/kiskaadee/Sites/homelab-excalidraw"
|
||||
path: "~/Sites/homelab-excalidraw"
|
||||
aliases:
|
||||
- "homelab-excalidraw"
|
||||
houston:
|
||||
path: "/home/kiskaadee/Sites/homelab-houston"
|
||||
path: "~/Sites/homelab-houston"
|
||||
aliases:
|
||||
- "homelab-houston"
|
||||
@@ -5,7 +5,7 @@
|
||||
- My Projects:
|
||||
- Github:
|
||||
- abbr: GH
|
||||
href: https://github.com/kiskaadee?tab=repositories
|
||||
href: https://github.com
|
||||
|
||||
- Social Media:
|
||||
- Instagram:
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
- Knowledge & Notes:
|
||||
- Docs-Viewer:
|
||||
icon: files.png
|
||||
href: https://docs.roadtotech.me
|
||||
href: https://docs.example.test
|
||||
description: Reactive Obsidian & Markdown Documentation Viewer
|
||||
server: my-docker
|
||||
container: docs
|
||||
- Excalidraw:
|
||||
icon: excalidraw.png
|
||||
href: https://excalidraw.roadtotech.me
|
||||
href: https://excalidraw.example.test
|
||||
description: Collaborative Whiteboarding & Sketching Tool
|
||||
server: my-docker
|
||||
container: excalidraw
|
||||
@@ -18,7 +18,7 @@
|
||||
- Media & Productivity:
|
||||
- Jellyfin:
|
||||
icon: jellyfin.png
|
||||
href: https://jellyfin.roadtotech.me
|
||||
href: https://jellyfin.example.test
|
||||
description: Media Server & Streaming Hub
|
||||
server: my-docker
|
||||
container: jellyfin
|
||||
+5
-5
@@ -106,11 +106,11 @@ services:
|
||||
environment:
|
||||
- TZ=America/Bogota
|
||||
- LLDAP_HTTP_URL=https://users.${DOMAIN}
|
||||
- LLDAP_LDAP_BASE_DN=dc=roadtotech,dc=me
|
||||
- LLDAP_LDAP_BASE_DN=${LLDAP_LDAP_BASE_DN:-dc=example,dc=test}
|
||||
- LLDAP_JWT_SECRET=${LLDAP_JWT_SECRET}
|
||||
- LLDAP_KEY_SEED=${LLDAP_KEY_SEED}
|
||||
- LLDAP_LDAP_USER_PASS=${LLDAP_LDAP_USER_PASS}
|
||||
- LLDAP_LDAP_USER_EMAIL=admin@${DOMAIN:-roadtotech.me}
|
||||
- LLDAP_LDAP_USER_EMAIL=${LLDAP_ADMIN_EMAIL:-admin@${DOMAIN:-example.test}}
|
||||
- LLDAP_DATABASE_URL=sqlite:///data/users.db?mode=rwc
|
||||
volumes:
|
||||
- ./config/lldap/data:/data
|
||||
@@ -222,12 +222,12 @@ services:
|
||||
- DIUN_PROVIDERS_DOCKER_APIVERSION=${DOCKER_API_VERSION:-1.40}
|
||||
- DIUN_NOTIF_MAIL_HOST=stalwart
|
||||
- DIUN_NOTIF_MAIL_PORT=465
|
||||
- DIUN_NOTIF_MAIL_USERNAME=notifier@${DOMAIN:-roadtotech.me}
|
||||
- DIUN_NOTIF_MAIL_USERNAME=${DIUN_NOTIF_MAIL_USERNAME:-notifier@${DOMAIN:-example.test}}
|
||||
- DIUN_NOTIF_MAIL_PASSWORD=${DIUN_SMTP_PASSWORD}
|
||||
- DIUN_NOTIF_MAIL_SSL=true
|
||||
- DIUN_NOTIF_MAIL_INSECURESKIPVERIFY=true
|
||||
- DIUN_NOTIF_MAIL_FROM=notifier@${DOMAIN:-roadtotech.me}
|
||||
- DIUN_NOTIF_MAIL_TO=kiskaadee@${DOMAIN:-roadtotech.me}
|
||||
- DIUN_NOTIF_MAIL_FROM=${DIUN_NOTIF_MAIL_FROM:-notifier@${DOMAIN:-example.test}}
|
||||
- DIUN_NOTIF_MAIL_TO=${DIUN_NOTIF_MAIL_TO:-operator@${DOMAIN:-example.test}}
|
||||
volumes:
|
||||
- ./config/diun:/data
|
||||
networks:
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
git
|
||||
pythonEnv
|
||||
ruff
|
||||
pyright
|
||||
];
|
||||
} ''
|
||||
mkdir -p $out
|
||||
@@ -59,6 +60,7 @@
|
||||
chmod -R u+w source
|
||||
cd source
|
||||
HOME=/tmp ruff check --no-cache .
|
||||
HOME=/tmp pyright
|
||||
HOME=/tmp pytest -o cache_dir=/tmp/.pytest_cache tests/
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# 🌐 Server NixOS Configuration — Turnkey Headless Homelab Appliance
|
||||
# Standalone declarative configuration for the roadtotech.me homelab server.
|
||||
# Standalone declarative configuration for the homelab server.
|
||||
# No Home Manager. No shared desktop modules.
|
||||
# Goal: wipe & restore from any NixOS installation via `nixos-install --flake ~/Core#server`
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
./modules/shell.nix # Declarative bash environment for the server
|
||||
];
|
||||
|
||||
# ── Homelab platform settings ────────────────────────────────────────────────
|
||||
homelab.operatorUser = "kiskaadee";
|
||||
|
||||
# ── SOPS secrets configuration ──────────────────────────────────────────────
|
||||
# Set once here to avoid duplicate-option conflicts across submodules
|
||||
sops.defaultSopsFile = ./secrets.yaml;
|
||||
|
||||
@@ -15,7 +15,7 @@ in
|
||||
sops.secrets."dynu/domain" = { };
|
||||
sops.secrets."dynu/password" = { };
|
||||
sops.secrets."system/pdf_decrypt_password" = {
|
||||
owner = "kiskaadee";
|
||||
owner = config.homelab.operatorUser;
|
||||
};
|
||||
|
||||
# Assemble the ddclient config file securely at boot time in /run/secrets/
|
||||
|
||||
@@ -4,6 +4,31 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Declarative configuration options for Homelab Core
|
||||
options.homelab = {
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "example.test";
|
||||
description = "Canonical domain for homelab services";
|
||||
};
|
||||
operatorUser = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "operator";
|
||||
description = "Primary operator user identity";
|
||||
};
|
||||
coreDir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/${config.homelab.operatorUser}/Core";
|
||||
description = "Path to Homelab Core repository";
|
||||
};
|
||||
sitesDir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/${config.homelab.operatorUser}/Sites";
|
||||
description = "Path to Sites directory";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
# Define the keys to decrypt from secrets.yaml
|
||||
sops.secrets = lib.genAttrs [
|
||||
"dynu/api_key"
|
||||
@@ -18,13 +43,13 @@
|
||||
"brevo/smtp_login"
|
||||
"brevo/smtp_key"
|
||||
"diun/smtp_password"
|
||||
] (name: { owner = "kiskaadee"; });
|
||||
] (name: { owner = config.homelab.operatorUser; });
|
||||
|
||||
# Generate the unified environment file at runtime in /run/secrets/homeserver.env
|
||||
sops.templates."homeserver.env" = {
|
||||
owner = "kiskaadee";
|
||||
owner = config.homelab.operatorUser;
|
||||
content = lib.generators.toKeyValue {} {
|
||||
DOMAIN = "roadtotech.me";
|
||||
DOMAIN = config.homelab.domain;
|
||||
DOCKER_API_VERSION = "1.40";
|
||||
DYNU_API_KEY = config.sops.placeholder."dynu/api_key";
|
||||
ACME_EMAIL = config.sops.placeholder."traefik/acme_email";
|
||||
@@ -53,7 +78,7 @@
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
WorkingDirectory = "/home/kiskaadee/Core";
|
||||
WorkingDirectory = config.homelab.coreDir;
|
||||
ExecStart = "${pkgs.docker-compose}/bin/docker-compose --env-file ${config.sops.templates."homeserver.env".path} up -d --remove-orphans";
|
||||
ExecStop = "${pkgs.docker-compose}/bin/docker-compose down";
|
||||
};
|
||||
@@ -78,24 +103,24 @@
|
||||
|
||||
environment = {
|
||||
GITOPS_SECRET_FILE = config.sops.secrets."gitops/webhook_secret".path;
|
||||
DOCKER_CONFIG = "/home/kiskaadee/.local/state/homelab/docker";
|
||||
DOCKER_CONFIG = "/home/${config.homelab.operatorUser}/.local/state/homelab/docker";
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = "kiskaadee";
|
||||
User = config.homelab.operatorUser;
|
||||
SupplementaryGroups = [ "docker" ];
|
||||
WorkingDirectory = "/home/kiskaadee/Core";
|
||||
WorkingDirectory = config.homelab.coreDir;
|
||||
ExecStart = "${pkgs.webhook}/bin/webhook -hooks ${pkgs.writeText "hooks.json" (builtins.toJSON [
|
||||
{
|
||||
id = "deploy";
|
||||
execute-command = "/home/kiskaadee/Core/scripts/gitops_dispatcher.py";
|
||||
execute-command = "${config.homelab.coreDir}/scripts/gitops_dispatcher.py";
|
||||
pass-arguments-to-command = [
|
||||
{ source = "raw-request-body"; }
|
||||
{ source = "header"; name = "X-Gitea-Signature"; }
|
||||
{ source = "header"; name = "X-Gitea-Event"; }
|
||||
];
|
||||
command-working-directory = "/home/kiskaadee/Core";
|
||||
command-working-directory = config.homelab.coreDir;
|
||||
response-message = "Deployment payload dispatched successfully.";
|
||||
}
|
||||
])} -port 9000 -verbose";
|
||||
@@ -110,8 +135,8 @@
|
||||
ProtectKernelTunables = true;
|
||||
ProtectControlGroups = true;
|
||||
ReadWritePaths = [
|
||||
"/home/kiskaadee/Sites"
|
||||
"/home/kiskaadee/.local/state/homelab"
|
||||
config.homelab.sitesDir
|
||||
"/home/${config.homelab.operatorUser}/.local/state/homelab"
|
||||
];
|
||||
};
|
||||
};
|
||||
@@ -149,10 +174,10 @@
|
||||
APPCTL_AUDIT_LOG = "/var/log/homelab/appctl/audit.jsonl";
|
||||
APPCTL_LOCK_DIR = "/var/lib/homelab/appctl/locks";
|
||||
APPCTL_TOKENS_FILE = "/run/secrets/appctl/tokens.json";
|
||||
SITES_DIR = "/home/kiskaadee/Sites";
|
||||
CORE_DIR = "/home/kiskaadee/Core";
|
||||
HOMELAB_CONFIG_DIR = "/home/kiskaadee/.config/homelab";
|
||||
HOMELAB_DEPLOYMENTS_FILE = "/home/kiskaadee/Core/config/deployments.yaml";
|
||||
SITES_DIR = config.homelab.sitesDir;
|
||||
CORE_DIR = config.homelab.coreDir;
|
||||
HOMELAB_CONFIG_DIR = "/home/${config.homelab.operatorUser}/.config/homelab";
|
||||
HOMELAB_DEPLOYMENTS_FILE = "${config.homelab.coreDir}/config/deployments.yaml";
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
@@ -160,8 +185,8 @@
|
||||
User = "homelab-appctl";
|
||||
Group = "homelab-operators";
|
||||
SupplementaryGroups = [ "docker" ];
|
||||
WorkingDirectory = "/home/kiskaadee/Core";
|
||||
ExecStart = "${(pkgs.python3.withPackages (ps: with ps; [ pyyaml pydantic ]))}/bin/python3 /home/kiskaadee/Core/scripts/appctl_daemon.py";
|
||||
WorkingDirectory = config.homelab.coreDir;
|
||||
ExecStart = "${(pkgs.python3.withPackages (ps: with ps; [ pyyaml pydantic ]))}/bin/python3 ${config.homelab.coreDir}/scripts/appctl_daemon.py";
|
||||
Restart = "always";
|
||||
RestartSec = "5s";
|
||||
|
||||
@@ -179,9 +204,9 @@
|
||||
ProtectKernelTunables = true;
|
||||
ProtectControlGroups = true;
|
||||
ReadWritePaths = [
|
||||
"/home/kiskaadee/Sites"
|
||||
"/home/kiskaadee/var/lib/homelab"
|
||||
"/home/kiskaadee/Core/config/homepage"
|
||||
config.homelab.sitesDir
|
||||
"/home/${config.homelab.operatorUser}/var/lib/homelab"
|
||||
"${config.homelab.coreDir}/config/homepage"
|
||||
"/var/log/homelab/appctl"
|
||||
"/var/lib/homelab/appctl"
|
||||
"/run/homelab"
|
||||
@@ -191,19 +216,20 @@
|
||||
|
||||
# Ensure persistent directories have proper permissions for container runtimes
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /home/kiskaadee/Core/config/stalwart/data 0777 kiskaadee users -"
|
||||
"d /home/kiskaadee/Core/config/stalwart/etc 0777 kiskaadee users -"
|
||||
"d /home/kiskaadee/Sites 0755 kiskaadee users -"
|
||||
"d /home/kiskaadee/.local/state/homelab/gitops 0755 kiskaadee users -"
|
||||
"d /home/kiskaadee/.local/state/homelab/docker 0755 kiskaadee users -"
|
||||
"d ${config.homelab.coreDir}/config/stalwart/data 0777 ${config.homelab.operatorUser} users -"
|
||||
"d ${config.homelab.coreDir}/config/stalwart/etc 0777 ${config.homelab.operatorUser} users -"
|
||||
"d ${config.homelab.sitesDir} 0755 ${config.homelab.operatorUser} users -"
|
||||
"d /home/${config.homelab.operatorUser}/.local/state/homelab/gitops 0755 ${config.homelab.operatorUser} users -"
|
||||
"d /home/${config.homelab.operatorUser}/.local/state/homelab/docker 0755 ${config.homelab.operatorUser} users -"
|
||||
# POSIX ACLs granting homelab-appctl traverse and access to operator sites & homepage config
|
||||
"a+ /home/kiskaadee - - - - u:homelab-appctl:x"
|
||||
"a+ /home/kiskaadee/Core - - - - u:homelab-appctl:x"
|
||||
"a+ /home/kiskaadee/Sites - - - - d:u:homelab-appctl:rwx,u:homelab-appctl:rwx"
|
||||
"a+ /home/kiskaadee/var/lib/homelab - - - - d:u:homelab-appctl:rwx,u:homelab-appctl:rwx"
|
||||
"a+ /home/kiskaadee/Core/config/homepage - - - - d:u:homelab-appctl:rwx,u:homelab-appctl:rwx"
|
||||
"a+ /home/${config.homelab.operatorUser} - - - - u:homelab-appctl:x"
|
||||
"a+ ${config.homelab.coreDir} - - - - u:homelab-appctl:x"
|
||||
"a+ ${config.homelab.sitesDir} - - - - d:u:homelab-appctl:rwx,u:homelab-appctl:rwx"
|
||||
"a+ /home/${config.homelab.operatorUser}/var/lib/homelab - - - - d:u:homelab-appctl:rwx,u:homelab-appctl:rwx"
|
||||
"a+ ${config.homelab.coreDir}/config/homepage - - - - d:u:homelab-appctl:rwx,u:homelab-appctl:rwx"
|
||||
];
|
||||
|
||||
# Open ports in the firewall for Traefik, Gitea SSH, GitOps Webhook Receiver, and Mail (SMTP, Submission, SMTPS, IMAPS, ManageSieve)
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 2223 9000 25 465 587 993 4190 ];
|
||||
};
|
||||
}
|
||||
@@ -15,31 +15,31 @@
|
||||
"postgres/password"
|
||||
"postgres/db"
|
||||
"gitea/runner_token"
|
||||
] (name: { owner = "kiskaadee"; });
|
||||
] (name: { owner = config.homelab.operatorUser; });
|
||||
|
||||
# Generate the unified environment file at runtime in /run/secrets/traefik-deployments.env
|
||||
sops.templates."traefik-deployments.env" = {
|
||||
owner = "kiskaadee";
|
||||
owner = config.homelab.operatorUser;
|
||||
content = lib.generators.toKeyValue {} {
|
||||
# --- Core / Infrastructure Settings ---
|
||||
PROXY_NETWORK = "proxy-net";
|
||||
CERT_RESOLVER = "myresolver";
|
||||
DOMAIN_SUFFIX = "roadtotech.me";
|
||||
DOMAIN_SUFFIX = config.homelab.domain;
|
||||
|
||||
# --- Dashboard & Landing ---
|
||||
DASHBOARD_DOMAIN = "dashboard.roadtotech.me";
|
||||
LANDING_DOMAIN = "roadtotech.me";
|
||||
DASHBOARD_DOMAIN = "dashboard.${config.homelab.domain}";
|
||||
LANDING_DOMAIN = config.homelab.domain;
|
||||
|
||||
# --- Docs ---
|
||||
DOCS_DOMAIN = "docs.roadtotech.me";
|
||||
DOCS_PROJECT_PATH = "/home/kiskaadee/Brain";
|
||||
DOCS_DOMAIN = "docs.${config.homelab.domain}";
|
||||
DOCS_PROJECT_PATH = "/home/${config.homelab.operatorUser}/Brain";
|
||||
|
||||
# --- Excalidraw ---
|
||||
EXCALIDRAW_DOMAIN = "excalidraw.roadtotech.me";
|
||||
EXCALIDRAW_DOMAIN = "excalidraw.${config.homelab.domain}";
|
||||
|
||||
# --- Gitea ---
|
||||
GITEA_DOMAIN = "gitea.roadtotech.me";
|
||||
GITEA_SSH_DOMAIN = "gitea.roadtotech.me";
|
||||
GITEA_DOMAIN = "gitea.${config.homelab.domain}";
|
||||
GITEA_SSH_DOMAIN = "gitea.${config.homelab.domain}";
|
||||
GITEA_SSH_PORT = "2223";
|
||||
GITEA_AUTH_MIDDLEWARE = "https-redirect@docker";
|
||||
GITEA_RUNNER_TOKEN = config.sops.placeholder."gitea/runner_token";
|
||||
@@ -48,7 +48,7 @@
|
||||
JELLYFIN_SERVICE_NAME = "jellyfin";
|
||||
JELLYFIN_CONTAINER_NAME = "jellyfin";
|
||||
JELLYFIN_IMAGE_TAG = "latest";
|
||||
JELLYFIN_DOMAIN = "jellyfin.roadtotech.me";
|
||||
JELLYFIN_DOMAIN = "jellyfin.${config.homelab.domain}";
|
||||
JELLYFIN_TZ = "UTC";
|
||||
JELLYFIN_PUID = "1000";
|
||||
JELLYFIN_PGID = "1000";
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
# --- Learning Dashboard ---
|
||||
LEARNING_SERVICE_NAME = "learning-hub";
|
||||
LEARNING_DOMAIN = "learning.roadtotech.me";
|
||||
LEARNING_DOMAIN = "learning.${config.homelab.domain}";
|
||||
LEARNING_APP_PORT = "8000";
|
||||
LEARNING_SOCKET_PROXY_NETWORK = "socket-net";
|
||||
LEARNING_DOCKER_HOST = "tcp://socket-proxy:2375";
|
||||
@@ -68,25 +68,25 @@
|
||||
TURSO_AUTH_TOKEN = config.sops.placeholder."learning/turso_auth_token";
|
||||
|
||||
# --- Mermaid ---
|
||||
MERMAID_DOMAIN = "mermaid.roadtotech.me";
|
||||
MERMAID_DOMAIN = "mermaid.${config.homelab.domain}";
|
||||
MERMAID_SERVICE_NAME = "mermaid";
|
||||
|
||||
# --- Minecraft ---
|
||||
MINECRAFT_DOMAIN = "minecraft.roadtotech.me";
|
||||
MINECRAFT_DOMAIN = "minecraft.${config.homelab.domain}";
|
||||
|
||||
# --- MongoDB ---
|
||||
MONGO_ROOT_USERNAME = config.sops.placeholder."mongo/root_username";
|
||||
MONGO_ROOT_PASSWORD = config.sops.placeholder."mongo/root_password";
|
||||
MONGO_DOMAIN = "mongodb.roadtotech.me";
|
||||
MONGO_DOMAIN = "mongodb.${config.homelab.domain}";
|
||||
|
||||
# --- PostgreSQL ---
|
||||
POSTGRES_USER = config.sops.placeholder."postgres/user";
|
||||
POSTGRES_PASSWORD = config.sops.placeholder."postgres/password";
|
||||
POSTGRES_DB = config.sops.placeholder."postgres/db";
|
||||
POSTGRES_DOMAIN = "pgsql.roadtotech.me";
|
||||
POSTGRES_DOMAIN = "pgsql.${config.homelab.domain}";
|
||||
|
||||
# --- Ollama ---
|
||||
OLLAMA_DOMAIN = "ollama.roadtotech.me";
|
||||
OLLAMA_DOMAIN = "ollama.${config.homelab.domain}";
|
||||
OLLAMA_API_KEY = config.sops.placeholder."ollama/api_key";
|
||||
OLLAMA_REPLICAS = "1";
|
||||
OLLAMA_DATA_VOLUME = "ollama_data";
|
||||
|
||||
@@ -285,6 +285,10 @@ def get_trusted_repository_mapping() -> dict[str, Path]:
|
||||
raw_path = entry.get("path")
|
||||
if not raw_path:
|
||||
continue
|
||||
if raw_path.startswith("~/Sites/") or raw_path == "~/Sites":
|
||||
sub = raw_path[len("~/Sites"):].lstrip("/")
|
||||
p = (SITES_DIR / sub).resolve() if sub else SITES_DIR.resolve()
|
||||
else:
|
||||
p = Path(raw_path).expanduser().resolve()
|
||||
# Enforce strict containment strictly inside SITES_DIR
|
||||
if SITES_DIR.is_dir() and p.is_relative_to(SITES_DIR.resolve()):
|
||||
|
||||
@@ -180,13 +180,20 @@ exit 0
|
||||
def test_platform_genericism_no_hardcoded_personal_domains_in_scripts_and_tests():
|
||||
"""Ensure personal domains and operator usernames are absent from scripts, tests, and documentation."""
|
||||
forbidden = ["roadtotech.me", "kiskaadee"]
|
||||
root_dirs = [CORE_ROOT / "scripts", CORE_ROOT / "tests", CORE_ROOT / "docs"]
|
||||
root_dirs = [
|
||||
CORE_ROOT / "scripts",
|
||||
CORE_ROOT / "tests",
|
||||
CORE_ROOT / "docs",
|
||||
CORE_ROOT / "nixos" / "modules",
|
||||
CORE_ROOT / "config",
|
||||
]
|
||||
root_files = [
|
||||
CORE_ROOT / "README.md",
|
||||
CORE_ROOT / "ROADMAP.md",
|
||||
CORE_ROOT / "AGENTS.md",
|
||||
CORE_ROOT / "SECURITY.md",
|
||||
CORE_ROOT / "flake.nix",
|
||||
CORE_ROOT / "docker-compose.yml",
|
||||
]
|
||||
violations = []
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ def test_manifest_data_overrides_default_values(app_factory: AppFactory):
|
||||
dir_name="homelab-custom",
|
||||
manifest_yaml="""
|
||||
name: custom-app
|
||||
domain: custom.roadtotech.local
|
||||
domain: custom.example.test
|
||||
auth: false
|
||||
visible: false
|
||||
networks:
|
||||
@@ -95,7 +95,7 @@ def test_manifest_data_overrides_default_values(app_factory: AppFactory):
|
||||
app = engine.resolve_app("custom-app", apps)
|
||||
|
||||
assert app is not None
|
||||
assert app.domain == "custom.roadtotech.local"
|
||||
assert app.domain == "custom.example.test"
|
||||
assert app.auth is False
|
||||
assert app.networks == ["custom-net"]
|
||||
|
||||
|
||||
@@ -29,4 +29,4 @@ x 2026-10-19 (B) Implement operational router, pure-Python dotenv loader, Compos
|
||||
x 2026-10-19 (B) Implement dual-transport HTTP/1.1 daemon (UDS + loopback TCP) and wire gitops_dispatcher.py worker to daemon in scripts/appctl_daemon.py +daemon @p4
|
||||
x 2026-10-19 (B) Add comprehensive unit and security test suite for P4 contracts, RBAC, audit guard, concurrency, and dual-transport parity in tests/unit/test_appctl_daemon.py +test @p4
|
||||
x 2026-10-19 (C) Re-implement scripts/appctl as a thin UDS HTTP client and declare homelab-appctl.service with POSIX ACLs in nixos/modules/homeserver.nix +cli @p4
|
||||
(C) Scrub remaining hardcoded domain and username literals across NixOS modules, Compose stack, and config/deployments.yaml and add pyright to flake.nix checks +generic @core
|
||||
x 2026-10-19 (C) Scrub remaining hardcoded domain and username literals across NixOS modules, Compose stack, and config/deployments.yaml and add pyright to flake.nix checks +generic @core
|
||||
Reference in new issue
Block a user