No description
Find a file
2026-05-24 19:04:15 +00:00
ansible_documentation docs: add comprehensive manual for rclone_gdrive_sync role 2026-05-24 19:04:15 +00:00
inventory feat: automated Google Drive offsite backups and documentation updates 2026-05-24 18:56:27 +00:00
keys feat: configure atop with conservative retention and interval 2026-04-13 11:42:56 +00:00
playbooks feat: automated Google Drive offsite backups and documentation updates 2026-05-24 18:56:27 +00:00
plugins/mitogen feat(perf): install mitogen and enable ssh multiplexing, fix check_updates.yml shell executable 2026-05-23 09:02:17 +00:00
roles feat: automated Google Drive offsite backups and documentation updates 2026-05-24 18:56:27 +00:00
scripts feat: restore trivy role, harden security & optimize networking 2026-05-20 19:34:26 +00:00
.ansible-lint feat: Add Caddy role and fix common roles 2025-12-24 11:22:36 +00:00
.gitignore Fix Loki WAL, remove dashboard, fix postfix bounce limit, bypass proxy for local subnets, and optimize ansible.cfg 2026-05-22 20:23:58 +00:00
ansible.cfg feat(perf): install mitogen and enable ssh multiplexing, fix check_updates.yml shell executable 2026-05-23 09:02:17 +00:00
ANTIGRAVITY.md chore: sync extensive fleet hardening and maintenance updates 2026-05-22 15:41:36 +00:00
backup.md feat: automated Google Drive offsite backups and documentation updates 2026-05-24 18:56:27 +00:00
dirtyfrag_mitigation.md security: mitigate DirtyFrag vulnerability (esp4, esp6, rxrpc) 2026-05-08 20:19:09 +00:00
forgejo.md docs: add beginner's Ansible guide and update Authelia config 2026-04-09 06:35:40 +00:00
hardening.md security: implement deep kernel hardening, docker protection, and instant root/sudo notifications 2026-05-02 07:27:03 +00:00
jellyfin_debug.md Security: Implement fleet-wide hardening and auditing 2026-04-14 20:27:12 +00:00
lint_and_notify.sh Fix: Apply system-wide proxy settings and resolve linting issues 2025-12-25 15:00:15 +00:00
power.md feat: implement automated LXC provisioning, SearXNG deployment, and bootstrapping fixes 2026-04-20 17:30:36 +00:00
README.md feat: automated Google Drive offsite backups and documentation updates 2026-05-24 18:56:27 +00:00
zabbix_docker_template.yaml fix(zabbix): restored nested triggers for proper import compatibility 2026-04-15 17:38:20 +00:00
zabbix_security_template.yaml fix(zabbix): restored nested triggers for proper import compatibility 2026-04-15 17:38:20 +00:00

🚀 Slava's Home Server Automation (Ansible Project)

Welcome to the magic folder that controls all the servers! 🎩

If you've ever played a video game where you build a city, this is kind of like the control panel for our real-life digital city. Instead of logging into every single computer (server) to install things one by one, we use a tool called Ansible to give them instructions all at once.

Our digital house is now more modern, secure, and autonomous than ever.


📖 Table of Contents

  1. What is this? (The Simple Explanation)
  2. How the Folders are Organized
  3. The Core Services We Run
  4. 🛡️ Security Hardening & Monitoring
  5. ⚙️ Automated Maintenance
  6. How to Manage the Servers
  7. 🔐 SSO Integration Tutorial (Authelia + PVE)
  8. 📚 Specialized Manuals & Guides

1. What is this? (The Simple Explanation)

Imagine you have 20 robots, and you want them all to put on a blue hat.

  • The hard way: Walk up to each robot, hand it a hat, and tell it to put it on.
  • The Ansible way: You stand at a microphone, shout "Everyone put on a blue hat!" and they all do it at the exact same time.

Ansible is our microphone.

  • The Playbooks are the scripts we read into the microphone (e.g., "Install Docker!").
  • The Inventory is our list of robots (IP addresses) so the microphone knows who to talk to.

2. How the Folders are Organized

Here is what all the folders in this project actually do:

  • 📂 inventory/: This is the address book.
    • hosts.yml: A list of every single server we own and what "groups" they belong to.
    • group_vars/: Settings that apply to a whole group. all.yml contains fleet-wide settings like centralized SSH keys and proxy info.
    • host_vars/: Settings for one specific server (like unique firewall ports).
  • 📂 playbooks/: These are the instruction manuals.
  • 📂 roles/: These are reusable "recipes" (e.g., how to install Caddy or CrowdSec).
  • 📂 keys/: Contains our digital keys (SSH keys) for passwordless login.

