CLI
CLI
The hostwall command-line interface: commands, common flags, running as root and exit codes.
Everything HostWall does goes through one binary, hostwall.
hostwall <command> [flags]| Command | What it does |
|---|---|
run | Start the proxy, WAF and dashboard |
validate | Check the configuration file |
reload | Apply configuration changes to a running HostWall |
status | Show whether HostWall is running, its sites and recent traffic |
site | Add, list, remove or change protected sites |
logs | Show security events (blocked and monitored requests) |
backup | Write config, data and certificates to one file |
restore | Restore from a backup file |
admin reset | Give admin a new random password and turn 2FA off, for example after losing your phone |
upgrade | Upgrade to the latest signed release |
version | Print version information |
help | Show the command list |
Run hostwall <command> --help to see a command's flags.
Common flags
Every command except version and help accepts:
| Flag | Default | Meaning |
|---|---|---|
--config <file> | /etc/hostwall/hostwall.yaml on Linux (see file locations) | Config file. Also settable with HOSTWALL_CONFIG. |
--data <dir> | server.data_dir, else /var/lib/hostwall on Linux | Data directory. Overrides server.data_dir. |
Flags can be written as --flag value, --flag=value or -flag value.
Running commands as root
On Linux, the data directory belongs to the hostwall user and isn't readable by others. Run CLI commands with sudo:
sudo hostwall statusWhen run as root, the CLI switches to the owner of the data directory (the hostwall user) before it opens the database, so files it creates stay usable by the service. Without sudo, commands that read the database fail with no hostwall database in /var/lib/hostwall.
Exit codes
| Code | Meaning |
|---|---|
0 | Success (also for --help) |
1 | The command failed. The error is printed as hostwall <command>: <error>. |
2 | Wrong usage, or an unknown command. Usage help is printed. |