|
|
||
|---|---|---|
| .. | ||
| README.md | ||
| sync-pb-hooks.sh | ||
PocketBase hooks sync (WFDASH)
The live WFDASH PocketBase (Coolify service pocketbase-wfdash, container
pocketbase-gnqc88suy8fqk6wyryjjdpvl, PocketBase 0.39.8) loads its hooks
from the Docker volume gnqc88suy8fqk6wyryjjdpvl_pocketbase-hooks, mounted
at /app/pb_hooks.
Hooks are deployed from git, not edited on the server:
- Edit or add files in
pocketbase/pb_hooks/in this repo (the source of truth). - List every file to deploy in
pocketbase/pb_hooks/DEPLOY. - Commit, then publish the folder to the hooks repo:
npm run pb:hooks:publish(pushespocketbase/pb_hookstomainof ForgejoDavid/WFDASH-PBHOOKSwithgit subtree).
Within ~2 minutes the VPS cron runs /opt/wfdash-pb-hooks/sync-pb-hooks.sh,
which pulls WFDASH-PBHOOKS into /opt/wfdash-pb-hooks/repo and copies the
listed files into the volume. PocketBase reloads itself when a hook file
changes. A .js file on the server that isn't in DEPLOY is removed.
- Log:
/var/log/wfdash-pb-hooks-sync.logon the VPS. - Force a sync:
/opt/wfdash-pb-hooks/sync-pb-hooks.sh --force - Roll back: revert the commit (or remove the line from
DEPLOY), commit,npm run pb:hooks:publish. - Pause syncing: comment out the cron line (
crontab -eas root). - The script itself is installed by copying this file to the VPS; re-copy it after changing it.
The sync never touches pb_data (the database).