-
Notifications
You must be signed in to change notification settings - Fork 0
Developer data
This repository includes a GitHub Actions workflow at .github/workflows/publish-dev-data.yml that publishes a sanitized developer copy of the production data directory.
The workflow runs daily at 00:00 UTC, matching the private /data backup workflow, and it can also be run manually from GitHub Actions.
Each run:
- Connects to
deploy@45.76.134.105over SSH - Copies
/var/www/fridge.dev/datainto a temporary server workspace while excluding the rebuildable hard-ban binary index - Runs
.github/scripts/sanitize-dev-data.phpagainst that copy - Compresses the sanitized
datadirectory into a zip file namedDD-MM-YY_hh-mm-ss.zip - Uploads the zip file into the public Google Drive developer data folder
- Keeps only the 10 newest developer copies in that folder
- Deletes temporary files from the runner and server
Before creating a workspace, the workflow removes any stale /home/deploy/dev-data.* workspaces left by an earlier failed or cancelled run. Runs are serialized, so this cleanup cannot remove files from another active developer-data run. If the initial production-data copy fails, that run also removes its newly-created workspace immediately.
Every production deployment normalizes the site permissions before Nginx is reloaded. Runtime data receives group read/write access, setgid directories, and default ACLs for the http group, so files added beneath data inherit access for both the http runtime user and the deploy user. The developer-data workflow retains its pre-copy repair for servers that have not yet received that deployment step.
The workflow reuses DEPLOY_KEY and RCLONE_CONFIG from the private backup workflow. Their SSH requirements, exact gdrive remote name, configuration shape, and setup procedure are documented once on Backup Data.
Create these repository variables in Settings -> Secrets and variables -> Actions -> Variables.
This must be the Google Drive folder ID that should hold the public developer data zip:
1dltxdqQjfUfGwEEXVxUrOw5fuv9nk_ex
This must be a variable, not a secret. If it is stored as a secret, GitHub will mask the folder ID in the workflow summary and the download link will show ***.
The public developer data folder is:
https://drive.google.com/drive/folders/1dltxdqQjfUfGwEEXVxUrOw5fuv9nk_ex
The workflow writes this into the run summary so developers can find the latest archives without digging through repo settings.
The sanitizer currently changes:
-
data/accounts/accounts.json: clears all accounts -
data/accounts/login_attempts.json: clears contents -
data/etc/page_views.json: clears page counts -
data/etc/toast.json: clearsbot.token,bot.client_id, andgroq.api_key -
data/etc/toast-personality.json: clearsprivate_lore -
data/etc/toast-dm-history.json: clears Discord DM history -
data/etc/toast-feed-notify-state.json: clears Discord notification state -
data/etc/toast-patch-approvals.json: clears pending and completed Discord update approvals -
data/etc/off-topic-archive.json: replaces exported Discord archive contents with an empty placeholder -
data/etc/webhooks.json: clears all scalar values -
data/guestbook/ip_index.json: clears contents -
data/guestbook/*.txt: removesIP:metadata while retaining public messages -
data/feed/replies/*.json: blanks guest IPs and removes guest browser-local inbox identities -
data/feed/post_ips.json: blanks feed-post IPs while retaining post IDs and usernames for local rendering -
data/feed/banned_ips.json: clears the shared posting IP ban list -
data/etc/banned-ip-content.json: clears deleted-content snapshots retained for soft-ban review -
data/contact/*.json: removes private contact submissions -
data/contact/rate_limits.json: clears IP rate-limit state -
data/upload/rooms.json: clears temporary room tokens and public keys -
data/mdpaste/: clears encrypted paste records -
data/chat/: clears encrypted chat conversations, attachments, presence state, and local chat keys -
data/journal/drafts: removes drafts and adds a harmless placeholder draft -
data/etc/access.jsonanddata/etc/access.json.lock: removes private access-log data and its lock file
The sanitizer finishes with privacy assertions that require access logs to be absent and the contact directory to contain only the empty rate-limit state. The archive command also excludes these operational identity files as defense in depth:
data/etc/hard-banned-ips.txtdata/etc/hard-ban-identities.jsondata/etc/access.jsondata/etc/banlists/*
To add more privacy rules, edit the marked block in:
.github/scripts/sanitize-dev-data.php
To run it manually:
- Open the repository on GitHub
- Go to
Actions - Select
publish development /data/ copy - Click
Run workflow
The workflow supports:
- Manual runs via
workflow_dispatch - Scheduled runs once per day at
00:00 UTC
If SSH fails, verify DEPLOY_KEY still works for deploy@45.76.134.105.
If upload fails, verify RCLONE_CONFIG contains gdrive and GDRIVE_DEV_DATA_FOLDER_ID points at a folder the authenticated Google account can write to.
If the archive step fails, verify the server has php and zip, and that /home/deploy has enough space for a temporary copy of /data.