docker: added home assistant
All checks were successful
ci/woodpecker/push/demo-workflow Pipeline was successful

This commit is contained in:
2025-07-18 19:15:13 +03:00
parent 64ca1bbd1f
commit 12f6a7343e
3 changed files with 83 additions and 73 deletions

View File

@ -1,23 +1,9 @@
Homeserver Notes # Homeserver Notes
================
# Future Plan
- Add authentication frontend like Authentik which will handle the authentication
- Add Nextcloud
- Add Gitea
# List of Service Running on Homeserver # List of Service Running on Homeserver
- Adguard
- Plex - Plex
- Sonarr - Home Assistant
- Radarr
- qbittorrent
- Portainer
- Jackett
- Jellyfin
- Wireguard
# List of Basic CLI tools installed on server # List of Basic CLI tools installed on server
@ -32,7 +18,6 @@ Homeserver Notes
- apt-transport-https - apt-transport-https
- htop - htop
# Firewall Rules (Currently Disabled) # Firewall Rules (Currently Disabled)
I am using ufw to set different firewall rules. As I go I will update the rules I am using ufw to set different firewall rules. As I go I will update the rules
@ -71,7 +56,6 @@ processor, we have HW transcoding. Here is the process to enable it:
``` ```
# Traefik Reverse proxy # Traefik Reverse proxy
- Traefik is modern HTTP reverse proxy and load balancerthat can be used to route - Traefik is modern HTTP reverse proxy and load balancerthat can be used to route
@ -81,7 +65,6 @@ processor, we have HW transcoding. Here is the process to enable it:
and renewal for HTTPS automatically handle SSL certificate genertion and renewal for HTTPS automatically handle SSL certificate genertion
and renewal for HTTPS. and renewal for HTTPS.
## Configuration ## Configuration
In order to get wildcard certificates from LetsEncrypt, I will be using DNS challange In order to get wildcard certificates from LetsEncrypt, I will be using DNS challange
@ -90,6 +73,7 @@ the ownership of the domain by adding specific DNS records.
To do that with cloudflare, I have created a new API token with name _CF_DNS_API_TOKEN_ To do that with cloudflare, I have created a new API token with name _CF_DNS_API_TOKEN_
and saved it as docker secret under ~/docker/secrets directory and saved it as docker secret under ~/docker/secrets directory
``` ```
# To save the appdata for traefik3, created the following folders # To save the appdata for traefik3, created the following folders
mkdir -p ~/docker/appdata/traefik3/acme mkdir -p ~/docker/appdata/traefik3/acme
@ -103,7 +87,9 @@ chmod 600 acme.json # without 600, Traefik will not start
touch traefik.log touch traefik.log
touch access.log touch access.log
``` ```
After creating the Docker Compose file, add these TLS options like this: After creating the Docker Compose file, add these TLS options like this:
``` ```
# Under DOCKERDIR/appdata/traefik3/rules/udms/tls-opts.yml # Under DOCKERDIR/appdata/traefik3/rules/udms/tls-opts.yml
tls: tls:
@ -126,7 +112,9 @@ tls:
- CurveP384 - CurveP384
sniStrict: true sniStrict: true
``` ```
Add the middleware Basic Auth: Add the middleware Basic Auth:
``` ```
# Under DOCKERDIR/appdata/traefik3/rules/udms/middlewares-basic-auth.yml # Under DOCKERDIR/appdata/traefik3/rules/udms/middlewares-basic-auth.yml
http: http:
@ -139,7 +127,9 @@ http:
realm: "Traefik 3 Basic Auth" realm: "Traefik 3 Basic Auth"
``` ```
Add middleware rate limited to prevent DDoS attack Add middleware rate limited to prevent DDoS attack
``` ```
# Under DOCKERDIR/appdata/traefik3/rules/udms/middlewares-rate-limit.yaml # Under DOCKERDIR/appdata/traefik3/rules/udms/middlewares-rate-limit.yaml
http: http:
@ -149,7 +139,9 @@ http:
average: 100 average: 100
burst: 50 burst: 50
``` ```
Add secure headers middleware Add secure headers middleware
``` ```
# Under DOCKERDIR/appdata/traefik3/rules/udms/middlewares-secure-headers.yaml # Under DOCKERDIR/appdata/traefik3/rules/udms/middlewares-secure-headers.yaml
http: http:
@ -186,6 +178,7 @@ Create a default Bridge network for the Traefik
In order for qbittorrent container to use the wireguard VPN tunnel In order for qbittorrent container to use the wireguard VPN tunnel
wireguard container has been added to the qbittorrent docker compose wireguard container has been added to the qbittorrent docker compose
file. file.
- qbittorrent container depends on the wireguard container. If - qbittorrent container depends on the wireguard container. If
wireguard container is down, qbittorrent network will not work. wireguard container is down, qbittorrent network will not work.
@ -203,8 +196,10 @@ file.
# Forward traffic from the WireGuard container back to the host's port 9500 # Forward traffic from the WireGuard container back to the host's port 9500
sudo iptables -t nat -A POSTROUTING -p tcp -d 172.18.0.6 --dport 9500 -j MASQUERADE sudo iptables -t nat -A POSTROUTING -p tcp -d 172.18.0.6 --dport 9500 -j MASQUERADE
``` ```
- We can check the host ip geolocation by the following command. In that way - We can check the host ip geolocation by the following command. In that way
we can verify VPN is working. we can verify VPN is working.
``` ```
docker exec -it qbittorrent curl ipinfo.io docker exec -it qbittorrent curl ipinfo.io
@ -221,7 +216,9 @@ file.
"readme": "https://ipinfo.io/missingauth" "readme": "https://ipinfo.io/missingauth"
} }
``` ```
- We can check the wireguard VPN connection status with the following command - We can check the wireguard VPN connection status with the following command
``` ```
docker exec -it wireguard wg docker exec -it wireguard wg

12
docker/homeassistant.yaml Normal file
View File

@ -0,0 +1,12 @@
services:
homeassistant:
container_name: homeassistant
image: ghcr.io/home-assistant/home-assistant:stable
restart: unless-stopped
network_mode: host
privileged: true
volumes:
- ${DOCKERDIR}/appdata/homeassistant:/config
- /etc/localtime:/etc/localtime:ro
# devices:
# - /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_<ID>

View File

@ -2,6 +2,7 @@ apt_packages:
- curl - curl
- vim - vim
- htop - htop
- nfs-common
# Kubernetes k0sctl configuration vars # Kubernetes k0sctl configuration vars
master1_ip: "192.168.1.151" master1_ip: "192.168.1.151"