It's still too unstable to be used.
* `user_name_length`: A user name maximum length (default: `100`)\r
* `skip_thread_containment`: Skip filter out broken threads. The default is `false`.\r
* `limit_to_local_content`: Limit unauthenticated users to search for local statutes and users only. Possible values: `:unauthenticated`, `:all` and `false`. The default is `:unauthenticated`.\r
-* `dynamic_configuration`: Allow transferring configuration to DB with the subsequent customization from Admin api.\r
* `max_account_fields`: The maximum number of custom fields in the user profile (default: `10`)\r
* `max_remote_account_fields`: The maximum number of custom fields in the remote user profile (default: `20`)\r
* `account_field_name_length`: An account field name maximum length (default: `512`)\r
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.Config do
+ @doc false
use Mix.Task
import Mix.Pleroma
alias Pleroma.Repo
alias Pleroma.Web.AdminAPI.Config
- @shortdoc "Manages the location of the config"
- @moduledoc """
- Manages the location of the config.
-
- ## Transfers config from file to DB.
-
- mix pleroma.config migrate_to_db
-
- ## Transfers config from DB to file `config/env.exported_from_db.secret.exs`
-
- mix pleroma.config migrate_from_db ENV
- """
def run(["migrate_to_db"]) do
start_pleroma()
- `--dbpass DBPASS` - the password to use for the database connection
- `--rum Y/N` - Whether to enable RUM indexes
- `--indexable Y/N` - Allow/disallow indexing site by search engines
- - `--db-configurable Y/N` - Allow/disallow configuring instance from admin part
- `--uploads-dir` - the directory uploads go in when using a local uploader
- `--static-dir` - the directory custom public files should be read from (custom emojis, frontend bundle overrides, robots.txt, etc.)
- `--listen-ip` - the ip the app should listen to, defaults to 127.0.0.1
dbpass: :string,
rum: :string,
indexable: :string,
- db_configurable: :string,
uploads_dir: :string,
static_dir: :string,
listen_ip: :string,
"y"
) === "y"
- db_configurable? =
- get_option(
- options,
- :db_configurable,
- "Do you want to store the configuration in the database (allows controlling it from admin-fe)? (y/n)",
- "n"
- ) === "y"
-
dbhost = get_option(options, :dbhost, "What is the hostname of your database?", "localhost")
dbname = get_option(options, :dbname, "What is the name of your database?", "pleroma")
signing_salt: signing_salt,
web_push_public_key: Base.url_encode64(web_push_public_key, padding: false),
web_push_private_key: Base.url_encode64(web_push_private_key, padding: false),
- db_configurable?: db_configurable?,
+ db_configurable?: false,
static_dir: static_dir,
uploads_dir: uploads_dir,
rum_enabled: rum_enabled,
email: "<%= email %>",
notify_email: "<%= notify_email %>",
limit: 5000,
- registrations_open: true,
- dynamic_configuration: <%= db_configurable? %>
+ registrations_open: true
config :pleroma, :media_proxy,
enabled: false,
"dbpass",
"--indexable",
"y",
- "--db-configurable",
- "y",
"--rum",
"y",
"--listen-port",
assert generated_config =~ "database: \"dbname\""
assert generated_config =~ "username: \"dbuser\""
assert generated_config =~ "password: \"dbpass\""
- assert generated_config =~ "dynamic_configuration: true"
assert generated_config =~ "http: [ip: {127, 0, 0, 1}, port: 4000]"
assert File.read!(tmp_path() <> "setup.psql") == generated_setup_psql()
end