Rayjas Configuration file – configuration.json
Rayjas stores its configuration information in two places – oneadmin/configuration.json (master configuration) and individual module configurations stored at oneadmin/modules/conf. The master configuration file (configuration.json ) controls the application-level configuration.
In this article, we will be taking a look at various configuration options available to us through the master configuration.
NOTE: Any changes made to the configuration will require a restart of the
rayjas
service.
configuration.json
{ "configuration": { "base_package": "oneadmin", "server": { "enabled": true, "http_port": 8000, "https_port": 8000, "bind_host": "127.0.0.1", "debug_mode": false, "hot_reload": false, "api": { "enabled": true }, "ws": { "enabled": true } }, "ssl": { "enabled": false, "cert_file": "server.crt", "private_key": "server.key" }, "modules": { "pubsub": { "enabled": true, "conf": { "allow_dynamic_topics": true, "topics": [{ "name": "/ping", "type": "push_message", "queue_size": 1, "max_users": 0 }, { "name": "/stats", "type": "push_message", "queue_size": 1, "max_users": 0 }, { "name": "/notification", "type": "subscription", "queue_size": 10, "max_users": 0 } ] } }, "action_dispatcher": { "enabled": true, "conf": {} } } } }
Configuration Properties
Attribute | Description | Value Type | Default Value |
base_package | The basename of the python package. This is used for resolving configurations and modules. | String | oneadmin |
server | Rayjas server configuration node | – | – |
server.enabled | Determines whether rayjas web server functionality is enabled or disabled. | Boolean | true |
server.http_port | The HTTP port for the webserver | Number | 8000 |
server.https_port | The HTTPS (secure) port for the webserver | Number | 8000 |
server.bind_host | The IP/host to which the webserver should bind. Leave it empty for flexible binding to all possible IP/hosts (interfaces). | String | 127.0.01 |
server.debug_mode | Runs underlying python application core in debug mode | Boolean | false |
server.hot_reload | Experimental: Intended to help rayjas load/unload modules without restart. | Boolean | false |
server.api | Rayjas HTTP API configuration node | – | – |
server.api.enabled | Enables/Disables REST API (HTTP handlers) in rayjas. | Boolean | true |
server.ws | Rayjas WebSocket configuration node | – | – |
server.ws.enabled | Enables/Disables Websockets in rayjas. | Boolean | true |
ssl | Rayjas SSL configuration node | – | – |
ssl.enabled | Enables/Disables SSL options in rayjas. | Boolean | true |
ssl.cert_file | Full absolute path to an SSL certificate file (.crt ) | String | – |
ssl.private_key | Full absolute path to an SSL key file (.key ) | String | – |
modules | Rayjas internal modules node. NOTE: The configuration section of internal modules should not be altered in any way. These are core to the system. This may be abstracted in the future. | – | – |
Apart from the main configuration, each module in rayjas
has its own configuration file, found under the modules/conf directory.
Configuration Tips & Tricks
Allow free binding to any host/IP
"server": { "enabled": true, "http_port": 8000, "https_port": 8000, "bind_host": "0.0.0.0", "debug_mode": true, "hot_reload": false, "api": { "enabled": true }, "ws": { "enabled": true } }
Disable Webserver (no inwards HTTP/WS traffic )
"server": { "enabled": false, "http_port": 8000, "https_port": 8000, "bind_host": "127.0.0.1", "debug_mode": true, "hot_reload": false, "api": { "enabled": true }, "ws": { "enabled": true } }
Disable HTTP APIs (Websocket only mode)
"server": { "enabled": true, "http_port": 8000, "https_port": 8000, "bind_host": "127.0.0.1", "debug_mode": true, "hot_reload": false, "api": { "enabled": false }, "ws": { "enabled": true } }
Disable HTTP APIs (Websocket only mode)
"server": { "enabled": true, "http_port": 8000, "https_port": 8000, "bind_host": "127.0.0.1", "debug_mode": true, "hot_reload": false, "api": { "enabled": false }, "ws": { "enabled": true } }
Disable HTTP APIs (Websocket only mode)
"server": { "enabled": true, "http_port": 8000, "https_port": 8000, "bind_host": "127.0.0.1", "debug_mode": true, "hot_reload": false, "api": { "enabled": false }, "ws": { "enabled": true } }
Disable Websocket service (HTTP API only)
"server": { "enabled": true, "http_port": 8000, "https_port": 8000, "bind_host": "127.0.0.1", "debug_mode": true, "hot_reload": false, "api": { "enabled": false }, "ws": { "enabled": true } }