rewrote setup

This commit is contained in:
2026-07-23 21:21:47 +02:00
parent eddfdc8280
commit fe0de5cd1d
3 changed files with 22 additions and 196 deletions
+8 -183
View File
@@ -105,29 +105,11 @@ ssh USERNAME@SERVER_IP
---
# 4. Clone the server configuration
Create the deployment directory:
```bash
mkdir -p /opt/server
cd /opt/server
```
Clone the configuration repository:
```bash
git clone YOUR_REPOSITORY_URL .
```
The structure should look like:
```
server/
├── compose.yml
├── Caddyfile
├── .env
├── scripts/
└── README.md
git clone https://github.com/tomasriveral/vps-config
cd vps-config
```
---
@@ -142,171 +124,14 @@ Create:
nano .env
```
Example:
See `.env.example`
```env
DOMAIN=example.com
FRESHRSS_ADMIN_PASSWORD=change_me
KDRIVE_USERNAME=user
KDRIVE_PASSWORD=password
# 6. Init the system
```
./scripts/init.sh
```
Set permissions:
```bash
chmod 600 .env
# 7. Deploy
```
---
# 6. Start the Docker stack
From `/opt/server`:
```bash
docker compose up -d
./scripts/deploy.sh
```
Check running containers:
```bash
docker ps
```
View logs:
```bash
docker compose logs -f
```
---
# 7. Reverse proxy
Caddy handles HTTPS automatically.
Example:
```
website.com
├── freshrss.website.com
├── archivebox.website.com
├── hledger.website.com
├── calendar.website.com
└── ntfy.website.com
```
The `Caddyfile` defines where traffic goes.
After changing it:
```bash
docker compose restart caddy
```
---
# 8. Updating services
Update images:
```bash
docker compose pull
```
Restart:
```bash
docker compose up -d
```
Remove unused images:
```bash
docker image prune
```
---
# 9. Backups
Important data is stored in Docker volumes.
List volumes:
```bash
docker volume ls
```
Back up using:
* restic
* kDrive
* another storage provider
Recommended backup targets:
```
FreshRSS database
ArchiveBox data
Calendar/contact data
hledger files
Caddy configuration
.env secrets
```
---
# 10. Disaster recovery
To rebuild:
1. Install Debian
2. Run `bootstrap.sh`
3. Clone this repository
4. Restore backups
5. Restore `.env`
6. Start Docker:
```bash
docker compose up -d
```
The complete server should be operational again.
---
# Planned services
Current stack:
* Caddy
* FreshRSS
* ArchiveBox
* hledger-web
* Calendar/contact server
* ntfy
* Monitoring
Possible additions:
* Uptime Kuma
* Authelia or Authentik
* Vaultwarden
* Gitea
* Miniflux
* Mealie
* Paperless-ngx
---
# Principles
* Configuration belongs in Git
* Data belongs in backups
* Secrets never go into Git
* Containers are disposable
* Volumes contain persistent data
* The server should be reproducible
-12
View File
@@ -68,19 +68,7 @@ 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/
rclone config
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 "Bootstrap finished!"
echo
+14 -1
View File
@@ -1,6 +1,19 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")/.."
echo "== installing systemd systems"
mkdir -p /opt/server/archivebox/archivebox-data
mkdir -p /mnt/kdrive/
rclone config
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 "== initializing archivebox"
docker compose run --rm archivebox init --setup