summaryrefslogtreecommitdiff
path: root/.env.example
diff options
context:
space:
mode:
authorhaturatu <taro@eyes4you.org>2025-10-12 18:52:35 +0900
committerhaturatu <taro@eyes4you.org>2025-10-12 18:52:35 +0900
commit0cf0d195218fc289f2a04db5535d8fbbd96c988c (patch)
treee5d1911b7e0aae157b3cd93719a4f547ca88a965 /.env.example
parent957dc75eddf69ccf26bd387828b9e205a5425f30 (diff)
add: php support
- ja doc
Diffstat (limited to '.env.example')
-rw-r--r--.env.example66
1 files changed, 66 insertions, 0 deletions
diff --git a/.env.example b/.env.example
new file mode 100644
index 0000000..0d60870
--- /dev/null
+++ b/.env.example
@@ -0,0 +1,66 @@
+# --- Required ---
+# The URL of the backend service you want to protect
+TARGET_URL=http://localhost:8081
+
+# A long, random string for securing session cookies and JWTs
+# For production, generate a new key using: openssl rand -base64 45
+SESSION_SECRET=
+
+# --- Database ---
+# Use ONE of the following options:
+
+# Option 1: PostgreSQL or MySQL (Recommended)
+# Example: postgres://user:password@host:port/dbname?sslmode=disable
+# Example: mysql://user:password@tcp(host:port)/dbname?charset=utf8mb4&parseTime=true
+# DATABASE_URL=
+
+# Option 2: SQLite (Default if DATABASE_URL is not set)
+DATABASE_PATH=./auth.db
+
+# --- Frontend & Proxy ---
+# Frontend mode: "js" (default) or "php"
+FRONTEND_TYPE=js
+# If true, protects the frontend path with session authentication
+PROTECT_FRONTEND=false
+# If true, protects the API path with bearer token authentication
+PROTECT_API=false
+# Base path for frontend routes to be protected
+FRONT_PATH=/
+# Base path for API routes to be protected
+API_PATH=/api/
+
+# --- Security Policies ---
+
+# Brute-force protection settings
+MAX_LOGIN_ATTEMPTS=5
+LOCKOUT_DURATION_MINUTES=10
+
+# User creation rate limit settings
+USER_CREATION_RATE_LIMIT_MAX_REQUESTS=5
+USER_CREATION_RATE_LIMIT_WINDOW_SECONDS=3600
+
+# Password policy (none, standard, enhanced, strict)
+PASSWORD_POLICY=standard
+
+# --- Token Durations ---
+# Duration for the web session cookie
+TOKEN_DURATION_HOURS=24
+# Duration for the API JWT access token
+ACCESS_TOKEN_DURATION_MINUTES=15
+# Duration for the API JWT refresh token
+REFRESH_TOKEN_DURATION_DAYS=7
+
+# --- PHP Frontend Settings (only needed if FRONTEND_TYPE=php) ---
+# PHP_FPM_SOCKET=/run/php-fpm/php-fpm.sock
+# PHP_DOC_ROOT=
+
+# --- Optional: Path Overrides ---
+# Uncomment and change these to avoid URL conflicts with your backend application.
+# AUTH_PATH_LOGIN=/login
+# AUTH_PATH_REGISTER=/register
+# AUTH_PATH_LOGOUT=/logout
+# AUTH_PATH_ACCOUNT=/account
+# AUTH_PATH_ACCOUNT_PASSWORD=/account/password
+# AUTH_PATH_ADMIN=/admin
+# AUTH_PATH_ADMIN_USERS_API=/api/admin/users
+# AUTH_ASSETS_PATH=/assets