Server Configuration: Difference between revisions
(Created page with " == Server Commands == ==System Commands== {| class="wikitable" |- | ===shutdown=== Shuts down the client and terminates. | style="width: 40%" | <nowiki>{ "target": "system", "action": "shutdown" }</nowiki> |- | ===set-log=== Enables logging to file or changes output file. {| class="wikitable" |+Parameters |- |file||The filename that the log should be written to. Required. |- |fileMode||can be <code>append</code> or <code>overwrite</code>. Required. |} || <no...") |
(Add descriptions and parameters) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
== Server Commands == | == Server Commands == | ||
{| class="wikitable" | |||
|- | |||
| | |||
=== add-apikey === | |||
Adds an authentication key to use with the [[Server HTTP Api | HTTP API]]. | |||
{| class="wikitable" | |||
|+Parameters | |||
|- | |||
|key||A secret string used to authenticate an API request. | |||
|} | |||
| style="width: 40%" | | |||
<nowiki>{ | |||
"target": "server", | |||
"action": "add-apikey", | |||
"key": "a-secret-key" | |||
}</nowiki> | |||
|- | |||
| | |||
=== add-environment=== | |||
Adds an environment. Deprecated, you can directly create environments in the web interface instead. | |||
{| class="wikitable" | |||
|+Parameters | |||
|- | |||
|settings||Object with JSON settings for this environment | |||
|- | |||
|name | |||
|Name used for the environment | |||
|} | |||
| style="width: 40%" | | |||
{ | |||
"target": "server", | |||
"action": "add-environment", | |||
"name": "env123", | |||
"settings": { | |||
"tunnelNetwork": "169.254.19.1/24", | |||
"udpListenerHost": "0.0.0.0", | |||
"udpListenerPort": "44343", | |||
"disableTunnelToTunnelTraffic": true | |||
} | |||
} | |||
|- | |||
| | |||
=== add-http === | |||
Adds an unencrypted http listener for web interface access. | |||
{| class="wikitable" | |||
|+Parameters | |||
|- | |||
|host||Host/IP to be used to for the listener. Use 0.0.0.0 to bind on all interfaces. | |||
|- | |||
|port | |||
|Port used for the listener. Defaults to 80 | |||
|} | |||
| style="width: 40%" | | |||
{ | |||
"target": "server", | |||
"action": "add-http", | |||
"host": "0.0.0.0", | |||
"port": "80" | |||
} | |||
|- | |||
| | |||
=== add-https === | |||
Adds an encrypted https listener for incoming tunnel connections and web interface access. | |||
{| class="wikitable" | |||
|+Parameters | |||
|- | |||
|host||Host/IP to be used to for the listener. Use 0.0.0.0 to bind on all interfaces. | |||
|- | |||
|port | |||
|Port used for the listener. Defaults to 443 | |||
|- | |||
|cert | |||
|Certificate file to use in PEM format. If none is supplied, a self signed certificate will be used instead. | |||
|- | |||
|key | |||
|Certifikate key to use in PEM format. If none is supplied, a self signed certificate key will be used instead. | |||
|- | |||
|rootCA | |||
|Specifies a root CA file that should be used in order to authenticate client tunnels using certificates. | |||
|- | |||
|allowTunnel | |||
|Specifies whether to accept incoming tunnel connections. | |||
|- | |||
|allowMonitor | |||
|Specifies whether to enable the web interface on this port. | |||
|} | |||
| style="width: 40%" | | |||
{ | |||
"target": "server", | |||
"action": "add-https", | |||
"host": "0.0.0.0", | |||
"port": "443", | |||
"allowMonitor": true | |||
} | |||
|- | |||
| | |||
=== add-user === | |||
Adds an user/password pair that can be used to log into the server's web interface. | |||
{| class="wikitable" | |||
|+Parameters | |||
|- | |||
|user||The username | |||
|- | |||
|password | |||
|The password | |||
|} | |||
| style="width: 40%" | | |||
<nowiki>{ | |||
"target": "server", | |||
"action": "add-user", | |||
"user": "admin", | |||
"password": "bad password" | |||
}</nowiki> | |||
|- | |||
| | |||
=== set-fallback-watchdog === | |||
Using this command, the server acts as a backup instance. When tunnels are connected, it will probe the specified url in regular intervals. If the probe succeeds, connected tunnels are instructed to connect to the primary server. | |||
{| class="wikitable" | |||
|+Parameters | |||
|- | |||
|url||The url used for probing the primary server. | |||
|- | |||
|interval | |||
|The interval in seconds that should be probed | |||
|- | |||
|maxTunnel | |||
|Amount of tunnels that should be disconnected in one go. This is useful to prevent many tunnels reconnecting at the same time to the primary server, causing unintended load spikes. | |||
|} | |||
| style="width: 40%" | | |||
{ | |||
"target": "server", | |||
"action": "set-fallback-watchdog", | |||
"url": "https://10.1.2.3/api/v1/ping", | |||
"interval": 3000, | |||
"maxTunnel": 10 | |||
} | |||
|- | |||
| | |||
=== slow-shutdown === | |||
Starts slow shutdown. This will disconnect all tunnels individually and tell them to connect to a different (backup) server. | |||
{| class="wikitable" | |||
|+Parameters | |||
|- | |||
| || | |||
|} | |||
| style="width: 40%" | | |||
{ | |||
"target": "server", | |||
"action": "slow-shutdown" | |||
} | |||
|- | |||
| | |||
=== set-password-authentication === | |||
Sets a global flag enabling or disabling password based authentication. When disabled, only certificate authentication is possible. | |||
{| class="wikitable" | |||
|+Parameters | |||
|- | |||
|enabled||true or false | |||
|} | |||
| style="width: 40%" | | |||
{ | |||
"target": "server", | |||
"action": "set-password-authentication", | |||
"enabled": true | |||
} | |||
|} | |||
==System Commands== | ==System Commands== | ||
Line 14: | Line 184: | ||
}</nowiki> | }</nowiki> | ||
|- | |- | ||
| | | | ||
===set-log=== | ===set-log=== |
Latest revision as of 13:45, 6 February 2023
Server Commands
add-apikeyAdds an authentication key to use with the HTTP API.
|
{ "target": "server", "action": "add-apikey", "key": "a-secret-key" } | ||||||||||||||
add-environmentAdds an environment. Deprecated, you can directly create environments in the web interface instead.
|
{ "target": "server", "action": "add-environment", "name": "env123", "settings": { "tunnelNetwork": "169.254.19.1/24", "udpListenerHost": "0.0.0.0", "udpListenerPort": "44343", "disableTunnelToTunnelTraffic": true } } | ||||||||||||||
add-httpAdds an unencrypted http listener for web interface access.
|
{ "target": "server", "action": "add-http", "host": "0.0.0.0", "port": "80" } | ||||||||||||||
add-httpsAdds an encrypted https listener for incoming tunnel connections and web interface access.
|
{ "target": "server", "action": "add-https", "host": "0.0.0.0", "port": "443", "allowMonitor": true } | ||||||||||||||
add-userAdds an user/password pair that can be used to log into the server's web interface.
|
{ "target": "server", "action": "add-user", "user": "admin", "password": "bad password" } | ||||||||||||||
set-fallback-watchdogUsing this command, the server acts as a backup instance. When tunnels are connected, it will probe the specified url in regular intervals. If the probe succeeds, connected tunnels are instructed to connect to the primary server.
|
{ "target": "server", "action": "set-fallback-watchdog", "url": "https://10.1.2.3/api/v1/ping", "interval": 3000, "maxTunnel": 10 } | ||||||||||||||
slow-shutdownStarts slow shutdown. This will disconnect all tunnels individually and tell them to connect to a different (backup) server. |
{ "target": "server", "action": "slow-shutdown" } | ||||||||||||||
set-password-authenticationSets a global flag enabling or disabling password based authentication. When disabled, only certificate authentication is possible.
|
{ "target": "server", "action": "set-password-authentication", "enabled": true } |
System Commands
shutdownShuts down the client and terminates. |
{ "target": "system", "action": "shutdown" } | ||||||||||||
set-logEnables logging to file or changes output file.
|
{ "target": "system", "action": "set-log", "file": "/var/log/saneclient.log", "fileMode": "append" } | ||||||||||||
set-script-pathChanges the directory that points towards the client scripts. (/opt/bondix/client/scripts by default)
|
{ "target": "system", "action": "set-script-path", "path": "/etc/bondix/scripts" } | ||||||||||||
set-webinterfaceEnables the integrated webserver & debug webinterface.
|
{ "target": "system", "action": "set-webinterface", "host": "0.0.0.0", "port": "80", "allowConfig": false, "allowMonitor": true, "configApiKey": "123456", "webroot": "/tmp/" } |