-
Notifications
You must be signed in to change notification settings - Fork 1
Config XML
Config.xml can be used to configure Itokawa's settings such as listening port. The config will be used by both the main server application and the cli application.
By default, config.xml can be found in ~/.itokawa/config.xml
. If the file doesn't exist, default settings will be used. By using the --datadir PATH
command line argument, an alternative directory can be used for loading the config and data.
<config>
<application>
<log>
<level>INFO</level>
</log>
</application>
<server>
<port>80</port>
<publish>
<ngrok>
<region>eu</region>
</ngrok>
</publish>
</server>
</config>
Command station configuration. If no explicit configuration is provided, Itokawa will attempt to auto-detect supported command stations and pick the first one found.
Key | Values | Default | Description |
---|---|---|---|
retryTime | Time in milliseconds | 5000 | Command station initialisation retry delay if there is an error or no command station found |
device | Device name | undefined | Name of command station to use, e.g. WebSocketCommandStation
|
connectionString | String | undefined | Connection string to pass to command station, e.g. url=ws://itokawa:8080/control/v1
|
Application log configuration.
Key | Values | Default | Description |
---|---|---|---|
level | DEBUG, INFO, DISPLAY, WARN, ERROR | DISPLAY | Log output level |
Config sections for web UI clients. The settings from this section are made available via the /config
route on the server.
Enables serial port debug logs if this section is present. Debug snap shots are saved to ~/.itokawa/serialport.snapshot.txt
.
Key | Values | Default | Description |
---|---|---|---|
snapshotsize | 1+ | 10 | Number of serial port messages to log in the event of an error |
Section for enabling in development and preview features.
Example usage (not real features):
<config>
<featureFlags>
<FEATURE_A/>
<FEATURE_B/>
</featureFlags>
</config>
Settings for the server application.
Key | Values | Default | Description |
---|---|---|---|
port | 1-65534 | 8080 | TCP port to listen on |
Password to enable admin features in the client GUI. If the password hash isn't set, then admin features are available to everyone all the time.
The hash is encoded in the format $scrypt512$cost$salt+hash
. Rather than attempting to set this manually, it is recommended that you use the password tool to set it by running npm run password
. It will prompt you for a new admin password and set it correctly in the config file.
Example:
<config>
<server>
<admin>
<password>$scrypt512$16384$4Xw0SPOXWyRhoWphmqXHFVX+RXkOQFR4SG4pCY1BqjcK00ilgbb6RQK7CXciVPGzcFCdiiqW449z7zwLB75hQEgUFYrLgkDnEjGuk6iTjaKhTA</password>
</admin>
</server>
</config>
Shell commands for server operations.
Key | Values | Default | Description |
---|---|---|---|
restart | Shell command | sudo shutdown -r now | Command to restart server |
shutdown | Shell command | sudo shutdown -h now | Command to shut down server |
update | Shell command | npm run prod-update | Command to update Itokawa to the latest version |
If the ngrok publishing section is present, the server will be publicly accessible using ngrok. Keys are mapped to options as defined on the ngrok npm package docs. The example config would be defined as:
<config>
<server>
<publish>
<ngrok>
<proto>http</proto>
<!-- addr>The port is automatically set by Itokawa</addr -->
<auth>user:pwd</auth>
<subdomain>alex</subdomain>
<authtoken>12345</authtoken>
<region>us</region>
<configPath>~/git/project/ngrok.yml</configPath>
</ngrok>
</publish>
</server>
</config>