/homeserver

Scripts and tools to deploy and monitor my homeserver

Primary LanguageShell

Quentin's Homeserver

gitleaks badge

This is a long living DIY homeserver project that I build over the years in my spare time. My end goal is to replace most of my third-party cloud dependencies (Spotify, Netflix, Newsfeeds...) by self-hosted, open source alternatives. I'd also like to try some smart home solutions.

This is the IaC repository for said homeserver, currently using:

  • Ansible for infrastructure deployment and setup
  • git-crypt for secrets encryption
  • gitleaks to detect secrets possibly slipping through the net

Hardware configuration

Currently my needs are met with a very cheap solution: a Raspberry Pi 4 (ARM).

At some point, I'll opt for a more powerfull machine, and at that time I think I will migrate the infrastructure to a type 1 hypervisor (probably proxmox, which I cannot use at the time because it doesn't work properly on RaspberryPi). I'll then be able to use the Proxmox Terraform provider to easily set it up. Until then, my infrastructure is deployed using good old docker and Ansible playbooks.

How to install

Requirements on the hosts:

  • Linux OS installed
  • SSH user/password connection enabled
  • Python installed (out of the box on most distros)

Then, from the control node (typically linux laptop):

  • Install Ansible (2.16.2+)
  • Install git-crypt
  • Make sure you have the GPG key in your keyring (passwords are encrypted via git-crypt)

Then, unlock the repository's secrets with:

git-crypt unlock

Then, install the dependencies and run the playbook:

ansible-galaxy install -r requirements.yml
ansible-playbook -i hosts.yaml playbook.yaml -k

If there are errors, debug will be easier with the -v(erbose) option.

You can also run some specific steps of the playbook with tags:

ansible-playbook -i hosts.yaml playbook.yaml -k --tags services

TODO

  • Logstash for log aggregation and Kibana for reading logs in web UI
  • Open source smart home server (HomeAssistant?)
  • Test it with a first device (temperature sensor in office?)