к каталогу

📦 authorizer/ authorizerdev

Your data, your control. Fully open source, authentication and authorization. No lock-ins. Deployment in Railway in 120 seconds || Spin a docker image as a micro-service in your infra. Built in login page and Admin panel out of the box.

Открыть на GitHubобновлён 1д назад
Звёзды
2.0k
Форки
209
За неделю
За месяц
Рост %
Язык
Go

Установка и запуск

Quick start (local)

Prerequisites: Go ≥ 1.24 (see go.mod).

git clone https://github.com/authorizerdev/authorizer.git
cd authorizer
make dev

make dev runs the server with SQLite and development defaults (RS256 keys, sample client credentials). Open the URL printed in the logs (default port 8080) and sign in with --admin-secret (admin in dev).

For production builds, tests, and Docker, see Getting Started below.

Run with Docker

The default image runs as non-root (UID 65532). Writable mounts (SQLite under /authorizer/data, etc.) are usually root-owned, so pick one of:

  1. Run as root for that container (simplest for local SQLite + volumes):

    docker run -p 8080:8080 -u root \
      -v authorizer_data:/authorizer/data \
      quay.io/authorizer/authorizer \
      --database-type=sqlite \
      --database-url=/authorizer/data/data.db \
      --url=http://localhost:8080 \
      --client-id=123456 \
      --client-secret=secret \
      --admin-secret=admin \
      --jwt-type=HS256 \
      --jwt-secret=test \
      --encryption-key=test-encryption-key
    
  2. Keep non-root and make the mount writable by 65532 (good for production-style bind mounts):

    mkdir -p ./data && sudo chown -R 65532:65532 ./data
    docker run -p 8080:8080 \
      -v "$(pwd)/data:/authorizer/data" \
      quay.io/authorizer/authorizer \
      --database-type=sqlite \
      --database-url=/authorizer/data/data.db \
      --url=http://localhost:8080 \
      ...
    
  3. Build from source with the root target (no -u at run time):

    docker build --target final-root -t authorizer:root .
    docker run -p 8080:8080 -v authorizer_data:/authorizer/data authorizer:root \
      --database-type=sqlite --database-url=/authorizer/data/data.db ...
    
  • Port 8080 serves the app and GraphQL; use -p 8080:8080 to expose it.
  • Volume authorizer_data persists the SQLite DB; use a named volume or a host path (e.g. -v $(pwd)/data:/authorizer/data).
  • All config is passed as CLI arguments (the image uses ENTRYPOINT ["./authorizer"] so args after the image name go to the binary). See MIGRATION.md for the full list of flags.

Из README репозитория · полный README на GitHub

Категории

Теги

2faauthauthenticationauthorizationdockergolanggraphdbgraphqlhacktoberfestmagic-linkmicroservicenosqloauth2role-based-access-controlsecuritysocial-loginssqltypescriptuser-privileges