[#1260] Merge remote-tracking branch 'remotes/upstream/develop' into 1260-rate-limite...
authorIvan Tashkinov <ivantashkinov@gmail.com>
Mon, 30 Sep 2019 14:41:20 +0000 (17:41 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Mon, 30 Sep 2019 14:41:20 +0000 (17:41 +0300)
# Conflicts:
# CHANGELOG.md

1  2 
CHANGELOG.md
config/config.exs
config/description.exs
lib/pleroma/web/oauth/oauth_controller.ex

diff --combined CHANGELOG.md
index 2ef60ea9b409052e468c070e5768bb613f056ccd,3d9424c8fdb977788031a92b85276bade90bd328..4ae1079fe89d7a54d4fc041262222fc4beb1a5fb
@@@ -4,11 -4,24 +4,24 @@@ All notable changes to this project wil
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
  
  ## [Unreleased]
+ ### Added
+ - Refreshing poll results for remote polls
+ - Admin API: Add ability to require password reset
+ - Mastodon API: Account entities now include `follow_requests_count` (planned Mastodon 3.x addition)
+ - Pleroma API: `GET /api/v1/pleroma/accounts/:id/scrobbles` to get a list of recently scrobbled items
+ - Pleroma API: `POST /api/v1/pleroma/scrobble` to scrobble a media item
  ### Changed
  - **Breaking:** Elixir >=1.8 is now required (was >= 1.7)
+ - **Breaking:** Admin API: Return link alongside with token on password reset
  - Replaced [pleroma_job_queue](https://git.pleroma.social/pleroma/pleroma_job_queue) and `Pleroma.Web.Federator.RetryQueue` with [Oban](https://github.com/sorentwo/oban) (see [`docs/config.md`](docs/config.md) on migrating customized worker / retry settings)
  - Introduced [quantum](https://github.com/quantum-elixir/quantum-core) job scheduler
  - Admin API: Return `total` when querying for reports
+ - Mastodon API: Return `pleroma.direct_conversation_id` when creating a direct message (`POST /api/v1/statuses`)
+ - Admin API: Return link alongside with token on password reset
+ ### Fixed
+ - Mastodon API: Fix private and direct statuses not being filtered out from the public timeline for an authenticated user (`GET /api/v1/timelines/public`)
  
  ## [1.1.0] - 2019-??-??
  ### Security
  - **Breaking:** Configuration: A setting to explicitly disable the mailer was added, defaulting to true, if you are using a mailer add `config :pleroma, Pleroma.Emails.Mailer, enabled: true` to your config
  - **Breaking:** Configuration: `/media/` is now removed when `base_url` is configured, append `/media/` to your `base_url` config to keep the old behaviour if desired
  - **Breaking:** `/api/pleroma/notifications/read` is moved to `/api/v1/pleroma/notifications/read` and now supports `max_id` and responds with Mastodon API entities.
+ - **Breaking:** `/api/pleroma/admin/users/invite_token` now uses `POST`, changed accepted params and returns full invite in json instead of only token string.
  - Configuration: added `config/description.exs`, from which `docs/config.md` is generated
+ - Configuration: OpenGraph and TwitterCard providers enabled by default
+ - Configuration: Filter.AnonymizeFilename added ability to retain file extension with custom text
+ - Mastodon API: `pleroma.thread_muted` key in the Status entity
  - Federation: Return 403 errors when trying to request pages from a user's follower/following collections if they have `hide_followers`/`hide_follows` set
  - NodeInfo: Return `skipThreadContainment` in `metadata` for the `skip_thread_containment` option
  - NodeInfo: Return `mailerEnabled` in `metadata`
@@@ -32,6 -49,7 +49,7 @@@
  - AdminAPI: Add "godmode" while fetching user statuses (i.e. admin can see private statuses)
  - Improve digest email template
  – Pagination: (optional) return `total` alongside with `items` when paginating
+ - Add `rel="ugc"` to all links in statuses, to prevent SEO spam
  
  ### Fixed
  - Following from Osada
@@@ -76,6 -94,7 +94,7 @@@
  - Mastodon API: added `/auth/password` endpoint for password reset with rate limit.
  - Mastodon API: /api/v1/accounts/:id/statuses now supports nicknames or user id
  - Mastodon API: Improve support for the user profile custom fields
+ - Mastodon API: follower/following counters are nullified when `hide_follows`/`hide_followers` and `hide_follows_count`/`hide_followers_count` are set
  - Admin API: Return users' tags when querying reports
  - Admin API: Return avatar and display name when querying users
  - Admin API: Allow querying user by ID
  - Pleroma API: Add `/api/v1/pleroma/accounts/confirmation_resend?email=<email>` for resending account confirmation.
  - Pleroma API: Email change endpoint.
  - Admin API: Added moderation log
+ - 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).
  - Web response cache (currently, enabled for ActivityPub)
  - Mastodon API: Added an endpoint to get multiple statuses by IDs (`GET /api/v1/statuses/?ids[]=1&ids[]=2`)
+ - ActivityPub: Add ActivityPub actor's `discoverable` parameter.
+ - Admin API: Added moderation log filters (user/start date/end date/search/pagination)
 +- Authentication: Added rate limit for password-authorized actions / login existence checks. 
  
  ### Changed
  - Configuration: Filter.AnonymizeFilename added ability to retain file extension with custom text
  - RichMedia: parsers and their order are configured in `rich_media` config.
  - RichMedia: add the rich media ttl based on image expiration time.
  
+ ## [1.0.7] - 2019-09-26
+ ### Fixed
+ - Broken federation on Erlang 22 (previous versions of hackney http client were using an option that got deprecated)
+ ### Changed
+ - ActivityPub: The first page in inboxes/outboxes is no longer embedded.
  ## [1.0.6] - 2019-08-14
  ### Fixed
  - MRF: fix use of unserializable keyword lists in describe() implementations
diff --combined config/config.exs
index 15979702fce2deca89261e427d944416d1203469,36bea19a089a51d035c696d2446ba8cf24e426df..92adf442c669dfff66efc99f3eb91bebefb306c2
@@@ -109,6 -109,7 +109,7 @@@ config :pleroma, Pleroma.Uploaders.Loca
  
  config :pleroma, Pleroma.Uploaders.S3,
    bucket: nil,
+   streaming_enabled: true,
    public_endpoint: "https://s3.amazonaws.com"
  
  config :pleroma, Pleroma.Uploaders.MDII,
@@@ -122,7 -123,8 +123,8 @@@ config :pleroma, :emoji
      # Put groups that have higher priority than defaults here. Example in `docs/config/custom_emoji.md`
      Custom: ["/emoji/*.png", "/emoji/**/*.png"]
    ],
-   default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json"
+   default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json",
+   shared_pack_cache_seconds_per_file: 60
  
  config :pleroma, :uri_schemes,
    valid_schemes: [
@@@ -507,7 -509,7 +509,7 @@@ config :auto_linker
      class: false,
      strip_prefix: false,
      new_window: false,
-     rel: false
+     rel: "ugc"
    ]
  
  config :pleroma, :ldap,
@@@ -585,10 -587,12 +587,12 @@@ config :pleroma, :env, Mix.env(
  config :http_signatures,
    adapter: Pleroma.Signature
  
 -config :pleroma, :rate_limit, nil
 +config :pleroma, :rate_limit, authentication: {60_000, 15}
  
  config :pleroma, Pleroma.ActivityExpiration, enabled: true
  
+ config :pleroma, Pleroma.Plugs.RemoteIp, enabled: false
  config :pleroma, :web_cache_ttl,
    activity_pub: nil,
    activity_pub_question: 30_000
diff --combined config/description.exs
index bd0378e003317bcb97609497058485c48962b9fa,4547ea36839e5d04ff6a017f209ecba47adce4cd..b007cf69ca9a83097525d5da56012d8dd11f084d
@@@ -39,11 -39,7 +39,7 @@@ config :pleroma, :config_description, 
          key: :link_name,
          type: :boolean,
          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
-         ]
+           "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`"
        },
        %{
          key: :base_url,
          key: :proxy_remote,
          type: :boolean,
          description:
-           "If enabled, requests to media stored using a remote uploader will be proxied instead of being redirected.",
-         suggestions: [
-           true,
-           false
-         ]
+           "If enabled, requests to media stored using a remote uploader will be proxied instead of being redirected."
        },
        %{
          key: :proxy_opts,
          type: :string,
          description:
            "If you use S3 compatible service such as Digital Ocean Spaces or CDN, set folder name or \"\" etc." <>
-             " For example, when using CDN to S3 virtual host format, set \"\". At this time, write CNAME to CDN in public_endpoint.",
-         suggestions: [""]
+             " For example, when using CDN to S3 virtual host format, set \"\". At this time, write CNAME to CDN in public_endpoint."
+       },
+       %{
+         key: :streaming_enabled,
+         type: :boolean,
+         description:
+           "Enable streaming uploads, when enabled the file will be sent to the server in chunks as it's being read. This may be unsupported by some providers, try disabling this if you have upload problems."
        }
      ]
    },
        %{
          key: :enabled,
          type: :boolean,
-         description: "Allow/disallow send emails",
-         suggestions: [
-           true,
-           false
-         ]
+         description: "Allow/disallow send emails"
        },
        %{
          group: {:subgroup, Swoosh.Adapters.SMTP},
          group: {:subgroup, Swoosh.Adapters.SMTP},
          key: :ssl,
          type: :boolean,
-         description: "`Swoosh.Adapters.SMTP` adapter specific setting",
-         suggestions: [true, false]
+         description: "`Swoosh.Adapters.SMTP` adapter specific setting"
        },
        %{
          group: {:subgroup, Swoosh.Adapters.SMTP},
          group: {:subgroup, Swoosh.Adapters.SMTP},
          key: :no_mx_lookups,
          type: :boolean,
-         description: "`Swoosh.Adapters.SMTP` adapter specific setting",
-         suggestions: [true, false]
+         description: "`Swoosh.Adapters.SMTP` adapter specific setting"
        },
        %{
          group: {:subgroup, Swoosh.Adapters.Sendgrid},
          group: {:subgroup, Swoosh.Adapters.Sendmail},
          key: :qmail,
          type: :boolean,
-         description: "`Swoosh.Adapters.Sendmail` adapter specific setting",
-         suggestions: [true, false]
+         description: "`Swoosh.Adapters.Sendmail` adapter specific setting"
        },
        %{
          group: {:subgroup, Swoosh.Adapters.Mandrill},
          group: {:subgroup, Swoosh.Adapters.SocketLabs},
          key: :server_id,
          type: :string,
-         description: "`Swoosh.Adapters.SocketLabs` adapter specific setting",
-         suggestions: [""]
+         description: "`Swoosh.Adapters.SocketLabs` adapter specific setting"
        },
        %{
          group: {:subgroup, Swoosh.Adapters.SocketLabs},
          key: :api_key,
          type: :string,
-         description: "`Swoosh.Adapters.SocketLabs` adapter specific setting",
-         suggestions: [""]
+         description: "`Swoosh.Adapters.SocketLabs` adapter specific setting"
        },
        %{
          group: {:subgroup, Swoosh.Adapters.Gmail},
          key: :access_token,
          type: :string,
-         description: "`Swoosh.Adapters.Gmail` adapter specific setting",
-         suggestions: [""]
+         description: "`Swoosh.Adapters.Gmail` adapter specific setting"
        }
      ]
    },
        %{
          key: :registrations_open,
          type: :boolean,
-         description: "Enable registrations for anyone, invitations can be enabled when false",
-         suggestions: [
-           true,
-           false
-         ]
+         description: "Enable registrations for anyone, invitations can be enabled when false"
        },
        %{
          key: :invites_enabled,
          type: :boolean,
-         description: "Enable user invitations for admins (depends on registrations_open: false)",
-         suggestions: [
-           true,
-           false
-         ]
+         description: "Enable user invitations for admins (depends on registrations_open: false)"
        },
        %{
          key: :account_activation_required,
          type: :boolean,
-         description: "Require users to confirm their emails before signing in",
-         suggestions: [
-           true,
-           false
-         ]
+         description: "Require users to confirm their emails before signing in"
        },
        %{
          key: :federating,
          type: :boolean,
-         description: "Enable federation with other instances",
-         suggestions: [
-           true,
-           false
-         ]
+         description: "Enable federation with other instances"
        },
        %{
          key: :federation_incoming_replies_max_depth,
        %{
          key: :allow_relay,
          type: :boolean,
-         description: "Enable Pleroma's Relay, which makes it possible to follow a whole instance",
-         suggestions: [
-           true,
-           false
-         ]
+         description: "Enable Pleroma's Relay, which makes it possible to follow a whole instance"
        },
        %{
          key: :rewrite_policy,
          type: :boolean,
          description:
            "Makes the client API in authentificated mode-only except for user-profiles." <>
-             " Useful for disabling the Local Timeline and The Whole Known Network",
-         suggestions: [
-           true,
-           false
-         ]
+             " Useful for disabling the Local Timeline and The Whole Known Network"
        },
        %{
          key: :quarantined_instances,
          key: :managed_config,
          type: :boolean,
          description:
-           "Whenether the config for pleroma-fe is configured in this config or in static/config.json",
-         suggestions: [
-           true,
-           false
-         ]
+           "Whenether the config for pleroma-fe is configured in this config or in static/config.json"
        },
        %{
          key: :static_dir,
          key: :mrf_transparency,
          type: :boolean,
          description:
-           "Make the content of your Message Rewrite Facility settings public (via nodeinfo)",
-         suggestions: [
-           true,
-           false
-         ]
+           "Make the content of your Message Rewrite Facility settings public (via nodeinfo)"
        },
        %{
          key: :mrf_transparency_exclusions,
          type: :boolean,
          description:
            "Set to true to use extended local nicknames format (allows underscores/dashes)." <>
-             " This will break federation with older software for theses nicknames",
-         suggestions: [
-           true,
-           false
-         ]
+             " This will break federation with older software for theses nicknames"
        },
        %{
          key: :max_pinned_statuses,
          key: :no_attachment_links,
          type: :boolean,
          description:
-           "Set to true to disable automatically adding attachment link text to statuses",
-         suggestions: [
-           true,
-           false
-         ]
+           "Set to true to disable automatically adding attachment link text to statuses"
        },
        %{
          key: :welcome_message,
          description:
            "If set to true, only mentions at the beginning of a post will be used to address people in direct messages." <>
              " This is to prevent accidental mentioning of people when talking about them (e.g. \"@friend hey i really don't like @enemy\")." <>
-             " Default: false",
-         suggestions: [
-           true,
-           false
-         ]
+             " Default: false"
        },
        %{
          key: :healthcheck,
          type: :boolean,
-         description: "If set to true, system data will be shown on /api/pleroma/healthcheck",
-         suggestions: [
-           true,
-           false
-         ]
+         description: "If set to true, system data will be shown on /api/pleroma/healthcheck"
        },
        %{
          key: :remote_post_retention_days,
        %{
          key: :skip_thread_containment,
          type: :boolean,
-         description: "Skip filter out broken threads. The default is true",
-         suggestions: [
-           true,
-           false
-         ]
+         description: "Skip filter out broken threads. The default is true"
        },
        %{
          key: :limit_to_local_content,
          key: :dynamic_configuration,
          type: :boolean,
          description:
-           "Allow transferring configuration to DB with the subsequent customization from Admin api. Defaults to `false`",
-         suggestions: [
-           true,
-           false
-         ]
+           "Allow transferring configuration to DB with the subsequent customization from Admin api. Defaults to `false`"
        },
        %{
          key: :max_account_fields,
        %{
          key: :external_user_synchronization,
          type: :boolean,
-         description: "Enabling following/followers counters synchronization for external users",
-         suggestions: [
-           true,
-           false
-         ]
+         description: "Enabling following/followers counters synchronization for external users"
        }
      ]
    },
        %{
          key: :metadata,
          type: {:list, :atom},
-         description: "",
          suggestions: [[:request_id]]
        }
      ]
        %{
          key: :metadata,
          type: {:list, :atom},
-         description: "",
          suggestions: [[:request_id]]
        }
      ]
            %{
              key: :showInstanceSpecificPanel,
              type: :boolean,
-             description: "Whenether to show the instance's specific panel",
-             suggestions: [true, false]
+             description: "Whenether to show the instance's specific panel"
            },
            %{
              key: :scopeOptionsEnabled,
              type: :boolean,
-             description: "Enable setting an notice visibility and subject/CW when posting",
-             suggestions: [true, false]
+             description: "Enable setting an notice visibility and subject/CW when posting"
            },
            %{
              key: :formattingOptionsEnabled,
              type: :boolean,
              description:
-               "Enable setting a formatting different than plain-text (ie. HTML, Markdown) when posting, relates to :instance, allowed_post_formats",
-             suggestions: [true, false]
+               "Enable setting a formatting different than plain-text (ie. HTML, Markdown) when posting, relates to :instance, allowed_post_formats"
            },
            %{
              key: :collapseMessageWithSubject,
              type: :boolean,
              description:
-               "When a message has a subject(aka Content Warning), collapse it by default",
-             suggestions: [true, false]
+               "When a message has a subject(aka Content Warning), collapse it by default"
            },
            %{
              key: :hidePostStats,
              type: :boolean,
-             description: "Hide notices statistics(repeats, favorites, ...)",
-             suggestions: [true, false]
+             description: "Hide notices statistics(repeats, favorites, ...)"
            },
            %{
              key: :hideUserStats,
              type: :boolean,
              description:
-               "Hide profile statistics(posts, posts per day, followers, followings, ...)",
-             suggestions: [true, false]
+               "Hide profile statistics(posts, posts per day, followers, followings, ...)"
            },
            %{
              key: :scopeCopy,
              type: :boolean,
-             description:
-               "Copy the scope (private/unlisted/public) in replies to posts by default",
-             suggestions: [true, false]
+             description: "Copy the scope (private/unlisted/public) in replies to posts by default"
            },
            %{
              key: :subjectLineBehavior,
            %{
              key: :alwaysShowSubjectInput,
              type: :boolean,
-             description: "When set to false, auto-hide the subject field when it's empty",
-             suggestions: [true, false]
+             description: "When set to false, auto-hide the subject field when it's empty"
            }
          ]
        },
            %{
              key: :showInstanceSpecificPanel,
              type: :boolean,
-             description: "Whenether to show the instance's specific panel",
-             suggestions: [true, false]
+             description: "Whenether to show the instance's specific panel"
            }
          ]
        }
      group: :pleroma,
      key: :mrf_rejectnonpublic,
      type: :group,
