Skip to content

Configuration Commands

These commands manage SafeCall runtime configuration.

safecall config

Shows current configuration in a grouped, human-readable format.

Usage

bash
sudo ./util.sh config show

Notes

  • Reads from main.config.json or config/main.config.json.
  • Groups keys by logical area (server, auth, bridge, MQTT, etc).

safecall config edit

Opens configuration in an editor.

Usage

bash
sudo ./util.sh config edit

Behavior

  • Uses $EDITOR if set; otherwise nano.
  • Validates JSON before restart.
  • If JSON is invalid after edit, service is not restarted.

safecall config set <key> <value>

Sets one config key and writes file back to disk.

Usage

bash
sudo ./util.sh config set server_http_port 8090
sudo ./util.sh config set server_ntfy_enabled true
sudo ./util.sh config set server_features '["bridge","safecall"]'

Hidden behavior

Value type is auto-parsed:

  • true / false -> booleans
  • numeric text -> number
  • values starting with [ -> JSON parse attempt
  • fallback -> string

If the service is active, it is restarted automatically.

safecall config reset

Resets configuration to defaults.

Usage

bash
sudo ./util.sh config reset

Behavior

  • Rebuilds defaults from config/defaults.ts.
  • Writes config and restarts service if active.

safecall config regen-mobile-key

Regenerates server_mobile_api_key.

Usage

bash
sudo ./util.sh config regen-mobile-key

Behavior

  • Creates a new 32-byte random hex key.
  • Persists it in config and restarts service if running.

When to use these commands

  • Use config set for precise, scriptable one-key changes.
  • Use config edit for bulk/manual edits.
  • Use regen-mobile-key when rotating API credentials.
  • Use reset for known-good baseline recovery.