Introduction
The registries module provides the ability to create & configure environments registries (one registry per environment) and this configuration can be reloaded during runtime without any downtime or restart needed.
SOAJS also provides the ability to have a custom registry for each environment where you can add additional configuration that is not supported by the default SOAJS components.
The registry is built upon deploying a service and is cached in memory. It is reloaded when the caching limit runs out. Changes you make take effect once the registry is auto reloaded or if you force a reload registry maintenance operation.
Objective
Create New Environment
Head to the Deploy pillar → Registries and click on Add new environment, follow the wizard and a new environment will be created.
By default, SOAJS is deployed with Dashboard Environment in place.
Whenever you create a new environment, SOAJS clones the clusters and deployment configuration from the Dashboard environment and merges them with the custom information you supply.
Step 1: General Information
Step 2: Environment deployment method
Step5: Validate and create
Once an environment is created, its Code is added automatically to the Red Menu in the top left sidebar of the interface. You can juggle between environments at any stage using the same Dashboard UI interface; no need to login to multiple locations.
Edit Environment
When editing an environment, you can update all the information inserted in Step 1 and Step 3 except the environment code and the Controller deployment settings.
Plus you can configure in depth every field in the registry. Click here to learn more about the registry and its properties.
Key Security Update
While editing your environment, you notice a section at the bottom with a highlighted Note box above and whose content is related to tenant key security.
This section allows you to change the tenant key security that is used to encrypt tenant keys with.
Changing the security phrase in any environment will trigger a background process that loops around all the tenants you have and:
- Flag all old keys for this environment as deprecated
- Generate new keys for this environment and update all the tenants affected.
If the environment happens to be Dashboard, SOAJS will prompt you with a new external key value that YOU MUST CHANGE in the config.js of the UI that was used by the dashboard Nginx. Otherwise if you logout from the dashboard, you will never be able to log back in.
Currently the config.js that the default SOAJS dashboard uses resides in: https://github.com/soajs/soajs.dashboard/blob/master/ui/config.js and the default external key is on line 16.
Custom Registry
Custom Registries are accessible after you create an environment and provide an JSON editor so you can enter any configuration you desire.
Add New Custom Registry:
In General tab, choose a name as a key, then the value can be a text or a JSON.
In settings tab, you can plug this custom registry so it becomes accessible, you can lock it so only the admin and the creator can modify it and you can share it with other environments.
Configure:
This button is for editing a custom registry.
Accessing the Registry in the code
The registry provide private inputs related to the environment the service/daemon is operating in. These inputs are acquired from the SOAJS object at runtime: req.soajs.registry
You can read in depth all the properties and information that the registry supplies inside the SOAJS Space → Registry section.
Add Comment