Skip to content

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.

You need a container runtime, such as Docker or Podman. The commands here use docker, and Podman accepts the same ones.

  1. Start masks:

    Terminal window
    docker run --name masks -p 3000:3000 -v masks:/rails/storage ghcr.io/masksrb/masks
  2. Copy the setup token from the output. It is on a line like masks: masks is not set up. Its setup token is 7Hq2….

  3. Open http://localhost:3000, enter the token, and follow the Set up screen. See setting a tenant up for each step.

  4. 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.

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.

  1. Clone the repository and start the stack:

    Terminal window
    git clone https://github.com/masksrb/masks.git
    cd masks
    ./dev
  2. Open masks at http://masks.localhost:12345.

  3. Enter the setup token masks-dev, and follow the Set up screen. See setting a tenant up for each step.

  4. On your account page, choose Manage this server to open /manage. The account you created holds masks: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.

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.

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.

  1. Pick the SDK in choosing an SDK.
  2. Follow connecting an app.
  • 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.