From 8960f5e39bcb08c088c378b10e7a07575325847a Mon Sep 17 00:00:00 2001 From: futile Date: Fri, 17 Jul 2026 03:42:59 +0100 Subject: [PATCH] initial commit --- .gitignore | 1 + Caddyfile | 7 ++++ docker-compose.yml | 80 ++++++++++++++++++++++++++++++++++++++++++++++ set-up-system.sh | 61 +++++++++++++++++++++++++++++++++++ 4 files changed, 149 insertions(+) create mode 100644 .gitignore create mode 100644 Caddyfile create mode 100644 docker-compose.yml create mode 100644 set-up-system.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..828ce35 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,7 @@ +m.yaoi.dog { + reverse_proxy stalwart:8080 +} + +mail.yaoi.dog { + reverse_proxy bulwark:3000 +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e25daf4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,80 @@ +services: + caddy: + image: caddy:2.11-alpine + container_name: caddy + restart: unless-stopped + ports: + - "80:80" + - "443:443" + - "443:443/udp" + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile:ro,z + - caddy-data:/data + - caddy-config:/config + networks: + - services + + stalwart: + image: stalwartlabs/stalwart:v0.16-alpine + container_name: stalwart + restart: unless-stopped + ports: + - "25:25" + - "465:465" + - "993:993" + - "4190:4190" + environment: + - STALWART_RECOVERY_ADMIN + - STALWART_PUBLIC_URL + volumes: + - stalwart-etc:/etc/stalwart + - stalwart-data:/var/lib/stalwart + networks: + - services + + bulwark: + image: ghcr.io/bulwarkmail/webmail:latest + container_name: bulwark + restart: unless-stopped + ports: + - "3000:3000" + environment: + - JMAP_SERVER_URL=http://stalwart:8080 + - SESSION_SECRET + depends_on: + - stalwart + healthcheck: + test: + [ + "CMD", + "wget", + "--no-verbose", + "--tries=1", + "--spider", + "http://127.0.0.1:3000/api/health", + ] + interval: 30s + timeout: 5s + retries: 3 + start_period: 10s + volumes: + - bulwark-settings:/app/data/settings + - bulwark-config:/app/data/admin # rw during setup + # - bulwark-config:/app/data/admin:ro # ro after setup + - bulwark-state:/app/data/admin-state + - bulwark-telemetry:/app/data/telemetry + networks: + - services + +volumes: + caddy-data: + caddy-config: + stalwart-etc: + stalwart-data: + bulwark-settings: + bulwark-config: + bulwark-state: + bulwark-telemetry: + +networks: + services: diff --git a/set-up-system.sh b/set-up-system.sh new file mode 100644 index 0000000..6d243e1 --- /dev/null +++ b/set-up-system.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +set -e +sudo -v + +function banner_top() { + echo -e "────┤ $1 ├────\n" +} + +function banner_bottom() { + echo -e "\n────┤ $1 ├────\n\n\n" +} + +# https://patorjk.com/software/taag/#p=display&f=Small+Slant +cat << 'EOF' + __ __ _ + / /_/ / (_)__ ___ ___ __ +/ __/ _ \/ / _ \/ _ `/ // / +\__/_//_/_/_//_/\_, /\_, / + /___//___/ + ..... brought to you by futile + +EOF + +# configure dnf +banner_top "configuring dnf" +sudo tee /etc/dnf/dnf.conf << 'EOF' +[main] +defaultyes = True +max_parallel_downloads = 10 +EOF +banner_bottom "configured dnf" + +# update system +banner_top "updating system" +sudo dnf update -y +banner_bottom "updated system" + +# install (& configure) docker +banner_top "installing docker" +sudo dnf config-manager addrepo --from-repofile https://download.docker.com/linux/fedora/docker-ce.repo --overwrite +sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +sudo usermod -aG docker $(id -un) +sudo systemctl enable --now docker +sudo docker run hello-world +banner_bottom "installed docker" + +# install (& configure) fish +banner_top "installing fish" +sudo dnf install -y fish +sudo chsh -s $(which fish) $(id -un) +fish -c "set -U fish_greeting" +fish -c "set -Ux EDITOR $(which micro)" +banner_bottom "installed fish" + +# install misc +banner_top "installing other packages" +sudo dnf install -y micro btop fastfetch +banner_bottom "installed other packages" + +# finish +banner_top "done! please log out and log back in"