Readeck Configuration
When you first start Readeck, it creates a default configuration file config.toml
if it doesn't exist already.
Default configuration
This file contains a basic configuration as in this example:
[main]
log_level = "info"
secret_key = "some long secret key, can be anything"
data_directory = "data"
[server]
host = "0.0.0.0"
port = 8000
[database]
source = "sqlite3:data/db.sqlite3"
You can start Readeck with a different configuration file, using the -config
flag when starting the server. For example:
readeck server -config /etc/readeck/config.toml
Note
If you run Readeck with Docker or Podman with a named volume, you'll find the configuration file in the volume's _data/config.toml
folder.
Full Configuration
[main]
section
Name | Environment | Default | Description |
---|---|---|---|
log_level |
READECK_LOG_LEVEL |
info | Defines the application log level. Can be one of error , warning , info , debug . |
secret_key |
- | The main secret key. It must be set and be a long string of random characters. | |
data_directory |
data | The directory where Readeck stores its content. If it's not an absolute path, it's relative to the current working directory. |
Caution
Do not change an already set secret_key
.
[server]
section
Name | Environment | Default | Description |
---|---|---|---|
host |
READECK_SERVER_HOST |
0.0.0.0 | The IP address on which Readeck listens to |
port |
READECK_SERVER_PORT |
8000 | The TCP port on which Readeck listens to |
prefix |
READECK_SERVER_PREFIX |
/ | The URL prefix of Readeck. |
allowed_hosts |
READECK_ALLOWED_HOSTS |
A list of hostnames allowed in HTTP requests. | |
use_x_forwarded_for |
READECK_USE_X_FORWARDED |
false | Use the X-Forwarded-For header to determine the client IP address. |
use_x_forwarded_host |
READECK_USE_X_FORWARDED |
false | Use the X-Forwarded-Host header to determine the instance hostname. |
use_x_forwarded_proto |
READECK_USE_X_FORWARDED |
false | Use the X-Forwarded-Proto header to determine the instance HTTP scheme. |
Note
You can use the same environment variable READECK_USE_X_FORWARDED
to set all use_x_forwarded_*
values at once.
[database]
section
Name | Environment | Default | Description |
---|---|---|---|
source |
READECK_DATABASE_SOURCE |
sqlite3:data/db.sqlite3 | The URL of the instance's database. See bellow for examples. |
The source
value is a URL of the following format:
<type>://<user>:<password>@<host>:<port>/<dbname>
For SQLite, the <host>:<port>
value is the path to the database file.
For example, to use SQLite with a file in /var/lib/readeck.sqlite
:
[database]
source = "sqlite3:/var/lib/readeck.sqlite"
For a PostgreSQL connection on the database readeck
on localhost:5432
with the user readeck
with a password password
:
[database]
source = "postgres://readeck:password@localhost:5432/readeck"
Do I need PostgreSQL?
Readeck's performances with SQLite will be solid in most use cases and you don't really need anything else unless you plan to have several instances behind a load balancer but it's beyond the scope of this documentation.
SQLite and NFS
Do NOT, under any circumstances, target a SQLite database located on an NFS mount point.
[email]
section
The email setup is optional but will unlock the ability to send emails, especially for password recovery. This is something you might want if you have several users.
Name | Environment | Default | Description |
---|---|---|---|
host |
The SMTP Host to send emails through | ||
port |
The TCP Port of the SMTP host | ||
username |
The SMTP username if needed | ||
password |
The SMTP password if needed | ||
insecure |
false | Do not use an encrypted transport when true |
|
encryption |
One of starttls or ssltls . Sets the encryption mechanism of the SMTP host |
||
from |
Email address of the From messages header. |
||
from_noreply |
Email address of the From header for messages that don't need a reply. |
Here's an example of an email section:
[email]
host = "smtp.example.net"
port = 465
username = "alice@example.net"
password = "12345678"
encryption = "ssltls"
from = "alice@example.net"
from_noreply = "noreply@example.net"
[extractor]
section
This section controls the extraction process, when a user submit a new link to save.
Name | Environment | Default | Description |
---|---|---|---|
workers |
Total number of cores | The number of extraction worker process that can run at the same time. | |
content_scripts |
data/content-scripts | The location of the instance's custom content scripts. | |
denied_ips |
["127.0.0.0/8", "::1/128",] |
A list of IP addresses that can never be extracted. |