# Infrastructuur Documentatie
## Christiaan Oexman — Persoonlijk IT Project

**Versie:** 1.0  
**Datum:** Juli 2026  
**Auteur:** Christiaan Oexman  
**Status:** Productie

---

## 1. Executive Summary

Dit document beschrijft de complete IT-infrastructuur die is opgebouwd rond een Ubuntu VPS, een Synology NAS en diverse webservices. De infrastructuur omvat automated backups, een monitoring dashboard, een CV-website, een Minecraft server met web API, en een AI-assistant (OpenClaw). Alle services zijn beveiligd met SSL, SSH keys en VPN-verbindingen.

**Kerncomponenten:**
- 1× Ubuntu 24.04 VPS (Strato) — 8 core CPU, 32GB RAM, 464GB opslag
- 1× Synology NAS — Backup target via Tailscale VPN
- 5 domeinen met Let's Encrypt SSL
- 7+ draaiende services
- Automated daily backups met push notificaties

---

## 2. Architectuur Overzicht

```
┌─────────────────────────────────────────────────────────────┐
│                     INTERNET                                │
└──────────────┬──────────────────────────────────────────────┘
               │
               ▼
┌─────────────────────────────────────────────────────────────┐
│              VPS (217.160.175.202)                          │
│              Ubuntu 24.04.4 LTS                             │
│              8-core AMD EPYC, 32GB RAM, 464GB SSD           │
│                                                             │
│  ┌─────────────────────────────────────────────────────┐   │
│  │              NGINX (Reverse Proxy)                   │   │
│  │  :443 SSL  :80 → 301 HTTPS                          │   │
│  │                                                     │   │
│  │  christiaanoexman.nl    → localhost:3000 (CV Site)  │   │
│  │  dashboard.oexmanai.nl  → localhost:3002 (Dashboard)│   │
│  │  mc.oexmanai.nl         → localhost:8080 (MC API)   │   │
│  │  oexmanai.nl            → localhost:18789 (OpenClaw)│   │
│  │  cv.oexmanai.nl         → 301 christiaanoexman.nl   │   │
│  └─────────────────────────────────────────────────────┘   │
│                                                             │
│  ┌──────────┐  ┌──────────────┐  ┌─────────────────┐      │
│  │ PM2      │  │ Systemd      │  │ Cron            │      │
│  │          │  │              │  │                 │      │
│  │ CV Site  │  │ Minecraft    │  │ Backup 03:00    │      │
│  │ :3000    │  │ API :8080    │  │ Dex Sync 5min   │      │
│  │          │  │              │  │                 │      │
│  │ Dashboard│  │ Minecraft    │  │ OpenClaw Cron   │      │
│  │ :3002    │  │ (inactive)   │  │                 │      │
│  └──────────┘  └──────────────┘  └─────────────────┘      │
│                                                             │
│  ┌──────────┐  ┌──────────────┐  ┌─────────────────┐      │
│  │ OpenClaw │  │ Let's Encrypt│  │ Tailscale       │      │
│  │ :18789   │  │ Certbot      │  │ 100.98.73.48    │      │
│  │          │  │ Auto-renew   │  │                 │      │
│  │ AI Agent │  │ 5 domeinen   │  │ → NAS VPN       │      │
│  └──────────┘  └──────────────┘  └────────┬────────┘      │
└─────────────────────────────────────────────┼──────────────┘
                                              │
                                    Tailscale VPN Tunnel
                                              │
              ┌───────────────────────────────┴──────────────┐
              │         Synology NAS (nasoexies1)            │
              │         100.87.134.75                        │
              │                                              │
              │  /volume1/VPSBackup/daily/   ← rsync backup  │
              │  /volume1/VPSBackup/weekly/  ← snapshots     │
              │  /volume1/VPSBackup/MIGRATIE-HANDLEIDING.txt │
              └──────────────────────────────────────────────┘
```

---

## 3. Server Specificaties

### 3.1 VPS (Strato)

| Eigenschap | Waarde |
|---|---|
| Provider | Strato |
| OS | Ubuntu 24.04.4 LTS (Noble Numbat) |
| CPU | 8-core AMD EPYC-Milan |
| RAM | 32 GB |
| Opslag | 464 GB SSD (17 GB in gebruik, 4%) |
| IP | 217.160.175.202 |
| Tailscale IP | 100.98.73.48 (vps-strato) |
| Node.js | v22.22.3 |
| npm | 10.9.8 |
| PM2 | 7.0.1 |
| OpenClaw | 2026.6.11 |
| Nginx | 1.x |
| Tailscale | 1.98.9 |