3. The Core Services We Run

Our home network runs a suite of high-performance services, all accessible via local DNS:

  • 🏠 Homepage (home.slavko.kyiv.ua): Our unified service portal. A single dashboard to access everything from Media to Security.
  • 🌐 Caddy: The Traffic Cop. Handles HTTPS certificates and reverse proxies all traffic to the correct container.
  • 🔐 Authelia SSO: The Bouncer. Provides Single Sign-On via OIDC for Proxmox, NAS, and Backup servers.
  • 🛑 Pi-hole: The Ad Blocker and Phonebook. Handles all local .slavko.kyiv.ua DNS resolution internally.
  • 🔍 SearXNG: The Private Eye. Our own private, ad-free metasearch engine.
  • 📊 Zabbix: The Doctor. Constant health monitoring with custom templates for Docker and Security.
  • 💾 Immich & Jellyfin: Our personal Media and Photo clouds.
  • 📦 APT Cacher & Docker Registry: The Warehouse. Local caching of all software updates and container images.
  • ☁️ Rclone & Restic: The Vault. Automated local (NAS) and offsite (Google Drive) encrypted backups.

4. 🛡️ Security Hardening & Monitoring

Our infrastructure is hardened to a Lynis 80+ score using aggressive industry standards.

Key Hardening Features:

  • Deep Kernel Protection: Aggressive sysctl hardening (disabling unprivileged BPF, restricting ptrace/kexec) and blacklisting 20+ dangerous kernel modules.
  • Intrusion Prevention (CrowdSec): A fleet-wide CrowdSec mesh has replaced Fail2Ban, providing community-driven threat intelligence and banning bad actors at the UFW level.
  • Docker Security: Globally enforced no-new-privileges and restricted Inter-Container Communication (ICC).
  • Infrastructure Isolation: PVE Native Firewall protects the main physical nodes, allowing management access only from trusted subnets.
  • Automated UFW Firewall: A flexible ufw role is gradually deployed to managed servers (Caddy, Vaultwarden, etc.), strictly whitelisting only the necessary ports and denying all other incoming traffic.
  • SSH Security: Password login is disabled. Access is controlled via a centralized public key list in group_vars/all.yml.

5. ⚙️ Automated Maintenance

We treat our servers like a self-healing fleet. Most maintenance is now automated:

  • kernel_cleanup.yml: Automatically purges old Linux kernels and leftover 'rc' configuration files to keep the boot partition clean.
  • monitor_security.yml: Runs every 4 hours to check for upgradable packages and reboot-required flags, sending Priority 9 Gotify alerts for urgent items.
  • vulnerability_fix.yml: A "fast-response" playbook for rolling out urgent security patches fleet-wide without a full system run.
  • docker_maintenance.yml: Weekly pruning of unused images, containers, and volumes to reclaim disk space.
  • gdrive_backup.yml & restic_backup.yml: Automated 3-2-1 backup pipeline. Restic backs up to the local NAS nightly, and Rclone safely mirrors those encrypted backups to Google Drive.

6. How to Manage the Servers

Precision Operations

We use Tags and Limits to manage the fleet efficiently:

  • Apply ONLY Security Hardening:
    ansible-playbook playbooks/site.yml --tags hardening
    
  • Update a Specific Host (e.g., SearXNG):
    ansible-playbook playbooks/site.yml --limit searxng
    
  • Run Vulnerability Scan:
    ansible-playbook playbooks/vulnerability_scan.yml
    

7. 🔐 SSO Integration Tutorial (Authelia + PVE)

We use Authelia as an OpenID Connect (OIDC) provider to secure our Proxmox infrastructure.

How it works:

  1. Authelia Side: Configured in roles/authelia/templates/configuration.yml.j2 under identity_providers: oidc. It defines clients for proxmox, nas, and backup.
  2. Proxmox Side:
    • Go to Datacenter > Permissions > Realms.
    • Add OpenID Connect Server.
    • Issuer URL: https://auth.slavko.kyiv.ua
    • Client ID: proxmox
    • Username Claim: preferred_username
  3. Permissions: Users created via SSO must be granted permissions in PVE (e.g., pveum user permissions slava@oidc).

This setup allows "One-Factor" login to all infrastructure nodes once you've authenticated with Authelia.


8. 📚 Specialized Manuals & Guides

For detailed instructions, refer to these dedicated manuals: