Move runtime configuration from :instance to :modules

This commit is contained in:
Egor Kislitsyn 2019-12-06 15:04:46 +07:00
parent 1f3c452d86
commit 157bceeda9
4 changed files with 14 additions and 4 deletions

View file

@ -249,7 +249,6 @@ config :pleroma, :instance,
quarantined_instances: [], quarantined_instances: [],
managed_config: true, managed_config: true,
static_dir: "instance/static/", static_dir: "instance/static/",
custom_modules_dir: "instance/modules/",
allowed_post_formats: [ allowed_post_formats: [
"text/plain", "text/plain",
"text/html", "text/html",
@ -618,6 +617,8 @@ config :pleroma, :web_cache_ttl,
activity_pub: nil, activity_pub: nil,
activity_pub_question: 30_000 activity_pub_question: 30_000
config :pleroma, :modules, runtime_dir: "instance/modules"
config :swarm, node_blacklist: [~r/myhtml_.*$/] config :swarm, node_blacklist: [~r/myhtml_.*$/]
# Import environment specific config. This must remain at the bottom # Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above. # of this file so it overrides the configuration defined above.

View file

@ -2,6 +2,7 @@ import Config
config :pleroma, :instance, static_dir: "/var/lib/pleroma/static" config :pleroma, :instance, static_dir: "/var/lib/pleroma/static"
config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads" config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads"
config :pleroma, :modules, runtime_dir: "/var/lib/pleroma/modules"
config_path = System.get_env("PLEROMA_CONFIG_PATH") || "/etc/pleroma/config.exs" config_path = System.get_env("PLEROMA_CONFIG_PATH") || "/etc/pleroma/config.exs"

View file

@ -68,8 +68,6 @@ You shouldn't edit the base config directly to avoid breakages and merge conflic
* `account_field_name_length`: An account field name maximum length (default: `512`). * `account_field_name_length`: An account field name maximum length (default: `512`).
* `account_field_value_length`: An account field value maximum length (default: `2048`). * `account_field_value_length`: An account field value maximum length (default: `2048`).
* `external_user_synchronization`: Enabling following/followers counters synchronization for external users. * `external_user_synchronization`: Enabling following/followers counters synchronization for external users.
* `custom_modules_dir`: A path to custom Elixir modules (such as MRF policies).
!!! danger !!! danger
This is a Work In Progress, not usable just yet This is a Work In Progress, not usable just yet
@ -831,3 +829,13 @@ config :auto_linker,
rel: "ugc" rel: "ugc"
] ]
``` ```
## Custom Runtime Modules (`:modules`)
* `runtime_dir`: A path to custom Elixir modules (such as MRF policies).
Example:
```elixir
config :pleroma, :modules, runtime_dir: "/var/lib/pleroma/modules"
```

View file

@ -69,7 +69,7 @@ defmodule Pleroma.Application do
end end
def load_custom_modules do def load_custom_modules do
dir = Pleroma.Config.get([:instance, :custom_modules_dir]) dir = Pleroma.Config.get([:modules, :runtime_dir])
if dir && File.exists?(dir) do if dir && File.exists?(dir) do
dir dir