TinyauthTinyauth

Configuration

Reference on Tinyauth's configuration.

Tinyauth can be configured using environment variables or CLI flags. The table below provides a comprehensive list of configuration options.

Configuration options with a FILE_ equivalent (e.g., USERS and USERS_FILE) allow the FILE_ environment variable or CLI flag to be used as an alternative.

General

EnvironmentFlagDescriptionDefaultRequired
ADDRESS--addressAddress to bind the server to.0.0.0.0no
APP_TITLE--app-titleTitle of the app.Tinyauthno
APP_URL--app-urlThe Tinyauth URL.``yes
BACKGROUND_IMAGE--background-imageBackground image URL for the login page./background.jpgno
DATABASE_PATH--database-pathPath to the SQLite database file./data/tinyauth.dbno
DISABLE_ANALYTICS--disable-analyticsDisable anonymous version collection.falseno
DISABLE_RESOURCES--disable-resourcesDisable the resources server.falseno
FORGOT_PASSWORD_MESSAGE--forgot-password-messageMessage to show on the forgot password page.``no
LOG_LEVEL--log-levelLog level (trace, debug, info, warn, error, fatal, panic).infono
LOGIN_MAX_RETRIES--login-max-retriesMaximum login attempts before timeout (0 to disable).5no
LOGIN_TIMEOUT--login-timeoutLogin timeout in seconds after max retries reached (0 to disable).300no
OAUTH_AUTO_REDIRECT--oauth-auto-redirectAuto redirect to the specified OAuth provider.``no
OAUTH_WHITELIST--oauth-whitelistComma-separated list of email addresses to whitelist when using OAuth.``no
PORT--portPort to run the server on.3000no
RESOURCES_DIR--resources-dirPath to a directory containing custom resources (e.g., background image)./data/resourcesno
SECURE_COOKIE--secure-cookieSend cookie over secure connection only.falseno
SESSION_EXPIRY--session-expirySession (cookie) expiration time in seconds.86400no
TRUSTED_PROXIES--trusted-proxiesComma-separated list of trusted proxies (IP addresses or CIDRs) for correct client IP detection.``no
USERS--usersComma-separated list of users in the format username:hash.``yes
USERS_FILE--users-filePath to a file containing users in the format username:hash.``no

The trace log level will log sensitive information such as usernames, emails and access controls. Use with caution.

OAuth Config

OAuth configuration includes a provider ID in the environment variable or flag name. For example, PROVIDERS_GOOGLE_CLIENT_ID.

EnvironmentFlagDescriptionDefaultRequired
PROVIDERS_[ID]_AUTH_URL--providers-[id]-auth-urlOAuth authorization URL.``yes
PROVIDERS_[ID]_CLIENT_ID--providers-[id]-client-idOAuth client ID.``yes
PROVIDERS_[ID]_CLIENT_SECRET--providers-[id]-client-secretOAuth client secret.``yes
PROVIDERS_[ID]_CLIENT_SECRET_FILE--providers-[id]-client-secret-filePath to a file containing client secret.``no
PROVIDERS_[ID]_INSECURE_SKIP_VERIFY--providers-[id]-insecure-skip-verifySkip TLS certificate verification.``no
PROVIDERS_[ID]_NAME--providers-[id]-nameName of the OAuth provider.``no
PROVIDERS_[ID]_REDIRECT_URL--providers-[id]-redirect-urlOAuth redirect URL.``yes
PROVIDERS_[ID]_SCOPES--providers-[id]-scopesList of OAuth scopes.``yes
PROVIDERS_[ID]_TOKEN_URL--providers-[id]-token-urlOAuth token URL.``yes
PROVIDERS_[ID]_USER_INFO_URL--providers-[id]-user-info-urlURL to fetch user info.``yes

Using google or github as provider IDs, triggers automatic filling of the required information (e.g., redirect URL, scopes). You will only have to provide the client ID and secret.

LDAP Config

EnvironmentFlagDescriptionDefaultRequired
LDAP_ADDRESS--ldap-addressLDAP server address (e.g., ldap://localhost:389).``no
LDAP_BASE_DN--ldap-base-dnLDAP base DN (e.g., dc=example,dc=com).``no
LDAP_BIND_DN--ldap-bind-dnLDAP bind DN (e.g., uid=user,dc=example,dc=com).``no
LDAP_BIND_PASSWORD--ldap-bind-passwordLDAP bind password.``no
LDAP_INSECURE--ldap-insecureSkip certificate verification for the LDAP server.falseno
LDAP_SEARCH_FILTER--ldap-search-filterLDAP search filter for user lookup.(uid=%s)no

For Windows LDAP, use the following search filter: (&(sAMAccountName=%s)).