2022-06-15 07:51:47 +00:00
---
title: "Common"
description: "Common configuration options and notations."
lead: "This section details common configuration elements within the Authelia configuration. This section is mainly used as a reference for other sections as necessary."
2022-06-28 05:27:14 +00:00
date: 2022-06-15T17:51:47+10:00
2022-06-15 07:51:47 +00:00
draft: false
images: []
menu:
configuration:
parent: "prologue"
weight: 100200
toc: true
aliases:
- /c/common
---
2023-05-07 05:48:26 +00:00
## Syntax
2022-06-15 07:51:47 +00:00
2023-05-07 05:48:26 +00:00
The following represent common syntax used within the configuration which have specific format requirements that are
used in multiple areas. This is intended on assisting in understanding these specific values, and not as a specific
guide on configuring any particular instance.
### Duration
The base type for this syntax is a string, and it also handles integers however this is discouraged.
2023-05-08 03:51:17 +00:00
If you supply an integer, it is considered a representation of seconds. If you supply a string, it parses the string in
blocks of quantities and units (number followed by a unit letter). For example `5h` indicates a quantity of 5 units
of `h` .
2022-06-15 07:51:47 +00:00
2023-02-11 03:11:40 +00:00
The following is ignored:
- all spaces
- leading zeros
2022-07-18 10:15:11 +00:00
While you can use multiple of these blocks in combination, we suggest keeping it simple and use a single value.
2022-06-15 07:51:47 +00:00
2023-05-07 05:48:26 +00:00
#### Unit Legend
2022-06-15 07:51:47 +00:00
2023-05-07 05:48:26 +00:00
##### Short Units
2023-02-11 03:11:40 +00:00
These values have been available for a long time.
2022-06-15 07:51:47 +00:00
| Unit | Associated Letter |
|:-------:|:-----------------:|
| Years | y |
| Months | M |
| Weeks | w |
| Days | d |
| Hours | h |
| Minutes | m |
| Seconds | s |
2023-05-07 05:48:26 +00:00
##### Long Units
2023-02-11 03:11:40 +00:00
These values are more human readable but have only been available since v4.38.0.
| Unit | Human Readable Long Unit |
|:------------:|:-----------------------------:|
| Years | `year` , `years` |
| Months | `month` , `months` |
| Weeks | `week` , `weeks` |
| Days | `day` , `days` |
| Hours | `hour` , `hours` |
| Minutes | `minute` , `minutes` |
| Seconds | `second` , `seconds` |
| Milliseconds | `millisecond` , `milliseconds` |
2023-05-07 05:48:26 +00:00
#### Examples
2022-06-15 07:51:47 +00:00
| Desired Value | Configuration Examples |
|:---------------------:|:-------------------------------------:|
| 1 hour and 30 minutes | `90m` or `1h30m` or `5400` or `5400s` |
| 1 day | `1d` or `24h` or `86400` or `86400s` |
| 10 hours | `10h` or `600m` or `9h60m` or `36000` |
2023-05-07 05:48:26 +00:00
### Address
The base type for this syntax is a string.
2023-05-07 06:39:17 +00:00
The address type is a string that indicates how to configure a listener (i.e. listening for connections) or connector
(i.e. opening remote connections), which are the two primary categories of addresses.
2022-07-05 04:43:12 +00:00
2023-05-07 06:39:17 +00:00
#### Format
This section outlines the format for these strings. The formats use a conventional POSIX format to indicate optional and
required elements. The square brackets `[]` surround optional portions, and the angled brackets `<>` surround required
portions. Required portions may exist within optional portions, in which case they are often accompanied with other
format specific text which indicates if the accompanying text exists then it is actually required, otherwise it's
entirely optional.
2023-05-08 03:51:17 +00:00
The square brackets indicate optional sections, and the angled brackets indicate required sections. The following
sections elaborate on this. Sections may only be optional for the purposes of parsing, there may be a configuration
requirement that one of these is provided.
##### Hostname
The following format represents the hostname format. It's valid for both a listener and connector in most instances.
Refer to the individual documentation for an option for clarity. In this format as per the notation the scheme and port
are optional. The default for these when not provided varies.
2022-07-05 04:43:12 +00:00
```text
2023-05-07 05:48:26 +00:00
[< scheme > ://]< hostname > [:< port > ]
2022-07-05 04:43:12 +00:00
```
2023-05-08 03:51:17 +00:00
##### Port
The following format represents the port format. It's valid only for a listener in most instances.
Refer to the individual documentation for an option for clarity. In this format as per the notation the scheme and
hostname are optional. The default for the scheme when not provided varies, and the default for the hostname is all
available addresses when not provided.
2023-05-07 06:39:17 +00:00
```text
2023-05-08 03:51:17 +00:00
[< scheme > ://][hostname]:< port >
2023-05-07 06:39:17 +00:00
```
2023-05-08 03:51:17 +00:00
##### Unix Domain Socket
The following format represents the unix domain socket format. It's valid for both a listener and connector in most
instances. Refer to the individual documentation for an option for clarity. In this format as per the notation there
are no optional portions.
```text
unix://< path >
```
##### Examples
Various examples for these formats.
2023-05-07 05:48:26 +00:00
```text
0.0.0.0
tcp://0.0.0.0
tcp://0.0.0.0:9091
tcp://:9091
0.0.0.0:9091
udp://0.0.0.0:123
udp://:123
unix:///var/lib/authelia.sock
```
2022-07-05 04:43:12 +00:00
2023-05-07 06:39:17 +00:00
#### scheme
2022-07-05 04:43:12 +00:00
The entire scheme is optional, but if the scheme host delimiter `://` is in the string, the scheme must be present. The
2023-05-07 05:48:26 +00:00
scheme must be one of the following (the listeners and connectors columns indicate support for the scheme on the
respective address type):
| Scheme | Listeners | Connectors | Default Port | Notes |
|:-------------:|:---------:|:----------:|:------------:|:-------------------------------------------------------------------------:|
| `tcp` | Yes | Yes | N/A | Standard TCP Socket which allows IPv4 and/or IPv6 addresses |
| `tcp4` | Yes | Yes | N/A | Standard TCP Socket which allows only IPv4 addresses |
| `tcp6` | Yes | Yes | N/A | Standard TCP Socket which allows only IPv6 addresses |
| `udp` | Yes | Yes | N/A | Standard UDP Socket which allows IPv4 and/or IPv6 addresses |
| `udp4` | Yes | Yes | N/A | Standard UDP Socket which allows only IPv4 addresses |
| `udp6` | Yes | Yes | N/A | Standard UDP Socket which allows only IPv6 addresses |
| `unix` | Yes | Yes | N/A | Standard Unix Domain Socket which allows only absolute paths |
| `ldap` | No | Yes | 389 | Remote LDAP connection via TCP with implicit TLS via StartTLS |
| `ldaps` | No | Yes | 636 | Remote LDAP connection via TCP with explicit TLS |
| `ldapi` | No | Yes | N/A | LDAP connection via Unix Domain Socket |
| `smtp` | No | Yes | 25 | Remote SMTP connection via TCP using implicit TLS via StartTLS |
| `submission` | No | Yes | 587 | Remote SMTP Submission connection via TCP using implicit TLS via StartTLS |
| `submissions` | No | Yes | 465 | Remote SMTP Submission connection via TCP using explicit TLS |
If the scheme is absent, the default scheme is assumed. If the address has a `/` prefix it's assumed to be `unix` ,
otherwise it's assumed to be`tcp`. If the scheme is `unix` it must be suffixed with an absolute path i.e.
`/var/local/authelia.sock` would be represented as `unix:///var/run/authelia.sock` .
2023-05-07 06:39:17 +00:00
#### hostname
2023-05-07 05:48:26 +00:00
The hostname is required if the scheme is one of the `tcp` or `udp` schemes and there is no [port ](#port ) specified. It
can be any IP that is locally addressable or a hostname which resolves to a locally addressable IP.
If specifying an IPv6 it should be wrapped in square brackets. For example for the IPv6 address `::1` with the `tcp`
scheme and port `80` the correct address would be `tcp://[::1]:80` .
2022-07-05 04:43:12 +00:00
2023-05-07 06:39:17 +00:00
#### port
2022-07-05 04:43:12 +00:00
2023-05-07 05:48:26 +00:00
The hostname is required if the scheme is one of the `tcp` or `udp` schemes and there is no [hostname ](#hostname )
specified.
### Regular Expressions
2022-07-05 04:43:12 +00:00
2023-05-07 05:48:26 +00:00
We have several sections of configuration that utilize regular expressions. We use the Google RE2 regular expression
engine which is the full Go regular expression syntax engine, the syntax of which is described
[here ](https://github.com/google/re2/wiki/Syntax ) by the authors. It's very similar to regular expression engines like
PCRE, Perl, and Python; with the major exceptions being that it doesn't have backtracking.
2022-06-15 07:51:47 +00:00
2023-05-07 05:48:26 +00:00
It's recommended to validate your regular expressions manually either via tools like [Regex 101 ](https://regex101.com/ )
(ensure you pick the `Golang` option) or some other means.
2022-06-15 07:51:47 +00:00
It's important when attempting to utilize a backslash that it's utilized correctly. The YAML parser is likely to parse
this as you trying to use YAML escape syntax instead of regex escape syntax. To avoid this use single quotes instead of
no quotes or double quotes.
Good Example:
```yaml
domain_regex: '^(admin|secure)\.example\.com$'
```
Bad Example:
```yaml
domain_regex: "^(admin|secure)\.example\.com$"
```
2023-05-07 05:48:26 +00:00
## Structures
The following represent common data structures used within the configuration which have specific requirements that are
used in multiple areas. This is intended on assisting in understanding these specific structures, and not as a specific
guide on configuring any particular instance.
### TLS Configuration
2022-06-15 07:51:47 +00:00
Various sections of the configuration use a uniform configuration section called TLS. Notably LDAP and SMTP.
This section documents the usage.
2023-05-07 05:48:26 +00:00
#### server_name
2022-06-15 07:51:47 +00:00
{{< confkey type = "string" required = "no" > }}
The key `server_name` overrides the name checked against the certificate in the verification process. Useful if you
2022-07-18 00:56:09 +00:00
require an IP address for the host of the backend service but want to verify a specific certificate server name.
2022-06-15 07:51:47 +00:00
2023-05-07 05:48:26 +00:00
#### skip_verify
2022-06-15 07:51:47 +00:00
{{< confkey type = "boolean" default = "false" required = "no" > }}
The key `skip_verify` completely negates validating the certificate of the backend service. This is not recommended,
instead you should tweak the `server_name` option, and the global option
2022-12-07 09:43:02 +00:00
[certificates directory ](../miscellaneous/introduction.md#certificatesdirectory ).
2022-06-15 07:51:47 +00:00
2023-05-07 05:48:26 +00:00
#### minimum_version
2022-06-15 07:51:47 +00:00
{{< confkey type = "string" default = "TLS1.2" required = "no" > }}
2022-10-21 08:41:33 +00:00
Controls the minimum TLS version Authelia will use when performing TLS handshakes.
The possible values are `TLS1.3` , `TLS1.2` , `TLS1.1` , `TLS1.0` , `SSL3.0` . Anything other than `TLS1.3` or `TLS1.2`
2022-06-15 07:51:47 +00:00
are very old and deprecated. You should avoid using these and upgrade your backend service instead of decreasing
2022-10-21 08:41:33 +00:00
this value. At the time of this writing `SSL3.0` will always produce errors.
2023-05-07 05:48:26 +00:00
#### maximum_version
2022-10-21 08:41:33 +00:00
{{< confkey type = "string" default = "TLS1.3" required = "no" > }}
Controls the maximum TLS version Authelia will use when performing TLS handshakes.
The possible values are `TLS1.3` , `TLS1.2` , `TLS1.1` , `TLS1.0` , `SSL3.0` . Anything other than `TLS1.3` or `TLS1.2`
are very old and deprecated. You should avoid using these and upgrade your backend service instead of decreasing
this value. At the time of this writing `SSL3.0` will always produce errors.
2023-05-07 05:48:26 +00:00
#### certificate_chain
2022-10-21 08:41:33 +00:00
{{< confkey type = "string" required = "no" > }}
2022-12-07 09:43:02 +00:00
The certificate chain/bundle to be used with the [private_key ](#privatekey ) to perform mutual TLS authentication with
2022-10-21 08:41:33 +00:00
the server.
The value must be one or more certificates encoded in the DER base64 ([RFC4648]) encoded PEM format.
2023-05-07 05:48:26 +00:00
#### private_key
2022-10-21 08:41:33 +00:00
2023-02-05 07:11:30 +00:00
{{< confkey type = "string" required = "no" > }}
2022-10-21 08:41:33 +00:00
*__Important Note:__ This can also be defined using a [secret ](../methods/secrets.md ) which is __strongly recommended__
especially for containerized deployments.*
2022-12-07 09:43:02 +00:00
The private key to be used with the [certificate_chain ](#certificatechain ) for mutual TLS authentication.
2022-10-21 08:41:33 +00:00
2023-05-04 11:23:15 +00:00
The value must be one private key encoded in the DER base64 ([RFC4648]) encoded PEM format. If more than one certificate
is provided, in top down order, each certificate must be signed by the next certificate if provided.
2022-08-08 21:50:12 +00:00
2023-02-05 07:11:30 +00:00
[RFC4648]: https://datatracker.ietf.org/doc/html/rfc4648
2023-05-07 05:48:26 +00:00
### Server Buffers
2022-08-08 21:50:12 +00:00
2023-05-07 05:48:26 +00:00
#### read
2022-08-08 21:50:12 +00:00
{{< confkey type = "integer" default = "4096" required = "no" > }}
Configures the maximum request size. The default of 4096 is generally sufficient for most use cases.
2023-05-07 05:48:26 +00:00
#### write
2022-08-08 21:50:12 +00:00
{{< confkey type = "integer" default = "4096" required = "no" > }}
Configures the maximum response size. The default of 4096 is generally sufficient for most use cases.
2023-05-07 05:48:26 +00:00
### Server Timeouts
2022-08-08 21:50:12 +00:00
2023-05-07 05:48:26 +00:00
#### read
2022-08-08 21:50:12 +00:00
2022-10-07 02:52:01 +00:00
{{< confkey type = "duration" default = "6s" required = "no" > }}
2022-08-08 21:50:12 +00:00
2023-05-07 05:48:26 +00:00
*__Reference Note:__ This configuration option uses the [duration common syntax ](#duration ).
Please see the [documentation ](../prologue/common.md#duration ) on this format for more information.*
2022-08-08 21:50:12 +00:00
Configures the server read timeout.
2023-05-07 05:48:26 +00:00
#### write
2022-08-08 21:50:12 +00:00
2022-10-07 02:52:01 +00:00
{{< confkey type = "duration" default = "6s" required = "no" > }}
2022-08-08 21:50:12 +00:00
2023-05-07 05:48:26 +00:00
*__Reference Note:__ This configuration option uses the [duration common syntax ](#duration ).
Please see the [documentation ](#duration ) on this format for more information.*
2022-08-08 21:50:12 +00:00
Configures the server write timeout.
2023-05-07 05:48:26 +00:00
#### idle
2022-08-08 21:50:12 +00:00
{{< confkey type = "duration" default = "30s" required = "no" > }}
2023-05-07 05:48:26 +00:00
*__Reference Note:__ This configuration option uses the [duration common syntax ](#duration ).
Please see the [documentation ](#duration ) on this format for more information.*
2022-08-08 21:50:12 +00:00
2023-01-23 22:58:57 +00:00
Configures the server idle timeout.
2023-05-07 05:48:26 +00:00
## Historical References
This contains links to historical anchors.
##### Duration Notation Format
See [duration common syntax ](#duration ).