.env.production.sample 9.43 KB
Newer Older
Eugen Rochko's avatar
Eugen Rochko committed
1
# Service dependencies
2
# You may set REDIS_URL instead for more advanced options
3
# You may also set REDIS_NAMESPACE to share Redis between multiple Mastodon servers
4
REDIS_HOST=redis
5
REDIS_PORT=6379
abcang's avatar
abcang committed
6
# You may set DATABASE_URL instead for more advanced options
7 8 9 10 11
DB_HOST=db
DB_USER=postgres
DB_NAME=postgres
DB_PASS=
DB_PORT=5432
12
# Optional ElasticSearch configuration
13
# You may also set ES_PREFIX to share the same cluster between multiple Mastodon servers (falls back to REDIS_NAMESPACE if not set)
14
# ES_ENABLED=true
15
# ES_HOST=es
16
# ES_PORT=9200
Eugen Rochko's avatar
Eugen Rochko committed
17 18

# Federation
19
# Note: Changing LOCAL_DOMAIN at a later time will cause unwanted side effects, including breaking all existing federation.
20
# LOCAL_DOMAIN should *NOT* contain the protocol part of the domain e.g https://example.com.
21
LOCAL_DOMAIN=example.com
22 23

# Changing LOCAL_HTTPS in production is no longer supported. (Mastodon will always serve https:// links)
Eugen Rochko's avatar
Eugen Rochko committed
24

25
# Use this only if you need to run mastodon on a different domain than the one used for federation.
26 27
# You can read more about this option on https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Serving_a_different_domain.md
# DO *NOT* USE THIS UNLESS YOU KNOW *EXACTLY* WHAT YOU ARE DOING.
28 29
# WEB_DOMAIN=mastodon.example.com

30 31 32 33 34
# Use this if you want to have several aliases handler@example1.com
# handler@example2.com etc. for the same user. LOCAL_DOMAIN should not
# be added. Comma separated values
# ALTERNATE_DOMAINS=example1.com,example2.com

Eugen Rochko's avatar
Eugen Rochko committed
35
# Application secrets
36
# Generate each with the `RAILS_ENV=production bundle exec rake secret` task (`docker-compose run --rm web rake secret` if you use docker compose)
37
SECRET_KEY_BASE=
Eugen Rochko's avatar
Eugen Rochko committed
38
OTP_SECRET=
Eugen Rochko's avatar
Eugen Rochko committed
39

40 41 42 43 44
# VAPID keys (used for push notifications
# You can generate the keys using the following command (first is the private key, second is the public one)
# You should only generate this once per instance. If you later decide to change it, all push subscription will
# be invalidated, requiring the users to access the website again to resubscribe.
#
45
# Generate with `RAILS_ENV=production bundle exec rake mastodon:webpush:generate_vapid_key` task (`docker-compose run --rm web rake mastodon:webpush:generate_vapid_key` if you use docker compose)
46 47 48 49 50
#
# For more information visit https://rossta.net/blog/using-the-web-push-api-with-vapid.html
VAPID_PRIVATE_KEY=
VAPID_PUBLIC_KEY=

Eugen Rochko's avatar
Eugen Rochko committed
51 52 53 54 55
# Registrations
# Single user mode will disable registrations and redirect frontpage to the first profile
# SINGLE_USER_MODE=true
# Prevent registrations with following e-mail domains
# EMAIL_DOMAIN_BLACKLIST=example1.com|example2.de|etc
Pete Keen's avatar
Pete Keen committed
56 57
# Only allow registrations with the following e-mail domains
# EMAIL_DOMAIN_WHITELIST=example1.com|example2.de|etc
Eugen Rochko's avatar
Eugen Rochko committed
58

59 60 61
# Optionally change default language
# DEFAULT_LOCALE=de

Eugen Rochko's avatar
Eugen Rochko committed
62
# E-mail configuration
63
# Note: Mailgun and SparkPost (https://sparkpo.st/smtp) each have good free tiers
64
# If you want to use an SMTP server without authentication (e.g local Postfix relay)
65
# then set SMTP_AUTH_METHOD and SMTP_OPENSSL_VERIFY_MODE to 'none' and
66
# *comment* SMTP_LOGIN and SMTP_PASSWORD (leaving them blank is not enough).
Eugen Rochko's avatar
Eugen Rochko committed
67 68 69 70 71
SMTP_SERVER=smtp.mailgun.org
SMTP_PORT=587
SMTP_LOGIN=
SMTP_PASSWORD=
SMTP_FROM_ADDRESS=notifications@example.com
72
#SMTP_REPLY_TO=
73
#SMTP_DOMAIN= # defaults to LOCAL_DOMAIN
James Moore's avatar
James Moore committed
74
#SMTP_DELIVERY_METHOD=smtp # delivery method can also be sendmail
75
#SMTP_AUTH_METHOD=plain
76
#SMTP_CA_FILE=/etc/ssl/certs/ca-certificates.crt
77 78
#SMTP_OPENSSL_VERIFY_MODE=peer
#SMTP_ENABLE_STARTTLS_AUTO=true
79
#SMTP_TLS=true
80

