relay/docs/configuration.md

193 lines
3.2 KiB
Markdown
Raw Permalink Normal View History

2022-05-06 07:04:51 +00:00
# Configuration
2024-03-13 22:37:00 +00:00
## Config File
2022-11-27 01:53:06 +00:00
2024-03-13 22:37:00 +00:00
These options are stored in the configuration file (usually relay.yaml)
### General
#### Domain
2022-05-06 07:04:51 +00:00
Hostname the relay will be hosted on.
2022-05-06 07:04:51 +00:00
domain: relay.example.com
2022-05-06 07:04:51 +00:00
2024-03-13 22:37:00 +00:00
#### Listener
2022-05-06 07:04:51 +00:00
The address and port the relay will listen on. If the reverse proxy (nginx, apache, caddy, etc)
is running on the same host, it is recommended to change `listen` to `localhost` if the reverse
proxy is on the same host.
2022-05-06 07:04:51 +00:00
listen: 0.0.0.0
port: 8080
2024-03-13 22:37:00 +00:00
#### Push Workers
2022-05-06 07:04:51 +00:00
The number of processes to spawn for pushing messages to subscribed instances. Leave it at 0 to
automatically detect how many processes should be spawned.
2022-05-06 07:04:51 +00:00
workers: 0
2022-05-06 07:04:51 +00:00
2024-03-13 22:37:00 +00:00
#### Database type
2022-05-06 07:04:51 +00:00
SQL database backend to use. Valid values are `sqlite` or `postgres`.
2022-05-06 07:04:51 +00:00
database_type: sqlite
2022-11-27 01:53:06 +00:00
2022-05-06 07:04:51 +00:00
2024-03-13 22:37:00 +00:00
#### Cache type
2024-02-01 02:23:45 +00:00
Cache backend to use. Valid values are `database` or `redis`
cache_type: database
2024-03-13 22:37:00 +00:00
#### Sqlite File Path
2022-05-06 07:04:51 +00:00
Path to the sqlite database file. If the path is not absolute, it is relative to the config file.
directory.
2022-11-27 01:53:06 +00:00
sqlite_path: relay.jsonld
2022-11-27 01:53:06 +00:00
2024-03-13 22:37:00 +00:00
### Postgresql
2022-11-27 01:53:06 +00:00
In order to use the Postgresql backend, the user and database need to be created first.
2022-11-27 01:53:06 +00:00
2024-02-01 02:23:45 +00:00
sudo -u postgres psql -c "CREATE USER activityrelay WITH PASSWORD SomeSecurePassword"
sudo -u postgres psql -c "CREATE DATABASE activityrelay OWNER activityrelay"
2022-11-27 01:53:06 +00:00
2024-03-13 22:37:00 +00:00
#### Database Name
2022-11-27 01:53:06 +00:00
Name of the database to use.
2022-05-06 07:04:51 +00:00
name: activityrelay
2022-05-06 07:04:51 +00:00
2024-03-13 22:37:00 +00:00
#### Host
2022-05-06 07:04:51 +00:00
Hostname, IP address, or unix socket the server is hosted on.
2022-05-06 07:04:51 +00:00
host: /var/run/postgresql
2022-05-06 07:04:51 +00:00
2024-03-13 22:37:00 +00:00
#### Port
2022-05-06 07:04:51 +00:00
Port number the server is listening on.
2022-05-06 07:04:51 +00:00
port: 5432
2022-05-06 07:04:51 +00:00
2024-03-13 22:37:00 +00:00
#### Username
2022-05-06 07:04:51 +00:00
User to use when logging into the server.
2022-05-06 07:04:51 +00:00
user: null
2022-05-06 07:04:51 +00:00
2024-03-13 22:37:00 +00:00
#### Password
2022-05-06 07:04:51 +00:00
Password for the specified user.
2022-05-06 07:04:51 +00:00
pass: null
2024-02-01 02:23:45 +00:00
2024-03-13 22:37:00 +00:00
### Redis
2024-02-01 02:23:45 +00:00
2024-03-13 22:37:00 +00:00
#### Host
2024-02-01 02:23:45 +00:00
Hostname, IP address, or unix socket the server is hosted on.
host: /var/run/postgresql
2024-03-13 22:37:00 +00:00
#### Port
2024-02-01 02:23:45 +00:00
Port number the server is listening on.
port: 5432
2024-03-13 22:37:00 +00:00
#### Username
2024-02-01 02:23:45 +00:00
User to use when logging into the server.
user: null
2024-03-13 22:37:00 +00:00
#### Password
2024-02-01 02:23:45 +00:00
Password for the specified user.
pass: null
2024-03-13 22:37:00 +00:00
#### Database Number
2024-02-01 02:23:45 +00:00
Number of the database to use.
database: 0
2024-03-13 22:37:00 +00:00
#### Prefix
2024-02-01 02:23:45 +00:00
Text to prefix every key with. It cannot contain a `:` character.
prefix: activityrelay
2024-03-13 22:37:00 +00:00
## Database Config
These options are stored in the database and can be changed via CLI, API, or the web interface.
### Approval Required
When enabled, instances that try to follow the relay will have to be manually approved by an admin.
approval-required: false
### Log Level
Maximum level of messages to log.
Note: Changing this setting via CLI does not actually take effect until restart.
2024-03-13 22:37:00 +00:00
Valid values: `DEBUG`, `VERBOSE`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`
log-level: INFO
### Name
Name of your relay's instance. It will be displayed at the top of web pages and in API endpoints.
name: ActivityRelay
### Note
2024-03-13 22:52:22 +00:00
Short blurb that will be displayed on the relay's home and in API endpoints if set. Can be in
markdown format.
2024-03-13 22:37:00 +00:00
note: null
### Theme
Color theme to use for the web pages.
Valid values: `Default`, `Pink`, `Blue`
theme: Default
### Whitelist Enabled
2024-03-13 22:52:22 +00:00
When enabled, only instances on the whitelist can join. Any instances currently subscribed and not
in the whitelist when this is enabled can still post.
2024-03-13 22:37:00 +00:00
whitelist-enabled: False