logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 39d769f25057dbaf89dc23d39941780bc65c2b06
parent: 6e70415e4a1d814d2b772d94658d9f7b66d1fe89
Author: rinpatch <rinpatch@sdf.org>
Date:   Mon, 14 Sep 2020 15:19:09 +0000

Merge branch 'remove/managed-config-option' into 'develop'

Remove `:managed_config` option.

Closes #2086

See merge request pleroma/pleroma!2983

Diffstat:

MCHANGELOG.md2++
Mconfig/config.exs1-
Mconfig/description.exs6------
Mdocs/configuration/cheatsheet.md1-
Apriv/repo/migrations/20200910113106_remove_managed_config_from_db.exs27+++++++++++++++++++++++++++
5 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -15,6 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **Breaking:** `Pleroma.Workers.Cron.StatsWorker` setting from Oban `:crontab` (moved to a simpler implementation). - **Breaking:** `Pleroma.Workers.Cron.ClearOauthTokenWorker` setting from Oban `:crontab` (moved to scheduled jobs). - **Breaking:** `Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker` setting from Oban `:crontab` (moved to scheduled jobs). +- Removed `:managed_config` option. In practice, it was accidentally removed with 2.0.0 release when frontends were +switched to a new configuration mechanism, however it was not officially removed until now. ### Changed - Minimum lifetime for ephmeral activities changed to 10 minutes and made configurable (`:min_lifetime` option). diff --git a/config/config.exs b/config/config.exs @@ -216,7 +216,6 @@ config :pleroma, :instance, allow_relay: true, public: true, quarantined_instances: [], - managed_config: true, static_dir: "instance/static/", allowed_post_formats: [ "text/plain", diff --git a/config/description.exs b/config/description.exs @@ -765,12 +765,6 @@ config :pleroma, :config_description, [ ] }, %{ - key: :managed_config, - type: :boolean, - description: - "Whenether the config for pleroma-fe is configured in this config or in static/config.json" - }, - %{ key: :static_dir, type: :string, description: "Instance static directory", diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md @@ -40,7 +40,6 @@ To add configuration to your config file, you can copy it from the base config. * `allow_relay`: Enable Pleroma’s Relay, which makes it possible to follow a whole instance. * `public`: Makes the client API in authenticated mode-only except for user-profiles. Useful for disabling the Local Timeline and The Whole Known Network. Note that there is a dependent setting restricting or allowing unauthenticated access to specific resources, see `restrict_unauthenticated` for more details. * `quarantined_instances`: List of ActivityPub instances where private (DMs, followers-only) activities will not be send. -* `managed_config`: Whenether the config for pleroma-fe is configured in [:frontend_configurations](#frontend_configurations) or in ``static/config.json``. * `allowed_post_formats`: MIME-type list of formats allowed to be posted (transformed into HTML). * `extended_nickname_format`: Set to `true` to use extended local nicknames format (allows underscores/dashes). This will break federation with older software for theses nicknames. diff --git a/priv/repo/migrations/20200910113106_remove_managed_config_from_db.exs b/priv/repo/migrations/20200910113106_remove_managed_config_from_db.exs @@ -0,0 +1,27 @@ +defmodule Pleroma.Repo.Migrations.RemoveManagedConfigFromDb do + use Ecto.Migration + import Ecto.Query + alias Pleroma.ConfigDB + alias Pleroma.Repo + + def up do + config_entry = + from(c in ConfigDB, + select: [:id, :value], + where: c.group == ^:pleroma and c.key == ^:instance + ) + |> Repo.one() + + if config_entry do + {_, value} = Keyword.pop(config_entry.value, :managed_config) + + config_entry + |> Ecto.Changeset.change(value: value) + |> Repo.update() + end + end + + def down do + :ok + end +end