81 82 83 84
# Optional user upload path and URL (images, avatars). Default is :rails_root/public/system. If you set this variable, you are responsible for making your HTTP server (eg. nginx) serve these files.
# PAPERCLIP_ROOT_PATH=/var/lib/mastodon/public-system
# PAPERCLIP_ROOT_URL=/system

85
# Optional asset host for multi-server setups
86 87 88 89
# The asset host must allow cross origin request from WEB_DOMAIN or LOCAL_DOMAIN
# if WEB_DOMAIN is not set. For example, the server may have the
# following header field:
# Access-Control-Allow-Origin: https://example.com/
90
# CDN_HOST=https://assets.example.com
91 92

# S3 (optional)
93 94 95 96
# The attachment host must allow cross origin request from WEB_DOMAIN or
# LOCAL_DOMAIN if WEB_DOMAIN is not set. For example, the server may have the
# following header field:
# Access-Control-Allow-Origin: https://192.168.1.123:9000/
Eugen Rochko's avatar
Eugen Rochko committed
97 98 99 100 101
# S3_ENABLED=true
# S3_BUCKET=
# AWS_ACCESS_KEY_ID=
# AWS_SECRET_ACCESS_KEY=
# S3_REGION=
leopku's avatar
leopku committed
102 103
# S3_PROTOCOL=http
# S3_HOSTNAME=192.168.1.123:9000
Eugen Rochko's avatar
Eugen Rochko committed
104

105
# S3 (Minio Config (optional) Please check Minio instance for details)
106 107
# The attachment host must allow cross origin request - see the description
# above.
108 109 110 111 112 113 114 115
# S3_ENABLED=true
# S3_BUCKET=
# AWS_ACCESS_KEY_ID=
# AWS_SECRET_ACCESS_KEY=
# S3_REGION=
# S3_PROTOCOL=https
# S3_HOSTNAME=
# S3_ENDPOINT=
116
# S3_SIGNATURE_VERSION=
117

118 119 120 121 122 123 124 125 126 127 128 129 130 131
# Google Cloud Storage (optional)
# Use S3 compatible API. Since GCS does not support Multipart Upload,
# increase the value of S3_MULTIPART_THRESHOLD to disable Multipart Upload.
# The attachment host must allow cross origin request - see the description
# above.
# S3_ENABLED=true
# AWS_ACCESS_KEY_ID=
# AWS_SECRET_ACCESS_KEY=
# S3_REGION=
# S3_PROTOCOL=https
# S3_HOSTNAME=storage.googleapis.com
# S3_ENDPOINT=https://storage.googleapis.com
# S3_MULTIPART_THRESHOLD=52428801 # 50.megabytes

132
# Swift (optional)
133 134
# The attachment host must allow cross origin request - see the description
# above.
135 136
# SWIFT_ENABLED=true
# SWIFT_USERNAME=
137
# For Keystone V3, the value for SWIFT_TENANT should be the project name
138 139
# SWIFT_TENANT=
# SWIFT_PASSWORD=
140 141
# Some OpenStack V3 providers require PROJECT_ID (optional)
# SWIFT_PROJECT_ID=
142 143
# Keystone V2 and V3 URLs are supported. Use a V3 URL if possible to avoid
# issues with token rate-limiting during high load.
144 145 146
# SWIFT_AUTH_URL=
# SWIFT_CONTAINER=
# SWIFT_OBJECT_URL=
147 148 149 150 151
# SWIFT_REGION=
# Defaults to 'default'
# SWIFT_DOMAIN_NAME=
# Defaults to 60 seconds. Set to 0 to disable
# SWIFT_CACHE_TTL=
152

153 154
# Optional alias for S3 (e.g. to serve files on a custom domain, possibly using Cloudfront or Cloudflare)
# S3_ALIAS_HOST=
Eugen Rochko's avatar
Eugen Rochko committed
155

156 157
# Streaming API integration
# STREAMING_API_BASE_URL=
158 159 160 161

# Advanced settings
# If you need to use pgBouncer, you need to disable prepared statements:
# PREPARED_STATEMENTS=false
162 163 164 165

# Cluster number setting for streaming API server.
# If you comment out following line, cluster number will be `numOfCpuCores - 1`.
STREAMING_CLUSTER_NUM=1
166 167 168 169 170

# Docker mastodon user
# If you use Docker, you may want to assign UID/GID manually.
# UID=1000
# GID=1000
171

