Introduction
What the AntelopeJS Cloud module adds to a DMS, where it runs, and where it keeps the AntelopeJS Cloud token.
@antelopejs/dms-antelope-cloud connects a DMS project to AntelopeJS Cloud and publishes it. It adds an AntelopeJS Cloud entry to the DMS sidebar, under /modules/antelope-cloud. Module pages are for the platform owner only, like every DMS module page.
What it adds
The sidebar groups the module's pages as Release, Environments and AntelopeJS Cloud:
- Overview shows the workspace, the project and what each stage serves.
- Unpublished changes and Versions publish the project's git repository and list its versions.
- Environments lists the branches AntelopeJS Cloud builds and promotes a version along the release pipeline.
- Deployments and Logs follow each deployment and stream what a service prints.
- Resources shows the databases each environment runs and applies the plan that creates the missing ones.
- Variables lists and edits the variables of each environment.
- Connection signs the workspace in to AntelopeJS Cloud and chooses the project it publishes.
The first-run setup is not in the sidebar. It puts a new project online in six steps, and the Overview, Environments and Connection pages lead to it while the DMS has no project. A DMS is two services on AntelopeJS Cloud, the API and the dashboard, and the module puts both online from one repository.
Where the module runs
The module runs where the project is published from: a developer's checkout, or the one server that holds the project's git work tree. It does not belong on an instance AntelopeJS Cloud deployed. That instance has no git work tree, so there is nothing for it to publish. The module also stores an AntelopeJS Cloud token that can deploy the project, change its variables and read its logs. On the public instance, that token would let whoever takes over the instance redeploy it.
So the secretKey option decides. Set it where you publish from, and leave it unset on the deployed services: do not add ANTELOPE_CLOUD_SECRET_KEY to the variables of a service on AntelopeJS Cloud. With no secretKey, or an empty one as an unset variable reads, the module stays out of the instance:
- It registers no page and no route, so the sidebar has no AntelopeJS Cloud entry and
/dms/pages/modules/antelope-cloud/...answers 404. - It declares no table and stores nothing.
- It gives the dashboard no frontend.
ajs dms dev,buildandstartread the same option, so a dashboard built without the key does not bundle the module's components. - It prints one line at startup, on the
antelope-cloudlog channel. The line says that the module is not running and that a deployed instance is meant to run without it.
A project whose build can install the module then keeps it in its antelope.config.ts with no condition around it. The same configuration starts the module in the checkout that has the key and leaves it out of the deployment that does not.
An AntelopeJS Cloud development environment has nobody to approve a sign-in, so AntelopeJS Cloud hands the module its connection instead. The development environment page describes that case.
Where the token lives
The sign-in runs on the DMS backend. The browser only shows the code to confirm and the link to confirm it at. The backend keeps one AntelopeJS Cloud token per DMS workspace, encrypted with the secretKey option in the module's MongoDB collection, and never sends it to the browser.
Every call to AntelopeJS Cloud runs on the DMS backend with that token, the log stream included. The browser reads the Logs page's own stream route, which relays the stream of AntelopeJS Cloud.