Rayjas Configuration

"Only a life lived for others is a life worthwhile." – Albert Einstein

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


AttributeDescriptionValue TypeDefault Value
base_packageThe basename of the python package. This is used for resolving configurations and modules.Stringoneadmin
serverRayjas server configuration node
server.enabledDetermines whether rayjas web server functionality is enabled or disabled.Booleantrue
server.http_portThe HTTP port for the webserverNumber8000
server.https_portThe HTTPS (secure) port for the webserverNumber8000
server.bind_hostThe IP/host to which the webserver should bind. Leave it empty for flexible binding to all possible IP/hosts (interfaces).String127.0.01
server.debug_modeRuns underlying python application core in debug modeBooleanfalse
server.hot_reloadExperimental: Intended to help rayjas load/unload modules without restart.Booleanfalse
server.apiRayjas HTTP API configuration node
server.api.enabledEnables/Disables REST API (HTTP handlers) in rayjas.Booleantrue
server.wsRayjas WebSocket configuration node
server.ws.enabledEnables/Disables Websockets in rayjas.Booleantrue
sslRayjas SSL configuration node
ssl.enabledEnables/Disables SSL options in rayjas.Booleantrue
ssl.cert_fileFull absolute path to an SSL certificate file (.crt)String
ssl.private_keyFull absolute path to an SSL key file (.key)String
modulesRayjas 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
	}
}