feat: put Patrizio inside VPN #43

Merged
polpetta merged 22 commits from feat/patrizio-vpn into master 2026-04-17 11:33:00 +02:00
Owner
No description provided.
polpetta added the
enhancement
label 2026-04-17 11:32:05 +02:00
polpetta added 22 commits 2026-04-17 11:32:05 +02:00
- Add Tailscale container with hostname 'patrizio' for network connectivity
- Configure health check for Tailscale service availability
- Make patrizio service depend on healthy Tailscale container
- Mount required volumes for Tailscale state and kernel modules
- Grant necessary capabilities (net_admin, sys_module, net_raw) for VPN operation
- Add internal network configuration for service isolation
- Switch patrizio to use published image (ghcr.io/polpetta/patrizio-bot:v0.2.0)
- Standardize logging configuration across both services
The tailscale service no longer needs to be explicitly connected to the internal
network in the docker-compose configuration.
Add read-only volume mount for patrizio.toml configuration file to make it
accessible within the container at /etc/patrizio/patrizio.toml
Add network_mode configuration to patrizio service to connect it through the
tailscale service network, enabling secure private network access.
Add new ACL entry allowing Patrizio tagged devices to access web
services on port 443. Also reformat the entire acl.json file with
consistent 2-space indentation for better readability.
Add TS_ACCEPT_DNS environment variable to allow tailscale to manage DNS settings
for the patrizio container.
Replace inline environment variable with env_file reference for better
configuration management. Remove redundant tailscaled command as it's
the default entrypoint.
Update docker-compose.yml to run tailscaled as a background daemon and execute
tailscale up with DNS acceptance flag. This replaces the previous env_file
configuration approach.
Add --login-server flag to tailscale up command to use custom VPN server at
vpn.poldebra.me instead of default Tailscale coordination server.
Remove unnecessary shell wrapper and startup delay from tailscale
service. Configure DNS directly in docker-compose instead of relying
on --accept-dns flag. This streamlines the container startup process
and removes the 5-second artificial delay.
Add 1.1.1.1 as secondary DNS server to ensure DNS resolution continues
working if Tailscale DNS (100.64.0.4) becomes unavailable.
Add custom DNS records for internal services (pihole and ollama) and configure
Tailscale to start automatically with accept-dns flag and custom login server.
Remove static DNS configuration in favor of extra_records approach.

Signed-off-by: Davide Polonio <davide.polonio@infinitaslearning.com>
Remove hardcoded DNS A records for pi.hole, pihole.lan.poldebra.me, and
ollama.lan.poldebra.me from the Tailscale container configuration. These DNS
entries are no longer needed in the docker-compose configuration.
Load tailscale configuration from external env_file for better
secrets management and configuration portability
Normalize whitespace and indentation in the tailscale service command
block for better readability and consistency with yaml formatting
standards.
- Run tailscaled with --netfilter-mode=off to avoid iptables failures
  in the container, which were breaking the MagicDNS proxy at 100.100.100.100
- Set dns: 100.100.100.100 so Docker forwards DNS queries to Tailscale's
  MagicDNS proxy instead of Contabo's public DNS, which was resolving
  ollama.lan.poldebra.me to the server's public IP instead of the tailnet IP
MagicDNS is broken in the container (DNS proxy returns SERVFAIL with
'no upstream resolvers set'). Use extra_hosts as a reliable workaround
to ensure ollama.lan.poldebra.me resolves to its Tailscale IP 100.64.0.7
instead of the server's public IP which has an expired cert.
Containers using network_mode: service:X share the target container's
network namespace including /etc/hosts. Move the ollama hosts entry
to the tailscale service so it applies to the shared namespace.
polpetta merged commit a8aee24639 into master 2026-04-17 11:33:00 +02:00
polpetta deleted branch feat/patrizio-vpn 2026-04-17 11:33:00 +02:00
Sign in to join this conversation.
No description provided.