-     description: "",
      children: [
        %{
          key: :allow_followersonly,
          type: :boolean,
-         description: "whether to allow followers-only posts",
-         suggestions: [true, false]
+         description: "whether to allow followers-only posts"
        },
        %{
          key: :allow_direct,
          type: :boolean,
-         description: "whether to allow direct messages",
-         suggestions: [true, false]
+         description: "whether to allow direct messages"
        }
      ]
    },
        %{
          key: :enabled,
          type: :boolean,
-         description: "Enables proxying of remote media to the instance's proxy",
-         suggestions: [true, false]
+         description: "Enables proxying of remote media to the instance's proxy"
        },
        %{
          key: :base_url,
        %{
          key: :enabled,
          type: :boolean,
-         description: "Enables the gopher interface",
-         suggestions: [true, false]
+         description: "Enables the gopher interface"
        },
        %{
          key: :ip,
        %{
          key: :instrumenters,
          type: {:list, :module},
-         description: "",
          suggestions: [Pleroma.Web.Endpoint.Instrumenter]
        },
        %{
          key: :protocol,
          type: :string,
-         description: "",
          suggestions: ["https"]
        },
        %{
          key: :secret_key_base,
          type: :string,
-         description: "",
          suggestions: ["aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl"]
        },
        %{
          key: :signing_salt,
          type: :string,
-         description: "",
          suggestions: ["CqaoopA2"]
        },
        %{
          key: :render_errors,
          type: :keyword,
-         description: "",
          suggestions: [[view: Pleroma.Web.ErrorView, accepts: ~w(json)]],
          children: [
            %{
              key: :view,
              type: :module,
-             description: "",
              suggestions: [Pleroma.Web.ErrorView]
            },
            %{
              key: :accepts,
              type: {:list, :string},
-             description: "",
              suggestions: ["json"]
            }
          ]
        %{
          key: :pubsub,
          type: :keyword,
-         description: "",
          suggestions: [[name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2]],
          children: [
            %{
              key: :name,
              type: :module,
-             description: "",
              suggestions: [Pleroma.PubSub]
            },
            %{
              key: :adapter,
              type: :module,
-             description: "",
              suggestions: [Phoenix.PubSub.PG2]
            }
          ]
        },
        %{
          key: :secure_cookie_flag,
-         type: :boolean,
-         description: "",
-         suggestions: [true, false]
+         type: :boolean
        },
        %{
          key: :extra_cookie_attrs,
          type: {:list, :string},
-         description: "",
          suggestions: ["SameSite=Lax"]
        }
      ]
        %{
          key: :unfollow_blocked,
          type: :boolean,
-         description: "Whether blocks result in people getting unfollowed",
-         suggestions: [true, false]
+         description: "Whether blocks result in people getting unfollowed"
        },
        %{
          key: :outgoing_blocks,
          type: :boolean,
-         description: "Whether to federate blocks to other instances",
-         suggestions: [true, false]
+         description: "Whether to federate blocks to other instances"
        },
        %{
          key: :sign_object_fetches,
          type: :boolean,
-         description: "Sign object fetches with HTTP signatures",
-         suggestions: [true, false]
+         description: "Sign object fetches with HTTP signatures"
        },
        %{
          key: :follow_handshake_timeout,
        %{
          key: :enabled,
          type: :boolean,
-         description: "Whether the managed content security policy is enabled",
-         suggestions: [true, false]
+         description: "Whether the managed content security policy is enabled"
        },
        %{
          key: :sts,
          type: :boolean,
-         description: "Whether to additionally send a Strict-Transport-Security header",
-         suggestions: [true, false]
+         description: "Whether to additionally send a Strict-Transport-Security header"
        },
        %{
          key: :sts_max_age,
        %{
          key: :enabled,
          type: :boolean,
-         description: "Whether the captcha should be shown on registration",
-         suggestions: [true, false]
+         description: "Whether the captcha should be shown on registration"
        },
        %{
          key: :method,
      group: :pleroma_job_queue,
      key: :queues,
      type: :group,
-     description: "[Deprecated] Replaced with `Oban`/`:queues` (keeping the same format)",
-     children: []
+     description: "[Deprecated] Replaced with `Oban`/`:queues` (keeping the same format)"
    },
    %{
      group: :pleroma,
        %{
          key: :max_retries,
          type: :integer,
-         description: "[Deprecated] Replaced as `Oban`/`:queues`/`:outgoing_federation` value",
-         suggestions: []
+         description: "[Deprecated] Replaced as `Oban`/`:queues`/`:outgoing_federation` value"
        }
      ]
    },
        %{
          key: :verbose,
          type: :boolean,
-         description: "Logs verbose mode",
-         suggestions: [false, true]
+         description: "Logs verbose mode"
        },
        %{
          key: :prune,
        %{
          key: :unfurl_nsfw,
          type: :boolean,
-         description: "If set to true nsfw attachments will be shown in previews",
-         suggestions: [
-           true,
-           false
-         ]
+         description: "If set to true nsfw attachments will be shown in previews"
        }
      ]
    },
      group: :pleroma,
      key: :rich_media,
      type: :group,
-     description: "",
      children: [
        %{
          key: :enabled,
          type: :boolean,
          description:
-           "if enabled the instance will parse metadata from attached links to generate link previews",
-         suggestions: [true, false]
+           "if enabled the instance will parse metadata from attached links to generate link previews"
        },
        %{
          key: :ignore_hosts,
          key: :enabled,
          type: :boolean,
          description:
-           "if enabled, when a new user is federated with, fetch some of their latest posts",
-         suggestions: [true, false]
+           "if enabled, when a new user is federated with, fetch some of their latest posts"
        },
        %{
          key: :pages,
          key: :rel,
          type: [:string, false],
          description: "override the rel attribute. false to clear",
-         suggestions: ["noopener noreferrer", false]
+         suggestions: ["ugc", "noopener noreferrer", false]
        },
        %{
          key: :new_window,
          type: :boolean,
-         description: "set to false to remove target='_blank' attribute",
-         suggestions: [true, false]
+         description: "set to false to remove target='_blank' attribute"
        },
        %{
          key: :scheme,
          type: :boolean,
-         description: "Set to true to link urls with schema http://google.com",
-         suggestions: [true, false]
+         description: "Set to true to link urls with schema http://google.com"
        },
        %{
          key: :truncate,
        %{
          key: :strip_prefix,
          type: :boolean,
-         description: "Strip the scheme prefix",
-         suggestions: [true, false]
+         description: "Strip the scheme prefix"
        },
        %{
          key: :extra,
          type: :boolean,
-         description: "link urls with rarely used schemes (magnet, ipfs, irc, etc.)",
-         suggestions: [true, false]
+         description: "link urls with rarely used schemes (magnet, ipfs, irc, etc.)"
        }
      ]
    },
        %{
          key: :enabled,
          type: :boolean,
-         description: "whether scheduled activities are sent to the job queue to be executed",
-         suggestions: [true, false]
+         description: "whether scheduled activities are sent to the job queue to be executed"
        }
      ]
    },
        %{
          key: :enabled,
          type: :boolean,
-         description: "whether expired activities will be sent to the job queue to be deleted",
-         suggestions: [true, false]
+         description: "whether expired activities will be sent to the job queue to be deleted"
        }
      ]
    },
        %{
          key: Pleroma.Web.Auth.Authenticator,
          type: :module,
-         description: "",
          suggestions: [Pleroma.Web.Auth.PleromaAuthenticator, Pleroma.Web.Auth.LDAPAuthenticator]
        }
      ]
        %{
          key: :enabled,
          type: :boolean,
-         description: "enables LDAP authentication",
-         suggestions: [true, false]
+         description: "enables LDAP authentication"
        },
        %{
          key: :host,
        %{
          key: :ssl,
          type: :boolean,
-         description: "true to use SSL, usually implies the port 636",
-         suggestions: [true, false]
+         description: "true to use SSL, usually implies the port 636"
        },
        %{
          key: :sslopts,
          type: :keyword,
-         description: "additional SSL options",
-         suggestions: []
+         description: "additional SSL options"
        },
        %{
          key: :tls,
          type: :boolean,
-         description: "true to start TLS, usually implies the port 389",
-         suggestions: [true, false]
+         description: "true to start TLS, usually implies the port 389"
        },
        %{
          key: :tlsopts,
          type: :keyword,
-         description: "additional TLS options",
-         suggestions: []
+         description: "additional TLS options"
        },
        %{
          key: :base,
            %{
              key: :active,
              type: :boolean,
-             description: "globally enable or disable digest emails",
-             suggestions: [true, false]
+             description: "globally enable or disable digest emails"
            },
            %{
              key: :schedule,
      children: [
        %{
          key: :logo,
-         type: [:string, nil],
+         type: [:string, nil],
          description: "a path to a custom logo. Set it to nil to use the default Pleroma logo",
          suggestions: ["some/path/logo.png", nil]
        },
            %{
              key: :link_color,
              type: :string,
-             description: "",
              suggestions: ["#d8a070"]
            },
            %{
              key: :background_color,
              type: :string,
-             description: "",
              suggestions: ["#2C3645"]
            },
            %{
              key: :content_background_color,
              type: :string,
-             description: "",
              suggestions: ["#1B2635"]
            },
            %{
              key: :header_color,
              type: :string,
-             description: "",
              suggestions: ["#d8a070"]
            },
            %{
              key: :text_color,
              type: :string,
-             description: "",
              suggestions: ["#b9b9ba"]
            },
            %{
              key: :text_muted_color,
              type: :string,
-             description: "",
              suggestions: ["#b9b9ba"]
            }
          ]
          key: :issue_new_refresh_token,
          type: :boolean,
          description:
-           "Keeps old refresh token or generate new refresh token when to obtain an access token",
-         suggestions: [true, false]
+           "Keeps old refresh token or generate new refresh token when to obtain an access token"
        },
        %{
          key: :clean_expired_tokens,
          type: :boolean,
-         description: "Enable a background job to clean expired oauth tokens. Defaults to false",
-         suggestions: [true, false]
+         description: "Enable a background job to clean expired oauth tokens. Defaults to false"
        },
        %{
          key: :clean_expired_tokens_interval,
      group: :pleroma,
      key: :emoji,
      type: :group,
-     description: "",
      children: [
        %{
          key: :shortcode_globs,
            "Location of the JSON-manifest. This manifest contains information about the emoji-packs you can download." <>
              " Currently only one manifest can be added (no arrays)",
          suggestions: ["https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json"]
+       },
+       %{
+         key: :shared_pack_cache_seconds_per_file,
+         type: :integer,
+         descpiption:
+           "When an emoji pack is shared, the archive is created and cached in memory" <>
+             " for this amount of seconds multiplied by the number of files.",
+         suggestions: [60]
        }
      ]
    },
        %{
          key: :rum_enabled,
          type: :boolean,
-         description: "If RUM indexes should be used. Defaults to false",
-         suggestions: [true, false]
+         description: "If RUM indexes should be used. Defaults to false"
        }
      ]
    },
      group: :pleroma,
      key: :rate_limit,
      type: :group,
 -    description: "Rate limit settings. This is an advanced feature and disabled by default.",
 +    description:
 +      "Rate limit settings. This is an advanced feature enabled only for :authentication by default.",
      children: [
        %{
          key: :search,
          description:
            "for fav / unfav or reblog / unreblog actions on the same status by the same user",
          suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]]
 +      },
 +      %{
 +        key: :authentication,
 +        type: [:tuple, {:list, :tuple}],
 +        description: "for authentication create / password check / user existence check requests",
 +        suggestions: [{60_000, 15}]
        }
      ]
    },
        %{
          key: :enabled,
          type: :boolean,
-         description: "Enables ssh",
-         suggestions: [true, false]
+         description: "Enables ssh"
        },
        %{
          key: :priv_dir,
        %{
          key: :types,
          type: :map,
-         description: "",
          suggestions: [
            %{
              "application/xml" => ["xml"],
            %{
              key: "application/xml",
              type: {:list, :string},
-             description: "",
              suggestions: [["xml"]]
            },
            %{
              key: "application/xrd+xml",
              type: {:list, :string},
-             description: "",
              suggestions: [["xrd+xml"]]
            },
            %{
              key: "application/jrd+json",
              type: {:list, :string},
-             description: "",
              suggestions: [["jrd+json"]]
            },
            %{
              key: "application/activity+json",
              type: {:list, :string},
-             description: "",
              suggestions: [["activity+json"]]
            },
            %{
              key: "application/ld+json",
              type: {:list, :string},
-             description: "",
              suggestions: [["activity+json"]]
            }
          ]
      children: [
        %{
          key: :enabled,
-         type: :boolean,
-         description: "",
-         suggestions: [true, false]
+         type: :boolean
        }
      ]
    },
      group: :pleroma,
      key: :suggestions,
      type: :group,
-     description: "",
      children: [
        %{
          key: :enabled,
          type: :boolean,
-         description: "Enables suggestions",
-         suggestions: []
+         description: "Enables suggestions"
        },
        %{
          key: :third_party_engine,
        %{
          key: :web,
          type: :string,
-         description: "",
          suggestions: ["https://vinayaka.distsn.org"]
        }
      ]
        %{
          key: :adapter,
          type: :module,
-         description: "",
          suggestions: [Pleroma.Signature]
        }
      ]
      group: :pleroma,
      key: Pleroma.Uploaders.MDII,
      type: :group,
-     description: "",
      children: [
        %{
          key: :cgi,
          type: :string,
-         description: "",
          suggestions: ["https://mdii.sakura.ne.jp/mdii-post.cgi"]
        },
        %{
          key: :files,
          type: :string,
-         description: "",
          suggestions: ["https://mdii.sakura.ne.jp"]
        }
      ]
        %{
          key: :proxy_url,
          type: [:string, :atom, nil],
-         description: "",
          suggestions: ["localhost:9020", {:socks5, :localhost, 3090}, nil]
        },
        %{
          key: :send_user_agent,
-         type: :boolean,
-         description: "",
-         suggestions: [true, false]
+         type: :boolean
        },
        %{
          key: :adapter,
          type: :keyword,
-         description: "",
          suggestions: [
            [
              ssl_options: [
      group: :pleroma,
      key: :markup,
      type: :group,
-     description: "",
      children: [
        %{
          key: :allow_inline_images,
-         type: :boolean,
-         description: "",
-         suggestions: [true, false]
+         type: :boolean
        },
        %{
          key: :allow_headings,
-         type: :boolean,
-         description: "",
-         suggestions: [true, false]
+         type: :boolean
        },
        %{
          key: :allow_tables,
-         type: :boolean,
-         description: "",
-         suggestions: [true, false]
+         type: :boolean
        },
        %{
          key: :allow_fonts,
-         type: :boolean,
-         description: "",
-         suggestions: [true, false]
+         type: :boolean
        },
        %{
          key: :scrub_policy,
          type: {:list, :module},
-         description: "",
          suggestions: [[Pleroma.HTML.Transform.MediaProxy, Pleroma.HTML.Scrubber.Default]]
        }
      ]
      group: :pleroma,
      key: :user,
      type: :group,
-     description: "",
      children: [
        %{
          key: :deny_follow_blocked,
-         type: :boolean,
-         description: "",
-         suggestions: [true, false]
+         type: :boolean
        }
      ]
    },
      group: :pleroma,
      key: :mrf_normalize_markup,
      type: :group,
-     description: "",
      children: [
        %{
          key: :scrub_policy,
          type: :module,
-         description: "",
          suggestions: [Pleroma.HTML.Scrubber.Default]
        }
      ]
      group: :pleroma,
      key: Pleroma.User,
      type: :group,
-     description: "",
      children: [
        %{
          key: :restricted_nicknames,
          type: {:list, :string},
-         description: "",
          suggestions: [
            [
              ".well-known",
    %{
      group: :cors_plug,
      type: :group,
-     description: "",
      children: [
        %{
          key: :max_age,
          type: :integer,
-         description: "",
          suggestions: [86_400]
        },
        %{
          key: :methods,
          type: {:list, :string},
-         description: "",
          suggestions: [["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"]]
        },
        %{
          key: :expose,
          type: :string,
-         description: "",
          suggestions: [
            [
              "Link",
        },
        %{
          key: :credentials,
+         type: :boolean
+       },
+       %{
+         key: :headers,
+         type: {:list, :string},
+         suggestions: [["Authorization", "Content-Type", "Idempotency-Key"]]
+       }
+     ]
+   },
+   %{
+     group: :pleroma,
+     key: Pleroma.Plugs.RemoteIp,
+     type: :group,
+     description: """
+     **If your instance is not behind at least one reverse proxy, you should not enable this plug.**
+     `Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
+     """,
+     children: [
+       %{
+         key: :enabled,
          type: :boolean,
-         description: "",
+         description: "Enable/disable the plug. Defaults to `false`.",
          suggestions: [true, false]
        },
        %{
          key: :headers,
          type: {:list, :string},
-         description: "",
-         suggestions: [["Authorization", "Content-Type", "Idempotency-Key"]]
+         description:
+           "A list of strings naming the `req_headers` to use when deriving the `remote_ip`. Order does not matter. Defaults to `~w[forwarded x-forwarded-for x-client-ip x-real-ip]`."
+       },
+       %{
+         key: :proxies,
+         type: {:list, :string},
+         description:
+           "A list of strings in [CIDR](https://en.wikipedia.org/wiki/CIDR) notation specifying the IPs of known proxies. Defaults to `[]`."
+       },
+       %{
+         key: :reserved,
+         type: {:list, :string},
+         description:
+           "Defaults to [localhost](https://en.wikipedia.org/wiki/Localhost) and [private network](https://en.wikipedia.org/wiki/Private_network)."
        }
      ]
    },
index 281c7d2d839cdb9977609858dd76da1039737052,a57670e025f734aa6d6db3ec2cb62cd14a773472..3bf67ceb7cb81d63b1422f4335d8cf8e57d8b97b
@@@ -24,7 -24,6 +24,7 @@@ defmodule Pleroma.Web.OAuth.OAuthContro
  
    plug(:fetch_session)
    plug(:fetch_flash)
 +  plug(Pleroma.Plugs.RateLimiter, :authentication when action == :create_authorization)
  
    action_fallback(Pleroma.Web.OAuth.FallbackController)
  
           {:ok, app} <- Token.Utils.fetch_app(conn),
           {:auth_active, true} <- {:auth_active, User.auth_active?(user)},
           {:user_active, true} <- {:user_active, !user.info.deactivated},
+          {:password_reset_pending, false} <-
+            {:password_reset_pending, user.info.password_reset_pending},
           {:ok, scopes} <- validate_scopes(app, params),
           {:ok, auth} <- Authorization.create_authorization(app, user, scopes),
           {:ok, token} <- Token.exchange_token(app, auth) do
        {:user_active, false} ->
          render_error(conn, :forbidden, "Your account is currently disabled")
  
+       {:password_reset_pending, true} ->
+         render_error(conn, :forbidden, "Password reset is required")
        _error ->
          render_invalid_credentials_error(conn)
      end