No description
Find a file
cclohmar 00165e9fef chore: 3-stage Docker build from source, rename image to authelia-api
- Dockerfile builds Go source in stage 2 (golang:1.22) instead of
  copying pre-built binary
- Image renamed to git24hcom/authelia-api:latest
- docker-compose.yml: updated image name, added build directive
- .gitignore: ignore root-level authelia-api binary
- Removed pre-built binary from git tracking (now built in Docker)
2026-07-15 16:55:28 +00:00
docker Add Docker container combining Authelia + Authelia-API 2026-06-24 18:54:27 +00:00
src feat: add policy management endpoints 2026-07-15 14:33:09 +00:00
.dockerignore Add Docker container combining Authelia + Authelia-API 2026-06-24 18:54:27 +00:00
.gitignore chore: 3-stage Docker build from source, rename image to authelia-api 2026-07-15 16:55:28 +00:00
authelia-api.postman_collection.json chore: sync: ClausL-MacBook-Pro.local 2026-05-04 17:50 2026-05-04 17:50:26 +01:00
authelia-api.postman_environment.json chore: sync: ClausL-MacBook-Pro.local 2026-05-04 17:50 2026-05-04 17:50:26 +01:00
docker-compose.yml chore: 3-stage Docker build from source, rename image to authelia-api 2026-07-15 16:55:28 +00:00
Dockerfile chore: 3-stage Docker build from source, rename image to authelia-api 2026-07-15 16:55:28 +00:00
example_bulk_request.json chore: sync: ClausL-MacBook-Pro.local 2026-05-04 17:50 2026-05-04 17:50:26 +01:00
install-authelia-api.sh chore: sync: ClausL-MacBook-Pro.local 2026-05-04 19:00 2026-05-04 19:00:55 +01:00
openapi.yml chore: add OpenAPI 3.0.3 spec for API documentation 2026-07-15 14:28:54 +00:00
POSTMAN_GUIDE.md Add POSTMAN_GUIDE.md with setup, endpoints, and troubleshooting 2026-06-24 19:17:39 +00:00
README.md Clarify mirror: developed on git.lohmar.co.uk, mirrored to Codeberg 2026-06-24 19:37:12 +00:00

Authelia API

A Go-based REST API and management layer that sits alongside an Authelia LXC on Proxmox. Provides a "Source of Truth" in SQLite, handles bulk user onboarding via JSON, and automates synchronization of the Authelia users_database.yml file.

Features

  • Sovereign Bootstrap: Automatically imports existing Authelia users on first run
  • Bulk User Management: Create multiple users via JSON API with automatic password generation
  • Real-time Sync: SQLite changes automatically sync to Authelia's YAML configuration
  • SMTP Onboarding: Send welcome emails using Authelia's SMTP configuration
  • Secure API: Bearer token authentication with bcrypt hashing
  • Drop-in Deployment: Runs alongside existing Authelia installation

Installation

A combined container with both Authelia and Authelia-API is available on Docker Hub:

# Create config directory with your Authelia configuration
mkdir -p config data certs
# Copy and edit the example config:
#   docker/configuration.yml.example → config/configuration.yml
#   Set secrets, domains, and other settings.

# Pull and start
docker compose up -d
Port Service
9091 Authelia web portal
8080 Authelia-API (user management API)

First-time authentication: The container creates an admin user automatically on startup by reading the session.secret from your Authelia config. Whatever value you set for session.secret in configuration.yml becomes your initial bearer token — there is nothing to fetch. For example:

curl -H "Authorization: Bearer your-session-secret-value" http://localhost:8080/api/health

Authelia configuration reference: The example file at docker/configuration.yml.example covers the essentials, but Authelia has many more options. See the official Authelia configuration docs for details on secrets, domains, authentication backends, and access control rules.

Bare Metal (Quick Installation)

Runs the install script directly on the host alongside an existing Authelia installation:

curl -fsSL https://git.lohmar.co.uk/cclohmar/autehlia-api/raw/branch/main/install-authelia-api.sh | sudo bash

Manual Installation

  1. Download the binary:

    curl -fsSL -o authelia-api https://git.lohmar.co.uk/cclohmar/autehlia-api/raw/branch/main/authelia-api
    chmod +x authelia-api
    
  2. Run the installer:

    sudo ./install-authelia-api.sh
    

Development Installation

For building from source, see the src/README.md file.

Note for local development: When installing from a cloned repository, set the environment variable to use the local binary:

AUTHELIA_API_DEVELOPMENT_MODE=true sudo ./install-authelia-api.sh

Get your bearer token:

  • Docker: The token is whatever you set as session.secret in your configuration.yml.
  • Bare metal: Read it from your existing Authelia configuration:
    grep -A2 "session:" /opt/authelia/configuration.yml | grep "secret:" | awk '{print $2}'
    

Then test the API:

curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:8080/api/health

API Testing with Postman

Postman collection and environment files are provided for API testing:

  • authelia-api.postman_collection.json - Complete API collection with all endpoints
  • authelia-api.postman_environment.json - Environment variables (base URL, token)
  • POSTMAN_GUIDE.md - Setup and usage guide

See POSTMAN_GUIDE.md for detailed setup and usage instructions.

Files in This Repository

  • authelia-api - Ready-to-use binary (production)
  • install-authelia-api.sh - Installation script
  • Dockerfile - Combined Authelia + Authelia-API container image
  • docker-compose.yml - Quick Docker deployment with volumes
  • docker/ - Container entrypoint and configuration templates
  • POSTMAN_GUIDE.md - API testing guide
  • src/ - Source code and build instructions
  • authelia-api.postman_collection.json - Postman collection
  • authelia-api.postman_environment.json - Postman environment

Mirror

This project is developed on git.lohmar.co.uk and mirrored to Codeberg.

License

MIT License