akkoma/docs/admin/config.md

85 lines
2.7 KiB
Markdown
Raw Normal View History

2019-09-29 02:17:38 -06:00
# Configuring instance
You can configure your instance from admin interface. You need account with admin rights and little change in config file, which will allow settings configuration from database.
2019-09-29 02:17:38 -06:00
```elixir
config :pleroma, configurable_from_database: true
2019-09-29 02:17:38 -06:00
```
## How it works
2020-01-27 09:48:20 -07:00
Settings are stored in database and are applied in `runtime` after each change. Most of the settings take effect immediately, except some, which need instance reboot.
2019-09-29 02:17:38 -06:00
## How to set it up
2020-01-22 08:08:53 -07:00
You need to migrate your existing settings to the database. This task will migrate only added by user settings.
For example you add settings to `prod.secret.exs` file, only these settings will be migrated to database. For release it will be `/etc/pleroma/config.exs` or `PLEROMA_CONFIG_PATH`.
You can do this with mix task (all config files will remain untouched):
```sh tab="OTP"
./bin/pleroma_ctl config migrate_to_db
```
```sh tab="From Source"
2019-09-29 02:17:38 -06:00
mix pleroma.config migrate_to_db
```
2020-01-22 08:08:53 -07:00
2020-01-27 09:48:20 -07:00
Now you can change settings in admin interface. If `reboot time` settings were changed, pleroma must be rebooted.
2019-09-29 02:17:38 -06:00
<span style="color:red">**ATTENTION**</span>
**<span style="color:red">Be careful while changing the settings. Every inaccurate configuration change can break the federation or the instance load.</span>**
*Compile time settings, which require instance reboot and can break instance loading:*
- all settings inside these keys:
- `:hackney_pools`
- `:chat`
2020-01-27 09:48:20 -07:00
- `Oban`
- `:rate_limit`
- `:markup`
- `:streamer`
2019-09-29 02:17:38 -06:00
- partially settings inside these keys:
- `:seconds_valid` in `Pleroma.Captcha`
- `:proxy_remote` in `Pleroma.Upload`
- `:upload_limit` in `:instance`
2020-01-27 09:48:20 -07:00
- `:digest` in `:email_notifications`
- `:clean_expired_tokens` in `:oauth2`
- `:enabled` in `Pleroma.ActivityExpiration`
- `:enabled` in `Pleroma.ScheduledActivity`
- `:enabled` in `:gopher`
2019-09-29 02:17:38 -06:00
2020-01-22 08:08:53 -07:00
## How to dump settings from database to file
*Adding `-d` flag will delete migrated settings from database table.*
```sh tab="OTP"
./bin/pleroma_ctl config migrate_from_db [-d]
```
```sh tab="From Source"
mix pleroma.config migrate_from_db [-d]
```
## How to completely remove it
2019-09-29 02:17:38 -06:00
1. Truncate or delete all values from `config` table
```sql
TRUNCATE TABLE config;
```
2020-01-27 09:48:20 -07:00
2. If migrate_from_db task was runned, backup and delete `config/{env}.exported_from_db.exs`.
2019-09-29 02:17:38 -06:00
For `prod` env:
```bash
cd /opt/pleroma
cp config/prod.exported_from_db.exs config/exported_from_db.back
rm -rf config/prod.exported_from_db.exs
```
*If you don't want to backup settings, you can skip step with `cp` command.*
3. Set configurable_from_database to `false`.
2019-09-29 02:17:38 -06:00
```elixir
config :pleroma, configurable_from_database: false
2019-09-29 02:17:38 -06:00
```
4. Restart pleroma instance
```bash
sudo service pleroma restart
```