aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2019-12-06 15:04:46 +0700
committerEgor Kislitsyn <egor@kislitsyn.com>2019-12-06 15:04:46 +0700
commit157bceeda9124cea7ba69eaf6639ca52b3fac7c6 (patch)
treebb4b2b3c2199750002026b917b5d825ad41514fc
parent1f3c452d864eff625dfd0f25c48abe0efef4507b (diff)
downloadpleroma-157bceeda9124cea7ba69eaf6639ca52b3fac7c6.tar.gz
Move runtime configuration from `:instance` to `:modules`
-rw-r--r--config/config.exs3
-rw-r--r--config/releases.exs1
-rw-r--r--docs/configuration/cheatsheet.md12
-rw-r--r--lib/pleroma/application.ex2
4 files changed, 14 insertions, 4 deletions
diff --git a/config/config.exs b/config/config.exs
index e1358eda0..64e33c82f 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -249,7 +249,6 @@ config :pleroma, :instance,
quarantined_instances: [],
managed_config: true,
static_dir: "instance/static/",
- custom_modules_dir: "instance/modules/",
allowed_post_formats: [
"text/plain",
"text/html",
@@ -618,6 +617,8 @@ config :pleroma, :web_cache_ttl,
activity_pub: nil,
activity_pub_question: 30_000
+config :pleroma, :modules, runtime_dir: "instance/modules"
+
config :swarm, node_blacklist: [~r/myhtml_.*$/]
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
diff --git a/config/releases.exs b/config/releases.exs
index 98c5ceccd..b224960db 100644
--- a/config/releases.exs
+++ b/config/releases.exs
@@ -2,6 +2,7 @@ import Config
config :pleroma, :instance, static_dir: "/var/lib/pleroma/static"
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"
diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md
index f73d368c1..413a668c6 100644
--- a/docs/configuration/cheatsheet.md
+++ b/docs/configuration/cheatsheet.md
@@ -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_value_length`: An account field value maximum length (default: `2048`).
* `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
This is a Work In Progress, not usable just yet
@@ -831,3 +829,13 @@ config :auto_linker,
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"
+```
diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex
index 73364f141..9d2f3f320 100644
--- a/lib/pleroma/application.ex
+++ b/lib/pleroma/application.ex
@@ -69,7 +69,7 @@ defmodule Pleroma.Application do
end
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
dir