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
FlagArgumentMeaning
--configpathThe config JSON (apiBase, apiToken, contentRoot). Required.
--watchSync once, then re-sync on every change to the content root until stopped.
--intervalsecondsRe-sync on a fixed period instead of (or alongside) watching. Good for cron-less scheduling.
--dry-runReport what would be uploaded, withdrawn or left alone — push nothing. Pairs well with --verbose.
--verboseLog every file decision: synced, skipped (_ / dotfile), entry point, supporting file.
--pull-logsFetch 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
ServiceOwns
porthoster-apiThe sync API. Receives the client's push on localhost; Caddy fronts it for TLS-by-IP.
porthoster-brokerEvery declared public port. Loads handlers from the content root and reconciles the OS firewall to the declared set.

Logs & firewall state

CommandShows
journalctl -u porthoster-broker -fLive broker logs — ports opened and closed, connections screened, handler errors, refused port conflicts.
journalctl -u porthoster-api -fLive sync-API logs — pushes received, generations promoted.
node client/sync.js --config config.json --pull-logsThe same broker logs pulled to your own machine, no SSH.
nft list ruleset / ufw statusThe 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.

See also