### 3.2 Synology NAS

| Eigenschap | Waarde |
|---|---|
| Hostname | nasoexies1 |
| Tailscale IP | 100.87.134.75 |
| Backup user | backup |
| SSH key | /root/.ssh/backup_nas |
| Backup pad | /volume1/VPSBackup/daily/ |
| Weekly snapshots | /volume1/VPSBackup/weekly/ |
| Snapshot retention | 28 dagen |
| Toegang | DS file app (iPhone via router VPN) |

---

## 4. Netwerk & VPN

### 4.1 Tailscale Mesh VPN

De VPS en NAS zijn verbonden via Tailscale, een mesh VPN gebaseerd op WireGuard. Dit zorgt voor een versleutelde verbinding tussen de twee servers zonder open poorten naar buiten.

- **VPS:** vps-strato (100.98.73.48)
- **NAS:** nasoexies1 (100.87.134.75)
- **Encryptie:** WireGuard (Noise IK)
- **Key-based authenticatie**

### 4.2 Router VPN (iPhone)

Christiaan's iPhone is verbonden met het thuisnetwerk via een router VPN. Dit geeft toegang tot alle thuisapparaten inclusief de NAS, zonder dat Tailscale op de iPhone geïnstalleerd hoeft te worden.

### 4.3 SSH

- Root login met SSH key authenticatie
- Backup user op NAS met dedicated SSH key
- StrictHostKeyChecking disabled voor backup (automatisering)

---

## 5. Domeinen & SSL

Alle domeinen worden gehost op de VPS via Nginx reverse proxy met Let's Encrypt SSL certificaten (automatische vernieuwing via Certbot).

| Domein | Doel | Poort | SSL Verloopt |
|---|---|---|---|
| christiaanoexman.nl | CV Site | 3000 | 13 sep 2026 |
| dashboard.oexmanai.nl | Jarvis Dashboard | 3002 | 29 aug 2026 |
| mc.oexmanai.nl | Minecraft API + Dex | 8080 | 20 aug 2026 |
| oexmanai.nl | OpenClaw WebChat | 18789 | — |
| cv.oexmanai.nl | 301 → christiaanoexman.nl | — | — |

**Nginx configuratie locatie:** `/etc/nginx/sites-enabled/`

---

## 6. Services

### 6.1 PM2 Process Manager

| Proces | Poort | Status | Omschrijving |
|---|---|---|---|
| cv-site | 3000 | Online | Express.js CV website met admin panel |
| jarvis-dashboard | 3002 | Online | Express.js monitoring dashboard PWA |

**PM2 startup:** `pm2 startup` + `pm2 save` voor auto-restart bij reboot.

### 6.2 Systemd Services

| Service | Poort | Status | Omschrijving |
|---|---|---|---|
| minecraft-api | 8080 | Active | Minecraft server API + WebSocket |
| minecraft | 25565 | Inactive | Minecraft server (handmatig startbaar) |

### 6.3 Minecraft Server

- **Locatie:** `/opt/minecraft-paper/`
- **Type:** Fabric + Cobblemon 1.7.3 + Minecraft 1.21.1
- **Java:** OpenJDK 21
- **Poort:** 25565 (game), 25575 (RCON)
- **API:** Node.js op poort 8080, nginx proxy op mc.oexmanai.nl
- **Features:** Live status, player list, RCON commands, WebSocket logs
- **Dex Sync:** Elke 5 minuten wordt player-dex.json gesynced naar web

### 6.4 OpenClaw AI Assistant

- **Versie:** 2026.6.11
- **Poort:** 18789
- **Domein:** oexmanai.nl
- **Functie:** Persoonlijke AI assistant met webchat interface
- **Memory:** MEMORY.md + dagelijkse notities in memory/
- **Cron:** Systeem events, herinneringen, scheduled tasks

---

## 7. Jarvis Dashboard

Een Progressive Web App (PWA) voor server monitoring en automatisering.

**Tech stack:** Node.js, Express, Tailwind CSS, Web Push API, Service Workers

### 7.1 Features per Tab

