minpeter / homelab_infra

πŸ“‹ rasspberry pi homelab infra using compose

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

homelab_infra

This is a collection of scripts and configuration files that I use to manage my homelab infrastructure.

(VPN power by tailsacle :)

Starting a new server

To start a new server, I use the following steps:

  1. install docker
curl https://get.docker.com | sh
  1. clone this repo
git clone https://github.com/minpeter/homelab_infra.git
  1. config .env

web interface passwod change

echo "WEBPASSWORD=<password>" > pihole/.env

set traefik basic auth username and password

echo "<username>:<htpassword>" >> secrets/usersfile.secret
  1. cloudflare settings
A record: *.domain.com -> <server_ip>
A record: domain.com -> <server_ip>

SSL -> Full (strict)

API token λ°œκΈ‰

image

그리고 secrets/cf-dns-api-token.secret νŒŒμΌμ— 토큰을 λ„£λŠ”λ‹€.

  1. server start up
docker-compose up -d

https://dockge.domain.com둜 μ ‘μ†ν•΄μ„œ ν•„μš”ν•œ μ„œλΉ„μŠ€λ₯Ό μ‹œμž‘μ‹œν‚¨λ‹€.

Setting up HTTP services that are not inside HomeLab

  1. add [service].toml to external folder

  2. add [service].toml to

[http.routers]
  [http.routers.[service]]
    rule = "Host(`[service].minpeter.tech`)"
    service = "[service]-ext-srv"
    [http.routers.[service].tls]
[[http.services.[service]-ext-srv.loadBalancer.servers]]
  url = "http://[service]:[port]"

// If the service is running on the same server, connect to host.docker.internal:[port]

Setting up TCP services that are not inside HomeLab

  1. add [service].toml to external folder

  2. add [service].toml to

[tcp.routers]
  [tcp.routers.[service]]
    rule = "HostSNI(`[service].minpeter.tech`)"
    service = "[service]-ext-srv"
    [tcp.routers.[service].tls]
[[tcp.services.[service]-ext-srv.loadBalancer.servers]]
  address = "[service]:[port]"
  1. disable proxy for the service domain in cloudflare DNS

// If the service is running on the same server, connect to host.docker.internal:[port]

About

πŸ“‹ rasspberry pi homelab infra using compose