diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-09-18 15:56:31 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-09-18 15:57:46 +0200 |
commit | b18e29b389792267269c77db711b54d38e6b9d59 (patch) | |
tree | 973ad914da9105cc526df1690cc99dc038fea5e4 |
initial commit
-rw-r--r-- | .config/archinstall/user_configuration.json | 148 | ||||
-rw-r--r-- | .config/yadm/bootstrap | 12 | ||||
-rw-r--r-- | .local/bin/update | 27 | ||||
-rw-r--r-- | .zshrc | 13 | ||||
-rw-r--r-- | Applications/NextCloud/.env.example | 11 | ||||
-rw-r--r-- | Applications/NextCloud/bin/fstab | 12 | ||||
-rw-r--r-- | Applications/NextCloud/docker-compose.yml | 41 | ||||
-rw-r--r-- | Applications/PiHole/.env.example | 2 | ||||
-rw-r--r-- | Applications/PiHole/.env.pihole.example | 47 | ||||
-rw-r--r-- | Applications/PiHole/docker-compose.yml | 35 | ||||
-rw-r--r-- | Applications/PiHole/volumes/pihole/custom.list | 3 | ||||
-rw-r--r-- | Applications/Traefik/.env.example | 2 | ||||
-rw-r--r-- | Applications/Traefik/docker-compose.yml | 28 |
13 files changed, 381 insertions, 0 deletions
diff --git a/.config/archinstall/user_configuration.json b/.config/archinstall/user_configuration.json new file mode 100644 index 0000000..b483e1c --- /dev/null +++ b/.config/archinstall/user_configuration.json @@ -0,0 +1,148 @@ +{ + "additional-repositories": [], + "archinstall-language": "English", + "audio_config": null, + "bootloader": "Systemd-boot", + "config_version": "2.6.0", + "debug": false, + "disk_config": null, + "hostname": "archion", + "kernels": [ + "linux-lts" + ], + "locale_config": { + "kb_layout": "de", + "sys_enc": "UTF-8", + "sys_lang": "de_DE" + }, + "mirror_config": { + "custom_mirrors": [], + "mirror_regions": { + "Germany": [ + "https://pkg.fef.moe/archlinux/$repo/os/$arch", + "https://packages.oth-regensburg.de/archlinux/$repo/os/$arch", + "https://mirrors.xtom.de/archlinux/$repo/os/$arch", + "https://mirrors.niyawe.de/archlinux/$repo/os/$arch", + "https://mirrors.n-ix.net/archlinux/$repo/os/$arch", + "https://mirrors.janbruckner.de/archlinux/$repo/os/$arch", + "https://mirror.wtnet.de/archlinux/$repo/os/$arch", + "https://mirror.ubrco.de/archlinux/$repo/os/$arch", + "https://mirror.sunred.org/archlinux/$repo/os/$arch", + "https://mirror.selfnet.de/archlinux/$repo/os/$arch", + "https://mirror.pseudoform.org/$repo/os/$arch", + "https://mirror.pagenotfound.de/archlinux/$repo/os/$arch", + "https://mirror.netcologne.de/archlinux/$repo/os/$arch", + "https://mirror.moson.org/arch/$repo/os/$arch", + "https://mirror.mikrogravitation.org/archlinux/$repo/os/$arch", + "https://mirror.metalgamer.eu/archlinux/$repo/os/$arch", + "https://mirror.kumi.systems/archlinux/$repo/os/$arch", + "https://mirror.iusearchbtw.nl/$repo/os/$arch", + "https://mirror.informatik.tu-freiberg.de/arch/$repo/os/$arch", + "https://mirror.fra10.de.leaseweb.net/archlinux/$repo/os/$arch", + "https://mirror.f4st.host/archlinux/$repo/os/$arch", + "https://mirror.dogado.de/archlinux/$repo/os/$arch", + "https://mirror.cmt.de/archlinux/$repo/os/$arch", + "https://mirror.clientvps.com/archlinux/$repo/os/$arch", + "https://mirror.bethselamin.de/$repo/os/$arch", + "https://mirror.23m.com/archlinux/$repo/os/$arch", + "https://ftp.wrz.de/pub/archlinux/$repo/os/$arch", + "https://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/$repo/os/$arch", + "https://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch", + "https://ftp.fau.de/archlinux/$repo/os/$arch", + "https://ftp.agdsn.de/pub/mirrors/archlinux/$repo/os/$arch", + "https://dist-mirror.fem.tu-ilmenau.de/archlinux/$repo/os/$arch", + "https://de.arch.mirror.kescher.at/$repo/os/$arch", + "https://archlinux.thaller.ws/$repo/os/$arch", + "https://archlinux.richard-neumann.de/$repo/os/$arch", + "https://archlinux.homeinfo.de/$repo/os/$arch", + "https://arch.unixpeople.org/$repo/os/$arch", + "https://arch.phinau.de/$repo/os/$arch", + "https://arch.mirror.zachlge.org/$repo/os/$arch", + "https://arch.jensgutermuth.de/$repo/os/$arch", + "https://appuals.com/archlinux/$repo/os/$arch", + "http://packages.oth-regensburg.de/archlinux/$repo/os/$arch", + "http://mirrors.xtom.de/archlinux/$repo/os/$arch", + "http://mirrors.niyawe.de/archlinux/$repo/os/$arch", + "http://mirrors.n-ix.net/archlinux/$repo/os/$arch", + "http://mirrors.janbruckner.de/archlinux/$repo/os/$arch", + "http://mirror.wtnet.de/archlinux/$repo/os/$arch", + "http://mirror.united-gameserver.de/archlinux/$repo/os/$arch", + "http://mirror.ubrco.de/archlinux/$repo/os/$arch", + "http://mirror.sunred.org/archlinux/$repo/os/$arch", + "http://mirror.selfnet.de/archlinux/$repo/os/$arch", + "http://mirror.pagenotfound.de/archlinux/$repo/os/$arch", + "http://mirror.netcologne.de/archlinux/$repo/os/$arch", + "http://mirror.moson.org/arch/$repo/os/$arch", + "http://mirror.mikrogravitation.org/archlinux/$repo/os/$arch", + "http://mirror.metalgamer.eu/archlinux/$repo/os/$arch", + "http://mirror.kumi.systems/archlinux/$repo/os/$arch", + "http://mirror.informatik.tu-freiberg.de/arch/$repo/os/$arch", + "http://mirror.fra10.de.leaseweb.net/archlinux/$repo/os/$arch", + "http://mirror.f4st.host/archlinux/$repo/os/$arch", + "http://mirror.cmt.de/archlinux/$repo/os/$arch", + "http://mirror.clientvps.com/archlinux/$repo/os/$arch", + "http://mirror.23m.com/archlinux/$repo/os/$arch", + "http://linux.rz.rub.de/archlinux/$repo/os/$arch", + "http://ftp.wrz.de/pub/archlinux/$repo/os/$arch", + "http://ftp.uni-kl.de/pub/linux/archlinux/$repo/os/$arch", + "http://ftp.uni-hannover.de/archlinux/$repo/os/$arch", + "http://ftp.uni-bayreuth.de/linux/archlinux/$repo/os/$arch", + "http://ftp.tu-chemnitz.de/pub/linux/archlinux/$repo/os/$arch", + "http://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/$repo/os/$arch", + "http://ftp.hosteurope.de/mirror/ftp.archlinux.org/$repo/os/$arch", + "http://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch", + "http://ftp.gwdg.de/pub/linux/archlinux/$repo/os/$arch", + "http://ftp.fau.de/archlinux/$repo/os/$arch", + "http://ftp.agdsn.de/pub/mirrors/archlinux/$repo/os/$arch", + "http://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/$repo/os/$arch", + "http://artfiles.org/archlinux.org/$repo/os/$arch", + "http://archlinux.thaller.ws/$repo/os/$arch", + "http://archlinux.mirror.iphh.net/$repo/os/$arch", + "http://archlinux.honkgong.info/$repo/os/$arch", + "http://arch.phinau.de/$repo/os/$arch", + "http://arch.mirror.zachlge.org/$repo/os/$arch", + "http://arch.jensgutermuth.de/$repo/os/$arch" + ] + } + }, + "network_config": { + "nics": [ + { + "dhcp": true, + "dns": [], + "gateway": null, + "iface": "wlan0", + "ip": null + } + ], + "type": "manual" + }, + "no_pkg_lookups": false, + "ntp": true, + "offline": false, + "packages": [ + "iwd", + "dhcpcd", + "openssh", + "yadm" + ], + "parallel downloads": 0, + "profile_config": { + "gfx_driver": "All open-source", + "greeter": "sddm", + "profile": { + "custom_settings": { + "Lxqt": {} + }, + "details": [ + "Lxqt" + ], + "main": "Desktop" + } + }, + "script": "guided", + "silent": false, + "swap": false, + "timezone": "Europe/Berlin", + "version": "2.6.0" +} diff --git a/.config/yadm/bootstrap b/.config/yadm/bootstrap new file mode 100644 index 0000000..71f4f0f --- /dev/null +++ b/.config/yadm/bootstrap @@ -0,0 +1,12 @@ +#!/bin/zsh + +sudo pacman -Sy \ + zsh neovim man-db \ + eza btop \ + firefox \ + docker + +sudo systemctl enable docker.service --now + +CRONTAB_UPDATE="0 3 * * * update" +(crontab -u $(whoami) -l; echo "$CRON_UPDATE") | crontab -u $(whoami) - diff --git a/.local/bin/update b/.local/bin/update new file mode 100644 index 0000000..ee6f67d --- /dev/null +++ b/.local/bin/update @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +import sys, os +import subprocess + + +# pacman +subprocess.run(["sudo", "pacman", "-Syu", "--noconfirm"]) + + +# docker +process_docker_ps = subprocess.run(["docker", "ps", "-q"], stdout=subprocess.PIPE) + +container_ids = process_docker_ps.stdout.decode("utf-8").split("\n") + +docker_compose_project_paths = [] +for id in container_ids: + if id: + process_docker_inspect = subprocess.run(["docker", "inspect", "--format", "{{ index .Config.Labels \"com.docker.compose.project.working_dir\" }}", id], stdout=subprocess.PIPE) + docker_compose_project_paths.append(process_docker_inspect.stdout.decode("utf-8").strip()) + +docker_compose_project_paths = set(docker_compose_project_paths) + +for path in docker_compose_project_paths: + subprocess.run(["docker", "compose", "down"], cwd=path) + subprocess.run(["docker", "compose", "pull"], cwd=path) + subprocess.run(["docker", "compose", "up", "-d"], cwd=path) @@ -0,0 +1,13 @@ +CASE_SENSITIVE="false" +HYPHEN_INSENSITIVE="true" +HIST_STAMPS="dd.mm.yyyy" + +export EDITOR=nvim +alias vim=$EDITOR + +alias ls="eza" +alias tree="eza --tree" + +alias ip="ip --color=auto" + +export PATH=$PATH:~/.local/bin diff --git a/Applications/NextCloud/.env.example b/Applications/NextCloud/.env.example new file mode 100644 index 0000000..52ae080 --- /dev/null +++ b/Applications/NextCloud/.env.example @@ -0,0 +1,11 @@ +DOMAIN=cloud.archion.sls19.lan +TRAEFIK_NETWORK=traefik-public + +DB_NAME=nextcloud +DB_USER=nextcloud +DB_PASSWORD=nextcloud + +EXTERNAL_STORAGE_PATH_HOST=/media/nextcloud +EXTERNAL_STORAGE_PATH_CONTAINER=/media/nextcloud +EXTERNAL_STORAGE_PARTITION=/dev/X +EXTERNAL_STORAGE_FS_TYPE=fat diff --git a/Applications/NextCloud/bin/fstab b/Applications/NextCloud/bin/fstab new file mode 100644 index 0000000..a804da2 --- /dev/null +++ b/Applications/NextCloud/bin/fstab @@ -0,0 +1,12 @@ +#!/usr/bin/env zsh + +source .env + +if grep -q "${EXTERNAL_STORAGE_PATH_HOST}"; then + echo "Already mounted." + exit +fi + +echo "${EXTERNAL_STORAGE_PARTITION} ${EXTERNAL_STORAGE_PATH_HOST} ${EXTERNAL_STORAGE_FS_TYPE} rw 0 1" >> "/etc/fstab" +mkdir -p "${EXTERNAL_STORAGE_PATH_HOST}" +mount -a -v diff --git a/Applications/NextCloud/docker-compose.yml b/Applications/NextCloud/docker-compose.yml new file mode 100644 index 0000000..c5af0b4 --- /dev/null +++ b/Applications/NextCloud/docker-compose.yml @@ -0,0 +1,41 @@ +version: "3" + +services: + app: + image: "nextcloud" + restart: "unless-stopped" + environment: + - "MYSQL_DATABASE=${DB_NAME}" + - "MYSQL_USER=${DB_USER}" + - "MYSQL_PASSWORD=${DB_PASSWORD}" + - "MYSQL_HOST=db" + volumes: + - "./volumes/nextcloud:/var/www/html" + - "${EXTERNAL_STORAGE_PATH_HOST}:${EXTERNAL_STORAGE_PATH_CONTAINER}" + networks: + - "internal" + - "traefik" + labels: + - "traefik.enable=true" + - "traefik.docker.network=${TRAEFIK_NETWORK}" + - "traefik.http.routers.nextcloud.rule=Host(`${DOMAIN}`)" + - "traefik.http.routers.nextcloud.entrypoints=web" + + db: + image: "mariadb" + restart: "unless-stopped" + command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW" + environment: + - "MYSQL_DATABASE=${DB_NAME}" + - "MYSQL_USER=${DB_USER}" + - "MYSQL_PASSWORD=${DB_PASSWORD}" + - "MYSQL_ROOT_PASSWORD=${DB_PASSWORD}" + volumes: + - "./volumes/db:/var/lib/mysql" + networks: + - "internal" + +networks: + internal: + traefik: + name: "${TRAEFIK_NETWORK}" diff --git a/Applications/PiHole/.env.example b/Applications/PiHole/.env.example new file mode 100644 index 0000000..4e95c38 --- /dev/null +++ b/Applications/PiHole/.env.example @@ -0,0 +1,2 @@ +DOMAIN=pi.hole.archion.sls19.lan +TRAEFIK_NETWORK=traefik-public diff --git a/Applications/PiHole/.env.pihole.example b/Applications/PiHole/.env.pihole.example new file mode 100644 index 0000000..6c62aab --- /dev/null +++ b/Applications/PiHole/.env.pihole.example @@ -0,0 +1,47 @@ +PIHOLE_IP= +ROUTER_IP= + +TZ=Europe/Berlin +WEBPASSWORD= +FTLCONF_LOCAL_IPv4=${PIHOLE_IP} + +PIHOLE_DNS_=${ROUTER_IP} + +DHCP_ACTIVE=true +DHCP_START= +DHCP_END + +# Environment Variables documented at: https://github.com/pi-hole/docker-pi-hole/#environment-variables + + +PIHOLE_IP= +ROUTER_IP= + + +## Recommended + +TZ=Europe/Berlin +WEBPASSWORD= +FTLCONF_LOCAL_IPV4=${PIHOLE_IP} + + +## Optional + +PIHOLE_DNS_=${ROUTER_IP} + +DHCP_ACTIVE=true +DHCP_START=192.168.178.20 +DHCP_END=192.168.178.200 +DHCP_ROUTER=${ROUTER_IP} + +WEBTHEME=default-dark + + +## Advanced + +# + + +## Experimental + +# diff --git a/Applications/PiHole/docker-compose.yml b/Applications/PiHole/docker-compose.yml new file mode 100644 index 0000000..b3fbabd --- /dev/null +++ b/Applications/PiHole/docker-compose.yml @@ -0,0 +1,35 @@ +version: "3" + +services: + pihole: + image: "pihole/pihole" + container_name: "pihole" + restart: "unless-stopped" + cap_add: + - NET_ADMIN + dns: + - "127.0.0.1" + hostname: "${DOMAIN}" + ports: + - "53:53/tcp" + - "53:53/udp" + - "67:67/udp" + environment: + - "VIRTUAL_HOST=${DOMAIN}" + - "DNSMASQ_LISTENING=all" + env_file: ".env.pihole" + volumes: + - "./volumes/pihole/data:/etc/pihole" + - "./volumes/pihole/dnsmasq.d:/etc/dnsmasq.d" + - "./volumes/pihole/custom.list:/etc/pihole/custom.list" + networks: + - "traefik" + labels: + - "traefik.enable=true" + - "traefik.http.routers.pihole.rule=Host(`${DOMAIN}`)" + - "traefik.http.routers.pihole.entrypoints=web" + - "traefik.http.services.pihole.loadbalancer.server.port=80" + +networks: + traefik: + name: "${TRAEFIK_NETWORK}" diff --git a/Applications/PiHole/volumes/pihole/custom.list b/Applications/PiHole/volumes/pihole/custom.list new file mode 100644 index 0000000..7e49694 --- /dev/null +++ b/Applications/PiHole/volumes/pihole/custom.list @@ -0,0 +1,3 @@ +127.0.0.1 pi.hole.archion.sls19.lan +127.0.0.1 traefik.archion.sls19.lan +127.0.0.1 cloud.archion.sls19.lan diff --git a/Applications/Traefik/.env.example b/Applications/Traefik/.env.example new file mode 100644 index 0000000..9c0f2a6 --- /dev/null +++ b/Applications/Traefik/.env.example @@ -0,0 +1,2 @@ +DOMAIN=traefik.archion.sls19.lan +NETWORK=traefik-public diff --git a/Applications/Traefik/docker-compose.yml b/Applications/Traefik/docker-compose.yml new file mode 100644 index 0000000..b432691 --- /dev/null +++ b/Applications/Traefik/docker-compose.yml @@ -0,0 +1,28 @@ +version: "3" + +services: + traefik: + image: "traefik" + container_name: "traefik" + restart: "always" + command: + - "--api.insecure=true" + - "--entrypoints.web.address=:80" + - "--providers.docker=true" + - "--providers.docker.exposedbydefault=false" + ports: + - "80:80" + labels: + - "traefik.enable=true" + # Dashboard + - "traefik.http.services.loadbalancer.server.port=8080" + - "traefik.http.routers.traefik.rule=Host(`${DOMAIN}`)" + - "traefik.http.routers.traefik.entrypoints=web" + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + networks: + - "traefik" + +networks: + traefik: + name: "${NETWORK}" |