| Tab | Functie |
|---|---|
| 📊 Server | CPU, RAM, disk usage, uptime, load average |
| ⏰ Reminders | CRUD herinneringen met push notificaties |
| 📝 Notities | Persoonlijke notities opslaan |
| 🌤️ Weer | Weerbericht voor Wanroij |
| 🔧 Services | PM2 process management (start/stop/restart) |
| 🌐 Websites | Status van alle domeinen (HTTP check) |
| 🔄 Routines | Terugkerende taken met push notificaties |
| 💪 Training | Workout tracker |
| 📦 Backups | Backup geschiedenis, "Nu backuppen" knop, migratie handleiding download |
| 📅 Gepland | Systeem cron + OpenClaw cron overzicht |
| ⚙️ Instellingen | Tailscale status, schijf usage per map, wachtwoord wijzigen, push apparaten beheren |
| 🤖 J.A.R.V.I.S. | Neural interface (OpenClaw integratie) |

### 7.2 Push Notificaties

- **Protocol:** Web Push API (VAPID)
- **Endpoints:**
  - `POST /api/push/send` — Generiek (title + body)
  - `POST /api/push/test` — Test notificatie
  - `POST /api/notify/jarvis` — OpenClaw hook
  - `DELETE /api/push/subscriptions/:id` — Apparaat verwijderen
- **Platform support:** iOS Safari PWA ✓, Brave ✗ (blokkeert push)
- **Gebruik:** Backup status, reminders, routines, Jarvis replies

### 7.3 Beveiliging

- Login met bcrypt password hashing
- JWT tokens voor API authenticatie
- Service Worker met cache versioning (jarvis-dashboard-v6)

---

## 8. CV Website

**URL:** christiaanoexman.nl  
**Tech stack:** Node.js, Express, Puppeteer (PDF generatie), QRCode

### 8.1 Features

- Responsive CV met dark/light theme
- Admin panel met CRUD voor alle secties
- PDF download ( Puppeteer headless Chrome)
- QR code generatie
- Email notificaties via Gmail SMTP bij contact formulier
- **Nieuw: Projecten pagina** met image upload
- **Nieuw: Project images** gallery per project
- Multi-page navigatie (Over Mij, Ervaring, Projecten, Opleiding, Vaardigheden, Contact)

### 8.2 Admin Panel

- Login: wachtwoord beschermd
- CRUD voor: profiel, services, werkervaring, projecten, opleiding, vaardigheden, interests, navigatie
- Image upload voor projecten (max 5MB per bestand)
- Contact berichten inbox met gelezen/ongelezen status

---

## 9. Backup Strategie

### 9.1 Daily Backup

- **Script:** `/root/scripts/backup-to-nas.sh`
- **Schedule:** Dagelijks 03:00 UTC (05:00 NL tijd) via cron
- **Methode:** rsync over SSH via Tailscale VPN
- **Target:** Synology NAS `/volume1/VPSBackup/daily/`
- **Sync mode:** `--delete` (mirror, houdt target identiek aan source)

### 9.2 Backup Items (27 total)

1. Minecraft Paper server (`/opt/minecraft-paper/`)
2. Minecraft Test server (`/opt/minecraft-test/`)
3. Dashboard (`/root/dashboard/`)
4. CV Site (`/root/cv-site/`)
5. OpenClaw workspace (`/root/.openclaw/workspace/`)
6. OpenClaw config (`/root/.openclaw/openclaw.json`)
7. OpenClaw agents (`/root/.openclaw/agents/`)
8. OpenClaw memory (`/root/.openclaw/memory/`)
9. OpenClaw cron (`/root/.openclaw/cron/`)
10. OpenClaw credentials (`/root/.openclaw/credentials/`)
11. Nginx configs (`/etc/nginx/`)
12. Crontab (`crontab -l`)
13. PM2 process list (`pm2 save`)
14. System info (OS, versies, hardware)
15. Migratie handleiding
16-27. Overige config files en scripts

### 9.3 Retention

- **Backup log:** `/var/log/vps-backup.log` — 30 dagen (auto-cleanup na elke run)
- **Weekly snapshots:** NAS — 28 dagen (auto-cleanup)
- **Daily backup:** Altijd laatste versie (rsync `--delete`)

### 9.4 Notificaties

Na elke backup run wordt een push notificatie verstuurd naar alle geregistreerde apparaten:
- **Succes:** "✅ Backup gelukt — 27 items gebackupt in 18s"
- **Fout:** "⚠️ Backup mislukt — X fouten — check /var/log/vps-backup.log"

### 9.5 Backup Performance

- **Gemiddelde duur:** 18-19 seconden
- **Datavolume:** ~7.1 GB (gecomprimeerd via rsync delta sync)
- **Foutpercentage:** 0% (na stabilisatie)

