wiki-plugin-zachup
v0.0.1
Published
Zachup backup plugin for the federated wiki - backs up all pages to BDO
Downloads
11
Maintainers
Readme
HUMAN
The following was generated by Claude, along with the code of this plugin. There are dev allyabases located at https://dev.bdo.allyabase.com, https://ent.bdo.allyabase.com, and https://ind.bdo.allyabase.com. Please use those to test, but do not use them to persist your wiki as they will be torn down and rebuilt at arbitary times without warning.
NAMUH
Federated Wiki - Zachup Backup Plugin
The Zachup plugin automatically backs up all pages in your federated wiki to a BDO (Big Dumb Object) instance at regular intervals.
Features
- Automatic Backups: Backs up all wiki pages once per day
- Startup Backup: Performs an initial backup when the server starts
- Manual Backup: Trigger backups manually through the plugin interface
- BDO Storage: Stores backups using the BDO protocol for secure, distributed storage
- Status Monitoring: View backup status including last backup time and next scheduled backup
Installation
Install the plugin in your federated wiki:
npm install wiki-plugin-zachupThe plugin will automatically generate and save its encryption keys on first launch
Usage
Configuration
The plugin requires no command-line arguments. Configuration is done through the web UI:
wikiOn first startup, the plugin will:
- Generate a new Sessionless keypair automatically
- Save the keys to
zachup-keys.jsonin the plugin directory - Wait for you to configure the BDO server URL through the UI
Important Security Notes:
- The
zachup-keys.jsonfile contains your private key. Keep it secure and back it up! - The
zachup-config.jsonfile contains your BDO server URL configuration
Adding the Plugin to a Page
In your wiki page, add a Zachup plugin item to configure and monitor backups:
- Click to add a new item
- Select "Zachup Backup Plugin" from the factory
- First Time Setup: Enter your BDO server URL (e.g.,
http://localhost:3003/) and click "Save Configuration" - After Configuration: The plugin will display:
- BDO Server URL
- BDO User UUID
- Public Key (with copy button)
- Last backup timestamp
- Next scheduled backup time
- "Backup Now" button for manual backups
- "Get Curl Command" button to generate a curl command for retrieving your backup
- "Reconfigure" button to change BDO server URL
Backup Schedule
- Initial Backup: 5 seconds after BDO URL is configured
- Regular Backups: Every 24 hours (only after configuration)
- Manual Backups: Any time via the "Backup Now" button
Note: No backups will occur until you configure the BDO server URL through the UI.
What Gets Backed Up
The plugin backs up:
- All wiki pages in JSON format
- Page metadata (title, slug, date, synopsis)
- Complete page content (story and journal)
The backup is stored in BDO with the hash wiki-zachup-backup and includes:
- Timestamp of the backup
- Count of pages backed up
- Complete page data indexed by slug
API Endpoints
The plugin provides the following endpoints:
GET /plugin/zachup/config
Returns the current configuration status:
{
"configured": true,
"bdoUrl": "http://localhost:3003/"
}POST /plugin/zachup/config
Sets the BDO server URL and initializes backups:
Request:
{
"bdoUrl": "http://localhost:3003/"
}Response:
{
"success": true,
"configured": true,
"bdoUrl": "http://localhost:3003/",
"bdoUser": "user-uuid-here"
}GET /plugin/zachup/pubkey
Returns the plugin's public key:
{
"pubKey": "02a1b2c3d4e5f6..."
}GET /plugin/zachup/status
Returns the current backup status:
{
"configured": true,
"bdoUrl": "http://localhost:3003/",
"lastBackup": "2025-01-16T22:00:00.000Z",
"bdoUser": "user-uuid-here",
"pubKey": "02a1b2c3d4e5f6...",
"nextBackup": "2025-01-17T22:00:00.000Z"
}POST /plugin/zachup/backup-now
Triggers an immediate backup (requires configuration first):
{
"success": true,
"message": "Backup initiated",
"timestamp": "2025-01-16T22:30:00.000Z"
}If not configured:
{
"success": false,
"error": "BDO not configured. Please configure BDO URL first."
}GET /plugin/zachup/get-curl
Generates a signed curl command for retrieving the backup from BDO:
{
"success": true,
"curlCommand": "curl \"http://localhost:3003/user/abc123.../bdo?timestamp=1234567890&hash=wiki-zachup-backup&signature=...\"",
"bdoUrl": "http://localhost:3003/",
"uuid": "abc123...",
"hash": "wiki-zachup-backup"
}The generated curl command includes a valid signature and can be run directly in a terminal to retrieve the backup.
Retrieving Backups
Using the Curl Command (Easiest)
The plugin provides a "Get Curl Command" button that generates a ready-to-use curl command with proper authentication:
- Click "Get Curl Command" in the plugin UI
- Copy the generated command
- Run it in your terminal to download your backup
Example output:
curl "http://localhost:3003/user/abc123.../bdo?timestamp=1234567890&hash=wiki-zachup-backup&signature=..."The curl command includes a signed timestamp that's valid for a limited time. Simply run the command to retrieve your backup as JSON.
Using the BDO Client Library
Alternatively, use the BDO client with your UUID and the hash wiki-zachup-backup:
import bdo from 'bdo-js';
const backupData = await bdo.getBDO(userUUID, 'wiki-zachup-backup');
console.log(backupData.pages); // All your wiki pagesTroubleshooting
Backup not starting
Check that:
- Your private_key and pub_key are correctly configured
- The BDO server is running and accessible at the configured URL
- Check server logs for error messages
BDO connection errors
- Verify the BDO server URL is correct
- Ensure the BDO server is running
- Check network connectivity between wiki and BDO servers
Development
The plugin consists of:
server/server.js: Server-side backup logicclient/zachup.js: Client-side UI and controlsfactory.json: Plugin metadatapackage.json: Dependencies and package info
License
MIT
