source: Klonkt/deploy/post-receive@ 5f483e3

main
Last change on this file since 5f483e3 was 5f483e3, checked in by Robin Genis <roboburr@…>, 2 months ago

chore: code cleanup — remove dead files, deps, DB tables, Google-login remnants

  • Deleted dead files: routes/notifications.js + services/NotificationService.js + views/pages/notifications.ejs (old bell, unmounted; live fedi notifications live in posts.js); deploy/verify.ps1 (stale smoke test).
  • package.json — drop unused ws dependency (no WebSocket since Prutter was removed).
  • .env.example — drop GOOGLE_* vars (Google login removed).
  • config/database.js — remove CREATE statements for dead tables (circle_links/remote_actors/ remote_posts from old Circles v1; user_notifications; post_likes). No DROP — existing rows stay.
  • services/i18n.js — remove dead keys: hub, prutter, and the whole Google-login set (+ the agoog.* wizard + glog.* notices, ~280 lines). Kept aseo.verify_google. solo_desc/login_google_only de-Googled.
  • views/pages/auth-login.ejs — drop the dead Google error block + button CSS; the password login form is unchanged.
  • deploy/post-receive — fix stale pm2 reload prutcms -> klonkt.
  • Property mode set to 100644
File size: 1.7 KB
Line 
1#!/bin/bash
2# PrutFolio deploy-hook — werkt zoals logboek-hook.
3# Bare repo is single 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.
6set -e
7
8DEPLOY=/srv/prutfolio
9GIT_DIR=/home/roboburr/git-repos/prutfolio.git
10
11while read oldrev newrev refname ; do
12 [ "$refname" != "refs/heads/main" ] && continue
13
14 echo ">>> Deploying $newrev to $DEPLOY"
15
16 # 1. Heel zelden — als een eerdere bug git-internals los in $DEPLOY
17 # heeft gedumpt (HEAD/objects/refs op root), eenmalig opruimen
18 # zodat dit een echte working tree wordt.
19 if [ -f "$DEPLOY/HEAD" ] && [ -d "$DEPLOY/objects" ] && [ ! -d "$DEPLOY/.git" ]; then
20 echo " cleanup: stale bare-init artifacts in $DEPLOY"
21 for f in branches config description FETCH_HEAD HEAD hooks info objects refs ORIG_HEAD; do
22 rm -rf "$DEPLOY/$f" 2>/dev/null || true
23 done
24 fi
25
26 # 2. Force-checkout van bare-repo state naar working tree.
27 git --git-dir="$GIT_DIR" --work-tree="$DEPLOY" checkout -f main
28
29 # 3. npm install alleen als package-lock.json wijzigde.
30 if [ -n "$oldrev" ] && [ "$oldrev" != "0000000000000000000000000000000000000000" ]; then
31 if git --git-dir="$GIT_DIR" diff --name-only "$oldrev" "$newrev" | grep -q "^package-lock.json$"; then
32 echo ">>> package-lock.json changed — npm ci --production"
33 cd "$DEPLOY" && npm ci --production
34 fi
35 fi
36
37 # 4. pm2 reload — process is named "klonkt"
38 pm2 reload klonkt 2>/dev/null || true
39
40 echo ">>> Done. App-files in $DEPLOY ongemoeid (.env, node_modules, storage)."
41done
Note: See TracBrowser for help on using the repository browser.