Commands
Two sides. On your machine you run the sync client; on the server you manage two systemd services. This page lists the flags and commands for each.
Client — node client/sync.js
The client mirrors your port folder to the server. Point it at a config and, optionally, keep it running. See Installation → Client for the config file.
node client/sync.js --config config.json --watch
| Flag | Argument | Meaning |
|---|---|---|
--config | path | The config JSON
(apiBase, apiToken, contentRoot). Required. |
--watch | — | Sync once, then re-sync on every change to the content root until stopped. |
--interval | seconds | Re-sync on a fixed period instead of (or alongside) watching. Good for cron-less scheduling. |
--dry-run | — | Report what would be uploaded, withdrawn
or left alone — push nothing. Pairs well with --verbose. |
--verbose | — | Log every file decision: synced, skipped
(_ / dotfile), entry point, supporting file. |
--pull-logs | — | Fetch the broker's recent handler logs from the server to your terminal — a quick look at what your ports are doing without an SSH session. |
Server — the services
The installer leaves two systemd units. Manage them with the usual
systemctl verbs (as root).
systemctl status porthoster-api # the sync API (localhost, behind Caddy)
systemctl status porthoster-broker # the broker that owns the public ports
systemctl restart porthoster-broker # reload after a manual change
systemctl restart porthoster-api
| Service | Owns |
|---|---|
porthoster-api | The sync API. Receives the client's push on localhost; Caddy fronts it for TLS-by-IP. |
porthoster-broker | Every declared public port. Loads handlers from the content root and reconciles the OS firewall to the declared set. |
Logs & firewall state
| Command | Shows |
|---|---|
journalctl -u porthoster-broker -f | Live broker logs — ports opened and closed, connections screened, handler errors, refused port conflicts. |
journalctl -u porthoster-api -f | Live sync-API logs — pushes received, generations promoted. |
node client/sync.js --config config.json --pull-logs | The same broker logs pulled to your own machine, no SSH. |
nft list ruleset / ufw status | The OS firewall the broker reconciles — the currently open port set. Which one depends on your box. |
The broker manages the OS firewall to match your declared ports (see Q4). Your hosting provider's edge firewall or security groups are separate and remain yours to set.