diff --git a/.editorconfig b/.editorconfig index a05ab45..733c9cf 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,20 @@ +# editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + [Caddyfile] indent_style = tab +[{compose.yaml,compose.*.yaml}] +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/.env b/.env new file mode 100644 index 0000000..84f4042 --- /dev/null +++ b/.env @@ -0,0 +1,16 @@ +# In all environments, the following files are loaded if they exist, +# the latter taking precedence over the former: +# +# * .env contains default values for the environment variables needed by the app +# * .env.local uncommitted file with local overrides +# * .env.$APP_ENV committed environment-specific defaults +# * .env.$APP_ENV.local uncommitted environment-specific overrides +# +# Real environment variables win over .env files. +# +# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. +# https://symfony.com/doc/current/configuration/secrets.html +# +# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). +# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration + diff --git a/.env.dev b/.env.dev new file mode 100644 index 0000000..ddb0d12 --- /dev/null +++ b/.env.dev @@ -0,0 +1,13 @@ + +###> symfony/framework-bundle ### +APP_ENV=dev +APP_SECRET=f88a1074691c40415be4439345b79f69 +APP_SHARE_DIR=var/share +###< symfony/framework-bundle ### + +###> symfony/routing ### +# Configure how to generate URLs in non-HTTP contexts, such as CLI commands. +# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands +DEFAULT_URI=http://localhost +###< symfony/routing ### + diff --git a/.env.example b/.env.example index daeaa3e..dd89f55 100644 --- a/.env.example +++ b/.env.example @@ -1,37 +1,65 @@ -# required, if missing will generate random values -# encryption key used to store sessions (static random bytes) in base64 -PREAUTH_KEY='' -# TOTP (RFC 6238) secret/token (static random bytes) in base32 -PREAUTH_TOKEN='' +# --- Main Options --- -# optional, change time-to-live, subdomain, default-redirect, text or colors -# how long a session lasts (in minutes): 43200 is 30 days -PREAUTH_TTL=43200 -PREAUTH_SUBDOMAIN='preauth' -PREAUTH_SEND_TO='https://secure.example.com/' -PREAUTH_BACKGROUND='#029386' -PREAUTH_FOREGROUND='#ffffff' -PREAUTH_TITLE='Pre-Authentication System' -PREAUTH_ID_NAME='Session ID' -PREAUTH_TOKEN_NAME='Authentication Token' -PREAUTH_SUBMIT_NAME='Submit' -# how many consecutive failed login attempts before we block them (a remote-ip) -PREAUTH_RATE_LIMIT=4 -# maximum time between failed login attempts to still be consecutive (in minutes): 360 is 6 hours -PREAUTH_RATE_TIMEOUT=360 -# how long after last failed login will they be blocked (in minutes): 1440 is 24 hours -PREAUTH_RATE_BLOCKED=1440 -# what do we show when they get rate-limited -PREAUTH_DENIED_CODE=418 -PREAUTH_DENIED_TITLE="I'm a teapot" -PREAUTH_DENIED_MESSAGE='I refuse to brew coffee.' -# alternatively, you could use a more standard response -#PREAUTH_DENIED_CODE=429 -#PREAUTH_DENIED_TITLE='Too Many Requests' -#PREAUTH_DENIED_MESSAGE='Try again later.' +# URI containing secret and config for TOTP, which determines the token to login +# app will generate one, if not provided, but you should copy it to your .env file +# format: "otpauth://totp/