Skip to content

feat: add local auth, proxy auth, health checks, and improved docs#148

Open
brian-olson wants to merge 1 commit intoEugeny:masterfrom
brian-olson:feat/local-auth-and-improvements
Open

feat: add local auth, proxy auth, health checks, and improved docs#148
brian-olson wants to merge 1 commit intoEugeny:masterfrom
brian-olson:feat/local-auth-and-improvements

Conversation

@brian-olson
Copy link
Contributor

Summary

This PR adds several improvements for self-hosted deployments, addressing multiple open issues:

Local Username/Password Authentication (Fixes #116)

  • Add LOCAL_AUTH_ENABLED and LOCAL_AUTH_REGISTRATION_ENABLED environment variables
  • Add /api/1/auth/local/login endpoint for username/password login
  • Add /api/1/auth/local/register endpoint for self-registration (when enabled)
  • Add /api/1/auth/change-password endpoint for password changes
  • Add /api/1/auth/status endpoint to show available authentication methods

This allows self-hosted instances to work without OAuth configuration - just set LOCAL_AUTH_ENABLED=true.

Proxy Authentication (Also addresses #116)

  • Add PROXY_AUTH_ENABLED setting for reverse proxy authentication
  • Add ProxyAuthMiddleware to trust X-Auth-* headers from auth proxies
  • Supports Authentik, Authelia, Traefik ForwardAuth, and similar solutions
  • Headers: X-Auth-User-Email (required), X-Auth-User-Name (optional)

Health Check Endpoints

  • Add /health endpoint for basic health checks (load balancers)
  • Add /ready endpoint for readiness checks (includes DB connectivity)
  • Add /live endpoint for liveness checks (includes uptime info)

Version Endpoint

  • Add /api/1/version endpoint exposing version and build information

Improved Error Messages (Addresses #125, #124, #119)

  • Document ALLOWED_HOSTS fix for "Invalid HTTP_HOST header" error
  • Document OAuth callback URL requirements for "redirect_uri MUST match" error
  • Document database migration commands for "Table doesn't exist" error
  • Add comprehensive troubleshooting section to README

Docker Compose Improvements

  • Add docker-compose.prebuilt.yml for quick deployment with pre-built images
  • Add healthcheck configuration
  • Document all authentication options with inline comments

Test Plan

  • Test local login with LOCAL_AUTH_ENABLED=true
  • Test self-registration with LOCAL_AUTH_REGISTRATION_ENABLED=true
  • Test password change for logged-in users
  • Test /api/1/auth/status returns correct auth methods
  • Test health endpoints (/health, /ready, /live)
  • Test /api/1/version endpoint
  • Test proxy auth with X-Auth-User-Email header

🤖 Generated with Claude Code

This PR adds several improvements for self-hosted deployments:

## Local Username/Password Authentication (Eugeny#116)
- Add LOCAL_AUTH_ENABLED and LOCAL_AUTH_REGISTRATION_ENABLED settings
- Add /api/1/auth/local/login endpoint for username/password login
- Add /api/1/auth/local/register endpoint for self-registration
- Add /api/1/auth/change-password endpoint for password changes
- Add /api/1/auth/status endpoint to show available auth methods

## Proxy Authentication (Eugeny#116)
- Add PROXY_AUTH_ENABLED setting for reverse proxy auth
- Add ProxyAuthMiddleware to trust X-Auth-* headers
- Supports Authentik, Authelia, Traefik ForwardAuth, etc.

## Health Check Endpoints
- Add /health endpoint for basic health checks (load balancers)
- Add /ready endpoint for readiness checks (DB connectivity)
- Add /live endpoint for liveness checks (uptime info)

## Version Endpoint
- Add /api/1/version endpoint exposing version and build info

## Improved Error Messages (Eugeny#125, Eugeny#124, Eugeny#119)
- Document ALLOWED_HOSTS fix for "Invalid HTTP_HOST header" error
- Document OAuth callback URL requirements
- Document database migration commands
- Add troubleshooting section to README

## Docker Compose Improvements
- Add docker-compose.prebuilt.yml for quick deployment
- Add healthcheck configuration
- Document all authentication options

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No local logins? I don't plan on getting an o-auth provider account anywhere will there ever be an account management for local users?

1 participant