Giter VIP home page Giter VIP logo

home-service's Introduction

home-service

My home service stack running on a Beelink T4 Pro with Fedora IoT. Applications are run as podman containers and managed by systemd to support my home infrastructure.

Core components

  • direnv: Update environment per working directory.
  • podman: A tool for managing OCI containers and pods with native systemd integration.
  • renovate: Universal dependency automation tool.
  • sops: Manage secrets which are commited to Git using Age for encryption.
  • task: A task runner / simpler Make alternative written in Go.

Setup

System configuration

  1. Install required system deps and reboot

    sudo rpm-ostree install --idempotent --assumeyes git go-task
    sudo systemctl reboot
  2. Make a new SSH key, add it to GitHub and clone your repo

    export GITHUB_USER="caycehouse"
    curl https://github.com/$GITHUB_USER.keys > ~/.ssh/authorized_keys
    sudo install -d -o $(logname) -g $(logname) -m 755 /var/opt/home-service
    git clone [email protected]:$GITHUB_USER/home-service.git /var/opt/home-service/.
  3. Install additional system deps and reboot

    cd /var/opt/home-service
    go-task deps
    sudo systemctl reboot
  4. Create an Age public/private key pair for use with sops

    age-keygen -o /var/opt/home-service/age.key

Network configuration

Note

I am using ipvlan to expose most containers on their own IP addresses on the same network as this here device, the available addresses are mentioned in the --ip-range flag below. Beware of IP addressing and interface names.

  1. Create the podman containernet network

    sudo podman network create \
        --driver=ipvlan \
        --ipam-driver=host-local \
        --subnet=192.168.1.0/24 \
        --gateway=192.168.1.1 \
        --ip-range=192.168.1.121-192.168.1.149 \
        containernet
  2. Setup the currently used interface with systemd-networkd

    ๐Ÿ“ Setting the DNS server to dnsdist might make dragons appear ๐Ÿ‰.

    sudo bash -c 'cat << EOF > /etc/systemd/network/enp1s0.network
    [Match]
    Name = enp1s0
    [Network]
    DHCP = yes
    DNS = 1.1.1.1
    DNS = 9.9.9.9
    IPVLAN = containernet
    [DHCPv4]
    UseDNS = false'
  3. Setup containernet with systemd-networkd

    sudo bash -c 'cat << EOF > /etc/systemd/network/containernet.netdev
    [NetDev]
    Name = containernet
    Kind = ipvlan'
    sudo bash -c 'cat << EOF > /etc/systemd/network/containernet.network
    [Match]
    Name = containernet
    [Network]
    IPForward = yes
    Address = 192.168.1.120/24'
  4. Disable networkmanager, then enable and start systemd-networkd

    sudo systemctl disable --now NetworkManager
    sudo systemctl enable systemd-networkd
    sudo systemctl start systemd-networkd

Container configuration

Tip

To encrypt files with sops replace the public key in the .sops.yaml file with your Age public key. The format should look similar to the one already present.

View the apps directory for documentation on configuring an app container used here, or setup your own by reviewing the structure of this repository.

Using the included Taskfile there are helper commands to start, stop, restart containers and more. Run the command below to view all available tasks.

go-task --list

Optional configuration

Fish shell

Tip

๐ŸŸ fish is awesome, you should try fish!

chsh -s /usr/bin/fish
# IMPORTANT: Log out and log back in
go-task dotfiles

Enable Chrony as a NTP server

Tip

โŒš You can also update /etc/chrony.conf with custom NTP servers.

sudo sed -i 's/^#allow .*/allow all/g' /etc/chrony.conf
sudo systemctl restart chronyd

Tune selinux

sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
sudo systemctl reboot

Disable firewalld

sudo systemctl disable --now firewalld.service

Network topology

Name Subnet DHCP range ARP reserved
LAN 192.168.1.0/24 150-254 120-149
TRUSTED 192.168.10.0/24 150-254 -
SERVERS 192.168.42.0/24 150-254 120-149
GUESTS 192.168.50.0/24 150-254 -
IOT 192.168.70.0/24 150-254 -
WIREGUARD 192.168.80.0/28 - -

Related Projects

home-service's People

Contributors

caycehouse avatar codewarden-bot[bot] avatar

Stargazers

 avatar

Watchers

 avatar

home-service's Issues

Renovate Dashboard ๐Ÿค–

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/label-sync.yaml
  • actions/create-github-app-token v1
  • actions/checkout v4
  • EndBug/label-sync v2
.github/workflows/renovate.yaml
  • actions/create-github-app-token v1
  • actions/checkout v4
  • renovatebot/github-action v40.2.6
regex
apps/dhcp-relay/dhcp-relay.container
  • quay.io/poseidon/dnsmasq v0.5.0-31-gdc1adc8@sha256:6a839fde323fb405f6be84003a6b9019d9151caa983bfdcbc8cc1b51b1f8627d
apps/gatus/gatus.container
  • ghcr.io/twin/gatus v5.11.0@sha256:eb0374eb55e3ff84ec8f9ea10342ddb623cfba23e5836138896cde01f11cf23d
apps/netbootxyz/netbootxyz.container
  • ghcr.io/netbootxyz/netbootxyz 0.7.3-nbxyz1@sha256:8dbca4d24354fd6ace12b9970188c866341384df2925753c807e87da83587438
apps/node-exporter/node-exporter.container
  • quay.io/prometheus/node-exporter v1.8.2@sha256:4032c6d5bfd752342c3e631c2f1de93ba6b86c41db6b167b9a35372c139e7706
apps/podman-exporter/podman-exporter.container
  • quay.io/navidys/prometheus-podman-exporter v1.13.0@sha256:b09cbe4d6a76d07aba23bb5de6945932be3adb8b91e64bd87b97709b80729f32
apps/traefik/traefik.container
  • docker.io/library/traefik v3.1.2@sha256:ec1a82940b8e00eaeef33fb4113aa1d1573b2ebb6440e10c023743fe96f08475
Taskfile.yaml
  • getsops/sops v3.9.0
apps/dhcp-relay/dhcp-relay.container
  • quay.io/poseidon/dnsmasq v0.5.0-31-gdc1adc8@sha256:6a839fde323fb405f6be84003a6b9019d9151caa983bfdcbc8cc1b51b1f8627d
apps/gatus/gatus.container
  • ghcr.io/twin/gatus v5.11.0@sha256:eb0374eb55e3ff84ec8f9ea10342ddb623cfba23e5836138896cde01f11cf23d
apps/netbootxyz/netbootxyz.container
  • ghcr.io/netbootxyz/netbootxyz 0.7.3-nbxyz1@sha256:8dbca4d24354fd6ace12b9970188c866341384df2925753c807e87da83587438
apps/node-exporter/node-exporter.container
  • quay.io/prometheus/node-exporter v1.8.2@sha256:4032c6d5bfd752342c3e631c2f1de93ba6b86c41db6b167b9a35372c139e7706
apps/podman-exporter/podman-exporter.container
  • quay.io/navidys/prometheus-podman-exporter v1.13.0@sha256:b09cbe4d6a76d07aba23bb5de6945932be3adb8b91e64bd87b97709b80729f32
apps/traefik/traefik.container
  • docker.io/library/traefik v3.1.2@sha256:ec1a82940b8e00eaeef33fb4113aa1d1573b2ebb6440e10c023743fe96f08475
Taskfile.yaml
  • getsops/sops v3.9.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.