- Mix task to list all users (`mix pleroma.user list`)
- Support for `X-Forwarded-For` and similar HTTP headers which used by reverse proxies to pass a real user IP address to the backend. Must not be enabled unless your instance is behind at least one reverse proxy (such as Nginx, Apache HTTPD or Varnish Cache).
- MRF: New module which handles incoming posts based on their age. By default, all incoming posts that are older than 2 days will be unlisted and not shown to their followers.
+- Support for custom Elixir modules (such as MRF policies)
<details>
<summary>API Changes</summary>
quarantined_instances: [],
managed_config: true,
static_dir: "instance/static/",
+ custom_modules_dir: "instance/modules/",
allowed_post_formats: [
"text/plain",
"text/html",
* `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
def start(_type, _args) do
Pleroma.Config.DeprecationWarnings.warn()
setup_instrumenters()
+ load_custom_modules()
# Define workers and child supervisors to be supervised
children =
Supervisor.start_link(children, opts)
end
+ def load_custom_modules() do
+ dir = Pleroma.Config.get([:instance, :custom_modules_dir])
+
+ if dir && File.exists?(dir) do
+ dir
+ |> File.ls!()
+ |> Enum.map(&Path.join(dir, &1))
+ |> Kernel.ParallelCompiler.compile()
+ |> case do
+ {:error, _errors, _warnings} ->
+ raise "Invalid custom modules"
+
+ {:ok, modules, _warnings} ->
+ Enum.each(modules, fn mod ->
+ name = mod |> Atom.to_string() |> String.trim_leading("Elixir.")
+ IO.puts("Custom module loaded: #{name}")
+ end)
+
+ :ok
+ end
+ end
+ end
+
defp setup_instrumenters do
require Prometheus.Registry