Replication¶
Overview¶
StarkOne supports two types of replication:
- Website file replication - sync website files to remote servers using rsync
- Panel action replication - replay panel actions (create website, add database, etc.) on one or more secondary servers in real time
Panel Action Replication¶
Panel action replication mirrors panel operations to secondary StarkOne servers. When you create a website on the primary, the secondary gets the same website created automatically.
Replication Servers¶
# List replication servers
GET /api/replication-servers
# Add a server
POST /api/replication-servers
{
"name": "Secondary EU",
"host": "eu-server.example.com",
"port": 2087,
"token": "secret-token"
}
# Update
PUT /api/replication-servers/:id
# Delete
DELETE /api/replication-servers/:id
# Test connectivity
POST /api/replication-servers/:id/test
# Toggle enabled/disabled
POST /api/replication-servers/:id/toggle
Category Toggles¶
Control which categories of actions are replicated:
# Get categories for a server
GET /api/replication-servers/:id/categories
# Update all categories
PUT /api/replication-servers/:id/categories
{
"websites": true,
"databases": true,
"dns": false,
"users": true
}
# Update a single category
PATCH /api/replication-servers/:id/categories/:category
{ "enabled": false }
Action Log¶
# Get recent replication actions and their status
GET /api/replication-servers/:id/action-log
# Retry a failed action
POST /api/replication-servers/:id/action-log/:action_id/retry
# Clear action log
DELETE /api/replication-servers/:id/action-log
Website File Replication¶
Sync website files to a remote server.
List Website Replications¶
Create a Replication¶
POST /api/webapps/:id/replications
{
"server_id": 1,
"remote_path": "/home/example/public_html/",
"schedule": "*/30 * * * *"
}
Delete a Replication¶
Trigger Manual Sync¶
Trigger Initial Sync¶
For the first sync (full copy):
Watch Folders¶
Control which folders are included in replication:
# List watch folders
GET /api/webapps/:id/replications/:replication_id/watch-folders
# Add a watch folder
POST /api/webapps/:id/replications/:replication_id/watch-folders
{ "path": "/public_html/" }
# Delete a watch folder
DELETE /api/webapps/:id/replications/:replication_id/watch-folders/:folder_id
# Toggle a watch folder
POST /api/webapps/:id/replications/:replication_id/watch-folders/:folder_id/toggle
Helper Endpoints¶
Used internally during replication setup: