Quickstart
masks signs people in to your apps. It is an OpenID Connect and OAuth 2.0 provider, which means it speaks the standard protocols that apps use to sign people in and get tokens.
Run it
Section titled “Run it”You need a container runtime, such as Docker or Podman. The commands here use docker, and
Podman accepts the same ones.
-
Start masks:
Terminal window docker run --name masks -p 3000:3000 -v masks:/rails/storage ghcr.io/masksrb/masks -
Copy the setup token from the output. It is on a line like
masks: masks is not set up. Its setup token is 7Hq2…. -
Open
http://localhost:3000, enter the token, and follow the Set up screen. See setting a tenant up for each step. -
On your account page, choose Manage this server to open
/manage.
The container runs its own Postgres, and keeps everything in the masks volume.
Self-hosting puts it behind HTTPS for other computers.
Try it locally
Section titled “Try it locally”The repository runs masks, Postgres, and this documentation on your computer with ./dev. Use it
to work on masks itself. You need Ruby and a container runtime that answers docker compose, such
as Docker or Podman. On a Mac, Colima runs one.
-
Clone the repository and start the stack:
Terminal window git clone https://github.com/masksrb/masks.gitcd masks./dev -
Open masks at
http://masks.localhost:12345. -
Enter the setup token
masks-dev, and follow the Set up screen. See setting a tenant up for each step. -
On your account page, choose Manage this server to open
/manage. The account you created holdsmasks:manage.
This documentation runs at http://masks.localhost:12346. The ports are in
environment variables.
| Command | |
|---|---|
./dev |
Builds and runs the stack in the foreground. |
./dev down |
Stops the stack and keeps its data. |
./dev reset |
Deletes the data and starts again at the Set up screen. |
./dev logs [service] |
Follows the logs of one service, or all of them. |
./dev test [suite] |
Runs the test suites in containers. |
./dev first-sign-in |
Times a fresh image to its first signed-in account. |
./dev --multi |
Runs two tenants, demo and acme. See the demo. |
./dev help lists every command.
Run it in production
Section titled “Run it in production”masks runs in one of three ways.
| The container image | ghcr.io/masksrb/masks, with its own Postgres or yours, and a TLS proxy in front of port 3000. |
| Engine mode | Mounted inside your own Rails app with the masks-server gem. |
| Server mode | A Rails app of your own that is a masks server and nothing else. |
Each one starts at the same Set up screen, with a setup token that masks prints in its logs.
Connect an app
Section titled “Connect an app”An app connects to masks through an SDK, a library for the app’s language. masks has SDKs for Ruby, JavaScript in the server and in the browser, Python, and Go.
- Pick the SDK in choosing an SDK.
- Follow connecting an app.
Next steps
Section titled “Next steps”- Core concepts explains tenants, actors, clients, scopes, and signing keys.
- Features covers clients, signing in, and signing out.
- Security describes what masks protects and how.