This thread may turn into more of a train-of-thought rambling but I am going to start by writing down the requirements we have that we’d like to satisfy as we reconfigure the way we deal with JS/reticulum integration/packaging/deploys.
First, the things we currently have in place that should continue to be true on the other side of these changes:
-
The current flow and URL structure: hubs.mozilla.com landing page, slugged URLs for rooms
-
Smoke testing in prod before any code changes are rolled out to the public
-
META tag inlining at server render time for Slack unfurls, etc.
-
No-configure experience for running
yarn start
locally and hittinghome.html
, with the full flow working properly -
Proper workflow for running a copy of hubs on your PC and hitting it from another IP address on the LAN, while using our dev servers
-
Ability to transactionally deploy a new version of the client from slack, bust the CDN properly, etc
-
All assets (other than the root document) on hubs.mozilla.com are CDN cached, gzipped, etc
-
Ideally minimal complexity in the CI step for doing a deploy, to reduce failure rate. Right now it’s eminently simple: it just does a habitat package promotion
-
CSP and CORS headers that allow least privilege and limit the blast radius of potential exploits against users.
-
The habitat system for running services in prod (habitat supervisor, habitat config deploys, habitat packages, etc.) I realize we may be revisiting some of this in time but I think it is out of scope for this body of work.
Things we want that are not currently possible or easy to do:
-
I want to take my own locally hacked copy of Hubs, and push it up on the internet somewhere and have it work. The full room creation flow should work, and it should not require me running any servers of my own.
-
If I do want to decouple myself from Mozilla’s servers, it should be possible for me to do so in a variety of ways:
-
I should be able to do a one-click deploy when possible on common hosting providers like AWS, and then be able to point my version of hubs to that IP or domain
-
I should be able to run a docker image on my own VPC similarly
-
I should be able to on my local computer run a small number of commands to get the “full stack” working against my local copy. If my local computer is accessible by the internet, I should be able to use it as a server.
-
-
We’d like to make it so its not necessary to do a full reticulum build + deploy in order to smoke test + roll out an update to the client, to reduce the time and complexity of client deploys, and also minimize downtime since reticulum deploys currently create a short outage. This is particularly useful because the client changes more rapidly than reticulum.
-
If I have my own GLTF scene I’d like to use for environments that is already accessible on the internet, it should be straightforward to incorporate it for the cases above.
-
Stretch goal: I should be able to easily stand up similar infrastructure on AWS as we do at Mozilla using our terraform scripts, to enable a horizontally scalable Hubs backend environment