configuration.md 3.79 KB
Newer Older
Eugen Rochko's avatar
Eugen Rochko committed
1 2
---
title: Configuration
3
description: Overview of Mastodon's configuration options
Eugen Rochko's avatar
Eugen Rochko committed
4 5 6 7 8 9
menu:
  docs:
    parent: administration
    weight: 2
---

Eugen Rochko's avatar
Eugen Rochko committed
10 11 12 13
Mastodon uses environment variables as its configuration.

For convenience, it can read them from a flat file called `.env.production` in the Mastodon directory, but they can always be overridden by a specific process. For example, systemd service files can read environment variables from an `EnvironmentFile` or from inline definitions with `Environment`, so you can have different configuration parameters for specific services. They can also be specified when calling Mastodon from the command line.

Eugen Rochko's avatar
Eugen Rochko committed
14 15
## Basic
### Federation
Eugen Rochko's avatar
Eugen Rochko committed
16 17 18 19 20

- `LOCAL_DOMAIN`
- `WEB_DOMAIN`
- `ALTERNATE_DOMAINS`

Eugen Rochko's avatar
Eugen Rochko committed
21
### Secrets
Eugen Rochko's avatar
Eugen Rochko committed
22 23 24 25 26 27

- `SECRET_KEY_BASE`
- `OTP_SECRET`
- `VAPID_PRIVATE_KEY`
- `VAPID_PUBLIC_KEY`

Eugen Rochko's avatar
Eugen Rochko committed
28 29 30 31 32 33 34 35 36 37 38
### Deployment

- `RAILS_ENV`
- `RAILS_SERVE_STATIC_FILES`
- `RAILS_LOG_LEVEL`
- `TRUSTED_PROXY_IP`
- `SOCKET`
- `PORT`
- `NODE_ENV`
- `BIND`

Eugen Rochko's avatar
Eugen Rochko committed
39 40 41 42 43 44 45 46
### Scaling options

- `WEB_CONCURRENCY`
- `MAX_THREADS`
- `PREPARED_STATEMENTS`
- `STREAMING_API_BASE_URL`
- `STREAMING_CLUSTER_NUM`

Eugen Rochko's avatar
Eugen Rochko committed
47 48
## Database connections
### PostgreSQL
Eugen Rochko's avatar
Eugen Rochko committed
49 50 51 52 53 54 55 56

- `DB_HOST`
- `DB_USER`
- `DB_NAME`
- `DB_PASS`
- `DB_PORT`
- `DATABASE_URL`

Eugen Rochko's avatar
Eugen Rochko committed
57
### Redis
Eugen Rochko's avatar
Eugen Rochko committed
58 59 60 61 62 63 64 65 66 67

- `REDIS_HOST`
- `REDIS_PORT`
- `REDIS_URL`
- `REDIS_NAMESPACE`
- `CACHE_REDIS_HOST`
- `CACHE_REDIS_PORT`
- `CACHE_REDIS_URL`
- `CACHE_REDIS_NAMESPACE`

Eugen Rochko's avatar
Eugen Rochko committed
68
### ElasticSearch
Eugen Rochko's avatar
Eugen Rochko committed
69 70 71 72

- `ES_ENABLED`
- `ES_HOST`
- `ES_PORT`
Eugen Rochko's avatar
Eugen Rochko committed
73 74 75 76 77 78
- `ES_PREFIX`

### StatsD

- `STATSD_ADDR`
- `STATSD_NAMESPACE`
Eugen Rochko's avatar
Eugen Rochko committed
79 80 81 82 83 84

## Limits

- `SINGLE_USER_MODE`
- `EMAIL_DOMAIN_WHITELIST`
- `DEFAULT_LOCALE`
Eugen Rochko's avatar
Eugen Rochko committed
85 86
- `MAX_SESSION_ACTIVATIONS`
- `USER_ACTIVE_DAYS`
Eugen Rochko's avatar
Eugen Rochko committed
87

Eugen Rochko's avatar
Eugen Rochko committed
88
## E-mail
Eugen Rochko's avatar
Eugen Rochko committed
89 90 91 92 93 94 95 96 97 98 99 100 101 102

- `SMTP_SERVER`
- `SMTP_PORT`
- `SMTP_LOGIN`
- `SMTP_PASSWORD`
- `SMTP_FROM_ADDRESS`
- `SMTP_DOMAIN`
- `SMTP_DELIVERY_METHOD`
- `SMTP_AUTH_METHOD`
- `SMTP_CA_FILE`
- `SMTP_OPENSSL_VERIFY_MODE`
- `SMTP_ENABLE_STARTTLS_AUTO`
- `SMTP_TLS`

Eugen Rochko's avatar
Eugen Rochko committed
103
## File storage
Eugen Rochko's avatar
Eugen Rochko committed
104 105 106 107

- `CDN_HOST`
- `S3_ALIAS_HOST`

Eugen Rochko's avatar
Eugen Rochko committed
108
### Local file storage
Eugen Rochko's avatar
Eugen Rochko committed
109 110 111 112