---

## 10. Automatisering

### 10.1 Cron Jobs

| Schedule | Taak | Locatie |
|---|---|---|
| `0 3 * * *` | VPS Backup naar NAS | `/root/scripts/backup-to-nas.sh` |
| `*/5 * * * *` | Cobblemon Dex Sync | `/opt/mcpanel-scripts/sync-cobblemon-dex.js` |
| 1e van maand 02:00 | Server update herinnering | OpenClaw cron (systemEvent) |
| 1e van maand 03:00 | CV log cleanup (90d/180d) | OpenClaw cron |

### 10.2 Scripts

| Script | Functie |
|---|---|
| `/root/scripts/backup-to-nas.sh` | Automated backup met push notificaties |
| `/opt/mcpanel-scripts/sync-cobblemon-dex.js` | Minecraft dex synchronization |
| `/root/cv-site/server.js` | CV website backend |
| `/root/dashboard/server.js` | Dashboard backend |
| `/root/.openclaw/workspace/minecraft-api/server.js` | Minecraft API server |

---

## 11. Security

### 11.1 Authenticatie

- **SSH:** Key-based only (root login met private key)
- **Dashboard:** bcrypt password hashing + JWT tokens
- **CV Site admin:** Wachtwoord-protected met session tokens
- **NAS backup:** Dedicated `backup` user met SSH key
- **Minecraft API:** bcrypt auth (admin/admin123)

### 11.2 SSL/TLS

- **Let's Encrypt** certificaten voor alle domeinen
- **Certbot** auto-renewal ingesteld
- **Nginx** forceert HTTPS (HTTP 301 → HTTPS)
- **HSTS** via Nginx headers

### 11.3 VPN

- **Tailscale** (WireGuard) voor VPS ↔ NAS communicatie
- **Router VPN** voor remote toegang tot thuisnetwerk (iPhone)
- Geen open poorten voor backup of NAS toegang

---

## 12. Migratie Procedure

Een complete migratie handleiding is beschikbaar op:
- VPS: `/root/dashboard/public/MIGRATIE-HANDLEIDING.txt`
- NAS: `/volume1/VPSBackup/MIGRATIE-HANDLEIDING.txt`
- Dashboard: Download knop in Backups tab

De handleiding bevat 15 stappen van server voorbereiding tot alles testen, inclusief alle benodigde commando's.

---

## 13. Lessons Learned

### Wat werkte goed
- **Tailscale VPN** — veel eenvoudiger dan传统ele VPN setup, werkt direct
- **rsync over SSH** — snel, betrouwbaar, delta sync bespaart bandbreedte
- **PWA + Web Push** — werkt uitstekend op iOS zonder App Store
- **PM2** — betrouwbare process management met auto-restart
- **AI-ondersteuning** — versnelde ontwikkeling aanzienlijk

### Uitdagingen
- **SCP over Tailscale** — Synology SFTP heeft compatibiliteitsissues, opgelost door rsync te gebruiken
- **Push op Brave** — Brave browser blokkeert Web Push, werkt wel op iOS Safari
- **Shell escaping** — wachtwoorden met speciale tekens in bash scripts vereisten workaround via Node.js

### Belangrijke beslissingen
- **Tailscale i.p.v. OpenVPN** — minder complex, mesh topologie, gratis voor persoonlijk gebruik
- **PWA i.p.v. native app** — geen App Store nodig, automatisch updates, werkt offline
- **rsync i.p.v. restic/borg** — eenvoudiger, NAS heeft native rsync support
- **Router VPN voor iPhone i.p.v. Tailscale** — al werkend, geen extra app nodig

---

## 14. Toekomstige Verbeteringen

- [ ] GitHub repository voor portfolio projecten
- [ ] Docker containerization van services
- [ ] CI/CD pipeline met GitHub Actions
- [ ] Grafana monitoring met visuele grafieken
- [ ] MS-900 of AZ-900 certificatie
- [ ] CV site: dark mode toggle, analytics, PDF auto-update
- [ ] Push notificaties op Brave/PC werkend krijgen

---

## 15. Contact

**Christiaan Oexman**  
christiaan.oexman@gmail.com  
Wanroij, Noord-Brabant  
https://christiaanoexman.nl  
https://www.linkedin.com/in/christiaan-oexman-17b6a0184/

---

*Dit document is gegenereerd als onderdeel van het persoonlijk infrastructuur project. Het dient als portfolio stuk en technische referentie.*