Configuration
Overview
Riversoft® STCP Gemini Rename uses a single configuration file, /usr/local/stcpren/configs/config.json. It sets the encryption key, the license, where the instance and the routings are stored and how run control is done. Another file can be given with -config.
Choose the mode before creating the file. See Configuration modes.
Password encryption key
Passwords and other sensitive data stored in the configuration database (for example, the passwords of users, databases and supervision credentials) are encrypted. All modules that read or write this data must use the same key. Otherwise, a module cannot read the passwords stored by another one.
| Module | File | Parameter |
|---|---|---|
| Riversoft STCP Gemini Server | /usr/local/stcp/configs/stcpserver.config.json | ApplConfigPassPhrase (STCPCore section) |
| Riversoft STCP DirectLink | configs/config.json of the installation | applConfigPassPhrase |
| Riversoft STCP Gemini Rename | /usr/local/stcpren/configs/config.json | applConfigPassPhrase (General section) |
| Riversoft STCP Gemini API | /usr/local/stcpgemini-api/configs/config.json | api_secret (general section) |
flowchart LR
K[Same key] --> G[Gemini Server]
K --> D[DirectLink]
K --> R[Gemini Rename]
K --> A[Gemini API]
G --> DB[(Configuration database<br/>encrypted passwords)]
D --> DB
R --> DB
A --> DB
Important
Set the key before the first registration and use the same value in all modules of the environment. To change it later, the sensitive data already stored must be encrypted again with the new key, through a procedure performed with a dedicated application. Contact Riversoft support before changing the key.
- Use a strong, random value, kept out of the code.
- In Riversoft STCP DirectLink, the parameter accepts a secret reference (
env:,file:orkms:). Prefer to read the value from an environment variable, a protected file or a secrets vault. - In Riversoft STCP Gemini API,
api_secretalso signs the access tokens. - Keep the key in the environment’s secure backup: without it, the passwords of a restored database cannot be read.
Configuration file
Create the file from the template of the chosen mode and adjust the values:
cd /usr/local/stcpren/configs
cp example-config-db.json config.json{
"General": {
"applDir": "/usr/local/stcpren",
"applLockDir": "/usr/local/stcpren/control",
"applPidFile": "",
"applConfigPassPhrase": "<encryption-key>",
"applUser": "stcp",
"applGroup": "stcp",
"applDebug": 0,
"License": "/usr/local/stcpren/license/<license-file>"
},
"cfgProvider": {
"cfgProviderType": "stcpgeminidb",
"cfgInstanceName": "<instance>",
"cfgDbName": "GEMINI_DBConfig",
"cfgDbHost": "db.example.com",
"cfgDbPort": 3306,
"cfgDbUser": "<user>",
"cfgDbPswd": "<password>",
"cfgDbType": "mysql"
},
"lockProvider": {
"lockEnable": true,
"lockType": "filesystem"
}
}Routings are read from the database by the name given in -rules, and messages are written to the instance log database.
| Section | Purpose |
|---|---|
General | Directories, run user and group, encryption key, debug and license. |
cfgProvider | Configuration mode, associated instance and, in the database mode, the configuration database connection. |
lockProvider | Control of concurrent runs. |
cfgInstance | Instance parameters, in the local file mode only. |
All parameters are in Parameter reference.
Important
cfgInstanceName must match the name of the instance used by Riversoft STCP Gemini Server (ApplName) or by Riversoft STCP DirectLink.
Create the control directory given in applLockDir, if it does not exist yet:
mkdir -p /usr/local/stcpren/control
chown stcp:stcp /usr/local/stcpren/controlRoutings
- Database mode: register the routings in the instance, in the Riversoft Console Portal. To check a routing outside the Portal, export it to JSON with
-export. See Operation. - Local file mode: create the routing JSON file from the
example-config_rules.jsontemplate. For old rules in INI format, use the-iniconversion. See Upgrade and migration.
The routing structure is in Rule reference.
Configuration test
Check that the configuration and the routing are read correctly, without processing files:
stcpren -db -rules <ROUTING> -test <sample-file>In the local file mode, replace -db -rules <ROUTING> with -rules <path-to-routing.json>.
File security
applConfigPassPhrase, cfgDbPswd and the license file are sensitive data. Restrict access to config.json to the user and group set in applUser and applGroup:
chown stcp:stcp /usr/local/stcpren/configs/config.json
chmod 640 /usr/local/stcpren/configs/config.jsonSee also Security.