f42ec897559e2f51a2d22917ae3051a381c2edca
[akkoma] / docs / admin / config.md
1 # Configuring instance
2 You can configure your instance from admin interface. You need account with admin rights and little change in config file, which will allow settings dynamic configuration from database.
3
4 ```elixir
5 config :pleroma, :instance,
6 dynamic_configuration: true
7 ```
8
9 ## How it works
10 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. These settings are needed in `compile time`, that's why settings are duplicated to the file.
11
12 File with duplicated settings is located in `config/{env}.exported_from_db.exs`. For prod env it will be `config/prod.exported_from_db.exs`.
13
14 ## How to set it up
15 You need to migrate your existing settings to the database. You can do this with mix task (all config files will remain untouched):
16 ```bash
17 mix pleroma.config migrate_to_db
18 ```
19 Now you can change settings in admin interface. After each save, settings are duplicated to the `config/{env}.exported_from_db.exs` file.
20
21 <span style="color:red">**ATTENTION**</span>
22
23 **<span style="color:red">Be careful while changing the settings. Every inaccurate configuration change can break the federation or the instance load.</span>**
24
25 *Compile time settings, which require instance reboot and can break instance loading:*
26 - all settings inside these keys:
27 - `:hackney_pools`
28 - `:chat`
29 - `Pleroma.Web.Endpoint`
30 - partially settings inside these keys:
31 - `:seconds_valid` in `Pleroma.Captcha`
32 - `:proxy_remote` in `Pleroma.Upload`
33 - `:upload_limit` in `:instance`
34
35 ## How to remove it
36
37 1. Truncate or delete all values from `config` table
38 ```sql
39 TRUNCATE TABLE config;
40 ```
41 2. Delete `config/{env}.exported_from_db.exs`.
42
43 For `prod` env:
44 ```bash
45 cd /opt/pleroma
46 cp config/prod.exported_from_db.exs config/exported_from_db.back
47 rm -rf config/prod.exported_from_db.exs
48 ```
49 *If you don't want to backup settings, you can skip step with `cp` command.*
50
51 3. Set dynamic configuration to `false`.
52 ```elixir
53 config :pleroma, :instance,
54 dynamic_configuration: false
55 ```
56 4. Restart pleroma instance
57 ```bash
58 sudo service pleroma restart
59 ```