--- name: homelab-context description: Background reference for the homelab repo. Auto-loads key facts about services, ports, paths, and operational rules when working in this project. user-invocable: false --- ## Architecture - **Domain**: ak-homelab.duckdns.org (DuckDNS) - **Static IP**: 192.168.0.100 (interface: enp4s0) - **SSH**: port 2222 (system), port 2223 (Gitea git) - **NAS**: 192.168.0.101, mounted at `/mnt/nas/` ## Services & Ports | Service | Port | Type | Path | |-------------|-------|----------|-----------------| | Nginx | 80/443| systemd | reverse proxy | | Gitea | 3000 | Docker | /gitea/ | | Jellyfin | 8096 | Docker | /media/ | | Copyparty | 8082 | systemd | /files/ | | Netdata | 19999 | Docker | /netdata/ | | Portainer | 9000 | Docker | /portainer/ | | qBittorrent | 8080 | Docker | /qbt/ | ## Key Paths All configs are **symlinked** from system locations to this repo — editing the repo file is editing the live config: | System location | Repo source | |---|---| | `/opt/docker//docker-compose.yml` | `config/docker//docker-compose.yml` | | `/etc/nginx/sites-available/homelab` | `config/nginx/homelab.conf` | | `/var/www/homelab/index.html` | `config/www/index.html` | | `/etc/systemd/system/copyparty.service` | `config/systemd/copyparty.service` | | `/etc/systemd/system/glances-web.service` | `config/systemd/glances-web.service` | | `/etc/systemd/system/ssh-honeypot.service` | `config/systemd/ssh-honeypot.service` | - NAS docker data: `/mnt/nas/docker-data//` ## Critical Rules ### Docker UID for NAS-mounted volumes Services with data on NAS (`/mnt/nas/`) must use `USER_UID=1024 USER_GID=100` to match NAS file ownership. Services with local storage use `1000:1000`. ### Docker config changes Edit `config/docker//docker-compose.yml` in repo → restart container. No copy needed (symlinked). ### After editing a config in repo - **Docker**: `cd /opt/docker/ && docker compose restart` - **Nginx**: `sudo nginx -t && sudo systemctl reload nginx` - **Systemd unit**: `sudo systemctl daemon-reload && sudo systemctl restart ` - **www/index.html**: no action needed ### Sudo scripts Never run sudo directly. Generate a script in `scripts/tmp/` and run `sudo bash ~/homelab/scripts/tmp/