{"id":21418827,"url":"https://github.com/zchfvy/home-pve","last_synced_at":"2026-01-03T20:02:50.309Z","repository":{"id":223383766,"uuid":"760152047","full_name":"zchfvy/home-pve","owner":"zchfvy","description":"My pve configs","archived":false,"fork":false,"pushed_at":"2024-11-25T21:00:57.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T06:12:51.832Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zchfvy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-19T22:00:25.000Z","updated_at":"2024-11-25T21:01:01.000Z","dependencies_parsed_at":"2024-07-13T22:37:55.569Z","dependency_job_id":"ff497625-c605-4801-960c-869646b87f57","html_url":"https://github.com/zchfvy/home-pve","commit_stats":null,"previous_names":["zchfvy/home-pve"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zchfvy%2Fhome-pve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zchfvy%2Fhome-pve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zchfvy%2Fhome-pve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zchfvy%2Fhome-pve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zchfvy","download_url":"https://codeload.github.com/zchfvy/home-pve/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243918656,"owners_count":20368747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T19:28:26.952Z","updated_at":"2026-01-03T20:02:50.305Z","avatar_url":"https://github.com/zchfvy.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Homeserver Infrastructure\n\nAutomated provisioning and configuration for a Proxmox-based homeserver stack using Terraform and Ansible.\n\n**GitHub**: https://github.com/zchfvy/home-pve\n\n## Architecture\n\n- **Terraform/Terragrunt**: Provisions Proxmox VMs and LXC containers\n- **Ansible**: Configures services and deploys applications\n- **Secrets**: Age encryption for infrastructure, Ansible Vault for application secrets\n\n## Prerequisites\n\nInstall the following tools:\n- [Terraform](https://www.terraform.io/)\n- [Terragrunt](https://terragrunt.gruntwork.io/)\n- [Ansible](https://www.ansible.com/)\n- [Age](https://github.com/FiloSottile/age) (for secrets encryption)\n\nInstall the Ansible Terraform inventory plugin:\n```bash\nansible-galaxy collection install cloud.terraform\n```\n\n## Directory Structure\n\n```\n.\n├── apps/       # Service definitions (terraform + ansible per service)\n├── network/    # Network infrastructure config (Pi-hole DNS, etc.)\n├── roles/      # Reusable Ansible roles\n├── secrets/    # Encrypted secrets (infrastructure + application)\n├── modules/    # Terraform modules\n├── docs/       # Additional documentation\n└── Makefile    # Deployment automation\n```\n\n## Initial Setup\n\n### 1. Proxmox Configuration\n\nProxmox requires root credentials for LXC mount operations. API keys cannot provide the necessary permissions.\n\n### 2. Secrets Setup\n\n**Infrastructure secrets** (Proxmox credentials):\n```bash\n# Copy the template\ncp secrets/infrastructure-template.env secrets/infrastructure.env\n\n# Edit with your Proxmox credentials\n# PROXMOX_VE_USERNAME=\"root@pam\"\n# PROXMOX_VE_PASSWORD=\"your_password\"\n\n# Encrypt with age\nage -e -R ~/.age/recipients.txt secrets/infrastructure.env \u003e secrets/infrastructure.age\nrm secrets/infrastructure.env\n```\n\n**Application secrets** (service credentials):\n```bash\n# Copy the template\ncp secrets/ansible/group_vars/all/vault-template.yml secrets/ansible/group_vars/all/vault.yml\n\n# Edit with your application secrets\n# Then encrypt with ansible-vault\nansible-vault encrypt secrets/ansible/group_vars/all/vault.yml\n```\n\nSee `docs/SECRETS_MANAGEMENT_SUMMARY.md` for detailed documentation.\n\n## Deployment\n\nUse the Makefile for all deployments. Run `make help` to see all available targets.\n\n### Single Service Deployment\n\n```bash\n# Deploy a complete service (infrastructure + application)\nmake deploy-immich\nmake deploy-portal\n\n# Deploy only infrastructure\nmake deploy-infra-immich\n\n# Deploy only application configuration\nmake deploy-app-immich\n\n# Preview infrastructure changes\nmake plan-infra-immich\n\n# Dry-run application changes\nmake check-app-immich\n```\n\n### Batch Deployment (All Services)\n\nBatch commands prompt for passphrases once and apply to all services:\n\n```bash\n# Preview all infrastructure changes (drift detection)\nmake plan-infra-all\n\n# Apply all infrastructure changes\nmake apply-infra-all\n\n# Deploy all applications\nmake deploy-app-all\n\n# Dry-run all applications\nmake check-app-all\n\n# Preview everything (infra plan + app check)\nmake plan-all\n```\n\n### Full Stack Deployment\n\nDeploy everything with a single command:\n\n```bash\nmake deploy-all\n```\n\nThis will:\n1. Prompt for infrastructure passphrase (age)\n2. Prompt for application passphrase (ansible-vault)\n3. Show terraform plan for all services\n4. Prompt for confirmation before applying\n5. Apply all infrastructure changes\n6. Wait for VMs/LXCs to be SSH-ready (2 min timeout)\n7. Deploy all applications via Ansible\n\n### Reverse Proxy and DNS\n\nThe infrastructure includes an nginx reverse proxy for SNI-based routing on port 80.\n\n**Deploy nginx reverse proxy:**\n```bash\n# Deploy nginx LXC and application\nmake deploy-nginx\n\n# Or separately:\nmake deploy-infra-nginx  # Create LXC container\nmake deploy-app-nginx    # Configure nginx\n```\n\n**Configure Pi-hole DNS:**\n```bash\n# Deploy CNAME records to Pi-hole\nmake deploy-dns\n```\n\nThis configures Pi-hole to route all service hostnames through nginx:\n- Simple names: `jellyfin`, `radarr`, etc.\n- Internal FQDNs: `jellyfin.home.arpa`, etc.\n- External domains: `jellyfin.jasonxun2020.com`, etc.\n\nSee `docs/REVERSE_PROXY_SETUP.md` for detailed documentation.\n\n## Maintenance\n\n### Proxmox Certificate Renewal\n\nWhen Proxmox certificates expire (annually), regenerate them:\n\n1. Delete or move the existing certificates:\n```bash\nrm /etc/pve/pve-root-ca.pem\nrm /etc/pve/priv/pve-root-ca.key\nrm /etc/pve/nodes/\u003cnode\u003e/pve-ssl.pem\nrm /etc/pve/nodes/\u003cnode\u003e/pve-ssl.key\n```\n\n2. Regenerate certificates:\n```bash\npvecm updatecerts -f\n```\n\nRun this on each node in the cluster.\n\n## Documentation\n\nAdditional documentation in `docs/`:\n- `STATE_RECOVERY.md` - Recovering from lost Terraform state\n- `REVERSE_PROXY_SETUP.md` - Nginx reverse proxy and Pi-hole DNS configuration\n- `SECRETS_MANAGEMENT_SUMMARY.md` - Secrets architecture and usage\n- `CLEANUP_ANALYSIS.md` - Codebase analysis and improvement plan\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzchfvy%2Fhome-pve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzchfvy%2Fhome-pve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzchfvy%2Fhome-pve/lists"}