πΉDemo Experience
Guardian now includes a "Demo Experience" feature which separates the production and demo versions by default. In order to access either the production or demo version, the user will need to build and deploy Guardian, defining on the β.envβ file present in the root directory the variable βDEMO=trueβ if the demo is desired or not stating it at all if the production mode is intended.
It's important to note that if βDEMOβ is present with a value other than βDEMO=trueβ, the auth-service, api-gateway, guardian-service and web-proxy modules will still be built as if the demo is intended, so either use βDEMO=trueβ or delete the variable altogether.
Demo Mode
Procedure:
./.env
When deploying in demo mode, the demo accounts created on build will be included. Additionally, when it comes to the API, the present βapi/v1/demoβ endpoints will be accessible, leading to the availability of the "Demo Admin Panel", and the βapi/v1/accounts/registerβ POST method can be used by anyone even when logged out, as before. The header will make it evident that the user is using the demo as "Guardian" will have "Demo" written in superscript and the color of the header will turn grey instead of the default black.
Production Mode
Procedure:
./.env
When Guardian is built in production mode, the demo accounts that have been present until now will no longer be produced on deployment, besides a single Standard Registry account. The βapi/v1/accounts/registerβ POST method is now guarded to be used exclusively by logged in Standard Registries while the βapi/v1/demo/β methods are deactivated as well. Finally, on the frontend side, the "Demo Admin Panel" will no longer be present.
To summarize, the "Demo Experience" feature in Guardian allows for the separation of the production and demo versions. By defining the βDEMOβ variable in the β.envβ file, the user can access the desired version. In production mode, the demo accounts and related features will no longer be present, whereas in demo mode, they will be available and the header will indicate that the user is using the demo version.
Deploying with Docker Compose
Much like what was already done for the βweb-proxyβ service, now the βauth-serviceβ, βapi-gatewayβ and βguardian-serviceβ services also contain separate Dockerfiles and tsconfig files for both demo and production modes. This allows further liberties when configuring each mode. For the already existing βweb-proxyβ service, as we are now allowing the toggle of building with demo configurations, some of these can be found at the bottom of your .env.${GUARDIAN_ENV}.guardian.system, such as:
./guardian/configs/.env.${GUARDIAN_ENV}.guardian.system
In order to make use of the already existing demo configuration files, the intention was to make the deployment in either demo or production mode as seamless as possible, leading, unfortunately, to a compromise. Because β.ymlβ files do not allow native logic operations and Docker Compose does not allow βif elseβ operations, the βweb-proxyβ, βauth-serviceβ, βapi-gatewayβ and βguardian-serviceβ services will build the demo versions every time the variable βDEMOβ is stated, even if it is equal to a random value or even βfalseβ. As stated before, the rule of thumb is if you want the demo, state βDEMO=trueβ, otherwise delete the variable all together from your root .env file. The following diagrams summarize what has been said:
New way of creating accounts (transversal to both Demo and Production modes)
Up until now it was possible to generate new accounts on the βCreate New Accountβ under the /login page, however, with these changes, this will only remain true if under a Demo build (DEMO=true defined on the ~/.env). This requires a new way for Standard Registries to be able to create new accounts. The /accounts/register POST method is still available on both versions, exclusively for Standard Registries if on Production mode (no DEMO variable defined on ~/.env), however Standard Registries also have a new menu option once logged in. Under the βAdministrationβ menu one can find a βCreate Accountsβ option that will lead to the same account creation process as before. This is depicted in the figures below.
Last updated