Hosting the app for a team
On this page
On your own machine the Open Factory Floor app is yours alone. Hosted, it is one always-on copy at a web address: each person on the team opens the address, signs in with GitHub, and sees and decides with their own access. Nobody installs anything.
One hosted copy serves one project, or several: people sign in once and see the floors GitHub lets them in to. It holds no token of its own, no private key and no database (unless you give it a store to share with other copies, which is off unless asked for and is described on its own page: everything below is about a copy without one). Unless you ask it to keep people signed in, it keeps nothing of anybody's sign-in outside its own memory. People sign in by typing a short code at github.com, which needs no secret at all, or, when you give the copy the GitHub App's client secret, with one click.
#What you need
- A GitHub App to sign in with, registered once, with device flow on and installed on each project's repository. Signing in with GitHub says how. Its client id is public.
- An https address, such as
https://floor.example.com. - Somewhere that runs a container behind a proxy or load balancer which holds the certificate for that address, passes requests on over plain http, and adds the caller's address to
X-Forwarded-For. Every ordinary container service does this.
#Running it
Build the container from the top of this repository, and run one copy of it:
docker build -f hosting/Dockerfile -t factory-app .
docker run -p 8080:8080 \
-e FACTORY_HOSTED=https://floor.example.com \
-e FACTORY_SIGN_IN=Iv23... \
-e GITHUB_REPOSITORY=OWNER/REPO \
factory-app
| Setting | What it is |
|---|---|
FACTORY_HOSTED | The https address people will use. Nothing after the name. |
FACTORY_SIGN_IN | The GitHub App's public client id. |
GITHUB_REPOSITORY | The project, as OWNER/REPO. |
GITHUB_REPOSITORIES | In its place, for several projects on one server: OWNER/REPO,OWNER/REPO, with commas between. |
FACTORY_SIGN_IN_SECRET | The GitHub App's client secret. Optional: with it people sign in with one click; without it they type a code. Only ever set here, in the environment. |
FACTORY_SIGN_IN_SECRET_FROM | In its place, where the platform cannot hand a secret over that way (AWS Lambda): the name or ARN of the secret in AWS Secrets Manager. The copy reads it itself as it starts, with its own role, and does not start if it cannot: the sign-in secret. Never both. |
FACTORY_DECIDE | 1 lets people decide from the page (merge, send back, release, go-ahead), each as themselves. Without it the app only looks. |
FACTORY_LET_IN | write (the default) or read: see below. |
FACTORY_KEEP | Where to keep the history across restarts: see Keeping the history. Optional. |
FACTORY_SESSIONS_KEY | An AWS KMS key. With it, and FACTORY_KEEP, people stay signed in across a restart. Optional, and it changes what is kept: read that section first. |
FACTORY_STORE | dynamodb://TABLE: a table that several copies share, so that they behave as one. Optional; it needs FACTORY_KEEP naming S3 and FACTORY_SESSIONS_KEY, and it changes what is kept more than either: read Several copies, one store first. |
The container listens on port 8080. Point the proxy's health check at /healthz, which answers ok and nothing else. Without a container the same thing is python3 -m factory.app --hosted https://floor.example.com --sign-in Iv23... --repo OWNER/REPO.
#On AWS, the same way every time
There are two ways. The one below is a floor that is always on (App Runner): one small machine, paid for by the hour whether anybody looks or not. The other is a floor that runs only while somebody is asking (Lambda), set up by hosting/aws_serverless.py and described on its own page, with what it needs, what it costs (cents a month for a quiet floor, now that floors there share one KMS key) and what has and has not yet been tried: a floor that runs only when it is asked. It can answer at an address of its own, and take one over from a floor of the kind below: moving a floor to Lambda. Neither tool changes the other's floors (the one thing aws_serverless.py switch changes is the address's record, which it replaces in one change it says how to undo).
hosting/aws_floor.py sets a floor up on AWS App Runner by one command, and updates floors by another. It drives the aws command you are signed in with (AWS_PROFILE and AWS_REGION choose the account and region) and holds no secret. Every aws command it can run is on a list written out at the top of the file; anything else is refused by the tool itself before it is run.
python3 hosting/aws_floor.py image 0.57.0 # build and push the container, at a checkout of the commit tagged v0.57.0 (from any directory in it)
python3 hosting/aws_floor.py create shop --repo OWNER/REPO --address https://shop.floor.example.com \
--client-id Iv23... --version 0.57.0 --zone ZONE_ID
python3 hosting/aws_floor.py list
python3 hosting/aws_floor.py update --all --version 0.58.0
python3 hosting/aws_floor.py update shop --decide on
python3 hosting/aws_floor.py update shop --repo OWNER/REPO --repo OWNER/OTHER # the floor's projects become exactly these
python3 hosting/aws_floor.py update shop --secret factory/shop-sign-in # one-click sign-in; `--secret none` takes it away
python3 hosting/aws_floor.py update shop --keep-sign-ins on # people stay signed in across a restart; `off` ends that
python3 hosting/aws_floor.py delete shop --zone ZONE_ID # take one floor away (`--plan` first shows what it would send)
python3 hosting/aws_floor.py pause shop # stop it answering and writing, keeping everything of it; `resume shop` starts it again
createmakes what a floor needs and nothing more: one small service running one copy, a role that can read and write the floor's own folder of one private bucket in your own account (so one floor cannot read another's history, and a bucket of the same name in somebody else's account is never used), and the address. With--zoneit writes the DNS records to that Route 53 zone, never over a name that already says something else; without, it prints them for you to add. A floor only looks unless you give--decide. Everything that can be refused is asked before anything is made: a role of the floor's name that allows other things, a bucket of the shared name that is not the tool's, and, with--zone, the address already in the zone. Run again, it carries on from where it stopped and makes nothing twice. It knows the bucket is its own by the tagproject=factory, which it puts on last: a bucket without it that is empty, untagged and has no rule of anybody else's is one whose setting up was stopped part-way, and is finished. Any other bucket of that name is never taken over:createstops and changes nothing. So leave that tag on; if it is taken off a bucket in use, put it back.updatechanges the version, whether a named floor lets people decide, a named floor's projects, its secret, or whether it keeps sign-ins, and nothing else: every other setting is read from the running floor and sent back as it was (its projects, its secret and its key for sign-ins among them, when they are not what is being changed). It looks at every floor before it touches one, and stops if any is not running. After each it reads the floor back, and stops if App Runner has put the old version back. Updating a floor restarts it, which signs everybody out of it, unless it keeps sign-ins.listshows each floor's version, whether it is running, whether it decides or only looks, how people sign in (clickwhen it has a secret,codewhen not), whether it keeps sign-ins (kept, or-), its address and its projects: all of them, or the first and+N morewhen the line would be too long.- After
createtwo things are left for a person: installing the GitHub App on the repository (on each, when there are several), and signing in.
A project set up with Open Factory Floor's older starters on a public repository. Starters up to v0.76.0 start the gate's first status, the automatic reviewer and the leftovers from pull_request_target, and GitHub has not started that trigger on a public repository since about 2 December 2026 unless the owner allows it by an Actions policy (GitHub's note). Such a project either allows it, or moves to the newer starters, which start after a small pull_request workflow and need no policy (why there are two workflows, and how to move). The gate's run when a review record is posted was never affected, and nor is a private repository. (A floor only shows a project's factory; setting the factory up on the project is where this matters.)
It costs what one small always-on App Runner service costs, for each floor, and a few pence of storage. A floor that keeps sign-ins has a KMS key of its own as well: about a dollar a month.
What it has been run against. Everything the tool does is tested against a made-up AWS (tests/test_hosting_aws.py). The parts for several projects, for the secret and for keeping sign-ins, below, were first run against that only. They have since been run against AWS itself, on the project's own floor: several projects on one floor and the secret by reference on 2 December 2026 (version 0.69.0), and keeping sign-ins on 2 and 3 December (versions 0.72.0 and 0.74.0), where a person signed in before an update was still signed in after the restart. What has not been run for real is said where it applies: a redeploy picking up a changed secret value, and --keep-sign-ins off. The commands it sends are few and are named below, so they can be checked against AWS's own documentation.
#Taking a floor away
python3 hosting/aws_floor.py delete shop --zone ZONE_ID --plan # prints every aws command it would send, in order (a wait is shown once; a real run repeats it); asks AWS nothing
python3 hosting/aws_floor.py delete shop --zone ZONE_ID
delete takes away one floor, the one named, in one region, and nothing else: there is no --all. It says the account and the region first: App Runner is of one region, so a floor called shop in another region is not the one it looks at. It asks everything first, and if anything is not as this tool leaves it, it stops and removes nothing, saying what it found: a service of the name without the tag project=factory, or that runs with another role, or that answers at an address this tool did not give it; a floor in the middle of anything but being deleted (it says what); a role of the floor's name without the tag, with a policy this tool does not write, any attached policy or a permissions boundary, or that others than App Runner's running containers may take; a role that another service in the region runs with, or that IAM says was last used in another region.
The role, and the region. IAM is the same in every region, so the role factory-floor-NAME is found from anywhere, and may be the role of a floor of that name in another region. So delete removes the role only when the floor in this region is shown to be its own: its service is here, or an earlier delete in this region marked the role (the tag factory-floor-deleting=REGION, written as the first change, before the service is touched) and was stopped after the service went. Even then it refuses, changing nothing, when anything says the role may be another region's floor's as well: create now tags a role it makes with the floor's region (factory-floor-region=REGION), and a role tagged for another region is refused; so is one IAM says was last used in another region; and so is one IAM has recorded no use of yet that was made in the last two days and carries no region tag of this one, because IAM records a role's use hours late (AWS says usually within four), and such a role cannot be told from the role of a floor just made elsewhere. Two days is twelve times that delay. Run in the wrong region, delete finds no service, leaves the role alone, says what it found and where it looked, and tells you first to find which region the floor runs in. A role whose floor you know is gone from every region goes with delete NAME --role-only, which removes it only if IAM says it was last used in this region more than two days ago, or never used and made more than two days ago (a running floor takes its role again about every hour). create refuses a name whose role is tagged for, or was last used in, another region, or that IAM has no use of yet and was made lately without this region's tag, so that two floors of one name in two regions never come to share a role. A run stopped after marking the role says so: run delete again in the same region to finish, or, to keep the floor, take the mark off with aws iam untag-role --role-name factory-floor-NAME --tag-keys factory-floor-deleting.
Before the first real delete in an account, run list with AWS_REGION set to each region the account uses, and check that no floor name appears in two of them. Two floors of one name made before this version share one role (IAM has one role of that name for the whole account), the tool cannot see other regions, and its guard against taking a shared role away rests on where IAM says the role was last used: both floors take the role about hourly, so that is close to a coin toss. If a name does appear twice, move one of the floors to another name first.
What goes, in this order. First the DNS records it wrote to the zone (with --zone): the address's own record and the ones that proved it for the certificate, as App Runner says them, each removed only if it still says exactly that; a record that says anything else is left, and named. (The certificate record is the one AWS gives for any certificate for that exact name in the account: if something else in the account has a certificate for the same address, check before it goes.) They go first, so that no name of yours points at a service that is going. Then the address is unlinked from the service, and the tool waits until App Runner no longer lists it (App Runner refuses to delete a service while one of its addresses is still being unlinked); then the service is deleted, and the tool waits until App Runner has finished. Then the role's policies, and the role. Without --zone no record is touched, and the ones to remove where the domain is kept are printed.
What stays, and is said by name: the floor's folder of the bucket (the history it kept, which somebody may want; a floor made again by the name takes it up); the bucket, the images, the one-copy setting and the role App Runner pulls images with, which every floor shares; the secret, if it had one; and its KMS key, if it kept sign-ins. A key is never deleted by this tool, because a deleted key cannot be brought back and nothing it locked can be opened again: it goes on costing about a dollar a month, and the tool prints the aws kms schedule-key-deletion command for you to run if you want it gone.
Stopped part-way, run it again (in the same region). It says exactly what it had already done before it stopped. Every step finds what is left and carries on. A floor whose service App Runner is already deleting is waited for, and the rest finished. Once the service is gone App Runner can no longer say which records were the floor's, which is why they are removed first; and when a run finds the address unlinked already, it names whatever records are still under the address in the zone, and says nothing of them when there are none (the earlier run removed them).
#Pausing a floor, and resuming it
python3 hosting/aws_floor.py pause shop [--plan]
python3 hosting/aws_floor.py resume shop [--plan]
pause stops a floor's service and keeps everything of it: its address, its settings, its records, its role, what it kept. While paused it answers nobody and writes nothing, and App Runner charges nothing for running it. resume starts it again, afresh: it reads the kept history as it now is, and people sign in again unless it keeps sign-ins. Each sends App Runner one command (pause-service, resume-service) and waits until App Runner says it is done (asked every 15 seconds, twenty minutes at most). Each is refused, with nothing changed, for a service of the name that this tool did not make (no tag project=factory) or that is not in a state that allows it (running, to be paused; paused, to be resumed); one that is paused or running already is left alone, and said. --plan prints the commands and sends none. This is how an always-on floor stops writing the history the moment its address moves to a floor on Lambda, and how it is started again, afresh, before the address comes back. It has been run only against the made-up AWS.
What it asks of AWS for this, besides what create asks: apprunner list-tags-for-resource, list-operations, disassociate-custom-domain and delete-service (and describe-service of each service in the region, to see that none other runs with the role), and iam tag-role (the mark) and delete-role. It has been run only against the made-up AWS so far, not yet against AWS itself.
#Several projects on one floor
A floor can serve several projects at one address. Give --repo once for each, up to fifty:
python3 hosting/aws_floor.py create shop --repo OWNER/SHOP --repo OWNER/TILL --address https://shop.floor.example.com \
--client-id Iv23... --version 0.57.0
python3 hosting/aws_floor.py update shop --repo OWNER/SHOP --repo OWNER/TILL --repo OWNER/STOCK
- With one project the floor is set up exactly as before (
GITHUB_REPOSITORY). With several it is given the list (GITHUB_REPOSITORIES, separated by commas) and not the single name. It needs a version of the app that reads the list. update NAME --repo … --repo …sets the floor's projects to exactly the ones given, for one named floor. It is not "add": name every project the floor is to have. The tool says which were added and which were removed.updatewithout--repoleaves the projects as they are.- Removing a project deletes nothing. What was kept for it stays in the floor's folder of the bucket; the floor just stops showing it. Delete it from the bucket yourself if you want it gone.
- The floor keeps every project under its own folder of the bucket, so its role needs no more leave than it had, and one floor still cannot read another's.
- Install the GitHub App on each project. The tool cannot do that, and a project without it cannot be read.
- A project named twice (GitHub's names do not differ by their case), a name that is not
OWNER/REPO, and more than fifty are refused before anything is changed.
#One-click sign-in on a floor
Without more, people sign in by typing a code. With the GitHub App's client secret, the app signs people in by one click instead (Signing in with GitHub). The client secret is a real secret: whoever has it can pass themselves off as the app. So it is kept in AWS Secrets Manager, App Runner hands it to the container when it starts, and the tool never reads it and never sees it, and nor does a command line. The tool asks Secrets Manager only whether the secret is there (describe-secret, which never answers with the value), and refuses by its own hand to send any other command to Secrets Manager.
Step by step, for a floor called shop at https://shop.floor.example.com:
In the GitHub App's settings, add the callback URL
https://shop.floor.example.com/signin/callback(the floor's address, then/signin/callback), and press Generate a new client secret. GitHub shows the secret once. Copy it and do not put it anywhere else: not in a chat, a ticket, or a file in a repository.Put it into Secrets Manager yourself, in the same AWS account and region as the floor, as plain text: the value alone, not a key and a value. Either way below. Do not give it as an argument on a command line (
--secret-string THE-SECRET): an argument is written into your shell's history, and can be read by anybody else on the machine while the command runs.In the console: Secrets Manager, Store a new secret, Other type of secret, the Plaintext tab; clear what is in the box and paste the client secret, so that the box holds the secret and nothing else. Leave the encryption key as it is (
aws/secretsmanager). Give it a name, such asfactory/shop-sign-in. No rotation.From a command line, typed at a prompt that does not show it, and passed to AWS as a file that is deleted straight after:
( umask 077 # the file is readable by you alone read -rs VALUE # paste the client secret and press Enter: nothing is shown printf %s "$VALUE" > sign-in-secret.txt ) aws secretsmanager create-secret --name factory/shop-sign-in --secret-string file://sign-in-secret.txt rm sign-in-secret.txtType these a line at a time: run the first three lines, paste the secret at the silent prompt and press Enter, and only then run the last two. (Pasted as one block into some shells, the
awsline would be read as the value.)readandprintfare part of the shell, so the secret is never an argument to a program, never in the history, and never on the screen. Do it in a directory of your own, not a shared one. The answer from AWS names the secret and does not show it.Tell the floor:
python3 hosting/aws_floor.py update shop --secret factory/shop-sign-in(or its whole ARN;
createtakes--secretthe same way). Before it changes anything the tool asks whether the secret is there, and refuses one that is not there, is marked to be deleted, or is in another account or region. It refuses, too, if the floor's role allows anything the tool did not give it, or can be taken by anybody but App Runner's running containers. Then it gives the floor's role leave to read that one secret and no other (a policy of its own on the role, calledread-sign-in-secret), sets the floor to be handed the secret asFACTORY_SIGN_IN_SECRET, and restarts it. If App Runner will not start the floor with it and goes back to what ran before, the role's leave is put back as it was.listthen showsclickfor the floor. It needs a version of the app that signs in by one click; an older one does not look at the setting and carries on with codes.
A key of your own. A secret encrypted with the usual key (aws/secretsmanager) needs nothing more. If you chose a key of your own for it, the floor's role (factory-floor-NAME) also needs kms:Decrypt on that one key. The tool says so and does not give it. Allow the role in that key's own policy, and only that role, only that key; do not add a policy to the role itself, or the tool will find the role "allows other things" and refuse to change it.
Changing the secret (rotating it). GitHub lets an app have two client secrets at once, so nobody need be locked out:
- In the GitHub App's settings, generate a new client secret. Leave the old one for now.
- Put the new value into the same secret in Secrets Manager: in the console, Retrieve secret value, Edit; or as in step 2 above with
aws secretsmanager put-secret-value --secret-id factory/shop-sign-in --secret-string file://sign-in-secret.txtin place of thecreate-secretline. - Deploy the floor again. This much is certain, from AWS's documentation: a running App Runner service does not pick up a changed value by itself; it reads secrets only when it is deployed. An
updatethat changes something (a new version, say) deploys it.update shop --secret factory/shop-sign-inagain does not: the floor is already so, and is left alone. To deploy it with nothing changed, ask App Runner:aws apprunner start-deployment --service-arn ARN(the ARN fromaws apprunner list-services). That this reads the new value is what AWS's words say; it has not been tried here. Either way it restarts the floor, which signs everybody out. - When people can sign in again, delete the old client secret in the GitHub App's settings.
Naming a different secret (update shop --secret factory/another) also works: the floor may read both while it changes over, and only the new one once it runs with it.
Turning it off. python3 hosting/aws_floor.py update shop --secret none takes the setting off the floor, and then takes away its role's leave to read the secret. People sign in by code again. The secret itself is left in Secrets Manager, and the client secret is still good at GitHub: delete both yourself if they are not wanted (in Secrets Manager, and in the GitHub App's settings), and take the callback URL off the app. A secret that really is called none can be named by its ARN.
What the tool asks of AWS for this, and nothing else: secretsmanager describe-secret; iam get-role, list-role-policies, list-attached-role-policies; iam put-role-policy and delete-role-policy for the one policy read-sign-in-secret; and apprunner create-service or update-service with RuntimeEnvironmentSecrets naming the secret's ARN.
#Keeping sign-ins on a floor
Without more, updating a floor signs everybody out of it. --keep-sign-ins on has the floor keep people signed in across a restart. Read that section before turning it on: it changes what the floor keeps. In short, the floor then keeps each signed-in person's refresh token in its folder of the bucket, locked by a key that AWS KMS holds.
python3 hosting/aws_floor.py update shop --keep-sign-ins on
python3 hosting/aws_floor.py update shop --keep-sign-ins off
python3 hosting/aws_floor.py create shop … --keep-sign-ins on
- On. The tool finds the floor's own KMS key by its alias,
alias/factory-floor-NAME-sign-ins, or makes one (a symmetric key, taggedproject=factoryand with the floor it is for and its purpose, with AWS's usual key policy, which leaves who may use it to your account's own IAM). It gives the floor's role leave to lock and unlock (kms:Encrypt,kms:Decrypt) with exactly that key and no other, as a policy of its own on the role calledlock-sign-ins. Then it sets the floor'sFACTORY_SESSIONS_KEYto the key's whole name (its ARN, not the alias: an alias moved later changes nothing), and restarts it. That restart still signs everybody out, once; after it they stay. - Everything that can be refused is asked before anything is made: a key of that alias that this tool did not make (no tag), that is switched off or marked to be deleted, or that is not a plain symmetric key of this account and region; a role that allows other things, or that others than App Runner's containers may take; a floor that keeps no history. Then nothing is changed.
- If App Runner will not start the floor with it and goes back to what ran before, the role's leave is taken away again. The key stays, and is found by its alias next time.
- Off. The tool takes the setting off the floor and restarts it, and then takes away the role's leave for the key. The app, started without the setting, removes what it had kept (how). The key itself is left: deleting a KMS key takes at least a week and cannot be undone, and anything it locked can then never be opened. It goes on costing about a dollar a month until you schedule its deletion yourself, in the KMS console.
- The tool never uses the key. It asks KMS to find, make and name a key, and refuses by its own hand to send any other command to KMS: it cannot lock, unlock, switch off, change or delete one.
- It needs a version of the app that keeps sign-ins. An older one does not look at the setting and signs everybody out at a restart, as before.
- What a key costs. About one US dollar a month for each key, and a few cents for every ten thousand requests; a floor asks KMS once when somebody signs in, once every eight hours for each person who is using it, and twice for each person who comes back after a restart. AWS's own price list is the word on it.
Before the tool uses a key it did not make in that same run, it looks at the key itself. A name and a tag are not proof of who made a key: anybody in the account who may make keys could give one this floor's alias or tags, with a policy that lets them unlock what it locks. So a key found by the floor's alias, or found unnamed by its tags, is used only if it is in this account and region, switched on, a symmetric key of your own for locking and unlocking, tagged by this tool, with the policy a new key has and nothing more (one statement, handing the key to the account itself, so that only your account's own IAM decides who may use it), and with no grant to anybody (kms get-key-policy, kms list-grants; an unnamed one must also have no alias at all, kms list-aliases, and carry the tags for exactly this floor and this purpose). A key that fails any of these is refused by name, with the reason, and nothing is changed: it is not used, and no other key is made beside it. Two unnamed keys that both pass are refused too: the tool does not choose. So leave the key's policy as it was made. Give people the use of the key, if you must, in IAM and not in the key's own policy or by a grant, or the tool will stop using it.
What the tool asks of AWS for this, and nothing else: kms describe-key (by the alias), kms list-resource-tags, kms get-key-policy and kms list-grants; when no key answers to the alias, kms list-keys and each key's tags, so that a key an earlier run made and was stopped before naming is found, named and used, and no second key is made (whoever runs the tool needs kms:ListKeys, kms:GetKeyPolicy, kms:ListGrants and kms:ListAliases for these looks); kms create-key (--key-usage ENCRYPT_DECRYPT --key-spec SYMMETRIC_DEFAULT, with a description and the tag) and kms create-alias, only when there is no key yet; iam get-role, list-role-policies, list-attached-role-policies; iam put-role-policy and delete-role-policy for the one policy lock-sign-ins; and apprunner create-service or update-service with FACTORY_SESSIONS_KEY among the plain settings (a key's name is not a secret). Whoever runs the tool needs leave for those: for the key, kms:CreateKey, kms:TagResource, kms:CreateAlias, kms:DescribeKey and kms:ListResourceTags.
#Signing in with one click
There are two ways to sign in, and the copy uses one or the other.
- With a code (the way it is without anything more). The page shows a short code; the person opens github.com, types it in and approves. This is GitHub's device flow. It needs no secret, so the copy holds none.
- With one click. The page shows one button, "Sign in with GitHub". It takes the person to github.com, where they approve (the first time; after that GitHub knows they have), and GitHub sends them straight back, signed in. There is nothing to type. This is GitHub's web flow, and GitHub will not complete it without the app's client secret. So this way the copy holds one secret, in memory.
The copy signs people in with one click when FACTORY_SIGN_IN_SECRET is set, and with a code when it is not. Nothing else changes: the same door, the same limits, the same people let in.
One way or the other, never both. A copy that has the secret refuses the code way entirely: asked to begin a sign-in by code, it says in words that it signs people in with one click, and asks GitHub nothing. The code way has a weakness that one click does not. Somebody can begin a sign-in, talk another person into typing the code at github.com, and then be signed in as that person. With one click the browser that comes back from GitHub must be the browser that set out, so there is nothing to hand to anybody else. A copy without the secret signs people in by code as it always did.
To switch it on, in the GitHub App's settings (Settings, Developer settings, GitHub Apps, your app):
- Callback URL: add
https://NAME/signin/callback, wherehttps://NAMEis exactly whatFACTORY_HOSTEDsays, such ashttps://floor.example.com/signin/callback. GitHub sends people back only to an address listed here, letter for letter. - Client secrets: press "Generate a new client secret". GitHub shows it once.
- Leave "Enable Device Flow" ticked. It is what the copy uses whenever it is started without the secret, and what the app uses on a person's own machine. A copy started with the secret does not use it.
- Leave "Expire user authorization tokens" on, as it is for a new app: a token then lasts eight hours and the copy renews it by itself (below).
Then give the copy the secret as the environment variable FACTORY_SIGN_IN_SECRET, the way your platform keeps secrets for a container (its secrets store, mounted as an environment variable), and restart it.
Where the secret goes, and where it must never go.
- Only in the environment. There is no command-line flag for it, on purpose: what is typed after a command shows in the machine's list of running programs, and in shell history.
- Never in the factory file, never in the repository, never in an image. The factory file is read by everybody who can read the project. Do not put the secret in a
Dockerfileor bake it into a container either. - The copy sends it to one place: GitHub's own token address,
https://github.com/login/oauth/access_token, when a person comes back from GitHub and when a token is renewed. It is never logged, never part of an error, never sent to the page, and never kept on disk. It asks that one address and takes that address's own answer: if it were ever told to go and ask somewhere else, it would not, and the sign-in would fail. The copy takes the secret out of its own environment as it starts. - What taking it out of the environment does, and does not. It keeps the secret from anything the copy starts, and that is all. On Linux the environment a process was started with can still be read for as long as it runs (
/proc/PID/environ), by the same user and by root. So the user the container runs as, and the machine it runs on, must be trusted with the secret, as with any secret given to a program. Run nothing else as that user. - If it leaks, generate a new one in the app's settings, delete the old one there, and restart the copy with the new one. Whoever holds the secret still cannot sign in as anybody: it is one half of what GitHub asks for, and the other half (a code GitHub hands a person's browser, good once, for ten minutes) they do not have.
What the copy does with a one-click sign-in. It makes up a state and one half of a puzzle (PKCE) that only it knows, remembers them for ten minutes, and gives the browser a cookie that names that attempt and nothing else. GitHub must send back the same state, to the same browser, and the copy must show GitHub the other half of the puzzle, or nobody is signed in. An attempt is good once: a visit that carries its state spends it, whatever comes of it. A visit that does not carry it is refused and spends nothing, so another website cannot use up somebody's sign-in by sending their browser to the way back; the person's own way back from GitHub still works. The state is 43 random characters, and after five visits with a wrong one the attempt is spent anyway, so there is nothing to be had by guessing. Every refusal (the state does not match, the ten minutes ran out, the person said no on GitHub, the door does not let them in, the house is full) is said in plain words on a page with a way to try again. If GitHub says the callback address is not one of the app's, step 1 above was missed.
#Several projects on one server
One copy can show several projects. People sign in once, and each sees the floors GitHub lets them in to.
docker run -p 8080:8080 \
-e FACTORY_HOSTED=https://floor.example.com \
-e FACTORY_SIGN_IN=Iv23... \
-e GITHUB_REPOSITORIES=example/shop,example/site,example/till \
factory-app
Without a container, give --repo once for each: --repo example/shop --repo example/site. Fifty at most; each must be OWNER/REPO, and none may be given twice. The GitHub App must be installed on every one of them. GITHUB_REPOSITORY and a single --repo work as they always did.
- The door is asked about each project. Everything under Who is let in holds project by project: at sign-in the copy asks GitHub, with the person's own access, what they may do on each one, and asks again every few minutes about the ones they are looking at.
FACTORY_LET_INis one rule for all of them. - Signed in means let in to at least one. Somebody GitHub lets in to none is told so, and nothing of theirs is kept.
- A person is shown only their own floors. The page lists the projects they are let in to and no others. Asked about any other project, the copy answers exactly as it does for a project it has never heard of. Nobody learns which projects a copy shows by asking it, signed in or not.
- When GitHub cannot say, the floor is not shown. A project GitHub will not answer about at sign-in is left out. One it said yes to a short while ago goes on being shown for a quarter of an hour, as with one project, and then is closed until GitHub answers.
- Access taken away on one project closes that floor and no other. The page says so and moves to another of the person's floors. When GitHub says no on every project, the person is signed out: the copy forgets their session and their tokens, and the page shows the sign-in card and says why. Only GitHub's own no on each project does that. While GitHub cannot be reached, or will not say about even one of them, nobody is signed out; the page says GitHub could not be asked.
- Nothing is shared between projects. Everything the people let in share (the reading, the history, the cost report, the note of what was already asked for, the one-at-a-time turn for decisions) they share within one project. A person's token is their own, and the same on every floor.
- Each project's history is kept in a folder of its own under the place
FACTORY_KEEPnames:PLACE/owner/repo/history.json, in small letters. With one project the history stays exactly where it has always been (PLACE/OWNER__REPO.history.json). So a copy that goes from one project to several begins that project's kept history again: move the old file to the new name first if you want to carry it over. It is a cache either way. - The address says which floor:
https://floor.example.com/#example/siteopens that one, for somebody let in to it.
#Who is let in
Signing in proves who somebody is. It does not make them one of the team, and anybody with a GitHub account can sign in to a GitHub App. So a hosted copy asks GitHub one more thing, with the person's own access: what may they do on this project?
write(the default). Only people GitHub lets write to the project come in. Everybody else is told the factory is not open to them, and nothing of theirs is kept.read. Anybody GitHub lets read the project. They share the readings of people who can write, less the one thing in them that GitHub tells only to people who may write: whether work on a request waiting in a hopper an agent may start from may begin by itself. Somebody who may only read is not shown that, whoever made the reading. A reading made with a reader's own access is short (GitHub tells them nothing of other people's standing, so it has no hoppers and no bin), and is theirs alone: it is never handed to anybody else, and never takes the place of the reading kept for everybody. What it saw happen is still added to the shared history. For a private project that is the people it has been shared with. For a public project it is everybody with a GitHub account.
If GitHub says there is no such project for them (a private project they cannot see), they are told it is not open to them. If GitHub will not answer at all, nobody comes in on a guess: the person is asked to try again.
An archived project lets the same people in, to look. The page says it is archived, and nothing can be decided there by anybody: nobody can change an archived repository.
Being let in is checked at sign-in and again every few minutes while somebody is looking, with their own access. Somebody whose access is taken away on GitHub is shown nothing more, and can decide nothing: every decision is done on GitHub as them, and GitHub refuses it. When that leaves them no project here at all, they are signed out and their tokens are forgotten, so nothing of theirs goes on being renewed. That happens only on GitHub's own no, never because GitHub could not be asked.
#Keeping the history
A container's disk goes when the container is replaced, so without more a hosted copy starts every time knowing nothing: the first person in after a restart or an update waits for, and pays for, a full reading of GitHub (several hundred requests on a busy project), and the history older than a week is gone.
FACTORY_KEEP (or --keep) names somewhere that outlives the container. The project's history, with the last reading whole and the short history of the cost, is kept there after each reading and read back at the start. Then the floor shows at once after a restart, and the first reading asks only about what has changed.
- A directory on a disk that stays:
FACTORY_KEEP=/var/factory, a volume mounted into the container and writable by the user it runs as. - An S3 bucket:
FACTORY_KEEP=s3://BUCKET/PREFIX. The container uses the AWS access it was given as a container (its task or instance role); give that roles3:GetObjectands3:PutObjectonBUCKET/PREFIX/*and nothing else. (Without leave to list the bucket, S3 answers "refused" where it would answer "not there", so the very first start, with nothing kept yet, says once in the log that S3 refused, and carries on.)AWS_REGIONmust say the bucket's region, and the bucket's name must have no dots. The access is read where a container is given it (ECS, Fargate, App Runner) or from the usualAWS_…environment variables; a plain EC2 instance profile and EKS pod identity are not read. Nothing else from AWS is used and no AWS library is needed.
What is kept is what GitHub said about the project (titles and review notes are other people's words), the notes of what people decided from the app, with their GitHub names, and a small dated summary of each cost report made (the day, the totals, and the figures by how each change ended: numbers only, one for a day, the last ninety). The cost report itself is held in memory for an hour and not kept: after a restart the first person to press "Cost" has it worked out again. For a private project that is private text: keep the bucket or the disk private and encrypted, as you would the repository, and writable by the app alone: whoever can write there can change what the floor shows. It is a cache: deleting it loses the steps older than a week and nothing more.
What is never kept, and the one thing that is when you ask. No access token is ever kept (except, locked by KMS, in the table of a copy given a shared store), nor the client secret, nor a session's cookie. Without FACTORY_SESSIONS_KEY, no refresh token is kept either and nothing else of anybody's sign-in: a restart signs everybody out. With it, the copy keeps one more object in the same place, sign-ins.json, holding each signed-in person's refresh token, locked by AWS KMS, and nothing else that could become access: Staying signed in across a restart says exactly what. The history itself never holds any of it.
If the place cannot be read or written, the app says so once in its log and carries on without it.
#Staying signed in across a restart
Sessions live in the copy's memory, so every restart, and so every update, signs everybody out. You can have the copy keep people signed in instead. It is off unless you turn it on, and turning it on changes a promise: a copy without it keeps no token of any kind anywhere; a copy with it keeps, outside its memory, one locked refresh token for each signed-in person. Decide with that in mind.
To turn it on, give the copy three things: somewhere to keep things (FACTORY_KEEP, above), an AWS KMS key (FACTORY_SESSIONS_KEY, or --keep-sign-ins KEY: the key's id, an alias such as alias/floor-sign-ins, or its ARN), and leave for the container's role to use that key: kms:Encrypt and kms:Decrypt on that one key and nothing else. On AWS App Runner the tool does all of it. The key's region is the one its ARN names, or AWS_REGION.
Why KMS, and nothing else. A token kept must be locked, and Python's standard library has no cipher; this app takes no dependency and makes no cipher of its own. So the locking is done by AWS: the copy sends the refresh token to KMS over https, KMS locks it with a key that never leaves KMS, and the copy keeps what comes back. A copy asked to keep sign-ins that has no kept place, no usable key name, no region or no AWS access refuses to start, and says why. There is no weaker way it falls back to. The kept place may be an S3 bucket or a directory; either way the lock is KMS's.
What is kept, in sign-ins.json in the kept place (beside the history, never inside it), for each signed-in session:
session | A SHA-256 of the session's id. The id itself, which is the cookie's value, is never kept: what is kept cannot be used as a cookie, and the id cannot be worked back from it. |
login | The person's GitHub name, when GitHub said it. |
how | code or click: which way they signed in. |
began, until | When the session began and when it must end, in seconds. |
refresh | The session's refresh token, locked by KMS. |
and the address of the copy that wrote it. Nothing else. The access token is not kept, locked or otherwise, nor the client secret. The object is private text (it says who is signed in, and since when): keep the place private, and writable by the app alone, as for the history. A session whose token does not expire has no refresh token, so nothing is kept for it and a restart signs that person out as before.
What the lock is tied to. KMS locks each refresh token together with a few plain words (its "encryption context"): this copy's address, the session's hash, how, and when it began and must end. It unlocks only when given the very same words, and the copy names its own key when it asks. So a locked token copied onto another record, onto another copy's object, or under a later ending does not open. The person's name is not among the words, because AWS writes them into its own record of each request (CloudTrail).
What happens after a restart. Nothing is unlocked at the start. When a browser brings a cookie whose hash matches a record, and only then:
- KMS is asked to unlock that record's refresh token, for the record's own words.
- GitHub is asked to renew it. That gives a new access token and a new refresh token, and spends the old one. The new refresh token is locked and put in the old one's place at once.
- The door is asked afresh, exactly as at sign-in, with the new token: what may this person do on each project now? If GitHub's name for the token is not the name in the record, nobody is let in.
- Only then is the person signed in again, and shown what the door allows.
Two requests on the same cookie arriving together make one unlocking and one renewal. A cookie that matches nothing costs nothing: neither KMS nor GitHub is asked. A record is trusted for nothing by itself; anything ill made, past its end, from another address, or made the other way of signing in than the copy uses now is dropped.
A restart never makes a sign-in longer. A sign-in lasts a week from when the person signed in (below), and the week goes on counting across restarts: until is set once, is part of what the lock is tied to, and is never moved.
When something says no, the person signs in again, and nothing worse.
| What happens | What the person sees | What becomes of the record |
|---|---|---|
| KMS says the locked token itself will not do: it was not locked by this key, or not for this record's words (the record was changed, swapped, or made up) | The sign-in card | Removed: asking again could not help, and the record may be a forgery |
| KMS says the key cannot be used: it is switched off or marked to be deleted, or the role may not use it | The sign-in card for now; the same cookie works again once the key can be used. While it says so the key is asked once in half a minute for the whole copy, not once for each person. Said once in the log | Stays |
| KMS says anything else, cannot be reached, or is slow (it is given five seconds) | The sign-in card for now; the same cookie works again once KMS answers, tried no more often than every half minute for each record. Nobody else waits | Stays |
| GitHub refuses the renewal (the person took the app's authorization away; the refresh token was used elsewhere) | The sign-in card | Removed |
| GitHub cannot be reached | The sign-in card for now; tried again after half a minute | Stays |
| The door says no on every project | The sign-in card | Removed |
| The door could not be asked | The sign-in card for now; tried again after half a minute | Stays, holding the new refresh token |
| The copy dies between GitHub's answer and the new refresh token being written | After the next start, GitHub refuses the spent token that was kept: the sign-in card | Removed |
| A sign-in could not be locked or written (KMS or the place failed, or the key could not be used) | Nothing: they are signed in. Tried again at their next request after half a minute. Until it is kept, a restart signs them out, as it always did. Said once in the log | Not there yet |
| What was kept cannot be read at the start | Everybody signs in again | Begun afresh |
Signing out, the end of the week, a renewal GitHub refuses and GitHub's no on every project each remove the record at once. No request ever fails because something could not be kept or removed.
A key switched off for a while costs nobody their sign-in. Only a no about the locked token itself removes a record. A key that is off for a few minutes, or a role whose leave is changed part-way through a rollout, leaves every record where it is; people who arrive meanwhile see the sign-in card, and are back on the same cookie when the key can be used again (unless they signed in afresh meanwhile, which is a new sign-in).
Somebody who can write the kept place cannot make the copy hammer KMS. A record costs nothing until a browser brings the cookie whose hash it carries, so they must send the cookies too. The most the copy reads back is 400 records. One whose locked token is not this key's, or not for its own words, is asked about once and dropped: 400 such records cost 400 requests to KMS, once. While KMS says the key itself cannot be used, the whole copy asks once in half a minute, however many records and cookies there are (and once more with a test value of its own, before everybody is made to wait on that no: one record's refusal is never taken for the key's, as on a floor that shares its key). Only while KMS is failing some other way (throttling, an outage, an answer the copy does not know) is each record asked about again, once in half a minute at most: 400 records sent without pause are then at most some 13 requests a second, about a dollar's worth in eight hours at AWS's list price, and only for as long as KMS goes on failing and the cookies go on arriving.
How it is written. One object, written whole after every change, behind the scenes, one write at a time and only the newest. One object and not one for each session, because the copy can only read and write the kept place by name: it has no leave to list it or to delete from it. It holds at most 400 records of a few hundred bytes: the 200 people who can be signed in at once, and as many left from before a restart that nobody has yet come back for.
Who can do what with it.
- Somebody who reads the kept place and nothing else learns who is signed in, how, and since when. They cannot sign in as anybody: the session ids are not there, and the refresh tokens are locked by a key they cannot use.
- Somebody who can also write the kept place can sign people out by removing records. They cannot make a record that opens, move one to another cookie, or give one a later ending. One thing they can do: put back an older copy of the object, which makes a signed-out session's old cookie good again until its week is up, for whoever still holds that cookie. (A bucket set up by the tool keeps old copies of every object for a fortnight.) So the place must be writable by the app alone.
- Somebody who holds the copy's own role (its AWS access: the place and the key) can unlock every kept refresh token. A refresh token that came by a code can be renewed at GitHub with nothing more, and one that came by one click with the client secret, which the same role can read. So whoever holds the role can act on GitHub as each person who is signed in, within what the GitHub App may do for that person. Without this setting the same thief would find no token anywhere but in the memory of the running container. That is the promise that changes. Keep the role to the container alone; every use of the key is in AWS's record (CloudTrail), with the copy's address and the session's hash, so an unlocking the copy did not make can be seen. A stolen refresh token is good once: when the thief uses it, the real person's next renewal is refused and they are signed out, and the other way about.
- AWS is trusted with the refresh tokens: KMS is sent each one to lock it.
To sign everybody out at once, start the copy without the setting (on a floor: update NAME --keep-sign-ins off): the restart empties its memory, and it removes what was kept. Turn it on again afterwards if you want it. Or, without the tool: delete sign-ins.json from the kept place and restart the copy (a running copy would write it again from its memory), or switch the key off in KMS and restart: while the key is off nothing kept can be opened by anybody, and nothing new is kept. That holds people out only for as long as the key is off: the records stay, and open again when it is switched back on. To end the sign-ins for good, use one of the other two ways. None of these takes anything back at GitHub. If you fear the tokens themselves were taken, revoke them at GitHub: in the GitHub App's settings, "Revoke all user tokens".
To turn it off, start the copy without FACTORY_SESSIONS_KEY. It then keeps nothing of any sign-in, and as it starts it removes what an earlier run kept: in a directory the file is deleted; in S3, where the copy has no leave to delete, the object is written empty (and when S3 will not say whether one is there, it is written empty anyway, so a floor that never kept sign-ins may gain one empty object). If it cannot, it says so in its log, and you should remove sign-ins.json by hand. In a bucket that keeps old versions, as the tool's does, the older copies of the object go when the bucket's own rule removes them (a fortnight): they hold locked tokens that only the key can open, most of them spent. Then take away the role's leave for the key, and delete the key when you are sure nothing needs it.
What it does not do. It does not carry over a sign-in that was part-way through when the copy restarted. It does not make two copies share sessions: run one copy, or give the copies a store to share. It does not give the session's cookie again when it brings somebody back: the browser already holds it, with the lifetime it was given at sign-in (below), so a restart moves the cookie's end no more than the session's.
#What a hosted copy does differently
- It answers at its own address only. A request that names it any other way is turned away, and deciding is accepted only from its own page at its https address.
- The session cookie is for https and that one name only (
__Host-,Path=/,Secure,HttpOnly,SameSite=Strict). It lasts as long as the sign-in may, and no longer: when somebody is signed in, by either way, the cookie is givenMax-Ageequal to the seconds their session has left (a week where GitHub's tokens can be renewed; twelve hours, or the token's own life if that is shorter, where they cannot). So closing the browser does not sign anybody out, and the browser lets go of the cookie when the copy would refuse it anyway. It is given once. Renewing the token does not give it again, and nor does a restart, with sign-ins kept or not, so nothing makes it last longer. Signing out, and a sign-in the copy ends, take it away at once. (On your own machine the cookie is as it always was: gone when the browser closes.) - The page tells people so, because of shared computers. Closing the browser does not sign anybody out of a hosted copy. The sign-in card of every hosted copy says, whichever way people sign in: "You stay signed in on this browser for up to 7 days, also after closing it. An update of this floor still signs everybody out. On a shared computer, sign out when you leave." Where sign-ins are kept the middle sentence is "An update of this floor no longer signs you out." Where GitHub's tokens for the app cannot be renewed it says "up to 12 hours", and that an update still signs everybody out, kept or not, since nothing is kept for such a sign-in. Somebody signed in finds the same words on the "Sign out" button (hold the pointer over it). The figures are the copy's own: until somebody has signed in it cannot know whether the app's tokens are renewed, and says seven days, which is the most it can be. A one-click sign-in uses a second cookie for the ten minutes it takes (
__Host-factory_signin,Secure,HttpOnly,SameSite=Lax): it names the attempt so that GitHub's answer can be matched to the browser that asked, and opens nothing. It isLaxbecause the way back from github.com is a visit another site began, on which a browser sends noStrictcookie. For the same reason the copy does not simply send the browser on to the floor when it comes back: it answers with a small page of its own, which goes there. - Beginning a sign-in is limited to five in ten minutes from one caller, whichever way people sign in. The caller is the address the proxy reports in
X-Forwarded-For, believed only when the connection comes from inside the private network, where the proxy is. So the container must sit behind one proxy and not be reachable around it: a second proxy in front would make the whole team one caller. - Codes nobody typed in do not keep people out for long. At most 200 people can be signed in or signing in at once. When that room is full, a new sign-in takes the place of the oldest one that was begun, never finished, and is at least two minutes old; whoever was part-way through that one is told their code has lapsed, and begins again. So filling the room with sign-ins that are never finished shuts a newcomer out for two minutes at most, not for the fifteen a code lasts. Nobody who is signed in is ever put out.
- A sign-in is safe for its first two minutes, which is enough to type the code and approve. However many sign-ins a crowd begins after yours, none of them puts yours out in that time. When the room is full and every unfinished sign-in in it is younger than two minutes, a newcomer is turned away and asked to try again in a couple of minutes, without GitHub being asked for a code; so is one who finds the room full of signed-in people.
- The limits slow a crowd down; they do not stop one. A crowd can no longer push out somebody who is in the middle of signing in. What it can still do is keep the room full, so that a newcomer cannot begin: every place not held by a signed-in person must be taken again as soon as it goes stale. With few people signed in that is close to 200 sign-ins begun every two minutes, and at five in ten minutes from one caller that takes some two hundred addresses, kept up for as long as people are to be kept out. If that matters to you, have the proxy admit only the addresses your team comes from.
- The page cannot be shown inside another site's page.
- It never opens a browser, and stops cleanly when the container is stopped.
#What to know
- Run one copy, unless the copies share a store. Sign-ins are held in memory. Two copies behind one address would each know only their own, and with sign-ins kept each would spend the other's refresh tokens. Copies that are each given the same table (
FACTORY_STORE) keep what they must share there, and behave as one: Several copies, one store. That is the first step towards a floor that runs only when it is used; it has so far been run against a made-up AWS only. - Restarting it signs everybody out, unless you have it keep sign-ins. That includes every update. Without that setting, sessions, tokens and sign-ins part-way through are held in memory and nowhere else, so nothing of them comes back. People sign in again: one click, or a new code. With it, people who were signed in stay so; no access token is kept even then. Either way, somebody who was on their way back from GitHub when it restarted is told the sign-in cannot be finished, and tries again.
- A sign-in lasts up to a week. GitHub's token for a person lasts eight hours and comes with a refresh token that buys the next one, once. The copy keeps both in memory with the session and renews the token ten minutes before it lapses, the next time the person asks for anything, or at once if GitHub refuses it early; one renewal at a time for a session. So somebody who comes back the next morning is still signed in. After seven days they sign in again. If GitHub refuses a renewal (the person took the app's authorization away, or the refresh token was used elsewhere) the session ends there and the page asks them to sign in again. If GitHub cannot be asked to renew (it is out of reach, or does not answer), nothing is decided either way: the copy carries on with the token it holds, waits for that one try and no more, and tries again half a minute later. Should GitHub refuse the held token meanwhile, the page says GitHub could not be asked, not that no project is open to the person, and it mends by itself when GitHub is back. A code sign-in is renewed without any secret; a one-click sign-in needs the secret to renew. Where the app's tokens do not expire, a session lasts twelve hours, as before.
- At most 200 people can be signed in or signing in at once; a sign-in left unfinished for two minutes gives up its place first (above). When every place is a signed-in person's, a session nobody has used since its token lapsed gives up its place to a newcomer; nobody whose token is good is put out.
- The people let in share one reading. Everybody the door lets in may read the project, so the newest reading any of them made, and the history built from the readings, is handed to all of them. Only the first person pays for a full reading of GitHub (several hundred requests on a busy project, from their own hourly allowance), and with the history kept only the first person ever; the others are given it, and when it has aged whoever asks next reads only what has changed. Tokens, who somebody is and what they may do are never shared. "Read again" always reads with your own access.
- The people let in share one cost report. Pressing "Cost" works the report out with the access of whoever pressed first (several hundred requests from their own hourly allowance, more on a busy project), one at a time, and everybody let in is given that one for an hour. It carries nothing that depends on who asked (why).
- A decision made by one person is known to the others. Pressing the same thing twice within a quarter of an hour is caught whoever pressed first, also when two people press at the same moment: what has been asked for is remembered once for everybody let in, and decisions are taken one at a time across all of them. After a restart the note in the kept history still says it was asked.
- Its log says nothing about who did what. The record of every decision is on GitHub, under the name of the person who made it.
- Updating is building the container from a newer version and replacing the running copy.
This guide is docs/HOSTING.md in the repository, and this page is made from it. Something wrong or unclear? Open an issue or send a pull request. Next: Several copies, one store, and a floor that runs only when it is asked.