The configuration helps you define all needed resources and services for all applications and sites at one single file.
The configuration file is defined hard coded as a contant in file “workng_boot.php
” and is normally located in "/data/.workng.json
".
If you are required to change this behaviour you could do so and change the appropriate constant definitions in “workng_boot.php
” file.
WORKNG_DATAPATH | “/data/” | The absolute path to the data folder. |
WORKNG_TEMPPATH | “/tmp/” | The absolute path to the temporary folder. |
WORKNG_CONFFILE | WORKNG_DATAPATH . '.workng.json' | The absolute path to the configuration file. |
Be absolutely aware of the fact, that the both given pathes and the configuration file must reside outside of the appropriate “DOCUMENT_ROOT
” of the used web server.
Additionally, specially if working with SELinux (enabled), you must allow the used web server to access the used data path.
The following settings could be set within the configuration file.
key
”string
The key (hex represented string) for encryption.
Be aware that you must not change this key after setting your application into operation, otherwise different resource are not readable anymore.
If you operate as a cluster, then all participating nodes must have the same key configured.
auth_rest
”string, enum (”basic”, “digest”), default “basic”
Which authentication method should the REST interface use?
sess_driver
”string, enum (”files”, “database”), default “files”
This setting defines the type of session handler will be used.
The use of “database
” is strongly recommended.
sess_save_path
”string, default WORKNG_DATAPATH . “.sessions/”
If “sess_driver
” is set to “files
” this setting represents the full path folder where session files will get stored.
If “sess_driver
” is set to “database
” this setting represents the table name in which session data will get stored.
settings_use_php
”bool, default false //NONE
If using PHP-FPM for running the system (specially/or having the settings reside on a NFS share), performance could be raised significant with this setting on true.
When true all settings files are are on demand (as before) but then exported to PHP source files which then are included into the system having PHP-FPM let them stay in its OP Cache.
output_cache
”string, enum ("", ”file”), default “” //NONE
With this settings the type of output cache is set, if there should be one.
cache_path
”string, default “”
If “output_cache
” is set to “file
” this setting represents the full path folder where cache files will get stored.
access_logs
”bool, default false
This setting enables the access logs. While the underlying web server certainly has its own access logs specially if in an cluster environment it is a good things to have all logs in one place.
Enabling this settings stores the access logs within die Key Value Store.
It is not recommended to use this settings if Matomo is used at the same time.
change_logs
”bool, default false
This setting enables the change logs. Every database change will then get logged into a special collection to have always a history of all changes on all resource.
Be aware that this settings will nearly double your needed database volume and transfer.
matomo_url
”string, default “”
If Matomo should be used this is the URL of the Matomo server.
matomo_key
”string, default “”
If Matomo should be used this is the key for the Matomo server.
udger_key
”string, default “”
If Matomo is not used but the access logs, using udger would enrich your access logs with appropriate user agent data.
ipinfodb_key
”string, default “”
If Matomo is not used but the access logs, using IPInfoDB would enrich your access logs with appropriate ip address data.
map
”map(string => object), optional
See concept “Site Tag”.
db
”map(string => object)
Within this section the database to use for the current “Site Tag” will be defined.
hostname | string | "localhost" | The hostname or ip address of the database server. |
username | string | The username for authentication at database server. | |
password | string | The password for authentication at database server. | |
database | string | The database name or schema of the database to use. |
{
"db": {
"default": {
"username": "database_user",
"password": "database_password",
"database": "database_name"
}
}
}
mongo_db
”map(string => object)
Within this section the Mongo database to use for the current “Site Tag” will be defined.
hostname | string | "localhost" | The hostname or ip address of the database server. |
username | string | The username for authentication at database server. | |
password | string | The password for authentication at database server. | |
database | string | The database name or schema of the database to use. | |
replicaset | string | “” | The replicaset to use if needed. |
compressors | string | “zstd,snappy,zlib” | The compression methods to use. |
cafile | string | “” | If needed the file path to a CA file could be given. |
compat | bool | false | If enabled a special compatibility mode (e.g. for AWS) is used. |
use_xact | bool | false | If enabled Mongo database operations will be put in a transaction. |
read_preference | string | "RP_PRIMARY" | Specifies the read preference if running on a Mongo cluter. |
{
"mongo_db": {
"default": {
"username": "database_user",
"password": "database_password",
"database": "database_name"
}
}
}
auth
”map(string => object)
Within this section the authentication method to use for the current “Site Tag” will be defined.
See “Authentication”.
mail
”map(string => object)
Within this section the mail settings to use for the current “Site Tag” will be defined.
See “Email Class from CodeIgniter”.
from | string | "" | The e-mail address to be used as sender. |
from_name | string | "" | The display name to be used for sender. |
{
"mail": {
"default": {
"from": "jane.doe@example.com",
"from_name": "Jane Doe"
}
}
}
stomp
”map(string => object)
Within this section the STOMP settings to use for the current “Site Tag” will be defined.
hostname | string | "localhost" | The hostname or ip address of the STOMP server. |
port | integer | 61614 | The port number of the STOMP server. |
username | string | The username for authentication at STOMP server. | |
password | string | The password for authentication at STOMP server. | |
path | string | "/topic/users/%user%/events" | The path to subscripte from the STOMP server. |
{
"stomp": {
"default": {
"username": "stomp_user",
"password": "stomp_password"
}
}
}
routes
”map(string => object)
Within this section special routes to use for the current “Site Tag” will be defined.
See “Routing Topic from CodeIgniter”.
{
"routes": {
"default": {
"blog": "frontend/blog",
"blog/feed.xml": "frontend/blog/feed",
"blog/([^/]+)/(.+)": "frontend/blog/show/$2",
"blog/(.+)": "frontend/blog/show/$1",
"contact": "frontend/my_issues/contact"
}
}
}
sites
”map(string => object)
This section defines which Application Definition to use for the current “Site Tag” and “Selector Path” (e.g. “frontend”).
The system tries to find an Application Definition in the following order:
“Site Tag”- "Selector Path" | example-frontend | For given “Site Tag” and “Selector Path” |
“Site Tag”-default | example-default | For given “Site Tag” and not defined “Selector Path” |
“Selector Path” | frontend | For given “Selector Path” |
default | default | For not defined “Site Tag” and not defined “Selector Path” |
The following example uses Application Definition “site1
” of all requests except for “Site Tag” “site2
”.
{
"sites": {
"default": "@site1",
"site2": "@site2"
}
}
The Application Definition could be assigned directly as an object (which is not recommended) or as a file to load with the “@
” operator. So the above given example would load file “site1.json
” as the Application Definition for the "default
" site.