mirror of
https://github.com/tomasriveral/vps-config.git
synced 2026-08-11 18:18:38 +02:00
should work now
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
# =========================
|
||||||
|
# General
|
||||||
|
# =========================
|
||||||
|
|
||||||
|
DOMAIN=tomasrivera.ch
|
||||||
|
TZ=Europe/Zurich
|
||||||
|
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# ArchiveBox
|
||||||
|
# =========================
|
||||||
|
|
||||||
|
ARCHIVEBOX_ADMIN_USERNAME=admin
|
||||||
|
ARCHIVEBOX_ADMIN_PASSWORD=change_me
|
||||||
+16
-10
@@ -1,11 +1,17 @@
|
|||||||
# Ignore build outputs from performing a nix-build or `nix build` command
|
# Secrets
|
||||||
result
|
|
||||||
result-*
|
|
||||||
|
|
||||||
# Ignore automatically generated direnv output
|
|
||||||
.direnv
|
|
||||||
|
|
||||||
# Ignore NixOS interactive test driver history
|
|
||||||
**/.nixos-test-history
|
|
||||||
|
|
||||||
.env
|
.env
|
||||||
|
|
||||||
|
# Docker data
|
||||||
|
data/
|
||||||
|
volumes/
|
||||||
|
|
||||||
|
# Temporary files
|
||||||
|
*.tmp
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Editor files
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# OS files
|
||||||
|
.DS_Store
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ apt install -y \
|
|||||||
htop \
|
htop \
|
||||||
unzip \
|
unzip \
|
||||||
rsync \
|
rsync \
|
||||||
|
rclone \
|
||||||
jq \
|
jq \
|
||||||
|
fail2ban \
|
||||||
|
unattended-upgrades \
|
||||||
ufw
|
ufw
|
||||||
|
|
||||||
echo "== Installing Docker repository key =="
|
echo "== Installing Docker repository key =="
|
||||||
@@ -61,7 +64,22 @@ ufw --force enable
|
|||||||
|
|
||||||
echo "== Enabling useful services =="
|
echo "== Enabling useful services =="
|
||||||
systemctl enable --now ssh
|
systemctl enable --now ssh
|
||||||
|
systemctl enable --now fail2ban
|
||||||
|
dpkg-reconfigure unattended-upgrades
|
||||||
|
|
||||||
|
echo "== installing systemd systems"
|
||||||
|
mkdir -p /opt/server/archivebox/archivebox-data
|
||||||
|
mkdir -p /mnt/kdrive/Archive
|
||||||
|
rclone config
|
||||||
|
|
||||||
|
mkdir -p /mnt/kdrive
|
||||||
|
cp systemd/kdrive-rclone.service /etc/systemd/system/
|
||||||
|
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable kdrive-rclone
|
||||||
|
systemctl start kdrive-rclone
|
||||||
|
mountpoint /mnt/kdrive
|
||||||
|
ls /mnt/kdrive
|
||||||
echo
|
echo
|
||||||
echo "================================"
|
echo "================================"
|
||||||
echo "Bootstrap finished!"
|
echo "Bootstrap finished!"
|
||||||
|
|||||||
+36
@@ -0,0 +1,36 @@
|
|||||||
|
services:
|
||||||
|
|
||||||
|
caddy:
|
||||||
|
image: caddy:latest
|
||||||
|
container_name: caddy
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
||||||
|
- caddy_data:/data
|
||||||
|
- caddy_config:/config
|
||||||
|
|
||||||
|
|
||||||
|
archivebox:
|
||||||
|
image: archivebox/archivebox:latest
|
||||||
|
container_name: archivebox
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
environment:
|
||||||
|
- TZ=Europe/Zurich
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
# Local SSD: database + config + metadata
|
||||||
|
- ./archivebox-data:/data
|
||||||
|
|
||||||
|
# kDrive: only the heavy archive content
|
||||||
|
- /mnt/kdrive/Archive:/data/archive
|
||||||
|
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
caddy_data:
|
||||||
|
caddy_config:
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
docker compose pull
|
||||||
|
docker compose up -d
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
mkdir -p archivebox-data
|
||||||
|
|
||||||
|
docker compose run --rm archivebox init --setup
|
||||||
|
|
||||||
|
docker compose up -d
|
||||||
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
docker compose pull
|
||||||
|
docker compose up -d
|
||||||
|
docker image prune -f
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Mount kDrive with rclone
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=root
|
||||||
|
ExecStart=/usr/bin/rclone mount kdrive: /mnt/kdrive \
|
||||||
|
--allow-other \
|
||||||
|
--vfs-cache-mode full \
|
||||||
|
--dir-cache-time 1h
|
||||||
|
ExecStop=/bin/fusermount -u /mnt/kdrive
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Reference in New Issue
Block a user