172 173 174 175 176 177 178 179 180
# LDAP authentication (optional)
# LDAP_ENABLED=true
# LDAP_HOST=localhost
# LDAP_PORT=389
# LDAP_METHOD=simple_tls
# LDAP_BASE=
# LDAP_BIND_DN=
# LDAP_PASSWORD=
# LDAP_UID=cn
181 182
# LDAP_MAIL=mail
# LDAP_SEARCH_FILTER=(|(%{uid}=%{email})(%{mail}=%{email}))
183 184 185
# LDAP_UID_CONVERSION_ENABLED=true
# LDAP_UID_CONVERSION_SEARCH=., -
# LDAP_UID_CONVERSION_REPLACE=_
186

187
# PAM authentication (optional)
Alexander's avatar
Alexander committed
188 189 190 191
# PAM authentication uses for the email generation the "email" pam variable
# and optional as fallback PAM_DEFAULT_SUFFIX
# The pam environment variable "email" is provided by:
# https://github.com/devkral/pam_email_extractor
192
# PAM_ENABLED=true
193 194
# Fallback email domain for email address generation (LOCAL_DOMAIN by default)
# PAM_EMAIL_DOMAIN=example.com
195 196
# Name of the pam service (pam "auth" section is evaluated)
# PAM_DEFAULT_SERVICE=rpam
197
# Name of the pam service used for checking if an user can register (pam "account" section is evaluated) (nil (disabled) by default)
198 199
# PAM_CONTROLLED_SERVICE=rpam

200 201 202 203
# Global OAuth settings (optional) :
# If you have only one strategy, you may want to enable this
# OAUTH_REDIRECT_AT_SIGN_IN=true

204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
# Optional CAS authentication (cf. omniauth-cas) :
# CAS_ENABLED=true
# CAS_URL=https://sso.myserver.com/
# CAS_HOST=sso.myserver.com/
# CAS_PORT=443
# CAS_SSL=true
# CAS_VALIDATE_URL=
# CAS_CALLBACK_URL=
# CAS_LOGOUT_URL=
# CAS_LOGIN_URL=
# CAS_UID_FIELD='user'
# CAS_CA_PATH=
# CAS_DISABLE_SSL_VERIFICATION=false
# CAS_UID_KEY='user'
# CAS_NAME_KEY='name'
# CAS_EMAIL_KEY='email'
# CAS_NICKNAME_KEY='nickname'
# CAS_FIRST_NAME_KEY='firstname'
# CAS_LAST_NAME_KEY='lastname'
# CAS_LOCATION_KEY='location'
# CAS_IMAGE_KEY='image'
# CAS_PHONE_KEY='phone'

# Optional SAML authentication (cf. omniauth-saml)
# SAML_ENABLED=true
229 230
# SAML_ACS_URL=http://localhost:3000/auth/auth/saml/callback
# SAML_ISSUER=https://example.com
231 232 233 234 235 236 237 238
# SAML_IDP_SSO_TARGET_URL=https://idp.testshib.org/idp/profile/SAML2/Redirect/SSO
# SAML_IDP_CERT=
# SAML_IDP_CERT_FINGERPRINT=
# SAML_NAME_IDENTIFIER_FORMAT=
# SAML_CERT=
# SAML_PRIVATE_KEY=
# SAML_SECURITY_WANT_ASSERTION_SIGNED=true
# SAML_SECURITY_WANT_ASSERTION_ENCRYPTED=true
239
# SAML_SECURITY_ASSUME_EMAIL_IS_VERIFIED=true
240 241
# SAML_ATTRIBUTES_STATEMENTS_UID="urn:oid:0.9.2342.19200300.100.1.1"
# SAML_ATTRIBUTES_STATEMENTS_EMAIL="urn:oid:1.3.6.1.4.1.5923.1.1.1.6"
242 243 244
# SAML_ATTRIBUTES_STATEMENTS_FULL_NAME="urn:oid:2.16.840.1.113730.3.1.241"
# SAML_ATTRIBUTES_STATEMENTS_FIRST_NAME="urn:oid:2.5.4.42"
# SAML_ATTRIBUTES_STATEMENTS_LAST_NAME="urn:oid:2.5.4.4"
245
# SAML_UID_ATTRIBUTE="urn:oid:0.9.2342.19200300.100.1.1"
246 247
# SAML_ATTRIBUTES_STATEMENTS_VERIFIED=
# SAML_ATTRIBUTES_STATEMENTS_VERIFIED_EMAIL=
248 249 250 251 252

# Use HTTP proxy for outgoing request (optional)
# http_proxy=http://gateway.local:8118
# Access control for hidden service.
# ALLOW_ACCESS_TO_HIDDEN_SERVICE=true
253 254 255 256 257 258 259 260 261 262

# Authorized fetch mode (optional)
# Require remote servers to authentify when fetching toots, see
# https://docs.joinmastodon.org/admin/config/#authorized_fetch
# AUTHORIZED_FETCH=true

# Whitelist mode (optional)
# Only allow federation with whitelisted domains, see
# https://docs.joinmastodon.org/admin/config/#whitelist_mode
# WHITELIST_MODE=true