relay/docs/configuration.md

138 lines
2.1 KiB
Markdown
Raw Normal View History

2022-05-06 07:04:51 +00:00
# Configuration
2022-11-27 01:53:06 +00:00
## 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
2022-11-27 01:53:06 +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
### Push Workers
2022-05-06 07:04:51 +00:00
The relay can be configured to use threads to push messages out. For smaller relays, this isn't
necessary, but bigger ones (>100 instances) will want to set this to the number of available cpu
threads.
2022-05-06 07:04:51 +00:00
workers: 0
2022-05-06 07:04:51 +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-02-01 02:23:45 +00:00
### Cache type
Cache backend to use. Valid values are `database` or `redis`
cache_type: database
### 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
## 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
### 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
### Host
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
### 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
### 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
### 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
## Redis
### Host
Hostname, IP address, or unix socket the server is hosted on.
host: /var/run/postgresql
### Port
Port number the server is listening on.
port: 5432
### Username
User to use when logging into the server.
user: null
### Password
Password for the specified user.
pass: null
### Database Number
Number of the database to use.
database: 0
### Prefix
Text to prefix every key with. It cannot contain a `:` character.
prefix: activityrelay