Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b5ebc8e
Add watchfiles ot enable reload on .env file
rragundez Nov 20, 2025
b5aa6f8
Simplify docker compose and add reload based on .env file to CMD comm…
rragundez Nov 20, 2025
74b63c7
Remove unused sqlite and mysql settings
rragundez Nov 20, 2025
798b215
Centralize the postgres url creation
rragundez Nov 20, 2025
9320712
Setting for defining the frontend and backend host
rragundez Nov 21, 2025
db1e172
Add validation logic based on environment and validate hosts protocol…
rragundez Nov 21, 2025
b1fdc52
Add validation message to avoid obscure changes that the user will no…
rragundez Nov 21, 2025
c4becf5
Merge pull request #223 from rragundez/envs-local
igorbenav Nov 21, 2025
656443e
Reload application on the change of the .env file
rragundez Nov 19, 2025
c1fe04c
Add flag to force reload on watchfiles
rragundez Nov 19, 2025
0febf52
Move example .env file to the root directory instead of inside src
rragundez Nov 19, 2025
96701b1
Move file .env from src/ to / when setting it up
rragundez Nov 19, 2025
2813444
Fix path reference to .env file
rragundez Nov 20, 2025
45969b7
Merge pull request #225 from rragundez/env-to-root
igorbenav Nov 24, 2025
421676c
Merge pull request #226 from rragundez/remove-sqlite-mysql
igorbenav Nov 24, 2025
53d7a83
Merge pull request #228 from rragundez/add-hosts
igorbenav Nov 24, 2025
1001e0f
Add auth settings
rragundez Nov 21, 2025
e5946f9
Make password auth optional based on environment variable
rragundez Nov 21, 2025
6a043ee
Add environment variables to the .env file example
rragundez Nov 21, 2025
3b34213
Add oauth for Google and Microsoft
rragundez Nov 21, 2025
7c98abf
Add microsoft and github oauth
rragundez Nov 21, 2025
db727a3
Add warning message about mixing password auth with oauth
rragundez Nov 23, 2025
325e89a
Allow Oauth user to have a null password and deny password auth when …
rragundez Nov 24, 2025
300ec9f
Solve conflicts and sync uv.lock file
rragundez Nov 25, 2025
3679474
Add comments for clarity
rragundez Nov 25, 2025
00f1a37
Remove inline comments, and rename githubsso to githuboauth and add t…
rragundez Dec 23, 2025
716f797
creating users with no password and with other characters on their em…
LucasQR Jan 13, 2026
ba5684f
took out dev comments
LucasQR Jan 13, 2026
bf5178d
adding tests and docs
LucasQR Jan 14, 2026
caf666f
oauth docs
LucasQR Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
413 changes: 413 additions & 0 deletions docs/user-guide/authentication/oauth.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ nav:
- Authentication:
- Overview: user-guide/authentication/index.md
- JWT Tokens: user-guide/authentication/jwt-tokens.md
- OAuth: user-guide/authentication/oauth.md
- User Management: user-guide/authentication/user-management.md
- Permissions: user-guide/authentication/permissions.md
- Admin Panel:
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies = [
"gunicorn>=23.0.0",
"ruff>=0.11.13",
"mypy>=1.16.0",
"fastapi-sso>=0.18.0",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -107,6 +108,7 @@ filterwarnings = [
dev = [
"pre-commit>=4.3.0",
"pytest-asyncio>=1.0.0",
"watchfiles>=1.1.1",
]

[tool.mypy]
Expand Down
4 changes: 2 additions & 2 deletions scripts/gunicorn_managing_uvicorn_workers/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file contains example values for development/testing purposes only.
#
# SECURITY CRITICAL: Before deploying to production, you MUST:
# 1. Copy this file to src/.env
# 1. Copy this file to a .env file at the project root
# 2. Generate a new SECRET_KEY using: openssl rand -hex 32
# 3. Change all passwords (POSTGRES_PASSWORD, ADMIN_PASSWORD, etc.)
# 4. Update all sensitive configuration values
Expand All @@ -20,7 +20,7 @@ CONTACT_NAME="Me"
CONTACT_EMAIL="my.email@example.com"
LICENSE_NAME="MIT"

# ------------- database -------------
# ------------- database -------------
POSTGRES_USER="postgres"
POSTGRES_PASSWORD=1234
POSTGRES_SERVER="db"
Expand Down
29 changes: 14 additions & 15 deletions scripts/gunicorn_managing_uvicorn_workers/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
web:
build:
build:
context: .
dockerfile: Dockerfile
# -------- Both of the following commands should be commented to run with nginx --------
Expand All @@ -9,7 +9,7 @@ services:
# command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
command: gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000
env_file:
- ./src/.env
- .env
# -------- replace with expose if you are using nginx --------
ports:
- "8000:8000"
Expand All @@ -20,26 +20,26 @@ services:
- redis
volumes:
- ./src/app:/code/app
- ./src/.env:/code/.env
- .env:/.env

worker:
build:
build:
context: .
dockerfile: Dockerfile
command: arq app.core.worker.settings.WorkerSettings
env_file:
- ./src/.env
- .env
depends_on:
- db
- redis
volumes:
- ./src/app:/code/app
- ./src/.env:/code/.env
- .env:/.env

db:
image: postgres:13
env_file:
- ./src/.env
- .env
volumes:
- postgres-data:/var/lib/postgresql/data
expose:
Expand All @@ -64,11 +64,11 @@ services:

#-------- uncomment to create first superuser --------
create_superuser:
build:
build:
context: .
dockerfile: Dockerfile
env_file:
- ./src/.env
- .env
depends_on:
- db
- web
Expand All @@ -78,11 +78,11 @@ services:

#-------- uncomment to run tests --------
# pytest:
# build:
# build:
# context: .
# dockerfile: Dockerfile
# dockerfile: Dockerfile
# env_file:
# - ./src/.env
# - .env
# depends_on:
# - db
# - create_superuser
Expand All @@ -93,11 +93,11 @@ services:

#-------- uncomment to create first tier --------
# create_tier:
# build:
# build:
# context: .
# dockerfile: Dockerfile
# env_file:
# - ./src/.env
# - .env
# depends_on:
# - create_superuser
# - db
Expand All @@ -109,4 +109,3 @@ services:
volumes:
postgres-data:
redis-data:

14 changes: 13 additions & 1 deletion scripts/local_with_uvicorn/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file contains example values for development/testing purposes only.
#
# SECURITY CRITICAL: Before deploying to production, you MUST:
# 1. Copy this file to src/.env
# 1. Copy this file to a .env file at the project root
# 2. Generate a new SECRET_KEY using: openssl rand -hex 32
# 3. Change all passwords (POSTGRES_PASSWORD, ADMIN_PASSWORD, etc.)
# 4. Update all sensitive configuration values
Expand All @@ -16,6 +16,8 @@
APP_NAME="My Project"
APP_DESCRIPTION="My Project Description"
APP_VERSION="0.1"
APP_BACKEND_HOST="http://localhost:8000"
APP_FRONTEND_HOST="http://localhost:3000"
CONTACT_NAME="Me"
CONTACT_EMAIL="my.email@example.com"
LICENSE_NAME="MIT"
Expand Down Expand Up @@ -70,3 +72,13 @@ ENVIRONMENT="local"

# ------------- first tier -------------
TIER_NAME="free"

# ------------- auth settings -------------
# ENABLE_PASSWORD_AUTH=true
# GOOGLE_CLIENT_ID=
# GOOGLE_CLIENT_SECRET=
# MICROSOFT_CLIENT_ID=
# MICROSOFT_CLIENT_SECRET=
# MICROSOFT_TENANT=
# GITHUB_CLIENT_ID=
# GITHUB_CLIENT_SECRET=
5 changes: 4 additions & 1 deletion scripts/local_with_uvicorn/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ COPY --from=builder --chown=app:app /app/.venv /app/.venv
# Ensure the virtual environment is in the PATH
ENV PATH="/app/.venv/bin:$PATH"

# Force file watching to use polling, which is more reliable in some Docker environments (like WSL/macOS)
ENV WATCHFILES_FORCE_POLLING=true

# Switch to the non-root user
USER app

# Set the working directory
WORKDIR /code

# -------- replace with comment to run with gunicorn --------
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--reload-include", ".env"]
# CMD ["gunicorn", "app.main:app", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:8000"]
40 changes: 16 additions & 24 deletions scripts/local_with_uvicorn/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
services:
web:
build:
build:
context: .
dockerfile: Dockerfile
# -------- Both of the following commands should be commented to run with nginx --------

# -------- replace with comment to run with gunicorn --------
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
# command: gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000
env_file:
- ./src/.env
# -------- replace with expose if you are using nginx --------
environment:
# Enable polling for file changes on macOS/Windows Docker Desktop
- WATCHFILES_FORCE_POLLING=true
ports:
- "8000:8000"
# expose:
# - "8000"
depends_on:
- db
- redis
volumes:
- ./src/app:/code/app
- ./src/.env:/code/.env
- .env:/code/.env

worker:
build:
build:
context: .
dockerfile: Dockerfile
command: arq app.core.worker.settings.WorkerSettings
env_file:
- ./src/.env
- .env
depends_on:
- db
- redis
volumes:
- ./src/app:/code/app
- ./src/.env:/code/.env
- .env:/code/.env

db:
image: postgres:13
env_file:
- ./src/.env
- .env
volumes:
- postgres-data:/var/lib/postgresql/data
expose:
Expand All @@ -64,11 +57,11 @@ services:

#-------- uncomment to create first superuser --------
create_superuser:
build:
build:
context: .
dockerfile: Dockerfile
env_file:
- ./src/.env
- .env
depends_on:
- db
- web
Expand All @@ -78,11 +71,11 @@ services:

#-------- uncomment to run tests --------
pytest:
build:
build:
context: .
dockerfile: Dockerfile
dockerfile: Dockerfile
env_file:
- ./src/.env
- .env
depends_on:
- db
- create_superuser
Expand All @@ -93,11 +86,11 @@ services:

#-------- uncomment to create first tier --------
# create_tier:
# build:
# build:
# context: .
# dockerfile: Dockerfile
# env_file:
# - ./src/.env
# - .env
# depends_on:
# - create_superuser
# - db
Expand All @@ -109,4 +102,3 @@ services:
volumes:
postgres-data:
redis-data:

4 changes: 2 additions & 2 deletions scripts/production_with_nginx/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file contains example values for development/testing purposes only.
#
# SECURITY CRITICAL: Before deploying to production, you MUST:
# 1. Copy this file to src/.env
# 1. Copy this file to a .env file at the project root
# 2. Generate a new SECRET_KEY using: openssl rand -hex 32
# 3. Change all passwords (POSTGRES_PASSWORD, ADMIN_PASSWORD, etc.)
# 4. Update all sensitive configuration values
Expand All @@ -20,7 +20,7 @@ CONTACT_NAME="Me"
CONTACT_EMAIL="my.email@example.com"
LICENSE_NAME="MIT"

# ------------- database -------------
# ------------- database -------------
POSTGRES_USER="postgres"
POSTGRES_PASSWORD=1234
POSTGRES_SERVER="db"
Expand Down
Loading