Revert "Merge branch 'revert-4fabf83a' into 'develop'"
[akkoma] / config / description.exs
index 537b9d9964acc57910b1e785e096a798f1452c69..be5eb0cc35302f878ac2da86081836201480e3c1 100644 (file)
@@ -1,5 +1,5 @@
 use Mix.Config
-alias Pleroma.Docs.Formatter
+alias Pleroma.Docs.Generator
 
 websocket_config = [
   path: "/websocket",
@@ -24,7 +24,7 @@ config :pleroma, :config_description, [
         type: :module,
         description: "Module which will be used for uploads",
         suggestions: [
-          Formatter.uploaders_list()
+          Generator.uploaders_list()
         ]
       },
       %{
@@ -32,13 +32,14 @@ config :pleroma, :config_description, [
         type: {:list, :module},
         description: "List of filter modules for uploads",
         suggestions: [
-          Formatter.filters_list()
+          Generator.filters_list()
         ]
       },
       %{
         key: :link_name,
         type: :boolean,
-        description: "If enabled Pleroma will add name parameter to the url off the upload",
+        description:
+          "If enabled, a name parameter will be added to the url of the upload. For example `https://instance.tld/media/imagehash.png?name=realname.png`",
         suggestions: [
           true,
           false
@@ -55,7 +56,8 @@ config :pleroma, :config_description, [
       %{
         key: :proxy_remote,
         type: :boolean,
-        description: "If enabled, Pleroma will proxy media requests instead of redirecting to it",
+        description:
+          "If enabled, requests to media stored using a remote uploader will be proxied instead of being redirected.",
         suggestions: [
           true,
           false
@@ -64,8 +66,7 @@ config :pleroma, :config_description, [
       %{
         key: :proxy_opts,
         type: :keyword,
-        description: "Proxy options, see `Pleroma.ReverseProxy` documentation",
-        suggestions: ["somehow created link to Pleroma.ReverseProxy options"]
+        description: "Proxy options, see `Pleroma.ReverseProxy` documentation"
       }
     ]
   },
@@ -93,7 +94,7 @@ config :pleroma, :config_description, [
     children: [
       %{
         key: :bucket,
-        type: :strings,
+        type: :string,
         description: "S3 bucket",
         suggestions: [
           "bucket"
@@ -629,7 +630,7 @@ config :pleroma, :config_description, [
         description: "A list of MRF policies enabled",
         suggestions: [
           Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
-          Formatter.mrf_list()
+          Generator.mrf_list()
         ]
       },
       %{
@@ -1777,87 +1778,141 @@ config :pleroma, :config_description, [
     group: :pleroma_job_queue,
     key: :queues,
     type: :group,
-    description: "Pleroma Job Queue configuration: a list of queues with maximum concurrent jobs",
+    description: "[Deprecated] Replaced with `Oban`/`:queues` (keeping the same format)",
+    children: []
+  },
+  %{
+    group: :pleroma,
+    key: Pleroma.Web.Federator.RetryQueue,
+    type: :group,
+    description: "[Deprecated] See `Oban` and `:workers` sections for configuration notes",
     children: [
       %{
-        key: :federator_outgoing,
-        type: :integer,
-        description: "Outgoing federation queue",
-        suggestions: [50]
-      },
-      %{
-        key: :federator_incoming,
-        type: :integer,
-        description: "Incoming federation queue",
-        suggestions: [50]
-      },
-      %{
-        key: :mailer,
-        type: :integer,
-        description: "Email sender queue, see Pleroma.Emails.Mailer",
-        suggestions: [10]
-      },
-      %{
-        key: :web_push,
+        key: :max_retries,
         type: :integer,
-        description: "Web push notifications queue",
-        suggestions: [50]
-      },
+        description: "[Deprecated] Replaced as `Oban`/`:queues`/`:outgoing_federation` value",
+        suggestions: []
+      }
+    ]
+  },
+  %{
+    group: :pleroma,
+    key: Oban,
+    type: :group,
+    description: """
+    [Oban](https://github.com/sorentwo/oban) asynchronous job processor configuration.
+
+    Note: if you are running PostgreSQL in [`silent_mode`](https://postgresqlco.nf/en/doc/param/silent_mode?version=9.1),
+      it's advised to set [`log_destination`](https://postgresqlco.nf/en/doc/param/log_destination?version=9.1) to `syslog`,
+      otherwise `postmaster.log` file may grow because of "you don't own a lock of type ShareLock" warnings
+      (see https://github.com/sorentwo/oban/issues/52).
+    """,
+    children: [
       %{
-        key: :transmogrifier,
-        type: :integer,
-        description: "Transmogrifier queue",
-        suggestions: [20]
+        key: :repo,
+        type: :module,
+        description: "Application's Ecto repo",
+        suggestions: [Pleroma.Repo]
       },
       %{
-        key: :scheduled_activities,
-        type: :integer,
-        description: "Scheduled activities queue, see Pleroma.ScheduledActivities",
-        suggestions: [10]
+        key: :verbose,
+        type: :boolean,
+        description: "Logs verbose mode",
+        suggestions: [false, true]
       },
       %{
-        key: :activity_expiration,
-        type: :integer,
-        description: "Activity expiration queue",
-        suggestions: [10]
+        key: :prune,
+        type: [:atom, :tuple],
+        description:
+          "Non-retryable jobs [pruning settings](https://github.com/sorentwo/oban#pruning)",
+        suggestions: [:disabled, {:maxlen, 1500}, {:maxage, 60 * 60}]
       },
       %{
-        key: :background,
-        type: :integer,
-        description: "Background queue",
-        suggestions: [5]
+        key: :queues,
+        type: :keyword,
+        description:
+          "Background jobs queues (keys: queues, values: max numbers of concurrent jobs)",
+        suggestions: [
+          [
+            activity_expiration: 10,
+            background: 5,
+            federator_incoming: 50,
+            federator_outgoing: 50,
+            mailer: 10,
+            scheduled_activities: 10,
+            transmogrifier: 20,
+            web_push: 50
+          ]
+        ],
+        children: [
+          %{
+            key: :activity_expiration,
+            type: :integer,
+            description: "Activity expiration queue",
+            suggestions: [10]
+          },
+          %{
+            key: :background,
+            type: :integer,
+            description: "Background queue",
+            suggestions: [5]
+          },
+          %{
+            key: :federator_incoming,
+            type: :integer,
+            description: "Incoming federation queue",
+            suggestions: [50]
+          },
+          %{
+            key: :federator_outgoing,
+            type: :integer,
+            description: "Outgoing federation queue",
+            suggestions: [50]
+          },
+          %{
+            key: :mailer,
+            type: :integer,
+            description: "Email sender queue, see Pleroma.Emails.Mailer",
+            suggestions: [10]
+          },
+          %{
+            key: :scheduled_activities,
+            type: :integer,
+            description: "Scheduled activities queue, see Pleroma.ScheduledActivities",
+            suggestions: [10]
+          },
+          %{
+            key: :transmogrifier,
+            type: :integer,
+            description: "Transmogrifier queue",
+            suggestions: [20]
+          },
+          %{
+            key: :web_push,
+            type: :integer,
+            description: "Web push notifications queue",
+            suggestions: [50]
+          }
+        ]
       }
     ]
   },
   %{
     group: :pleroma,
-    key: Pleroma.Web.Federator.RetryQueue,
+    key: :workers,
     type: :group,
-    description: "",
+    description: "Includes custom worker options not interpretable directly by `Oban`",
     children: [
       %{
-        key: :enabled,
-        type: :boolean,
-        description: "If set to true, failed federation jobs will be retried",
-        suggestions: [true, false]
-      },
-      %{
-        key: :max_jobs,
-        type: :integer,
-        description: "The maximum amount of parallel federation jobs running at the same time",
-        suggestions: [20]
-      },
-      %{
-        key: :initial_timeout,
-        type: :integer,
-        description: "The initial timeout in seconds",
-        suggestions: [30]
-      },
-      %{
-        key: :max_retries,
-        type: :integer,
-        description: "The maximum number of times a federation job is retried",
-        suggestions: [5]
+        key: :retries,
+        type: :keyword,
+        description: "Max retry attempts for failed jobs, per `Oban` queue",
+        suggestions: [
+          [
+            federator_incoming: 5,
+            federator_outgoing: 5
+          ]
+        ]
       }
     ]
   },
@@ -1920,7 +1975,7 @@ config :pleroma, :config_description, [
         type: {:list, :module},
         description: "list of Rich Media parsers",
         suggestions: [
-          Formatter.richmedia_parsers()
+          Generator.richmedia_parsers()
         ]
       },
       %{
@@ -2809,5 +2864,28 @@ config :pleroma, :config_description, [
         suggestions: [["Authorization", "Content-Type", "Idempotency-Key"]]
       }
     ]
+  },
+  %{
+    group: :pleroma,
+    key: :web_cache_ttl,
+    type: :group,
+    description:
+      "The expiration time for the web responses cache. Values should be in milliseconds or `nil` to disable expiration.",
+    children: [
+      %{
+        key: :activity_pub,
+        type: :integer,
+        description:
+          "activity pub routes (except question activities). Defaults to `nil` (no expiration).",
+        suggestions: [30_000, nil]
+      },
+      %{
+        key: :activity_pub_question,
+        type: :integer,
+        description:
+          "activity pub routes (question activities). Defaults to `30_000` (30 seconds).",
+        suggestions: [30_000]
+      }
+    ]
   }
 ]