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