Changeset d2b7247 in Klonkt
- Timestamp:
- 06/27/2026 09:53:29 PM (2 months ago)
- Branches:
- main
- Children:
- 907a013
- Parents:
- abdcf33
- Files:
-
- 11 edited
-
deploy/DEPLOY.md (modified) (1 diff)
-
deploy/backup.sh (modified) (4 diffs)
-
deploy/nginx.conf.example (modified) (3 diffs)
-
deploy/post-receive (modified) (4 diffs)
-
ecosystem.config.cjs (modified) (1 diff)
-
src/assets/css/audio.css (modified) (1 diff)
-
src/assets/css/style.css (modified) (1 diff)
-
src/db/migrations/001-init.sql (modified) (1 diff)
-
src/views/partials/bottom-tab.ejs (modified) (1 diff)
-
src/views/partials/chrome.ejs (modified) (1 diff)
-
src/views/partials/topnav.ejs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
deploy/DEPLOY.md
rabdcf33 rd2b7247 152 152 153 153 Now visit `https://YOUR-DOMAIN/`. You should see your site over HTTPS, with 154 HSTS active and Prutter WebSocket working (browser dev-tools → Network → 155 filter "WS" → see the `wss://YOUR-DOMAIN/ws/prutter` connection). 154 HSTS active. 156 155 157 156 --- -
deploy/backup.sh
rabdcf33 rd2b7247 1 1 #!/usr/bin/env bash 2 2 # 3 # PrutCMS v10— nightly backup script.3 # Klonkt — nightly backup script. 4 4 # 5 5 # Snapshots: … … 13 13 # 14 14 # Recommended cron: 15 # 0 3 * * * /home/robin/ prutcms/deploy/backup.sh >> /home/robin/prutcms/logs/backup.log 2>&115 # 0 3 * * * /home/robin/klonkt/deploy/backup.sh >> /home/robin/klonkt/logs/backup.log 2>&1 16 16 17 17 set -euo pipefail 18 18 19 19 # ── Config ──────────────────────────────────────────────────────── 20 APP_DIR="${APP_DIR:-/home/robin/ prutcms}"21 BACKUP_DIR="${BACKUP_DIR:-/home/robin/backups/ prutcms}"20 APP_DIR="${APP_DIR:-/home/robin/klonkt}" 21 BACKUP_DIR="${BACKUP_DIR:-/home/robin/backups/klonkt}" 22 22 KEEP_DAYS="${KEEP_DAYS:-14}" 23 23 TS="$(date +%Y%m%d-%H%M%S)" … … 35 35 36 36 # ── Tar the snapshot + storage subdirs ──────────────────────────── 37 ARCHIVE="$BACKUP_DIR/ prutcms-$TS.tar.gz"37 ARCHIVE="$BACKUP_DIR/klonkt-$TS.tar.gz" 38 38 tar -czf "$ARCHIVE" \ 39 39 -C "$BACKUP_DIR" "$(basename "$DB_SNAPSHOT")" \ … … 47 47 48 48 # ── Rotation ─────────────────────────────────────────────────────── 49 find "$BACKUP_DIR" -type f -name ' prutcms-*.tar.gz' -mtime "+$KEEP_DAYS" -delete49 find "$BACKUP_DIR" -type f -name 'klonkt-*.tar.gz' -mtime "+$KEEP_DAYS" -delete 50 50 51 51 SIZE="$(du -h "$ARCHIVE" | cut -f1)" -
deploy/nginx.conf.example
rabdcf33 rd2b7247 1 1 # ────────────────────────────────────────────────────────────────── 2 # PrutCMS v10— nginx reverse proxy2 # Klonkt — nginx reverse proxy 3 3 # 4 # Place this in /etc/nginx/sites-available/ prutcmsand symlink to4 # Place this in /etc/nginx/sites-available/klonkt and symlink to 5 5 # /etc/nginx/sites-enabled/. Replace <YOUR-DOMAIN> with the real host. 6 6 # 7 7 # Key points: 8 8 # • SSL termination here; Node listens on 127.0.0.1:3000 only. 9 # • WebSocket upgrade headers wired through ( Prutter live messaging).9 # • WebSocket upgrade headers wired through (in case any route uses WS). 10 10 # • Static assets cached aggressively (Node gives them 1y maxAge anyway). 11 11 # • Audio streaming endpoint /audio/stream/* must NOT be cached by nginx — … … 14 14 # 15 15 # After installing: 16 # sudo ln -s /etc/nginx/sites-available/ prutcms/etc/nginx/sites-enabled/16 # sudo ln -s /etc/nginx/sites-available/klonkt /etc/nginx/sites-enabled/ 17 17 # sudo nginx -t 18 18 # sudo systemctl reload nginx … … 96 96 } 97 97 98 # ── WebSocket: Prutter live chat. Long-lived connection.98 # ── WebSocket: long-lived connection (in case any route uses WS). 99 99 location /ws/ { 100 100 proxy_pass http://127.0.0.1:3000; -
deploy/post-receive
rabdcf33 rd2b7247 1 1 #!/bin/bash 2 # PrutFolio deploy-hook — werkt zoals logboek-hook.3 # Bare repo issingle source of truth.4 # /srv/prutfolio is de working tree — gevuld via "git --work-tree=..."5 # ( geen .git submap erin), zelfde patroon als logboek->celine.2 # Klonkt deploy hook — works like the logboek hook. 3 # The bare repo is the single source of truth. 4 # /srv/prutfolio is the working tree — populated via "git --work-tree=..." 5 # (no .git subdir inside), same pattern as logboek->celine. 6 6 set -e 7 7 … … 14 14 echo ">>> Deploying $newrev to $DEPLOY" 15 15 16 # 1. Heel zelden — als een eerdere bug git-internals los in $DEPLOY17 # heeft gedumpt (HEAD/objects/refs op root), eenmalig opruimen18 # zodat dit een echte working tree wordt.16 # 1. Very rarely — if an earlier bug dumped git internals loose into 17 # $DEPLOY (HEAD/objects/refs at the root), clean them up once so this 18 # becomes a real working tree. 19 19 if [ -f "$DEPLOY/HEAD" ] && [ -d "$DEPLOY/objects" ] && [ ! -d "$DEPLOY/.git" ]; then 20 20 echo " cleanup: stale bare-init artifacts in $DEPLOY" … … 24 24 fi 25 25 26 # 2. Force-checkout van bare-repo state naarworking tree.26 # 2. Force-checkout the bare-repo state into the working tree. 27 27 git --git-dir="$GIT_DIR" --work-tree="$DEPLOY" checkout -f main 28 28 29 # 3. npm install alleen als package-lock.json wijzigde.29 # 3. npm install only when package-lock.json changed. 30 30 if [ -n "$oldrev" ] && [ "$oldrev" != "0000000000000000000000000000000000000000" ]; then 31 31 if git --git-dir="$GIT_DIR" diff --name-only "$oldrev" "$newrev" | grep -q "^package-lock.json$"; then … … 38 38 pm2 reload klonkt 2>/dev/null || true 39 39 40 echo ">>> Done. App -files in $DEPLOY ongemoeid (.env, node_modules, storage)."40 echo ">>> Done. App files in $DEPLOY left untouched (.env, node_modules, storage)." 41 41 done -
ecosystem.config.cjs
rabdcf33 rd2b7247 4 4 * Single fork (NOT cluster mode) because: 5 5 * - SqliteSessionStore is in-process: cluster workers wouldn't share sessions. 6 * - PrutterService.wsConnections is in-process: WS broadcast wouldn't reach7 * sockets attached to other workers.8 6 * - better-sqlite3 is synchronous and not designed for multi-process writes. 9 * If you ever need horizontal scaling, swap the session /Prutter stores for a10 * sharedbackend (Redis) first, then enable cluster mode.7 * If you ever need horizontal scaling, swap the session store for a shared 8 * backend (Redis) first, then enable cluster mode. 11 9 * 12 10 * Usage: -
src/assets/css/audio.css
rabdcf33 rd2b7247 1 /* PrutCMS v10— Audio CSS1 /* Klonkt — Audio CSS 2 2 Two pieces: 3 3 1. .post-audio-track — the play-button block inserted by [[track:id]] shortcode -
src/assets/css/style.css
rabdcf33 rd2b7247 54 54 } 55 55 56 /* PrutCMSpublieke stijl — editorial-ish, geen emoji-UI */56 /* Klonkt publieke stijl — editorial-ish, geen emoji-UI */ 57 57 58 58 :root { -
src/db/migrations/001-init.sql
rabdcf33 rd2b7247 1 -- PrutFolio v1— initial schema2 -- Forked from PrutCMS v9 (PHP, file-based)→ SQLite/Node3 -- Complete schema with v9 features (Prutter,Forum, Audio, Themes) + v10 CRDT1 -- Klonkt — initial schema 2 -- Forked from a v9 PHP, file-based CMS → SQLite/Node 3 -- Complete schema with the v9 features (Forum, Audio, Themes) + v10 CRDT 4 4 5 5 -- ==================== USERS ==================== -
src/views/partials/bottom-tab.ejs
rabdcf33 rd2b7247 4 4 // Tabs: 5 5 // logged-out: Home · Zoek · Inloggen (3 tabs) 6 // logged-in: Home · Zoek · [Plus] · [Prutter] ·Profiel6 // logged-in: Home · Zoek · [Plus] · Profiel 7 7 // The Plus tab is a FAB-style center action (accent bg, slightly raised). 8 8 // It only appears for users with create-post permission. 9 // Prutter only appears when the site has DMs enabled.10 9 11 10 const _siteUrlBase = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : ''; -
src/views/partials/chrome.ejs
rabdcf33 rd2b7247 11 11 // 12 12 // _isAuth → focus-scherm (in/uitloggen): helemaal geen chrome. 13 // _headerless → hub-homepagina én de Prutter-chat: WÉL de mini topnav-balk,14 // GEEN profielkop (hub: hero = header ; chat: full-height view).13 // _headerless → hub-homepagina én full-height views: WÉL de mini topnav-balk, 14 // GEEN profielkop (hub: hero = header). 15 15 // anders → topnav + profielkop (+ view-switcher buiten admin). 16 16 var _isAdmin = typeof bodyClass === 'string' && bodyClass.indexOf('on-admin') >= 0; -
src/views/partials/topnav.ejs
rabdcf33 rd2b7247 9 9 // Desktop (≥768px): 10 10 // - Full v9 masthead: brand left, action row right 11 // (Archief / Search / Install / Theme / Prutter /User-menu).11 // (Archief / Search / Install / Theme / User-menu). 12 12 // - bottom-tab is hidden via CSS, so all nav must live here. 13 13
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)