- `PAPERCLIP_ROOT_PATH`
- `PAPERCLIP_ROOT_URL`

Eugen Rochko's avatar
Eugen Rochko committed
113
### Amazon S3 and compatible
Eugen Rochko's avatar
Eugen Rochko committed
114 115 116 117 118 119 120 121 122 123 124

- `S3_ENABLED`
- `S3_BUCKET`
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
- `S3_REGION`
- `S3_PROTOCOL`
- `S3_HOSTNAME`
- `S3_ENDPOINT`
- `S3_SIGNATURE_VERSION`

Eugen Rochko's avatar
Eugen Rochko committed
125
### Swift
Eugen Rochko's avatar
Eugen Rochko committed
126 127 128 129 130 131 132 133 134 135 136 137 138

- `SWIFT_ENABLED`
- `SWIFT_USERNAME`
- `SWIFT_TENANT`
- `SWIFT_PASSWORD`
- `SWIFT_PROJECT_ID`
- `SWIFT_AUTH_URL`
- `SWIFT_CONTAINER`
- `SWIFT_OBJECT_URL`
- `SWIFT_REGION`
- `SWIFT_DOMAIN_NAME`
- `SWIFT_CACHE_TTL`

Eugen Rochko's avatar
Eugen Rochko committed
139
## External authentication
Eugen Rochko's avatar
Eugen Rochko committed
140 141 142

- `OAUTH_REDIRECT_AT_SIGN_IN`

Eugen Rochko's avatar
Eugen Rochko committed
143
### LDAP
Eugen Rochko's avatar
Eugen Rochko committed
144 145 146 147 148 149 150 151 152 153 154

- `LDAP_ENABLED`
- `LDAP_HOST`
- `LDAP_PORT`
- `LDAP_METHOD`
- `LDAP_BASE`
- `LDAP_BIND_DN`
- `LDAP_PASSWORD`
- `LDAP_UID`
- `LDAP_SEARCH_FILTER`

Eugen Rochko's avatar
Eugen Rochko committed
155
### PAM
Eugen Rochko's avatar
Eugen Rochko committed
156 157 158 159 160 161

- `PAM_ENABLED`
- `PAM_EMAIL_DOMAIN`
- `PAM_DEFAULT_SERVICE`
- `PAM_CONTROLLED_SERVICE`

Eugen Rochko's avatar
Eugen Rochko committed
162
### CAS
Eugen Rochko's avatar
Eugen Rochko committed
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185

- `CAS_ENABLED`
- `CAS_URL`
- `CAS_HOST`
- `CAS_PORT`
- `CAS_SSL`
- `CAS_VALIDATE_URL`
- `CAS_CALLBACK_URL`
- `CAS_LOGOUT_URL`
- `CAS_LOGIN_URL`
- `CAS_UID_FIELD`
- `CAS_CA_PATH`
- `CAS_DISABLE_SSL_VERIFICATION`
- `CAS_UID_KEY`
- `CAS_NAME_KEY`
- `CAS_EMAIL_KEY`
- `CAS_NICKNAME_KEY`
- `CAS_FIRST_NAME_KEY`
- `CAS_LAST_NAME_KEY`
- `CAS_LOCATION_KEY`
- `CAS_IMAGE_KEY`
- `CAS_PHONE_KEY`

Eugen Rochko's avatar
Eugen Rochko committed
186
### SAML
Eugen Rochko's avatar
Eugen Rochko committed
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208

- `SAML_ENABLED`
- `SAML_ACS_URL`
- `SAML_ISSUER`
- `SAML_IDP_SSO_TARGET_URL`
- `SAML_IDP_CERT`
- `SAML_IDP_CERT_FINGERPRINT`
- `SAML_NAME_IDENTIFIER_FORMAT`
- `SAML_CERT`
- `SAML_PRIVATE_KEY`
- `SAML_SECURITY_WANT_ASSERTION_SIGNED`
- `SAML_SECURITY_WANT_ASSERTION_ENCRYPTED`
- `SAML_SECURITY_ASSUME_EMAIL_IS_VERIFIED`
- `SAML_ATTRIBUTES_STATEMENTS_UID`
- `SAML_ATTRIBUTES_STATEMENTS_EMAIL`
- `SAML_ATTRIBUTES_STATEMENTS_FULL_NAME`
- `SAML_ATTRIBUTES_STATEMENTS_FIRST_NAME`
- `SAML_ATTRIBUTES_STATEMENTS_LAST_NAME`
- `SAML_UID_ATTRIBUTE`
- `SAML_ATTRIBUTES_STATEMENTS_VERIFIED`
- `SAML_ATTRIBUTES_STATEMENTS_VERIFIED_EMAIL`

Eugen Rochko's avatar
Eugen Rochko committed
209
## Hidden services
Eugen Rochko's avatar
Eugen Rochko committed
210 211 212

- `http_proxy`
- `ALLOW_ACCESS_TO_HIDDEN_SERVICE`
Eugen Rochko's avatar
Eugen Rochko committed
213 214 215 216

## Other

- `SKIP_POST_DEPLOYMENT_MIGRATIONS`