diff --git a/CHANGELOG.md b/CHANGELOG.md
index 411b0b46d..772bd34e9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- **Breaking:** Elixir >=1.8 is now required (was >= 1.7)
+- **Breaking:** attachment links (`config :pleroma, :instance, no_attachment_links` and `config :pleroma, Pleroma.Upload, link_name`) disabled by default
- 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
- Enabled `:instance, extended_nickname_format` in the default config
@@ -62,6 +63,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Pleroma API: `POST /api/v1/pleroma/conversations/read` to mark all conversations as read
- Mastodon API: Add `/api/v1/markers` for managing timeline read markers
- Mastodon API: Add the `recipients` parameter to `GET /api/v1/conversations`
+- Configuration: `feed` option for user atom feed.
### Fixed
diff --git a/README.md b/README.md
index dd49822e9..7fc1fd381 100644
--- a/README.md
+++ b/README.md
@@ -1,80 +1,43 @@
-# Pleroma
+
-**Note**: This readme as well as complete documentation is also available at
+## About
-## About Pleroma
+Pleroma is a microblogging server software that can federate (= exchange messages with) other servers that support ActivityPub. What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed.
-Pleroma is a microblogging server software that can federate (= exchange messages with) other servers that support the same federation standards (OStatus and ActivityPub). What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement either OStatus or ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed.
+Pleroma is written in Elixir and uses PostgresSQL for data storage. It's efficient enough to be ran on low-power devices like Raspberry Pi (though we wouldn't recommend storing the database on the internal SD card ;) but can scale well when ran on more powerful hardware (albeit only single-node for now).
-Pleroma is written in Elixir, high-performance and can run on small devices like a Raspberry Pi.
+For clients it supports the [Mastodon client API](https://docs.joinmastodon.org/api/guidelines/) with Pleroma extensions (see the API section on ).
-For clients it supports the [Mastodon client API](https://docs.joinmastodon.org/api/guidelines/) with Pleroma extensions (see "Pleroma's APIs and Mastodon API extensions" section on ).
-
-- [Client Applications for Pleroma](https://docs-develop.pleroma.social/clients.html)
-
-If you want to run your own server, feel free to contact us at @lain@pleroma.soykaf.com or in our dev chat at #pleroma on freenode or via matrix at .
+- [Client Applications for Pleroma](https://docs-develop.pleroma.social/backend/clients/)
## Installation
-**Note:** The guide below may be outdated and in most cases shouldn't be used. Instead check out our [wiki](https://docs.pleroma.social) for platform-specific installation instructions, most likely [Installing on Linux using OTP releases](https://docs.pleroma.social/otp_en.html) is the guide you need.
+
+### OTP releases (Recommended)
+If you are running Linux (glibc or musl) on x86/arm, the recommended way to install Pleroma is by using OTP releases. OTP releases are as close as you can get to binary releases with Erlang/Elixir. The release is self-contained, and provides everything needed to boot it. The installation instructions are available [here](https://docs-develop.pleroma.social/backend/installation/otp_en/).
+
+### From Source
+If your platform is not supported, or you just want to be able to edit the source code easily, you may install Pleroma from source.
+
+- [Debian-based](https://docs-develop.pleroma.social/backend/installation/debian_based_en/)
+- [Debian-based (jp)](https://docs-develop.pleroma.social/backend/installation/debian_based_jp/)
+- [Alpine Linux](https://docs-develop.pleroma.social/backend/installation/alpine_linux_en/)
+- [Arch Linux](https://docs-develop.pleroma.social/backend/installation/arch_linux_en/)
+- [Gentoo Linux](https://docs-develop.pleroma.social/backend/installation/gentoo_en/)
+- [NetBSD](https://docs-develop.pleroma.social/backend/installation/netbsd_en/)
+- [OpenBSD](https://docs-develop.pleroma.social/backend/installation/openbsd_en/)
+- [OpenBSD (fi)](https://docs-develop.pleroma.social/backend/installation/openbsd_fi/)
+- [CentOS 7](https://docs-develop.pleroma.social/backend/installation/centos7_en/)
### OS/Distro packages
-Currently Pleroma is not packaged by any OS/Distros, but feel free to reach out to us at [#pleroma-dev on freenode](https://webchat.freenode.net/?channels=%23pleroma-dev) or via matrix at for assistance. If you want to change default options in your Pleroma package, please **discuss it with us first**.
+Currently Pleroma is not packaged by any OS/Distros, but if you want to package it for one, we can guide you through the process on our [community channels](#community-channels). If you want to change default options in your Pleroma package, please **discuss it with us first**.
### Docker
While we don’t provide docker files, other people have written very good ones. Take a look at or .
-### Dependencies
+## Documentation
+- Latest Released revision:
+- Latest Git revision:
-* Postgresql version 9.6 or newer, including the contrib modules
-* Elixir version 1.7 or newer. If your distribution only has an old version available, check [Elixir’s install page](https://elixir-lang.org/install.html) or use a tool like [asdf](https://github.com/asdf-vm/asdf).
-* Build-essential tools
-
-### Configuration
-
-* Run `mix deps.get` to install elixir dependencies.
-* Run `mix pleroma.instance gen`. This will ask you questions about your instance and generate a configuration file in `config/generated_config.exs`. Check that and copy it to either `config/dev.secret.exs` or `config/prod.secret.exs`. It will also create a `config/setup_db.psql`, which you should run as the PostgreSQL superuser (i.e., `sudo -u postgres psql -f config/setup_db.psql`). It will create the database, user, and password you gave `mix pleroma.gen.instance` earlier, as well as set up the necessary extensions in the database. PostgreSQL superuser privileges are only needed for this step.
-* For these next steps, the default will be to run pleroma using the dev configuration file, `config/dev.secret.exs`. To run them using the prod config file, prefix each command at the shell with `MIX_ENV=prod`. For example: `MIX_ENV=prod mix phx.server`. Documentation for the config can be found at [`docs/config.md`](docs/config.md) in the repository, or at the "Configuration" page on
-* Run `mix ecto.migrate` to run the database migrations. You will have to do this again after certain updates.
-* You can check if your instance is configured correctly by running it with `mix phx.server` and checking the instance info endpoint at `/api/v1/instance`. If it shows your uri, name and email correctly, you are configured correctly. If it shows something like `localhost:4000`, your configuration is probably wrong, unless you are running a local development setup.
-* The common and convenient way for adding HTTPS is by using Nginx as a reverse proxy. You can look at example Nginx configuration in `installation/pleroma.nginx`. If you need TLS/SSL certificates for HTTPS, you can look get some for free with letsencrypt: . The simplest way to obtain and install a certificate is to use [Certbot.](https://certbot.eff.org) Depending on your specific setup, certbot may be able to get a certificate and configure your web server automatically.
-
-## Running
-
-* By default, it listens on port 4000 (TCP), so you can access it on (if you are on the same machine). In case of an error it will restart automatically.
-
-### Frontends
-
-Pleroma comes with two frontends. The first one, Pleroma FE, can be reached by normally visiting the site. The other one, based on the Mastodon project, can be found by visiting the /web path of your site.
-
-### As systemd service (with provided .service file)
-
-Example .service file can be found in `installation/pleroma.service`. Copy this to `/etc/systemd/system/`. Running `systemctl enable --now pleroma.service` will run Pleroma and enable startup on boot. Logs can be watched by using `journalctl -fu pleroma.service`.
-
-### As OpenRC service (with provided RC file)
-
-Copy `installation/init.d/pleroma` to `/etc/init.d/pleroma`. You can add it to the services ran by default with: `rc-update add pleroma`
-
-### Standalone/run by other means
-
-Run `mix phx.server` in repository’s root, it will output log into stdout/stderr.
-
-### Using an upstream proxy for federation
-
-Add the following to your `dev.secret.exs` or `prod.secret.exs` if you want to proxify all http requests that Pleroma makes to an upstream proxy server:
-
-```elixir
-config :pleroma, :http,
- proxy_url: "127.0.0.1:8123"
-```
-
-This is useful for running Pleroma inside Tor or I2P.
-
-## Customization and contribution
-
-The [Pleroma Documentation](https://docs-develop.pleroma.social) offers manuals and guides on how to further customize your instance to your liking and how you can contribute to the project.
-
-## Troubleshooting
-
-### No incoming federation
-
-Check that you correctly forward the `host` header to the backend. It is needed to validate signatures.
+## Community Channels
+* IRC: **#pleroma** and **#pleroma-dev** on freenode, webchat is available at
+* Matrix: and
diff --git a/config/config.exs b/config/config.exs
index 787809b27..54de8fa9f 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -90,7 +90,7 @@
config :pleroma, Pleroma.Upload,
uploader: Pleroma.Uploaders.Local,
filters: [Pleroma.Upload.Filter.Dedupe],
- link_name: true,
+ link_name: false,
proxy_remote: false,
proxy_opts: [
redirect_on_failure: false,
@@ -257,7 +257,7 @@
mrf_transparency_exclusions: [],
autofollowed_nicknames: [],
max_pinned_statuses: 1,
- no_attachment_links: false,
+ no_attachment_links: true,
welcome_user_nickname: nil,
welcome_message: nil,
max_report_comment_size: 1000,
@@ -276,6 +276,12 @@
external_user_synchronization: true,
extended_nickname_format: false
+config :pleroma, :feed,
+ post_title: %{
+ max_length: 100,
+ omission: "..."
+ }
+
config :pleroma, :markup,
# XXX - unfortunately, inline images must be enabled by default right now, because
# of custom emoji. Issue #275 discusses defanging that somehow.
diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md
index 3427ae419..8f609fcfd 100644
--- a/docs/configuration/cheatsheet.md
+++ b/docs/configuration/cheatsheet.md
@@ -6,10 +6,370 @@ Pleroma configuration works by first importing the base config (`config/config.e
You shouldn't edit the base config directly to avoid breakages and merge conflicts, but it can be used as a reference if you don't understand how an option is supposed to be formatted, the latest version of it can be viewed [here](https://git.pleroma.social/pleroma/pleroma/blob/develop/config/config.exs).
+## :instance
+* `name`: The instance’s name.
+* `email`: Email used to reach an Administrator/Moderator of the instance.
+* `notify_email`: Email used for notifications.
+* `description`: The instance’s description, can be seen in nodeinfo and ``/api/v1/instance``.
+* `limit`: Posts character limit (CW/Subject included in the counter).
+* `remote_limit`: Hard character limit beyond which remote posts will be dropped.
+* `upload_limit`: File size limit of uploads (except for avatar, background, banner).
+* `avatar_upload_limit`: File size limit of user’s profile avatars.
+* `background_upload_limit`: File size limit of user’s profile backgrounds.
+* `banner_upload_limit`: File size limit of user’s profile banners.
+* `poll_limits`: A map with poll limits for **local** polls.
+ * `max_options`: Maximum number of options.
+ * `max_option_chars`: Maximum number of characters per option.
+ * `min_expiration`: Minimum expiration time (in seconds).
+ * `max_expiration`: Maximum expiration time (in seconds).
+* `registrations_open`: Enable registrations for anyone, invitations can be enabled when false.
+* `invites_enabled`: Enable user invitations for admins (depends on `registrations_open: false`).
+* `account_activation_required`: Require users to confirm their emails before signing in.
+* `federating`: Enable federation with other instances.
+* `federation_incoming_replies_max_depth`: Max. depth of reply-to activities fetching on incoming federation, to prevent out-of-memory situations while fetching very long threads. If set to `nil`, threads of any depth will be fetched. Lower this value if you experience out-of-memory crashes.
+* `federation_reachability_timeout_days`: Timeout (in days) of each external federation target being unreachable prior to pausing federating to it.
+* `allow_relay`: Enable Pleroma’s Relay, which makes it possible to follow a whole instance.
+* `rewrite_policy`: Message Rewrite Policy, either one or a list. Here are the ones available by default:
+ * `Pleroma.Web.ActivityPub.MRF.NoOpPolicy`: Doesn’t modify activities (default).
+ * `Pleroma.Web.ActivityPub.MRF.DropPolicy`: Drops all activities. It generally doesn’t makes sense to use in production.
+ * `Pleroma.Web.ActivityPub.MRF.SimplePolicy`: Restrict the visibility of activities from certains instances (See [`:mrf_simple`](#mrf_simple)).
+ * `Pleroma.Web.ActivityPub.MRF.TagPolicy`: Applies policies to individual users based on tags, which can be set using pleroma-fe/admin-fe/any other app that supports Pleroma Admin API. For example it allows marking posts from individual users nsfw (sensitive).
+ * `Pleroma.Web.ActivityPub.MRF.SubchainPolicy`: Selectively runs other MRF policies when messages match (See [`:mrf_subchain`](#mrf_subchain)).
+ * `Pleroma.Web.ActivityPub.MRF.RejectNonPublic`: Drops posts with non-public visibility settings (See [`:mrf_rejectnonpublic`](#mrf_rejectnonpublic)).
+ * `Pleroma.Web.ActivityPub.MRF.EnsureRePrepended`: Rewrites posts to ensure that replies to posts with subjects do not have an identical subject and instead begin with re:.
+ * `Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy`: Rejects posts from likely spambots by rejecting posts from new users that contain links.
+ * `Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy`: Crawls attachments using their MediaProxy URLs so that the MediaProxy cache is primed.
+ * `Pleroma.Web.ActivityPub.MRF.MentionPolicy`: Drops posts mentioning configurable users. (See [`:mrf_mention`](#mrf_mention)).
+ * `Pleroma.Web.ActivityPub.MRF.VocabularyPolicy`: Restricts activities to a configured set of vocabulary. (See [`:mrf_vocabulary`](#mrf_vocabulary)).
+* `public`: Makes the client API in authentificated mode-only except for user-profiles. Useful for disabling the Local Timeline and The Whole Known Network.
+* `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).
+* `mrf_transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo).
+* `mrf_transparency_exclusions`: Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value.
+* `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.
+* `max_pinned_statuses`: The maximum number of pinned statuses. `0` will disable the feature.
+* `autofollowed_nicknames`: Set to nicknames of (local) users that every new user should automatically follow.
+* `no_attachment_links`: Set to true to disable automatically adding attachment link text to statuses.
+* `welcome_message`: A message that will be send to a newly registered users as a direct message.
+* `welcome_user_nickname`: The nickname of the local user that sends the welcome message.
+* `max_report_comment_size`: The maximum size of the report comment (Default: `1000`).
+* `safe_dm_mentions`: 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`.
+* `healthcheck`: If set to true, system data will be shown on ``/api/pleroma/healthcheck``.
+* `remote_post_retention_days`: The default amount of days to retain remote posts when pruning the database.
+* `user_bio_length`: A user bio maximum length (default: `5000`).
+* `user_name_length`: A user name maximum length (default: `100`).
+* `skip_thread_containment`: Skip filter out broken threads. The default is `false`.
+* `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`.
+* `max_account_fields`: The maximum number of custom fields in the user profile (default: `10`).
+* `max_remote_account_fields`: The maximum number of custom fields in the remote user profile (default: `20`).
+* `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.
-## Pleroma.Upload
-* `uploader`: Select which `Pleroma.Uploaders` to use
-* `filters`: List of `Pleroma.Upload.Filter` to use.
+!!! danger
+ This is a Work In Progress, not usable just yet
+
+* `dynamic_configuration`: Allow transferring configuration to DB with the subsequent customization from Admin api.
+
+## Federation
+### MRF policies
+
+!!! note
+ Configuring MRF policies is not enough for them to take effect. You have to enable them by specifying their module in `rewrite_policy` under [:instance](#instance) section.
+
+#### :mrf_simple
+* `media_removal`: List of instances to remove media from.
+* `media_nsfw`: List of instances to put media as NSFW(sensitive) from.
+* `federated_timeline_removal`: List of instances to remove from Federated (aka The Whole Known Network) Timeline.
+* `reject`: List of instances to reject any activities from.
+* `accept`: List of instances to accept any activities from.
+* `report_removal`: List of instances to reject reports from.
+* `avatar_removal`: List of instances to strip avatars from.
+* `banner_removal`: List of instances to strip banners from.
+
+#### :mrf_subchain
+This policy processes messages through an alternate pipeline when a given message matches certain criteria.
+All criteria are configured as a map of regular expressions to lists of policy modules.
+
+* `match_actor`: Matches a series of regular expressions against the actor field.
+
+Example:
+
+```elixir
+config :pleroma, :mrf_subchain,
+ match_actor: %{
+ ~r/https:\/\/example.com/s => [Pleroma.Web.ActivityPub.MRF.DropPolicy]
+ }
+```
+
+#### :mrf_rejectnonpublic
+* `allow_followersonly`: whether to allow followers-only posts.
+* `allow_direct`: whether to allow direct messages.
+
+#### :mrf_hellthread
+* `delist_threshold`: Number of mentioned users after which the message gets delisted (the message can still be seen, but it will not show up in public timelines and mentioned users won't get notifications about it). Set to 0 to disable.
+* `reject_threshold`: Number of mentioned users after which the messaged gets rejected. Set to 0 to disable.
+
+#### :mrf_keyword
+* `reject`: A list of patterns which result in message being rejected, each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html).
+* `federated_timeline_removal`: A list of patterns which result in message being removed from federated timelines (a.k.a unlisted), each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html).
+* `replace`: A list of tuples containing `{pattern, replacement}`, `pattern` can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html).
+
+#### :mrf_mention
+* `actors`: A list of actors, for which to drop any posts mentioning.
+
+#### :mrf_vocabulary
+* `accept`: A list of ActivityStreams terms to accept. If empty, all supported messages are accepted.
+* `reject`: A list of ActivityStreams terms to reject. If empty, no messages are rejected.
+
+#### :mrf_user_allowlist
+
+The keys in this section are the domain names that the policy should apply to.
+Each key should be assigned a list of users that should be allowed through by
+their ActivityPub ID.
+
+An example:
+
+```elixir
+config :pleroma, :mrf_user_allowlist,
+ "example.org": ["https://example.org/users/admin"]
+```
+
+### :activitypub
+* ``unfollow_blocked``: Whether blocks result in people getting unfollowed
+* ``outgoing_blocks``: Whether to federate blocks to other instances
+* ``deny_follow_blocked``: Whether to disallow following an account that has blocked the user in question
+* ``sign_object_fetches``: Sign object fetches with HTTP signatures
+
+### :fetch_initial_posts
+* `enabled`: if enabled, when a new user is federated with, fetch some of their latest posts
+* `pages`: the amount of pages to fetch
+
+## Pleroma.ScheduledActivity
+
+* `daily_user_limit`: the number of scheduled activities a user is allowed to create in a single day (Default: `25`)
+* `total_user_limit`: the number of scheduled activities a user is allowed to create in total (Default: `300`)
+* `enabled`: whether scheduled activities are sent to the job queue to be executed
+
+## Pleroma.ActivityExpiration
+
+* `enabled`: whether expired activities will be sent to the job queue to be deleted
+
+## Frontends
+
+### :frontend_configurations
+
+This can be used to configure a keyword list that keeps the configuration data for any kind of frontend. By default, settings for `pleroma_fe` and `masto_fe` are configured. You can find the documentation for `pleroma_fe` configuration into [Pleroma-FE configuration and customization for instance administrators](/frontend/CONFIGURATION/#options).
+
+Frontends can access these settings at `/api/pleroma/frontend_configurations`
+
+To add your own configuration for PleromaFE, use it like this:
+
+```elixir
+config :pleroma, :frontend_configurations,
+ pleroma_fe: %{
+ theme: "pleroma-dark",
+ # ... see /priv/static/static/config.json for the available keys.
+},
+ masto_fe: %{
+ showInstanceSpecificPanel: true
+ }
+```
+
+These settings **need to be complete**, they will override the defaults.
+
+### :assets
+
+This section configures assets to be used with various frontends. Currently the only option
+relates to mascots on the mastodon frontend
+
+* `mascots`: KeywordList of mascots, each element __MUST__ contain both a `url` and a
+ `mime_type` key.
+* `default_mascot`: An element from `mascots` - This will be used as the default mascot
+ on MastoFE (default: `:pleroma_fox_tan`).
+
+### :manifest
+
+This section describe PWA manifest instance-specific values. Currently this option relate only for MastoFE.
+
+* `icons`: Describe the icons of the app, this a list of maps describing icons in the same way as the
+ [spec](https://www.w3.org/TR/appmanifest/#imageresource-and-its-members) describes it.
+
+ Example:
+
+ ```elixir
+ config :pleroma, :manifest,
+ icons: [
+ %{
+ src: "/static/logo.png"
+ },
+ %{
+ src: "/static/icon.png",
+ type: "image/png"
+ },
+ %{
+ src: "/static/icon.ico",
+ sizes: "72x72 96x96 128x128 256x256"
+ }
+ ]
+ ```
+
+* `theme_color`: Describe the theme color of the app. (Example: `"#282c37"`, `"rebeccapurple"`).
+* `background_color`: Describe the background color of the app. (Example: `"#191b22"`, `"aliceblue"`).
+
+## :emoji
+* `shortcode_globs`: Location of custom emoji files. `*` can be used as a wildcard. Example `["/emoji/custom/**/*.png"]`
+* `pack_extensions`: A list of file extensions for emojis, when no emoji.txt for a pack is present. Example `[".png", ".gif"]`
+* `groups`: Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the groupname and the value the location or array of locations. `*` can be used as a wildcard. Example `[Custom: ["/emoji/*.png", "/emoji/custom/*.png"]]`
+* `default_manifest`: 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).
+* `shared_pack_cache_seconds_per_file`: 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.
+
+## :media_proxy
+* `enabled`: Enables proxying of remote media to the instance’s proxy
+* `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts.
+* `proxy_opts`: All options defined in `Pleroma.ReverseProxy` documentation, defaults to `[max_body_length: (25*1_048_576)]`.
+* `whitelist`: List of domains to bypass the mediaproxy
+
+## Link previews
+
+### Pleroma.Web.Metadata (provider)
+* `providers`: a list of metadata providers to enable. Providers available:
+ * `Pleroma.Web.Metadata.Providers.OpenGraph`
+ * `Pleroma.Web.Metadata.Providers.TwitterCard`
+ * `Pleroma.Web.Metadata.Providers.RelMe` - add links from user bio with rel=me into the `` as ``.
+ * `Pleroma.Web.Metadata.Providers.Feed` - add a link to a user's Atom feed into the `` as ``.
+* `unfurl_nsfw`: If set to `true` nsfw attachments will be shown in previews.
+
+### :rich_media (consumer)
+* `enabled`: if enabled the instance will parse metadata from attached links to generate link previews.
+* `ignore_hosts`: list of hosts which will be ignored by the metadata parser. For example `["accounts.google.com", "xss.website"]`, defaults to `[]`.
+* `ignore_tld`: list TLDs (top-level domains) which will ignore for parse metadata. default is ["local", "localdomain", "lan"].
+* `parsers`: list of Rich Media parsers.
+
+## HTTP server
+
+### Pleroma.Web.Endpoint
+
+!!! note
+ `Phoenix` endpoint configuration, all configuration options can be viewed [here](https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#module-dynamic-configuration), only common options are listed here.
+
+* `http` - a list containing http protocol configuration, all configuration options can be viewed [here](https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html#module-options), only common options are listed here. For deployment using docker, you need to set this to `[ip: {0,0,0,0}, port: 4000]` to make pleroma accessible from other containers (such as your nginx server).
+ - `ip` - a tuple consisting of 4 integers
+ - `port`
+* `url` - a list containing the configuration for generating urls, accepts
+ - `host` - the host without the scheme and a post (e.g `example.com`, not `https://example.com:2020`)
+ - `scheme` - e.g `http`, `https`
+ - `port`
+ - `path`
+* `extra_cookie_attrs` - a list of `Key=Value` strings to be added as non-standard cookie attributes. Defaults to `["SameSite=Lax"]`. See the [SameSite article](https://www.owasp.org/index.php/SameSite) on OWASP for more info.
+
+Example:
+```elixir
+config :pleroma, Pleroma.Web.Endpoint,
+ url: [host: "example.com", port: 2020, scheme: "https"],
+ http: [
+ port: 8080,
+ ip: {127, 0, 0, 1}
+ ]
+```
+
+This will make Pleroma listen on `127.0.0.1` port `8080` and generate urls starting with `https://example.com:2020`
+
+### :http_security
+* ``enabled``: Whether the managed content security policy is enabled.
+* ``sts``: Whether to additionally send a `Strict-Transport-Security` header.
+* ``sts_max_age``: The maximum age for the `Strict-Transport-Security` header if sent.
+* ``ct_max_age``: The maximum age for the `Expect-CT` header if sent.
+* ``referrer_policy``: The referrer policy to use, either `"same-origin"` or `"no-referrer"`.
+* ``report_uri``: Adds the specified url to `report-uri` and `report-to` group in CSP header.
+
+### Pleroma.Plugs.RemoteIp
+
+!!! warning
+ 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.
+
+Available options:
+
+* `enabled` - Enable/disable the plug. Defaults to `false`.
+* `headers` - 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]`.
+* `proxies` - A list of strings in [CIDR](https://en.wikipedia.org/wiki/CIDR) notation specifying the IPs of known proxies. Defaults to `[]`.
+* `reserved` - Defaults to [localhost](https://en.wikipedia.org/wiki/Localhost) and [private network](https://en.wikipedia.org/wiki/Private_network).
+
+
+### :rate_limit
+
+This is an advanced feature and disabled by default.
+
+If your instance is behind a reverse proxy you must enable and configure [`Pleroma.Plugs.RemoteIp`](#pleroma-plugs-remoteip).
+
+A keyword list of rate limiters where a key is a limiter name and value is the limiter configuration. The basic configuration is a tuple where:
+
+* The first element: `scale` (Integer). The time scale in milliseconds.
+* The second element: `limit` (Integer). How many requests to limit in the time scale provided.
+
+It is also possible to have different limits for unauthenticated and authenticated users: the keyword value must be a list of two tuples where the first one is a config for unauthenticated users and the second one is for authenticated.
+
+Supported rate limiters:
+
+* `:search` for the search requests (account & status search etc.)
+* `:app_account_creation` for registering user accounts from the same IP address
+* `:relations_actions` for actions on relations with all users (follow, unfollow)
+* `:relation_id_action` for actions on relation with a specific user (follow, unfollow)
+* `:statuses_actions` for create / delete / fav / unfav / reblog / unreblog actions on any statuses
+* `:status_id_action` for fav / unfav or reblog / unreblog actions on the same status by the same user
+
+### :web_cache_ttl
+
+The expiration time for the web responses cache. Values should be in milliseconds or `nil` to disable expiration.
+
+Available caches:
+
+* `:activity_pub` - activity pub routes (except question activities). Defaults to `nil` (no expiration).
+* `:activity_pub_question` - activity pub routes (question activities). Defaults to `30_000` (30 seconds).
+
+## :hackney_pools
+
+Advanced. Tweaks Hackney (http client) connections pools.
+
+There's three pools used:
+
+* `:federation` for the federation jobs.
+ You may want this pool max_connections to be at least equal to the number of federator jobs + retry queue jobs.
+* `:media` for rich media, media proxy
+* `:upload` for uploaded media (if using a remote uploader and `proxy_remote: true`)
+
+For each pool, the options are:
+
+* `max_connections` - how much connections a pool can hold
+* `timeout` - retention duration for connections
+
+
+## Captcha
+
+### Pleroma.Captcha
+* `enabled`: Whether the captcha should be shown on registration.
+* `method`: The method/service to use for captcha.
+* `seconds_valid`: The time in seconds for which the captcha is valid.
+
+### Captcha providers
+
+#### Pleroma.Captcha.Kocaptcha
+Kocaptcha is a very simple captcha service with a single API endpoint,
+the source code is here: https://github.com/koto-bank/kocaptcha. The default endpoint
+`https://captcha.kotobank.ch` is hosted by the developer.
+
+* `endpoint`: the Kocaptcha endpoint to use.
+
+## Uploads
+
+### Pleroma.Upload
+* `uploader`: Which one of the [uploaders](#uploaders) to use.
+* `filters`: List of [upload filters](#upload-filters) to use.
* `link_name`: When enabled Pleroma will add a `name` parameter to the url of the upload, for example `https://instance.tld/media/corndog.png?name=corndog.png`. This is needed to provide the correct filename in Content-Disposition headers when using filters like `Pleroma.Upload.Filter.Dedupe`
* `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host.
* `proxy_remote`: If you're using a remote uploader, Pleroma will proxy media requests instead of redirecting to it.
@@ -18,34 +378,40 @@ You shouldn't edit the base config directly to avoid breakages and merge conflic
!!! warning
`strip_exif` has been replaced by `Pleroma.Upload.Filter.Mogrify`.
-## Pleroma.Uploaders.Local
-* `uploads`: Which directory to store the user-uploads in, relative to pleroma’s working directory
+### Uploaders
+#### Pleroma.Uploaders.Local
+* `uploads`: Which directory to store the user-uploads in, relative to pleroma’s working directory.
-## Pleroma.Uploaders.S3
-* `bucket`: S3 bucket name
-* `bucket_namespace`: S3 bucket namespace
+#### Pleroma.Uploaders.S3
+* `bucket`: S3 bucket name.
+* `bucket_namespace`: S3 bucket namespace.
* `public_endpoint`: S3 endpoint that the user finally accesses(ex. "https://s3.dualstack.ap-northeast-1.amazonaws.com")
* `truncated_namespace`: 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.
* `streaming_enabled`: 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.
-## Pleroma.Upload.Filter.Mogrify
+
+### Upload filters
+
+#### Pleroma.Upload.Filter.Mogrify
* `args`: List of actions for the `mogrify` command like `"strip"` or `["strip", "auto-orient", {"implode", "1"}]`.
-## Pleroma.Upload.Filter.Dedupe
+#### Pleroma.Upload.Filter.Dedupe
No specific configuration.
-## Pleroma.Upload.Filter.AnonymizeFilename
+#### Pleroma.Upload.Filter.AnonymizeFilename
This filter replaces the filename (not the path) of an upload. For complete obfuscation, add
`Pleroma.Upload.Filter.Dedupe` before AnonymizeFilename.
* `text`: Text to replace filenames in links. If empty, `{random}.extension` will be used. You can get the original filename extension by using `{extension}`, for example `custom-file-name.{extension}`.
-## Pleroma.Emails.Mailer
+## Email
+
+### Pleroma.Emails.Mailer
* `adapter`: one of the mail adapters listed in [Swoosh readme](https://github.com/swoosh/swoosh#adapters), or `Swoosh.Adapters.Local` for in-memory mailbox.
* `api_key` / `password` and / or other adapter-specific settings, per the above documentation.
* `enabled`: Allows enable/disable send emails. Default: `false`.
@@ -72,77 +438,112 @@ config :pleroma, Pleroma.Emails.Mailer,
auth: :always
```
-## :uri_schemes
-* `valid_schemes`: List of the scheme part that is considered valid to be an URL
+### :email_notifications
-## :instance
-* `name`: The instance’s name
-* `email`: Email used to reach an Administrator/Moderator of the instance
-* `notify_email`: Email used for notifications.
-* `description`: The instance’s description, can be seen in nodeinfo and ``/api/v1/instance``
-* `limit`: Posts character limit (CW/Subject included in the counter)
-* `remote_limit`: Hard character limit beyond which remote posts will be dropped.
-* `upload_limit`: File size limit of uploads (except for avatar, background, banner)
-* `avatar_upload_limit`: File size limit of user’s profile avatars
-* `background_upload_limit`: File size limit of user’s profile backgrounds
-* `banner_upload_limit`: File size limit of user’s profile banners
-* `poll_limits`: A map with poll limits for **local** polls
- * `max_options`: Maximum number of options
- * `max_option_chars`: Maximum number of characters per option
- * `min_expiration`: Minimum expiration time (in seconds)
- * `max_expiration`: Maximum expiration time (in seconds)
-* `registrations_open`: Enable registrations for anyone, invitations can be enabled when false.
-* `invites_enabled`: Enable user invitations for admins (depends on `registrations_open: false`).
-* `account_activation_required`: Require users to confirm their emails before signing in.
-* `federating`: Enable federation with other instances
-* `federation_incoming_replies_max_depth`: Max. depth of reply-to activities fetching on incoming federation, to prevent out-of-memory situations while fetching very long threads. If set to `nil`, threads of any depth will be fetched. Lower this value if you experience out-of-memory crashes.
-* `federation_reachability_timeout_days`: Timeout (in days) of each external federation target being unreachable prior to pausing federating to it.
-* `allow_relay`: Enable Pleroma’s Relay, which makes it possible to follow a whole instance
-* `rewrite_policy`: Message Rewrite Policy, either one or a list. Here are the ones available by default:
- * `Pleroma.Web.ActivityPub.MRF.NoOpPolicy`: Doesn’t modify activities (default)
- * `Pleroma.Web.ActivityPub.MRF.DropPolicy`: Drops all activities. It generally doesn’t makes sense to use in production
- * `Pleroma.Web.ActivityPub.MRF.SimplePolicy`: Restrict the visibility of activities from certains instances (See ``:mrf_simple`` section)
- * `Pleroma.Web.ActivityPub.MRF.TagPolicy`: Applies policies to individual users based on tags, which can be set using pleroma-fe/admin-fe/any other app that supports Pleroma Admin API. For example it allows marking posts from individual users nsfw (sensitive)
- * `Pleroma.Web.ActivityPub.MRF.SubchainPolicy`: Selectively runs other MRF policies when messages match (see ``:mrf_subchain`` section)
- * `Pleroma.Web.ActivityPub.MRF.RejectNonPublic`: Drops posts with non-public visibility settings (See ``:mrf_rejectnonpublic`` section)
- * `Pleroma.Web.ActivityPub.MRF.EnsureRePrepended`: Rewrites posts to ensure that replies to posts with subjects do not have an identical subject and instead begin with re:.
- * `Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy`: Rejects posts from likely spambots by rejecting posts from new users that contain links.
- * `Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy`: Crawls attachments using their MediaProxy URLs so that the MediaProxy cache is primed.
- * `Pleroma.Web.ActivityPub.MRF.MentionPolicy`: Drops posts mentioning configurable users. (see `:mrf_mention` section)
- * `Pleroma.Web.ActivityPub.MRF.VocabularyPolicy`: Restricts activities to a configured set of vocabulary. (see `:mrf_vocabulary` section)
-* `public`: Makes the client API in authentificated mode-only except for user-profiles. Useful for disabling the Local Timeline and The Whole Known Network.
-* `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 this config or in ``static/config.json``
-* `allowed_post_formats`: MIME-type list of formats allowed to be posted (transformed into HTML)
-* `mrf_transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo).
-* `mrf_transparency_exclusions`: Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value.
-* `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.
-* `max_pinned_statuses`: The maximum number of pinned statuses. `0` will disable the feature.
-* `autofollowed_nicknames`: Set to nicknames of (local) users that every new user should automatically follow.
-* `no_attachment_links`: Set to true to disable automatically adding attachment link text to statuses
-* `welcome_message`: A message that will be send to a newly registered users as a direct message.
-* `welcome_user_nickname`: The nickname of the local user that sends the welcome message.
-* `max_report_comment_size`: The maximum size of the report comment (Default: `1000`)
-* `safe_dm_mentions`: 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`.
-* `healthcheck`: If set to true, system data will be shown on ``/api/pleroma/healthcheck``.
-* `remote_post_retention_days`: The default amount of days to retain remote posts when pruning the database.
-* `user_bio_length`: A user bio maximum length (default: `5000`)
-* `user_name_length`: A user name maximum length (default: `100`)
-* `skip_thread_containment`: Skip filter out broken threads. The default is `false`.
-* `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`.
-* `max_account_fields`: The maximum number of custom fields in the user profile (default: `10`)
-* `max_remote_account_fields`: The maximum number of custom fields in the remote user profile (default: `20`)
-* `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.
+Email notifications settings.
-!!! danger
- This is a Work In Progress, not usable just yet
+ - digest - emails of "what you've missed" for users who have been
+ inactive for a while.
+ - active: globally enable or disable digest emails
+ - schedule: When to send digest email, in [crontab format](https://en.wikipedia.org/wiki/Cron).
+ "0 0 * * 0" is the default, meaning "once a week at midnight on Sunday morning"
+ - interval: Minimum interval between digest emails to one user
+ - inactivity_threshold: Minimum user inactivity threshold
-* `dynamic_configuration`: Allow transferring configuration to DB with the subsequent customization from Admin api.
+### Pleroma.Emails.UserEmail
+- `:logo` - a path to a custom logo. Set it to `nil` to use the default Pleroma logo.
+- `:styling` - a map with color settings for email templates.
+## Background jobs
+
+### Oban
+
+[Oban](https://github.com/sorentwo/oban) asynchronous job processor configuration.
+
+Configuration options described in [Oban readme](https://github.com/sorentwo/oban#usage):
+
+* `repo` - app's Ecto repo (`Pleroma.Repo`)
+* `verbose` - logs verbosity
+* `prune` - non-retryable jobs [pruning settings](https://github.com/sorentwo/oban#pruning) (`:disabled` / `{:maxlen, value}` / `{:maxage, value}`)
+* `queues` - job queues (see below)
+
+Pleroma has the following queues:
+
+* `activity_expiration` - Activity expiration
+* `federator_outgoing` - Outgoing federation
+* `federator_incoming` - Incoming federation
+* `mailer` - Email sender, see [`Pleroma.Emails.Mailer`](#pleromaemailsmailer)
+* `transmogrifier` - Transmogrifier
+* `web_push` - Web push notifications
+* `scheduled_activities` - Scheduled activities, see [`Pleroma.ScheduledActivity`](#pleromascheduledactivity)
+
+Example:
+
+```elixir
+config :pleroma, Oban,
+ repo: Pleroma.Repo,
+ verbose: false,
+ prune: {:maxlen, 1500},
+ queues: [
+ federator_incoming: 50,
+ federator_outgoing: 50
+ ]
+```
+
+This config contains two queues: `federator_incoming` and `federator_outgoing`. Both have the number of max concurrent jobs set to `50`.
+
+#### Migrating `pleroma_job_queue` settings
+
+`config :pleroma_job_queue, :queues` is replaced by `config :pleroma, Oban, :queues` and uses the same format (keys are queues' names, values are max concurrent jobs numbers).
+
+### :workers
+
+Includes custom worker options not interpretable directly by `Oban`.
+
+* `retries` — keyword lists where keys are `Oban` queues (see above) and values are numbers of max attempts for failed jobs.
+
+Example:
+
+```elixir
+config :pleroma, :workers,
+ retries: [
+ federator_incoming: 5,
+ federator_outgoing: 5
+ ]
+```
+
+#### Migrating `Pleroma.Web.Federator.RetryQueue` settings
+
+* `max_retries` is replaced with `config :pleroma, :workers, retries: [federator_outgoing: 5]`
+* `enabled: false` corresponds to `config :pleroma, :workers, retries: [federator_outgoing: 1]`
+* deprecated options: `max_jobs`, `initial_timeout`
+
+### Pleroma.Scheduler
+
+Configuration for [Quantum](https://github.com/quantum-elixir/quantum-core) jobs scheduler.
+
+See [Quantum readme](https://github.com/quantum-elixir/quantum-core#usage) for the list of supported options.
+
+Example:
+
+```elixir
+config :pleroma, Pleroma.Scheduler,
+ global: true,
+ overlap: true,
+ timezone: :utc,
+ jobs: [{"0 */6 * * * *", {Pleroma.Web.Websub, :refresh_subscriptions, []}}]
+```
+
+The above example defines a single job which invokes `Pleroma.Web.Websub.refresh_subscriptions()` every 6 hours ("0 */6 * * * *", [crontab format](https://en.wikipedia.org/wiki/Cron)).
+
+## :web_push_encryption, :vapid_details
+
+Web Push Notifications configuration. You can use the mix task `mix web_push.gen.keypair` to generate it.
+
+* ``subject``: a mailto link for the administrative contact. It’s best if this email is not a personal email address, but rather a group email so that if a person leaves an organization, is unavailable for an extended period, or otherwise can’t respond, someone else on the list can.
+* ``public_key``: VAPID public key
+* ``private_key``: VAPID private key
## :logger
* `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog, and `Quack.Logger` to log to Slack
@@ -187,430 +588,26 @@ config :quack,
See the [Quack Github](https://github.com/azohra/quack) for more details
-## :frontend_configurations
-This can be used to configure a keyword list that keeps the configuration data for any kind of frontend. By default, settings for `pleroma_fe` and `masto_fe` are configured. You can find the documentation for `pleroma_fe` configuration into [Pleroma-FE configuration and customization for instance administrators](/frontend/CONFIGURATION/#options).
-Frontends can access these settings at `/api/pleroma/frontend_configurations`
+## Database options
-To add your own configuration for PleromaFE, use it like this:
+### RUM indexing for full text search
+* `rum_enabled`: If RUM indexes should be used. Defaults to `false`.
-```elixir
-config :pleroma, :frontend_configurations,
- pleroma_fe: %{
- theme: "pleroma-dark",
- # ... see /priv/static/static/config.json for the available keys.
-},
- masto_fe: %{
- showInstanceSpecificPanel: true
- }
-```
+RUM indexes are an alternative indexing scheme that is not included in PostgreSQL by default. While they may eventually be mainlined, for now they have to be installed as a PostgreSQL extension from https://github.com/postgrespro/rum.
-These settings **need to be complete**, they will override the defaults.
+Their advantage over the standard GIN indexes is that they allow efficient ordering of search results by timestamp, which makes search queries a lot faster on larger servers, by one or two orders of magnitude. They take up around 3 times as much space as GIN indexes.
-NOTE: for versions < 1.0, you need to set [`:fe`](#fe) to false, as shown a few lines below.
+To enable them, both the `rum_enabled` flag has to be set and the following special migration has to be run:
-## :fe
-!!! warning
- __THIS IS DEPRECATED__
+`mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/`
- If you are using this method, please change it to the [`frontend_configurations`](#frontend_configurations) method.
- Please **set this option to false** in your config like this:
+This will probably take a long time.
- ```elixir
- config :pleroma, :fe, false
- ```
+## Alternative client protocols
-This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:instance`` is set to false.
-
-* `theme`: Which theme to use, they are defined in ``styles.json``
-* `logo`: URL of the logo, defaults to Pleroma’s logo
-* `logo_mask`: Whether to use only the logo's shape as a mask (true) or as a regular image (false)
-* `logo_margin`: What margin to use around the logo
-* `background`: URL of the background, unless viewing a user profile with a background that is set
-* `redirect_root_no_login`: relative URL which indicates where to redirect when a user isn’t logged in.
-* `redirect_root_login`: relative URL which indicates where to redirect when a user is logged in.
-* `show_instance_panel`: Whenether to show the instance’s specific panel.
-* `scope_options_enabled`: Enable setting an notice visibility and subject/CW when posting
-* `formatting_options_enabled`: Enable setting a formatting different than plain-text (ie. HTML, Markdown) when posting, relates to ``:instance, allowed_post_formats``
-* `collapse_message_with_subjects`: When a message has a subject(aka Content Warning), collapse it by default
-* `hide_post_stats`: Hide notices statistics(repeats, favorites, …)
-* `hide_user_stats`: Hide profile statistics(posts, posts per day, followers, followings, …)
-
-## :assets
-
-This section configures assets to be used with various frontends. Currently the only option
-relates to mascots on the mastodon frontend
-
-* `mascots`: KeywordList of mascots, each element __MUST__ contain both a `url` and a
- `mime_type` key.
-* `default_mascot`: An element from `mascots` - This will be used as the default mascot
- on MastoFE (default: `:pleroma_fox_tan`)
-
-## :manifest
-
-This section describe PWA manifest instance-specific values. Currently this option relate only for MastoFE.
-
-* `icons`: Describe the icons of the app, this a list of maps describing icons in the same way as the
- [spec](https://www.w3.org/TR/appmanifest/#imageresource-and-its-members) describes it.
-
- Example:
-
- ```elixir
- config :pleroma, :manifest,
- icons: [
- %{
- src: "/static/logo.png"
- },
- %{
- src: "/static/icon.png",
- type: "image/png"
- },
- %{
- src: "/static/icon.ico",
- sizes: "72x72 96x96 128x128 256x256"
- }
- ]
- ```
-
-* `theme_color`: Describe the theme color of the app. (Example: `"#282c37"`, `"rebeccapurple"`)
-* `background_color`: Describe the background color of the app. (Example: `"#191b22"`, `"aliceblue"`)
-
-## :mrf_simple
-* `media_removal`: List of instances to remove medias from
-* `media_nsfw`: List of instances to put medias as NSFW(sensitive) from
-* `federated_timeline_removal`: List of instances to remove from Federated (aka The Whole Known Network) Timeline
-* `reject`: List of instances to reject any activities from
-* `accept`: List of instances to accept any activities from
-* `report_removal`: List of instances to reject reports from
-* `avatar_removal`: List of instances to strip avatars from
-* `banner_removal`: List of instances to strip banners from
-
-## :mrf_subchain
-This policy processes messages through an alternate pipeline when a given message matches certain criteria.
-All criteria are configured as a map of regular expressions to lists of policy modules.
-
-* `match_actor`: Matches a series of regular expressions against the actor field.
-
-Example:
-
-```elixir
-config :pleroma, :mrf_subchain,
- match_actor: %{
- ~r/https:\/\/example.com/s => [Pleroma.Web.ActivityPub.MRF.DropPolicy]
- }
-```
-
-## :mrf_rejectnonpublic
-* `allow_followersonly`: whether to allow followers-only posts
-* `allow_direct`: whether to allow direct messages
-
-## :mrf_hellthread
-* `delist_threshold`: Number of mentioned users after which the message gets delisted (the message can still be seen, but it will not show up in public timelines and mentioned users won't get notifications about it). Set to 0 to disable.
-* `reject_threshold`: Number of mentioned users after which the messaged gets rejected. Set to 0 to disable.
-
-## :mrf_keyword
-* `reject`: A list of patterns which result in message being rejected, each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html)
-* `federated_timeline_removal`: A list of patterns which result in message being removed from federated timelines (a.k.a unlisted), each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html)
-* `replace`: A list of tuples containing `{pattern, replacement}`, `pattern` can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html)
-
-## :mrf_mention
-* `actors`: A list of actors, for which to drop any posts mentioning.
-
-## :mrf_vocabulary
-* `accept`: A list of ActivityStreams terms to accept. If empty, all supported messages are accepted.
-* `reject`: A list of ActivityStreams terms to reject. If empty, no messages are rejected.
-
-## :media_proxy
-* `enabled`: Enables proxying of remote media to the instance’s proxy
-* `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts.
-* `proxy_opts`: All options defined in `Pleroma.ReverseProxy` documentation, defaults to `[max_body_length: (25*1_048_576)]`.
-* `whitelist`: List of domains to bypass the mediaproxy
-
-## :gopher
-* `enabled`: Enables the gopher interface
-* `ip`: IP address to bind to
-* `port`: Port to bind to
-* `dstport`: Port advertised in urls (optional, defaults to `port`)
-
-## Pleroma.Web.Endpoint
-
-!!! note
- `Phoenix` endpoint configuration, all configuration options can be viewed [here](https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#module-dynamic-configuration), only common options are listed here.
-
-* `http` - a list containing http protocol configuration, all configuration options can be viewed [here](https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html#module-options), only common options are listed here. For deployment using docker, you need to set this to `[ip: {0,0,0,0}, port: 4000]` to make pleroma accessible from other containers (such as your nginx server).
- - `ip` - a tuple consisting of 4 integers
- - `port`
-* `url` - a list containing the configuration for generating urls, accepts
- - `host` - the host without the scheme and a post (e.g `example.com`, not `https://example.com:2020`)
- - `scheme` - e.g `http`, `https`
- - `port`
- - `path`
-* `extra_cookie_attrs` - a list of `Key=Value` strings to be added as non-standard cookie attributes. Defaults to `["SameSite=Lax"]`. See the [SameSite article](https://www.owasp.org/index.php/SameSite) on OWASP for more info.
-
-
-
-!!! warning
- If you modify anything inside these lists, default `config.exs` values will be overwritten, which may result in breakage, to make sure this does not happen please copy the default value for the list from `config.exs` and modify/add only what you need
-
-Example:
-```elixir
-config :pleroma, Pleroma.Web.Endpoint,
- url: [host: "example.com", port: 2020, scheme: "https"],
- http: [
- # start copied from config.exs
- dispatch: [
- {:_,
- [
- {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
- {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
- {Phoenix.Transports.WebSocket,
- {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
- {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
- ]}
- # end copied from config.exs
- ],
- port: 8080,
- ip: {127, 0, 0, 1}
- ]
-```
-
-This will make Pleroma listen on `127.0.0.1` port `8080` and generate urls starting with `https://example.com:2020`
-
-## :activitypub
-* ``unfollow_blocked``: Whether blocks result in people getting unfollowed
-* ``outgoing_blocks``: Whether to federate blocks to other instances
-* ``deny_follow_blocked``: Whether to disallow following an account that has blocked the user in question
-* ``sign_object_fetches``: Sign object fetches with HTTP signatures
-
-## :http_security
-* ``enabled``: Whether the managed content security policy is enabled
-* ``sts``: Whether to additionally send a `Strict-Transport-Security` header
-* ``sts_max_age``: The maximum age for the `Strict-Transport-Security` header if sent
-* ``ct_max_age``: The maximum age for the `Expect-CT` header if sent
-* ``referrer_policy``: The referrer policy to use, either `"same-origin"` or `"no-referrer"`
-* ``report_uri``: Adds the specified url to `report-uri` and `report-to` group in CSP header.
-
-## :mrf_user_allowlist
-
-The keys in this section are the domain names that the policy should apply to.
-Each key should be assigned a list of users that should be allowed through by
-their ActivityPub ID.
-
-An example:
-
-```elixir
-config :pleroma, :mrf_user_allowlist,
- "example.org": ["https://example.org/users/admin"]
-```
-
-## :web_push_encryption, :vapid_details
-
-Web Push Notifications configuration. You can use the mix task `mix web_push.gen.keypair` to generate it.
-
-* ``subject``: a mailto link for the administrative contact. It’s best if this email is not a personal email address, but rather a group email so that if a person leaves an organization, is unavailable for an extended period, or otherwise can’t respond, someone else on the list can.
-* ``public_key``: VAPID public key
-* ``private_key``: VAPID private key
-
-## Pleroma.Captcha
-* `enabled`: Whether the captcha should be shown on registration
-* `method`: The method/service to use for captcha
-* `seconds_valid`: The time in seconds for which the captcha is valid
-
-### Pleroma.Captcha.Kocaptcha
-Kocaptcha is a very simple captcha service with a single API endpoint,
-the source code is here: https://github.com/koto-bank/kocaptcha. The default endpoint
-`https://captcha.kotobank.ch` is hosted by the developer.
-
-* `endpoint`: the kocaptcha endpoint to use
-
-## :admin_token
-
-Allows to set a token that can be used to authenticate with the admin api without using an actual user by giving it as the 'admin_token' parameter. Example:
-
-```elixir
-config :pleroma, :admin_token, "somerandomtoken"
-```
-
-You can then do
-
-```sh
-curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerandomtoken"
-```
-
-## Oban
-
-[Oban](https://github.com/sorentwo/oban) asynchronous job processor configuration.
-
-Configuration options described in [Oban readme](https://github.com/sorentwo/oban#usage):
-* `repo` - app's Ecto repo (`Pleroma.Repo`)
-* `verbose` - logs verbosity
-* `prune` - non-retryable jobs [pruning settings](https://github.com/sorentwo/oban#pruning) (`:disabled` / `{:maxlen, value}` / `{:maxage, value}`)
-* `queues` - job queues (see below)
-
-Pleroma has the following queues:
-
-* `activity_expiration` - Activity expiration
-* `federator_outgoing` - Outgoing federation
-* `federator_incoming` - Incoming federation
-* `mailer` - Email sender, see [`Pleroma.Emails.Mailer`](#pleromaemailsmailer)
-* `transmogrifier` - Transmogrifier
-* `web_push` - Web push notifications
-* `scheduled_activities` - Scheduled activities, see [`Pleroma.ScheduledActivity`](#pleromascheduledactivity)
-
-Example:
-
-```elixir
-config :pleroma, Oban,
- repo: Pleroma.Repo,
- verbose: false,
- prune: {:maxlen, 1500},
- queues: [
- federator_incoming: 50,
- federator_outgoing: 50
- ]
-```
-
-This config contains two queues: `federator_incoming` and `federator_outgoing`. Both have the number of max concurrent jobs set to `50`.
-
-### Migrating `pleroma_job_queue` settings
-
-`config :pleroma_job_queue, :queues` is replaced by `config :pleroma, Oban, :queues` and uses the same format (keys are queues' names, values are max concurrent jobs numbers).
-
-## :workers
-
-Includes custom worker options not interpretable directly by `Oban`.
-
-* `retries` — keyword lists where keys are `Oban` queues (see above) and values are numbers of max attempts for failed jobs.
-
-Example:
-
-```elixir
-config :pleroma, :workers,
- retries: [
- federator_incoming: 5,
- federator_outgoing: 5
- ]
-```
-
-### Migrating `Pleroma.Web.Federator.RetryQueue` settings
-
-* `max_retries` is replaced with `config :pleroma, :workers, retries: [federator_outgoing: 5]`
-* `enabled: false` corresponds to `config :pleroma, :workers, retries: [federator_outgoing: 1]`
-* deprecated options: `max_jobs`, `initial_timeout`
-
-## Pleroma.Web.Metadata
-* `providers`: a list of metadata providers to enable. Providers available:
- * Pleroma.Web.Metadata.Providers.OpenGraph
- * Pleroma.Web.Metadata.Providers.TwitterCard
- * Pleroma.Web.Metadata.Providers.RelMe - add links from user bio with rel=me into the `` as ``
- * Pleroma.Web.Metadata.Providers.Feed - add a link to a user's Atom feed into the `` as ``
-* `unfurl_nsfw`: If set to `true` nsfw attachments will be shown in previews
-
-## :rich_media
-* `enabled`: if enabled the instance will parse metadata from attached links to generate link previews
-* `ignore_hosts`: list of hosts which will be ignored by the metadata parser. For example `["accounts.google.com", "xss.website"]`, defaults to `[]`.
-* `ignore_tld`: list TLDs (top-level domains) which will ignore for parse metadata. default is ["local", "localdomain", "lan"]
-* `parsers`: list of Rich Media parsers
-
-## :fetch_initial_posts
-* `enabled`: if enabled, when a new user is federated with, fetch some of their latest posts
-* `pages`: the amount of pages to fetch
-
-## :hackney_pools
-
-Advanced. Tweaks Hackney (http client) connections pools.
-
-There's three pools used:
-
-* `:federation` for the federation jobs.
- You may want this pool max_connections to be at least equal to the number of federator jobs + retry queue jobs.
-* `:media` for rich media, media proxy
-* `:upload` for uploaded media (if using a remote uploader and `proxy_remote: true`)
-
-For each pool, the options are:
-
-* `max_connections` - how much connections a pool can hold
-* `timeout` - retention duration for connections
-
-## :auto_linker
-
-Configuration for the `auto_linker` library:
-
-* `class: "auto-linker"` - specify the class to be added to the generated link. false to clear
-* `rel: "noopener noreferrer"` - override the rel attribute. false to clear
-* `new_window: true` - set to false to remove `target='_blank'` attribute
-* `scheme: false` - Set to true to link urls with schema `http://google.com`
-* `truncate: false` - Set to a number to truncate urls longer then the number. Truncated urls will end in `..`
-* `strip_prefix: true` - Strip the scheme prefix
-* `extra: false` - link urls with rarely used schemes (magnet, ipfs, irc, etc.)
-
-Example:
-
-```elixir
-config :auto_linker,
- opts: [
- scheme: true,
- extra: true,
- class: false,
- strip_prefix: false,
- new_window: false,
- rel: "ugc"
- ]
-```
-
-## Pleroma.Scheduler
-
-Configuration for [Quantum](https://github.com/quantum-elixir/quantum-core) jobs scheduler.
-
-See [Quantum readme](https://github.com/quantum-elixir/quantum-core#usage) for the list of supported options.
-
-Example:
-
-```elixir
-config :pleroma, Pleroma.Scheduler,
- global: true,
- overlap: true,
- timezone: :utc,
- jobs: [{"0 */6 * * * *", {Pleroma.Web.Websub, :refresh_subscriptions, []}}]
-```
-
-The above example defines a single job which invokes `Pleroma.Web.Websub.refresh_subscriptions()` every 6 hours ("0 */6 * * * *", [crontab format](https://en.wikipedia.org/wiki/Cron)).
-
-## Pleroma.ScheduledActivity
-
-* `daily_user_limit`: the number of scheduled activities a user is allowed to create in a single day (Default: `25`)
-* `total_user_limit`: the number of scheduled activities a user is allowed to create in total (Default: `300`)
-* `enabled`: whether scheduled activities are sent to the job queue to be executed
-
-## Pleroma.ActivityExpiration
-
-* `enabled`: whether expired activities will be sent to the job queue to be deleted
-
-## Pleroma.Web.Auth.Authenticator
-
-* `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator
-* `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication
-
-## :ldap
-
-Use LDAP for user authentication. When a user logs in to the Pleroma
-instance, the name and password will be verified by trying to authenticate
-(bind) to an LDAP server. If a user exists in the LDAP directory but there
-is no account with the same name yet on the Pleroma instance then a new
-Pleroma account will be created with the same name as the LDAP user name.
-
-* `enabled`: enables LDAP authentication
-* `host`: LDAP server hostname
-* `port`: LDAP port, e.g. 389 or 636
-* `ssl`: true to use SSL, usually implies the port 636
-* `sslopts`: additional SSL options
-* `tls`: true to start TLS, usually implies the port 389
-* `tlsopts`: additional TLS options
-* `base`: LDAP base, e.g. "dc=example,dc=com"
-* `uid`: LDAP attribute name to authenticate the user, e.g. when "cn", the filter will be "cn=username,base"
-
-## BBS / SSH access
+### BBS / SSH access
To enable simple command line interface accessible over ssh, add a setting like this to your configuration file:
@@ -628,10 +625,33 @@ config :esshd,
Feel free to adjust the priv_dir and port number. Then you will have to create the key for the keys (in the example `priv/ssh_keys`) and create the host keys with `ssh-keygen -m PEM -N "" -b 2048 -t rsa -f ssh_host_rsa_key`. After restarting, you should be able to connect to your Pleroma instance with `ssh username@server -p $PORT`
-## :auth
+### :gopher
+* `enabled`: Enables the gopher interface
+* `ip`: IP address to bind to
+* `port`: Port to bind to
+* `dstport`: Port advertised in urls (optional, defaults to `port`)
-* `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator
-* `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication
+
+## Authentication
+
+### :admin_token
+
+Allows to set a token that can be used to authenticate with the admin api without using an actual user by giving it as the 'admin_token' parameter. Example:
+
+```elixir
+config :pleroma, :admin_token, "somerandomtoken"
+```
+
+You can then do
+
+```sh
+curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerandomtoken"
+```
+
+### :auth
+
+* `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator.
+* `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication.
Authentication / authorization settings.
@@ -639,24 +659,30 @@ Authentication / authorization settings.
* `oauth_consumer_template`: OAuth consumer mode authentication form template. By default it's `consumer.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex`.
* `oauth_consumer_strategies`: the list of enabled OAuth consumer strategies; by default it's set by `OAUTH_CONSUMER_STRATEGIES` environment variable. Each entry in this space-delimited string should be of format `` or `:` (e.g. `twitter` or `keycloak:ueberauth_keycloak_strategy` in case dependency is named differently than `ueberauth_`).
-## :email_notifications
+### Pleroma.Web.Auth.Authenticator
-Email notifications settings.
+* `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator.
+* `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication.
- - digest - emails of "what you've missed" for users who have been
- inactive for a while.
- - active: globally enable or disable digest emails
- - schedule: When to send digest email, in [crontab format](https://en.wikipedia.org/wiki/Cron).
- "0 0 * * 0" is the default, meaning "once a week at midnight on Sunday morning"
- - interval: Minimum interval between digest emails to one user
- - inactivity_threshold: Minimum user inactivity threshold
+### :ldap
-## Pleroma.Emails.UserEmail
+Use LDAP for user authentication. When a user logs in to the Pleroma
+instance, the name and password will be verified by trying to authenticate
+(bind) to an LDAP server. If a user exists in the LDAP directory but there
+is no account with the same name yet on the Pleroma instance then a new
+Pleroma account will be created with the same name as the LDAP user name.
-- `:logo` - a path to a custom logo. Set it to `nil` to use the default Pleroma logo.
-- `:styling` - a map with color settings for email templates.
+* `enabled`: enables LDAP authentication
+* `host`: LDAP server hostname
+* `port`: LDAP port, e.g. 389 or 636
+* `ssl`: true to use SSL, usually implies the port 636
+* `sslopts`: additional SSL options
+* `tls`: true to start TLS, usually implies the port 389
+* `tlsopts`: additional TLS options
+* `base`: LDAP base, e.g. "dc=example,dc=com"
+* `uid`: LDAP attribute name to authenticate the user, e.g. when "cn", the filter will be "cn=username,base"
-## OAuth consumer mode
+### OAuth consumer mode
OAuth consumer mode allows sign in / sign up via external OAuth providers (e.g. Twitter, Facebook, Google, Microsoft, etc.).
Implementation is based on Ueberauth; see the list of [available strategies](https://github.com/ueberauth/ueberauth/wiki/List-of-Strategies).
@@ -728,7 +754,7 @@ config :ueberauth, Ueberauth,
]
```
-## OAuth 2.0 provider - :oauth2
+### OAuth 2.0 provider - :oauth2
Configure OAuth 2 provider capabilities:
@@ -737,70 +763,34 @@ Configure OAuth 2 provider capabilities:
* `clean_expired_tokens` - Enable a background job to clean expired oauth tokens. Defaults to `false`.
* `clean_expired_tokens_interval` - Interval to run the job to clean expired tokens. Defaults to `86_400_000` (24 hours).
-## :emoji
-* `shortcode_globs`: Location of custom emoji files. `*` can be used as a wildcard. Example `["/emoji/custom/**/*.png"]`
-* `pack_extensions`: A list of file extensions for emojis, when no emoji.txt for a pack is present. Example `[".png", ".gif"]`
-* `groups`: Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the groupname and the value the location or array of locations. `*` can be used as a wildcard. Example `[Custom: ["/emoji/*.png", "/emoji/custom/*.png"]]`
-* `default_manifest`: 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).
-* `shared_pack_cache_seconds_per_file`: 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.
+## Link parsing
-## Database options
+### :uri_schemes
+* `valid_schemes`: List of the scheme part that is considered valid to be an URL.
-### RUM indexing for full text search
-* `rum_enabled`: If RUM indexes should be used. Defaults to `false`.
+### :auto_linker
-RUM indexes are an alternative indexing scheme that is not included in PostgreSQL by default. While they may eventually be mainlined, for now they have to be installed as a PostgreSQL extension from https://github.com/postgrespro/rum.
+Configuration for the `auto_linker` library:
-Their advantage over the standard GIN indexes is that they allow efficient ordering of search results by timestamp, which makes search queries a lot faster on larger servers, by one or two orders of magnitude. They take up around 3 times as much space as GIN indexes.
+* `class: "auto-linker"` - specify the class to be added to the generated link. false to clear.
+* `rel: "noopener noreferrer"` - override the rel attribute. false to clear.
+* `new_window: true` - set to false to remove `target='_blank'` attribute.
+* `scheme: false` - Set to true to link urls with schema `http://google.com`.
+* `truncate: false` - Set to a number to truncate urls longer then the number. Truncated urls will end in `..`.
+* `strip_prefix: true` - Strip the scheme prefix.
+* `extra: false` - link urls with rarely used schemes (magnet, ipfs, irc, etc.).
-To enable them, both the `rum_enabled` flag has to be set and the following special migration has to be run:
+Example:
-`mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/`
+```elixir
+config :auto_linker,
+ opts: [
+ scheme: true,
+ extra: true,
+ class: false,
+ strip_prefix: false,
+ new_window: false,
+ rel: "ugc"
+ ]
+```
-This will probably take a long time.
-
-## :rate_limit
-
-This is an advanced feature and disabled by default.
-
-If your instance is behind a reverse proxy you must enable and configure [`Pleroma.Plugs.RemoteIp`](#pleroma-plugs-remoteip).
-
-A keyword list of rate limiters where a key is a limiter name and value is the limiter configuration. The basic configuration is a tuple where:
-
-* The first element: `scale` (Integer). The time scale in milliseconds.
-* The second element: `limit` (Integer). How many requests to limit in the time scale provided.
-
-It is also possible to have different limits for unauthenticated and authenticated users: the keyword value must be a list of two tuples where the first one is a config for unauthenticated users and the second one is for authenticated.
-
-Supported rate limiters:
-
-* `:search` for the search requests (account & status search etc.)
-* `:app_account_creation` for registering user accounts from the same IP address
-* `:relations_actions` for actions on relations with all users (follow, unfollow)
-* `:relation_id_action` for actions on relation with a specific user (follow, unfollow)
-* `:statuses_actions` for create / delete / fav / unfav / reblog / unreblog actions on any statuses
-* `:status_id_action` for fav / unfav or reblog / unreblog actions on the same status by the same user
-
-## :web_cache_ttl
-
-The expiration time for the web responses cache. Values should be in milliseconds or `nil` to disable expiration.
-
-Available caches:
-
-* `:activity_pub` - activity pub routes (except question activities). Defaults to `nil` (no expiration).
-* `:activity_pub_question` - activity pub routes (question activities). Defaults to `30_000` (30 seconds).
-
-## Pleroma.Plugs.RemoteIp
-
-!!! warning
- 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.
-
-Available options:
-
-* `enabled` - Enable/disable the plug. Defaults to `false`.
-* `headers` - 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]`.
-* `proxies` - A list of strings in [CIDR](https://en.wikipedia.org/wiki/CIDR) notation specifying the IPs of known proxies. Defaults to `[]`.
-* `reserved` - Defaults to [localhost](https://en.wikipedia.org/wiki/Localhost) and [private network](https://en.wikipedia.org/wiki/Private_network).
diff --git a/lib/pleroma/object/containment.ex b/lib/pleroma/object/containment.ex
index 68535c09e..a1f9c1250 100644
--- a/lib/pleroma/object/containment.ex
+++ b/lib/pleroma/object/containment.ex
@@ -64,15 +64,15 @@ def contain_origin(id, %{"actor" => _actor} = params) do
def contain_origin(id, %{"attributedTo" => actor} = params),
do: contain_origin(id, Map.put(params, "actor", actor))
- def contain_origin_from_id(_id, %{"id" => nil}), do: :error
-
- def contain_origin_from_id(id, %{"id" => other_id} = _params) do
+ def contain_origin_from_id(id, %{"id" => other_id} = _params) when is_binary(other_id) do
id_uri = URI.parse(id)
other_uri = URI.parse(other_id)
compare_uris(id_uri, other_uri)
end
+ def contain_origin_from_id(_id, _data), do: :error
+
def contain_child(%{"object" => %{"id" => id, "attributedTo" => _} = object}),
do: contain_origin(id, object)
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index 51a9c6169..65dd251f3 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -568,7 +568,6 @@ def fetch_public_activities(opts \\ %{}, pagination \\ :keyset) do
|> fetch_activities_query(opts)
|> restrict_unlisted()
|> Pagination.fetch_paginated(opts, pagination)
- |> Enum.reverse()
end
@valid_visibilities ~w[direct unlisted public private]
diff --git a/lib/pleroma/web/feed/feed_controller.ex b/lib/pleroma/web/feed/feed_controller.ex
index d91ecef9c..d0e23007d 100644
--- a/lib/pleroma/web/feed/feed_controller.ex
+++ b/lib/pleroma/web/feed/feed_controller.ex
@@ -33,21 +33,22 @@ def feed_redirect(conn, %{"nickname" => nickname}) do
def feed(conn, %{"nickname" => nickname} = params) do
with {_, %User{} = user} <- {:fetch_user, User.get_cached_by_nickname(nickname)} do
- query_params =
- params
- |> Map.take(["max_id"])
- |> Map.put("type", ["Create"])
- |> Map.put("whole_db", true)
- |> Map.put("actor_id", user.ap_id)
-
activities =
- query_params
+ %{
+ "type" => ["Create"],
+ "whole_db" => true,
+ "actor_id" => user.ap_id
+ }
+ |> Map.merge(Map.take(params, ["max_id"]))
|> ActivityPub.fetch_public_activities()
- |> Enum.reverse()
conn
|> put_resp_content_type("application/atom+xml")
- |> render("feed.xml", user: user, activities: activities)
+ |> render("feed.xml",
+ user: user,
+ activities: activities,
+ feed_config: Pleroma.Config.get([:feed])
+ )
end
end
diff --git a/lib/pleroma/web/feed/feed_view.ex b/lib/pleroma/web/feed/feed_view.ex
index 5eef1e757..bb1332fd3 100644
--- a/lib/pleroma/web/feed/feed_view.ex
+++ b/lib/pleroma/web/feed/feed_view.ex
@@ -6,12 +6,23 @@ defmodule Pleroma.Web.Feed.FeedView do
use Phoenix.HTML
use Pleroma.Web, :view
+ alias Pleroma.Formatter
alias Pleroma.Object
alias Pleroma.User
alias Pleroma.Web.MediaProxy
require Pleroma.Constants
+ def prepare_activity(activity) do
+ object = activity_object(activity)
+
+ %{
+ activity: activity,
+ data: Map.get(object, :data),
+ object: object
+ }
+ end
+
def most_recent_update(activities, user) do
(List.first(activities) || user).updated_at
|> NaiveDateTime.to_iso8601()
@@ -23,31 +34,23 @@ def logo(user) do
|> MediaProxy.url()
end
- def last_activity(activities) do
- List.last(activities)
+ def last_activity(activities), do: List.last(activities)
+
+ def activity_object(activity), do: Object.normalize(activity)
+
+ def activity_title(%{data: %{"content" => content}}, opts \\ %{}) do
+ content
+ |> Formatter.truncate(opts[:max_length], opts[:omission])
+ |> escape()
end
- def activity_object(activity) do
- Object.normalize(activity)
- end
-
- def activity_object_data(activity) do
- activity
- |> activity_object()
- |> Map.get(:data)
- end
-
- def activity_content(activity) do
- content = activity_object_data(activity)["content"]
-
+ def activity_content(%{data: %{"content" => content}}) do
content
|> String.replace(~r/[\n\r]/, "")
|> escape()
end
- def activity_context(activity) do
- activity.data["context"]
- end
+ def activity_context(activity), do: activity.data["context"]
def attachment_href(attachment) do
attachment["url"]
diff --git a/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex b/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex
index f2d2d3ccb..384159336 100644
--- a/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex
@@ -71,7 +71,6 @@ def public(%{assigns: %{user: user}} = conn, params) do
|> Map.put("blocking_user", user)
|> Map.put("muting_user", user)
|> ActivityPub.fetch_public_activities()
- |> Enum.reverse()
conn
|> add_link_headers(activities, %{"local" => local_only})
@@ -110,7 +109,6 @@ def hashtag(%{assigns: %{user: user}} = conn, params) do
|> Map.put("tag_all", tag_all)
|> Map.put("tag_reject", tag_reject)
|> ActivityPub.fetch_public_activities()
- |> Enum.reverse()
conn
|> add_link_headers(activities, %{"local" => local_only})
diff --git a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
index 192984242..d7ae503f6 100644
--- a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
+++ b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
@@ -58,6 +58,7 @@ def raw_nodeinfo do
"polls",
"pleroma_explicit_addressing",
"shareable_emoji_packs",
+ "multifetch",
if Config.get([:media_proxy, :enabled]) do
"media_proxy"
end,
diff --git a/lib/pleroma/web/templates/feed/feed/_activity.xml.eex b/lib/pleroma/web/templates/feed/feed/_activity.xml.eex
index d1f5e903c..514eacaed 100644
--- a/lib/pleroma/web/templates/feed/feed/_activity.xml.eex
+++ b/lib/pleroma/web/templates/feed/feed/_activity.xml.eex
@@ -2,11 +2,13 @@
http://activitystrea.ms/schema/1.0/notehttp://activitystrea.ms/schema/1.0/post<%= @data["id"] %>
- <%= "New note by #{@user.nickname}" %>
- <%= activity_content(@activity) %>
+ <%= activity_title(@object, Keyword.get(@feed_config, :post_title, %{})) %>
+ <%= activity_content(@object) %><%= @data["published"] %><%= @data["published"] %>
- <%= activity_context(@activity) %>
+
+ <%= activity_context(@activity) %>
+
<%= if @data["summary"] do %>
diff --git a/lib/pleroma/web/templates/feed/feed/feed.xml.eex b/lib/pleroma/web/templates/feed/feed/feed.xml.eex
index 45df9dc09..5ae36d345 100644
--- a/lib/pleroma/web/templates/feed/feed/feed.xml.eex
+++ b/lib/pleroma/web/templates/feed/feed/feed.xml.eex
@@ -19,6 +19,6 @@
<% end %>
<%= for activity <- @activities do %>
- <%= render @view_module, "_activity.xml", Map.merge(assigns, %{activity: activity, data: activity_object_data(activity)}) %>
+ <%= render @view_module, "_activity.xml", Map.merge(assigns, prepare_activity(activity)) %>
<% end %>
diff --git a/mix.lock b/mix.lock
index 4529506a8..5b471fe3d 100644
--- a/mix.lock
+++ b/mix.lock
@@ -37,7 +37,7 @@
"ex_syslogger": {:git, "https://github.com/slashmili/ex_syslogger.git", "f3963399047af17e038897c69e20d552e6899e1d", [tag: "1.4.0"]},
"excoveralls": {:hex, :excoveralls, "0.11.2", "0c6f2c8db7683b0caa9d490fb8125709c54580b4255ffa7ad35f3264b075a643", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"fast_html": {:hex, :fast_html, "0.99.3", "e7ce6245fed0635f4719a31cc409091ed17b2091165a4a1cffbf2ceac77abbf4", [:make, :mix], [], "hexpm"},
- "fast_sanitize": {:hex, :fast_sanitize, "0.1.1", "a403c3c09369e23423d3e6beb14068ad07be82741d10b293c71abac445dcc636", [:mix], [{:fast_html, "~> 0.99", [hex: :fast_html, repo: "hexpm", optional: false]}, {:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"},
+ "fast_sanitize": {:hex, :fast_sanitize, "0.1.3", "e89a743b1679c344abdfcf79778d1499fbc599eca2d8a8cdfaf9ff520986fb72", [:mix], [{:fast_html, "~> 0.99", [hex: :fast_html, repo: "hexpm", optional: false]}, {:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"},
"flake_id": {:hex, :flake_id, "0.1.0", "7716b086d2e405d09b647121a166498a0d93d1a623bead243e1f74216079ccb3", [:mix], [{:base62, "~> 1.2", [hex: :base62, repo: "hexpm", optional: false]}, {:ecto, ">= 2.0.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm"},
"floki": {:hex, :floki, "0.23.0", "956ab6dba828c96e732454809fb0bd8d43ce0979b75f34de6322e73d4c917829", [:mix], [{:html_entities, "~> 0.4.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm"},
"gen_smtp": {:hex, :gen_smtp, "0.15.0", "9f51960c17769b26833b50df0b96123605a8024738b62db747fece14eb2fbfcc", [:rebar3], [], "hexpm"},
diff --git a/priv/static/index.html b/priv/static/index.html
index fc5eee901..f1a26cc95 100644
--- a/priv/static/index.html
+++ b/priv/static/index.html
@@ -1 +1 @@
-Pleroma
\ No newline at end of file
+Pleroma
\ No newline at end of file
diff --git a/priv/static/static/css/app.4e8e80a2f95232cff399.css b/priv/static/static/css/app.fd71461124f3eb029b1b.css
similarity index 97%
rename from priv/static/static/css/app.4e8e80a2f95232cff399.css
rename to priv/static/static/css/app.fd71461124f3eb029b1b.css
index ca3d4e41f..6ab9849ec 100644
--- a/priv/static/static/css/app.4e8e80a2f95232cff399.css
+++ b/priv/static/static/css/app.fd71461124f3eb029b1b.css
@@ -99,4 +99,4 @@ .with-subscription-loading .error {
font-size: 14px;
}
-/*# sourceMappingURL=app.4e8e80a2f95232cff399.css.map*/
\ No newline at end of file
+/*# sourceMappingURL=app.fd71461124f3eb029b1b.css.map*/
\ No newline at end of file
diff --git a/priv/static/static/css/app.4e8e80a2f95232cff399.css.map b/priv/static/static/css/app.fd71461124f3eb029b1b.css.map
similarity index 95%
rename from priv/static/static/css/app.4e8e80a2f95232cff399.css.map
rename to priv/static/static/css/app.fd71461124f3eb029b1b.css.map
index dc2c92ced..660b09d2c 100644
--- a/priv/static/static/css/app.4e8e80a2f95232cff399.css.map
+++ b/priv/static/static/css/app.fd71461124f3eb029b1b.css.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///./src/hocs/with_load_more/with_load_more.scss","webpack:///./src/components/tab_switcher/tab_switcher.scss","webpack:///./src/hocs/with_subscription/with_subscription.scss"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;AClFA;AACA;AACA;AACA;AACA;AACA;AACA,C","file":"static/css/app.4e8e80a2f95232cff399.css","sourcesContent":[".with-load-more-footer {\n padding: 10px;\n text-align: center;\n border-top: 1px solid;\n border-top-color: #222;\n border-top-color: var(--border, #222);\n}\n.with-load-more-footer .error {\n font-size: 14px;\n}",".tab-switcher {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.tab-switcher .contents {\n -ms-flex: 1 0 auto;\n flex: 1 0 auto;\n min-height: 0px;\n}\n.tab-switcher .contents .hidden {\n display: none;\n}\n.tab-switcher .contents.scrollable-tabs {\n -ms-flex-preferred-size: 0;\n flex-basis: 0;\n overflow-y: auto;\n}\n.tab-switcher .tabs {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n width: 100%;\n overflow-y: hidden;\n overflow-x: auto;\n padding-top: 5px;\n box-sizing: border-box;\n}\n.tab-switcher .tabs::after, .tab-switcher .tabs::before {\n display: block;\n content: \"\";\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n border-bottom: 1px solid;\n border-bottom-color: #222;\n border-bottom-color: var(--border, #222);\n}\n.tab-switcher .tabs .tab-wrapper {\n height: 28px;\n position: relative;\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.tab-switcher .tabs .tab-wrapper .tab {\n width: 100%;\n min-width: 1px;\n position: relative;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding: 6px 1em;\n padding-bottom: 99px;\n margin-bottom: -93px;\n white-space: nowrap;\n}\n.tab-switcher .tabs .tab-wrapper .tab:not(.active) {\n z-index: 4;\n}\n.tab-switcher .tabs .tab-wrapper .tab:not(.active):hover {\n z-index: 6;\n}\n.tab-switcher .tabs .tab-wrapper .tab.active {\n background: transparent;\n z-index: 5;\n}\n.tab-switcher .tabs .tab-wrapper .tab img {\n max-height: 26px;\n vertical-align: top;\n margin-top: -5px;\n}\n.tab-switcher .tabs .tab-wrapper:not(.active)::after {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 7;\n border-bottom: 1px solid;\n border-bottom-color: #222;\n border-bottom-color: var(--border, #222);\n}",".with-subscription-loading {\n padding: 10px;\n text-align: center;\n}\n.with-subscription-loading .error {\n font-size: 14px;\n}"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///./src/hocs/with_load_more/with_load_more.scss","webpack:///./src/components/tab_switcher/tab_switcher.scss","webpack:///./src/hocs/with_subscription/with_subscription.scss"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;AClFA;AACA;AACA;AACA;AACA;AACA;AACA,C","file":"static/css/app.fd71461124f3eb029b1b.css","sourcesContent":[".with-load-more-footer {\n padding: 10px;\n text-align: center;\n border-top: 1px solid;\n border-top-color: #222;\n border-top-color: var(--border, #222);\n}\n.with-load-more-footer .error {\n font-size: 14px;\n}",".tab-switcher {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.tab-switcher .contents {\n -ms-flex: 1 0 auto;\n flex: 1 0 auto;\n min-height: 0px;\n}\n.tab-switcher .contents .hidden {\n display: none;\n}\n.tab-switcher .contents.scrollable-tabs {\n -ms-flex-preferred-size: 0;\n flex-basis: 0;\n overflow-y: auto;\n}\n.tab-switcher .tabs {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n width: 100%;\n overflow-y: hidden;\n overflow-x: auto;\n padding-top: 5px;\n box-sizing: border-box;\n}\n.tab-switcher .tabs::after, .tab-switcher .tabs::before {\n display: block;\n content: \"\";\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n border-bottom: 1px solid;\n border-bottom-color: #222;\n border-bottom-color: var(--border, #222);\n}\n.tab-switcher .tabs .tab-wrapper {\n height: 28px;\n position: relative;\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.tab-switcher .tabs .tab-wrapper .tab {\n width: 100%;\n min-width: 1px;\n position: relative;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding: 6px 1em;\n padding-bottom: 99px;\n margin-bottom: -93px;\n white-space: nowrap;\n}\n.tab-switcher .tabs .tab-wrapper .tab:not(.active) {\n z-index: 4;\n}\n.tab-switcher .tabs .tab-wrapper .tab:not(.active):hover {\n z-index: 6;\n}\n.tab-switcher .tabs .tab-wrapper .tab.active {\n background: transparent;\n z-index: 5;\n}\n.tab-switcher .tabs .tab-wrapper .tab img {\n max-height: 26px;\n vertical-align: top;\n margin-top: -5px;\n}\n.tab-switcher .tabs .tab-wrapper:not(.active)::after {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 7;\n border-bottom: 1px solid;\n border-bottom-color: #222;\n border-bottom-color: var(--border, #222);\n}",".with-subscription-loading {\n padding: 10px;\n text-align: center;\n}\n.with-subscription-loading .error {\n font-size: 14px;\n}"],"sourceRoot":""}
\ No newline at end of file
diff --git a/priv/static/static/js/2.48f39bc510b7c0a7fca6.js b/priv/static/static/js/2.48f39bc510b7c0a7fca6.js
deleted file mode 100644
index eabbcf690..000000000
--- a/priv/static/static/js/2.48f39bc510b7c0a7fca6.js
+++ /dev/null
@@ -1,2 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{987:function(t,e,i){"use strict";i.r(e);var n=i(988),c=i.n(n);for(var r in n)"default"!==r&&function(t){i.d(e,t,function(){return n[t]})}(r);var a=i(991),s=i(0);var o=function(t){i(989)},u=Object(s.a)(c.a,a.a,a.b,!1,o,null,null);e.default=u.exports},988:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=c(i(332));function c(t){return t&&t.__esModule?t:{default:t}}var r={components:{TabSwitcher:c(i(197)).default},data:function(){return{meta:{stickers:[]},path:""}},computed:{pack:function(){return this.$store.state.instance.stickers||[]}},methods:{clear:function(){this.meta={stickers:[]}},pick:function(t,e){var i=this,c=this.$store;fetch(t).then(function(t){t.blob().then(function(t){var r=new File([t],e,{mimetype:"image/png"}),a=new FormData;a.append("file",r),n.default.uploadMedia({store:c,formData:a}).then(function(t){i.$emit("uploaded",t),i.clear()},function(t){console.warn("Can't attach sticker"),console.warn(t),i.$emit("upload-failed","default")})})})}}};e.default=r},989:function(t,e,i){var n=i(990);"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);(0,i(2).default)("cc6cdea4",n,!0,{})},990:function(t,e,i){(t.exports=i(1)(!1)).push([t.i,".sticker-picker{width:100%;position:relative}.sticker-picker .tab-switcher{position:absolute;top:0;bottom:0;left:0;right:0}.sticker-picker .sticker-picker-content .sticker{display:inline-block;width:20%;height:20%}.sticker-picker .sticker-picker-content .sticker img{width:100%}.sticker-picker .sticker-picker-content .sticker img:hover{filter:drop-shadow(0 0 5px var(--link,#d8a070))}",""])},991:function(t,e,i){"use strict";i.d(e,"a",function(){return n}),i.d(e,"b",function(){return c});var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"sticker-picker"},[i("tab-switcher",{staticClass:"tab-switcher",attrs:{"render-only-focused":!0,"scrollable-tabs":""}},t._l(t.pack,function(e){return i("div",{key:e.path,staticClass:"sticker-picker-content",attrs:{"image-tooltip":e.meta.title,image:e.path+e.meta.tabIcon}},t._l(e.meta.stickers,function(n){return i("div",{key:n,staticClass:"sticker",on:{click:function(i){i.stopPropagation(),i.preventDefault(),t.pick(e.path+n,e.meta.title)}}},[i("img",{attrs:{src:e.path+n}})])}),0)}),0)],1)},c=[]}}]);
-//# sourceMappingURL=2.48f39bc510b7c0a7fca6.js.map
\ No newline at end of file
diff --git a/priv/static/static/js/2.73375b727cef616c59b4.js b/priv/static/static/js/2.73375b727cef616c59b4.js
new file mode 100644
index 000000000..ebfd9acbd
--- /dev/null
+++ b/priv/static/static/js/2.73375b727cef616c59b4.js
@@ -0,0 +1,2 @@
+(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{1012:function(t,e,i){"use strict";i.r(e);var n=i(1013),c=i.n(n);for(var r in n)"default"!==r&&function(t){i.d(e,t,function(){return n[t]})}(r);var a=i(1016),s=i(0);var o=function(t){i(1014)},u=Object(s.a)(c.a,a.a,a.b,!1,o,null,null);e.default=u.exports},1013:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=c(i(348));function c(t){return t&&t.__esModule?t:{default:t}}var r={components:{TabSwitcher:c(i(205)).default},data:function(){return{meta:{stickers:[]},path:""}},computed:{pack:function(){return this.$store.state.instance.stickers||[]}},methods:{clear:function(){this.meta={stickers:[]}},pick:function(t,e){var i=this,c=this.$store;fetch(t).then(function(t){t.blob().then(function(t){var r=new File([t],e,{mimetype:"image/png"}),a=new FormData;a.append("file",r),n.default.uploadMedia({store:c,formData:a}).then(function(t){i.$emit("uploaded",t),i.clear()},function(t){console.warn("Can't attach sticker"),console.warn(t),i.$emit("upload-failed","default")})})})}}};e.default=r},1014:function(t,e,i){var n=i(1015);"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);(0,i(2).default)("cc6cdea4",n,!0,{})},1015:function(t,e,i){(t.exports=i(1)(!1)).push([t.i,".sticker-picker{width:100%;position:relative}.sticker-picker .tab-switcher{position:absolute;top:0;bottom:0;left:0;right:0}.sticker-picker .sticker-picker-content .sticker{display:inline-block;width:20%;height:20%}.sticker-picker .sticker-picker-content .sticker img{width:100%}.sticker-picker .sticker-picker-content .sticker img:hover{filter:drop-shadow(0 0 5px var(--link,#d8a070))}",""])},1016:function(t,e,i){"use strict";i.d(e,"a",function(){return n}),i.d(e,"b",function(){return c});var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"sticker-picker"},[i("tab-switcher",{staticClass:"tab-switcher",attrs:{"render-only-focused":!0,"scrollable-tabs":""}},t._l(t.pack,function(e){return i("div",{key:e.path,staticClass:"sticker-picker-content",attrs:{"image-tooltip":e.meta.title,image:e.path+e.meta.tabIcon}},t._l(e.meta.stickers,function(n){return i("div",{key:n,staticClass:"sticker",on:{click:function(i){i.stopPropagation(),i.preventDefault(),t.pick(e.path+n,e.meta.title)}}},[i("img",{attrs:{src:e.path+n}})])}),0)}),0)],1)},c=[]}}]);
+//# sourceMappingURL=2.73375b727cef616c59b4.js.map
\ No newline at end of file
diff --git a/priv/static/static/js/2.48f39bc510b7c0a7fca6.js.map b/priv/static/static/js/2.73375b727cef616c59b4.js.map
similarity index 92%
rename from priv/static/static/js/2.48f39bc510b7c0a7fca6.js.map
rename to priv/static/static/js/2.73375b727cef616c59b4.js.map
index be87ffa46..d2c864eb3 100644
--- a/priv/static/static/js/2.48f39bc510b7c0a7fca6.js.map
+++ b/priv/static/static/js/2.73375b727cef616c59b4.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///./src/components/sticker_picker/sticker_picker.vue","webpack:///./src/components/sticker_picker/sticker_picker.js","webpack:///./src/components/sticker_picker/sticker_picker.vue?d6cd","webpack:///./src/components/sticker_picker/sticker_picker.vue?d5ea","webpack:///./src/components/sticker_picker/sticker_picker.vue?8003"],"names":["__webpack_require__","r","__webpack_exports__","_babel_loader_sticker_picker_js__WEBPACK_IMPORTED_MODULE_0__","_babel_loader_sticker_picker_js__WEBPACK_IMPORTED_MODULE_0___default","n","__WEBPACK_IMPORT_KEY__","key","d","_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70972e0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sticker_picker_vue__WEBPACK_IMPORTED_MODULE_1__","_node_modules_vue_loader_lib_runtime_component_normalizer__WEBPACK_IMPORTED_MODULE_2__","__vue_styles__","context","Component","Object","a","StickerPicker","components","TabSwitcher","data","meta","stickers","path","computed","pack","this","$store","state","instance","methods","clear","pick","sticker","name","_this","store","fetch","then","res","blob","file","File","mimetype","formData","FormData","append","statusPosterService","uploadMedia","fileData","$emit","error","console","warn","content","module","i","locals","exports","add","default","push","render","staticRenderFns","_vm","_h","$createElement","_c","_self","staticClass","attrs","render-only-focused","scrollable-tabs","_l","stickerpack","image-tooltip","title","image","tabIcon","on","click","$event","stopPropagation","preventDefault","src"],"mappings":"0FAAAA,EAAAC,EAAAC,GAAA,IAAAC,EAAAH,EAAA,KAAAI,EAAAJ,EAAAK,EAAAF,GAAA,QAAAG,KAAAH,EAAA,YAAAG,GAAA,SAAAC,GAAAP,EAAAQ,EAAAN,EAAAK,EAAA,kBAAAJ,EAAAI,KAAA,CAAAD,GAAA,IAAAG,EAAAT,EAAA,KAAAU,EAAAV,EAAA,GAQA,IAEAW,EAVA,SAAAC,GACEZ,EAAQ,MAeVa,EAAgBC,OAAAJ,EAAA,EAAAI,CACdV,EAAAW,EACAN,EAAA,EACAA,EAAA,GAXF,EAaAE,EATA,KAEA,MAYeT,EAAA,QAAAW,EAAiB,2FCzBhC,QAAAb,EAAA,yDAGA,IAAMgB,EAAgB,CACpBC,WAAY,CACVC,cAJJlB,EAAA,MAIIkB,SAEFC,KAJoB,WAKlB,MAAO,CACLC,KAAM,CACJC,SAAU,IAEZC,KAAM,KAGVC,SAAU,CACRC,KADQ,WAEN,OAAOC,KAAKC,OAAOC,MAAMC,SAASP,UAAY,KAGlDQ,QAAS,CACPC,MADO,WAELL,KAAKL,KAAO,CACVC,SAAU,KAGdU,KANO,SAMDC,EAASC,GAAM,IAAAC,EAAAT,KACbU,EAAQV,KAAKC,OAEnBU,MAAMJ,GACHK,KAAK,SAACC,GACLA,EAAIC,OAAOF,KAAK,SAACE,GACf,IAAIC,EAAO,IAAIC,KAAK,CAACF,GAAON,EAAM,CAAES,SAAU,cAC1CC,EAAW,IAAIC,SACnBD,EAASE,OAAO,OAAQL,GACxBM,UAAoBC,YAAY,CAAEZ,QAAOQ,aACtCN,KAAK,SAACW,GACLd,EAAKe,MAAM,WAAYD,GACvBd,EAAKJ,SACJ,SAACoB,GACFC,QAAQC,KAAK,wBACbD,QAAQC,KAAKF,GACbhB,EAAKe,MAAM,gBAAiB,8BAQ7BjC,uBChDf,IAAAqC,EAAcrD,EAAQ,KACtB,iBAAAqD,MAAA,EAA4CC,EAAAC,EAASF,EAAA,MACrDA,EAAAG,SAAAF,EAAAG,QAAAJ,EAAAG,SAGAE,EADU1D,EAAQ,GAAgE2D,SAClF,WAAAN,GAAA,4BCRAC,EAAAG,QAA2BzD,EAAQ,EAARA,EAA0D,IAKrF4D,KAAA,CAAcN,EAAAC,EAAS,oYAAoY,uCCL3ZvD,EAAAQ,EAAAN,EAAA,sBAAA2D,IAAA7D,EAAAQ,EAAAN,EAAA,sBAAA4D,IAAA,IAAAD,EAAA,WAA0B,IAAAE,EAAAtC,KAAauC,EAAAD,EAAAE,eAA0BC,EAAAH,EAAAI,MAAAD,IAAAF,EAAwB,OAAAE,EAAA,OAAiBE,YAAA,kBAA6B,CAAAF,EAAA,gBAAqBE,YAAA,eAAAC,MAAA,CAAkCC,uBAAA,EAAAC,kBAAA,KAAiDR,EAAAS,GAAAT,EAAA,cAAAU,GAAyC,OAAAP,EAAA,OAAiB3D,IAAAkE,EAAAnD,KAAA8C,YAAA,yBAAAC,MAAA,CAAiEK,gBAAAD,EAAArD,KAAAuD,MAAAC,MAAAH,EAAAnD,KAAAmD,EAAArD,KAAAyD,UAA4Fd,EAAAS,GAAAC,EAAArD,KAAA,kBAAAY,GAAsD,OAAAkC,EAAA,OAAiB3D,IAAAyB,EAAAoC,YAAA,UAAAU,GAAA,CAAsCC,MAAA,SAAAC,GAAyBA,EAAAC,kBAAyBD,EAAAE,iBAAwBnB,EAAAhC,KAAA0C,EAAAnD,KAAAU,EAAAyC,EAAArD,KAAAuD,UAA+D,CAAAT,EAAA,OAAYG,MAAA,CAAOc,IAAAV,EAAAnD,KAAAU,SAAsC,KAAK,QAC1vB8B,EAAA","file":"static/js/2.48f39bc510b7c0a7fca6.js","sourcesContent":["function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./sticker_picker.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./sticker_picker.js\"\nimport __vue_script__ from \"!!babel-loader!./sticker_picker.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-70972e0c\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./sticker_picker.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","/* eslint-env browser */\nimport statusPosterService from '../../services/status_poster/status_poster.service.js'\nimport TabSwitcher from '../tab_switcher/tab_switcher.js'\n\nconst StickerPicker = {\n components: {\n TabSwitcher\n },\n data () {\n return {\n meta: {\n stickers: []\n },\n path: ''\n }\n },\n computed: {\n pack () {\n return this.$store.state.instance.stickers || []\n }\n },\n methods: {\n clear () {\n this.meta = {\n stickers: []\n }\n },\n pick (sticker, name) {\n const store = this.$store\n // TODO remove this workaround by finding a way to bypass reuploads\n fetch(sticker)\n .then((res) => {\n res.blob().then((blob) => {\n var file = new File([blob], name, { mimetype: 'image/png' })\n var formData = new FormData()\n formData.append('file', file)\n statusPosterService.uploadMedia({ store, formData })\n .then((fileData) => {\n this.$emit('uploaded', fileData)\n this.clear()\n }, (error) => {\n console.warn(\"Can't attach sticker\")\n console.warn(error)\n this.$emit('upload-failed', 'default')\n })\n })\n })\n }\n }\n}\n\nexport default StickerPicker\n","// style-loader: Adds some css to the DOM by adding a \n","import * as DateUtils from 'src/services/date_utils/date_utils.js'\nimport { uniq } from 'lodash'\n\nexport default {\n name: 'PollForm',\n props: ['visible'],\n data: () => ({\n pollType: 'single',\n options: ['', ''],\n expiryAmount: 10,\n expiryUnit: 'minutes'\n }),\n computed: {\n pollLimits () {\n return this.$store.state.instance.pollLimits\n },\n maxOptions () {\n return this.pollLimits.max_options\n },\n maxLength () {\n return this.pollLimits.max_option_chars\n },\n expiryUnits () {\n const allUnits = ['minutes', 'hours', 'days']\n const expiry = this.convertExpiryFromUnit\n return allUnits.filter(\n unit => this.pollLimits.max_expiration >= expiry(unit, 1)\n )\n },\n minExpirationInCurrentUnit () {\n return Math.ceil(\n this.convertExpiryToUnit(\n this.expiryUnit,\n this.pollLimits.min_expiration\n )\n )\n },\n maxExpirationInCurrentUnit () {\n return Math.floor(\n this.convertExpiryToUnit(\n this.expiryUnit,\n this.pollLimits.max_expiration\n )\n )\n }\n },\n methods: {\n clear () {\n this.pollType = 'single'\n this.options = ['', '']\n this.expiryAmount = 10\n this.expiryUnit = 'minutes'\n },\n nextOption (index) {\n const element = this.$el.querySelector(`#poll-${index + 1}`)\n if (element) {\n element.focus()\n } else {\n // Try adding an option and try focusing on it\n const addedOption = this.addOption()\n if (addedOption) {\n this.$nextTick(function () {\n this.nextOption(index)\n })\n }\n }\n },\n addOption () {\n if (this.options.length < this.maxOptions) {\n this.options.push('')\n return true\n }\n return false\n },\n deleteOption (index, event) {\n if (this.options.length > 2) {\n this.options.splice(index, 1)\n }\n },\n convertExpiryToUnit (unit, amount) {\n // Note: we want seconds and not milliseconds\n switch (unit) {\n case 'minutes': return (1000 * amount) / DateUtils.MINUTE\n case 'hours': return (1000 * amount) / DateUtils.HOUR\n case 'days': return (1000 * amount) / DateUtils.DAY\n }\n },\n convertExpiryFromUnit (unit, amount) {\n // Note: we want seconds and not milliseconds\n switch (unit) {\n case 'minutes': return 0.001 * amount * DateUtils.MINUTE\n case 'hours': return 0.001 * amount * DateUtils.HOUR\n case 'days': return 0.001 * amount * DateUtils.DAY\n }\n },\n expiryAmountChange () {\n this.expiryAmount =\n Math.max(this.minExpirationInCurrentUnit, this.expiryAmount)\n this.expiryAmount =\n Math.min(this.maxExpirationInCurrentUnit, this.expiryAmount)\n this.updatePollToParent()\n },\n updatePollToParent () {\n const expiresIn = this.convertExpiryFromUnit(\n this.expiryUnit,\n this.expiryAmount\n )\n\n const options = uniq(this.options.filter(option => option !== ''))\n if (options.length < 2) {\n this.$emit('update-poll', { error: this.$t('polls.not_enough_options') })\n return\n }\n this.$emit('update-poll', {\n options,\n multiple: this.pollType === 'multiple',\n expiresIn\n })\n }\n }\n}\n","import UserAvatar from '../user_avatar/user_avatar.vue'\nimport RemoteFollow from '../remote_follow/remote_follow.vue'\nimport ProgressButton from '../progress_button/progress_button.vue'\nimport FollowButton from '../follow_button/follow_button.vue'\nimport ModerationTools from '../moderation_tools/moderation_tools.vue'\nimport AccountActions from '../account_actions/account_actions.vue'\nimport { hex2rgb } from '../../services/color_convert/color_convert.js'\nimport generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'\nimport { mapGetters } from 'vuex'\n\nexport default {\n props: [\n 'user', 'switcher', 'selected', 'hideBio', 'rounded', 'bordered', 'allowZoomingAvatar'\n ],\n data () {\n return {\n followRequestInProgress: false,\n betterShadow: this.$store.state.interface.browserSupport.cssFilter\n }\n },\n created () {\n this.$store.dispatch('fetchUserRelationship', this.user.id)\n },\n computed: {\n classes () {\n return [{\n 'user-card-rounded-t': this.rounded === 'top', // set border-top-left-radius and border-top-right-radius\n 'user-card-rounded': this.rounded === true, // set border-radius for all sides\n 'user-card-bordered': this.bordered === true // set border for all sides\n }]\n },\n style () {\n const color = this.$store.getters.mergedConfig.customTheme.colors\n ? this.$store.getters.mergedConfig.customTheme.colors.bg // v2\n : this.$store.getters.mergedConfig.colors.bg // v1\n\n if (color) {\n const rgb = (typeof color === 'string') ? hex2rgb(color) : color\n const tintColor = `rgba(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)}, .5)`\n\n return {\n backgroundColor: `rgb(${Math.floor(rgb.r * 0.53)}, ${Math.floor(rgb.g * 0.56)}, ${Math.floor(rgb.b * 0.59)})`,\n backgroundImage: [\n `linear-gradient(to bottom, ${tintColor}, ${tintColor})`,\n `url(${this.user.cover_photo})`\n ].join(', ')\n }\n }\n },\n isOtherUser () {\n return this.user.id !== this.$store.state.users.currentUser.id\n },\n subscribeUrl () {\n // eslint-disable-next-line no-undef\n const serverUrl = new URL(this.user.statusnet_profile_url)\n return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus`\n },\n loggedIn () {\n return this.$store.state.users.currentUser\n },\n dailyAvg () {\n const days = Math.ceil((new Date() - new Date(this.user.created_at)) / (60 * 60 * 24 * 1000))\n return Math.round(this.user.statuses_count / days)\n },\n userHighlightType: {\n get () {\n const data = this.$store.getters.mergedConfig.highlight[this.user.screen_name]\n return (data && data.type) || 'disabled'\n },\n set (type) {\n const data = this.$store.getters.mergedConfig.highlight[this.user.screen_name]\n if (type !== 'disabled') {\n this.$store.dispatch('setHighlight', { user: this.user.screen_name, color: (data && data.color) || '#FFFFFF', type })\n } else {\n this.$store.dispatch('setHighlight', { user: this.user.screen_name, color: undefined })\n }\n },\n ...mapGetters(['mergedConfig'])\n },\n userHighlightColor: {\n get () {\n const data = this.$store.getters.mergedConfig.highlight[this.user.screen_name]\n return data && data.color\n },\n set (color) {\n this.$store.dispatch('setHighlight', { user: this.user.screen_name, color })\n }\n },\n visibleRole () {\n const rights = this.user.rights\n if (!rights) { return }\n const validRole = rights.admin || rights.moderator\n const roleTitle = rights.admin ? 'admin' : 'moderator'\n return validRole && roleTitle\n },\n ...mapGetters(['mergedConfig'])\n },\n components: {\n UserAvatar,\n RemoteFollow,\n ModerationTools,\n AccountActions,\n ProgressButton,\n FollowButton\n },\n methods: {\n muteUser () {\n this.$store.dispatch('muteUser', this.user.id)\n },\n unmuteUser () {\n this.$store.dispatch('unmuteUser', this.user.id)\n },\n subscribeUser () {\n return this.$store.dispatch('subscribeUser', this.user.id)\n },\n unsubscribeUser () {\n return this.$store.dispatch('unsubscribeUser', this.user.id)\n },\n setProfileView (v) {\n if (this.switcher) {\n const store = this.$store\n store.commit('setProfileView', { v })\n }\n },\n linkClicked ({ target }) {\n if (target.tagName === 'SPAN') {\n target = target.parentNode\n }\n if (target.tagName === 'A') {\n window.open(target.href, '_blank')\n }\n },\n userProfileLink (user) {\n return generateProfileLink(\n user.id, user.screen_name,\n this.$store.state.instance.restrictedNicknames\n )\n },\n zoomAvatar () {\n const attachment = {\n url: this.user.profile_image_url_original,\n mimetype: 'image'\n }\n this.$store.dispatch('setMedia', [attachment])\n this.$store.dispatch('setCurrent', attachment)\n }\n }\n}\n","import StillImage from '../still-image/still-image.vue'\n\nconst UserAvatar = {\n props: [\n 'user',\n 'betterShadow',\n 'compact'\n ],\n data () {\n return {\n showPlaceholder: false\n }\n },\n components: {\n StillImage\n },\n computed: {\n imgSrc () {\n return this.showPlaceholder ? '/images/avi.png' : this.user.profile_image_url_original\n }\n },\n methods: {\n imageLoadError () {\n this.showPlaceholder = true\n }\n },\n watch: {\n src () {\n this.showPlaceholder = false\n }\n }\n}\n\nexport default UserAvatar\n","export default {\n props: [ 'user' ],\n computed: {\n subscribeUrl () {\n // eslint-disable-next-line no-undef\n const serverUrl = new URL(this.user.statusnet_profile_url)\n return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus`\n }\n }\n}\n","\n \n\n\n\n","import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'\nexport default {\n props: ['user', 'labelFollowing', 'buttonClass'],\n data () {\n return {\n inProgress: false\n }\n },\n computed: {\n isPressed () {\n return this.inProgress || this.user.following\n },\n title () {\n if (this.inProgress || this.user.following) {\n return this.$t('user_card.follow_unfollow')\n } else if (this.user.requested) {\n return this.$t('user_card.follow_again')\n } else {\n return this.$t('user_card.follow')\n }\n },\n label () {\n if (this.inProgress) {\n return this.$t('user_card.follow_progress')\n } else if (this.user.following) {\n return this.labelFollowing || this.$t('user_card.following')\n } else if (this.user.requested) {\n return this.$t('user_card.follow_sent')\n } else {\n return this.$t('user_card.follow')\n }\n }\n },\n methods: {\n onClick () {\n this.user.following ? this.unfollow() : this.follow()\n },\n follow () {\n this.inProgress = true\n requestFollow(this.user, this.$store).then(() => {\n this.inProgress = false\n })\n },\n unfollow () {\n const store = this.$store\n this.inProgress = true\n requestUnfollow(this.user, store).then(() => {\n this.inProgress = false\n store.commit('removeStatus', { timeline: 'friends', userId: this.user.id })\n })\n }\n }\n}\n","import DialogModal from '../dialog_modal/dialog_modal.vue'\n\nconst FORCE_NSFW = 'mrf_tag:media-force-nsfw'\nconst STRIP_MEDIA = 'mrf_tag:media-strip'\nconst FORCE_UNLISTED = 'mrf_tag:force-unlisted'\nconst DISABLE_REMOTE_SUBSCRIPTION = 'mrf_tag:disable-remote-subscription'\nconst DISABLE_ANY_SUBSCRIPTION = 'mrf_tag:disable-any-subscription'\nconst SANDBOX = 'mrf_tag:sandbox'\nconst QUARANTINE = 'mrf_tag:quarantine'\n\nconst ModerationTools = {\n props: [\n 'user'\n ],\n data () {\n return {\n showDropDown: false,\n tags: {\n FORCE_NSFW,\n STRIP_MEDIA,\n FORCE_UNLISTED,\n DISABLE_REMOTE_SUBSCRIPTION,\n DISABLE_ANY_SUBSCRIPTION,\n SANDBOX,\n QUARANTINE\n },\n showDeleteUserDialog: false\n }\n },\n components: {\n DialogModal\n },\n computed: {\n tagsSet () {\n return new Set(this.user.tags)\n },\n hasTagPolicy () {\n return this.$store.state.instance.tagPolicyAvailable\n }\n },\n methods: {\n hasTag (tagName) {\n return this.tagsSet.has(tagName)\n },\n toggleTag (tag) {\n const store = this.$store\n if (this.tagsSet.has(tag)) {\n store.state.api.backendInteractor.untagUser(this.user, tag).then(response => {\n if (!response.ok) { return }\n store.commit('untagUser', { user: this.user, tag })\n })\n } else {\n store.state.api.backendInteractor.tagUser(this.user, tag).then(response => {\n if (!response.ok) { return }\n store.commit('tagUser', { user: this.user, tag })\n })\n }\n },\n toggleRight (right) {\n const store = this.$store\n if (this.user.rights[right]) {\n store.state.api.backendInteractor.deleteRight(this.user, right).then(response => {\n if (!response.ok) { return }\n store.commit('updateRight', { user: this.user, right: right, value: false })\n })\n } else {\n store.state.api.backendInteractor.addRight(this.user, right).then(response => {\n if (!response.ok) { return }\n store.commit('updateRight', { user: this.user, right: right, value: true })\n })\n }\n },\n toggleActivationStatus () {\n const store = this.$store\n const status = !!this.user.deactivated\n store.state.api.backendInteractor.setActivationStatus(this.user, status).then(response => {\n if (!response.ok) { return }\n store.commit('updateActivationStatus', { user: this.user, status: status })\n })\n },\n deleteUserDialog (show) {\n this.showDeleteUserDialog = show\n },\n deleteUser () {\n const store = this.$store\n const user = this.user\n const { id, name } = user\n store.state.api.backendInteractor.deleteUser(user)\n .then(e => {\n this.$store.dispatch('markStatusesAsDeleted', status => user.id === status.user.id)\n const isProfile = this.$route.name === 'external-user-profile' || this.$route.name === 'user-profile'\n const isTargetUser = this.$route.params.name === name || this.$route.params.id === id\n if (isProfile && isTargetUser) {\n window.history.back()\n }\n })\n }\n }\n}\n\nexport default ModerationTools\n","const DialogModal = {\n props: {\n darkOverlay: {\n default: true,\n type: Boolean\n },\n onCancel: {\n default: () => {},\n type: Function\n }\n }\n}\n\nexport default DialogModal\n","import ProgressButton from '../progress_button/progress_button.vue'\n\nconst AccountActions = {\n props: [\n 'user'\n ],\n data () {\n return { }\n },\n components: {\n ProgressButton\n },\n methods: {\n showRepeats () {\n this.$store.dispatch('showReblogs', this.user.id)\n },\n hideRepeats () {\n this.$store.dispatch('hideReblogs', this.user.id)\n },\n blockUser () {\n this.$store.dispatch('blockUser', this.user.id)\n },\n unblockUser () {\n this.$store.dispatch('unblockUser', this.user.id)\n },\n reportUser () {\n this.$store.dispatch('openUserReportingModal', this.user.id)\n },\n mentionUser () {\n this.$store.dispatch('openPostStatusModal', { replyTo: true, repliedUser: this.user })\n }\n }\n}\n\nexport default AccountActions\n","import Attachment from '../attachment/attachment.vue'\nimport { chunk, last, dropRight, sumBy } from 'lodash'\n\nconst Gallery = {\n props: [\n 'attachments',\n 'nsfw',\n 'setMedia'\n ],\n data () {\n return {\n sizes: {}\n }\n },\n components: { Attachment },\n computed: {\n rows () {\n if (!this.attachments) {\n return []\n }\n const rows = chunk(this.attachments, 3)\n if (last(rows).length === 1 && rows.length > 1) {\n // if 1 attachment on last row -> add it to the previous row instead\n const lastAttachment = last(rows)[0]\n const allButLastRow = dropRight(rows)\n last(allButLastRow).push(lastAttachment)\n return allButLastRow\n }\n return rows\n },\n useContainFit () {\n return this.$store.getters.mergedConfig.useContainFit\n }\n },\n methods: {\n onNaturalSizeLoad (id, size) {\n this.$set(this.sizes, id, size)\n },\n rowStyle (itemsPerRow) {\n return { 'padding-bottom': `${(100 / (itemsPerRow + 0.6))}%` }\n },\n itemStyle (id, row) {\n const total = sumBy(row, item => this.getAspectRatio(item.id))\n return { flex: `${this.getAspectRatio(id) / total} 1 0%` }\n },\n getAspectRatio (id) {\n const size = this.sizes[id]\n return size ? size.width / size.height : 1\n }\n }\n}\n\nexport default Gallery\n","const LinkPreview = {\n name: 'LinkPreview',\n props: [\n 'card',\n 'size',\n 'nsfw'\n ],\n data () {\n return {\n imageLoaded: false\n }\n },\n computed: {\n useImage () {\n // Currently BE shoudn't give cards if tagged NSFW, this is a bit paranoid\n // as it makes sure to hide the image if somehow NSFW tagged preview can\n // exist.\n return this.card.image && !this.nsfw && this.size !== 'hide'\n },\n useDescription () {\n return this.card.description && /\\S/.test(this.card.description)\n }\n },\n created () {\n if (this.useImage) {\n const newImg = new Image()\n newImg.onload = () => {\n this.imageLoaded = true\n }\n newImg.src = this.card.image\n }\n }\n}\n\nexport default LinkPreview\n","import UserAvatar from '../user_avatar/user_avatar.vue'\nimport generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'\n\nconst AvatarList = {\n props: ['users'],\n computed: {\n slicedUsers () {\n return this.users ? this.users.slice(0, 15) : []\n }\n },\n components: {\n UserAvatar\n },\n methods: {\n userProfileLink (user) {\n return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)\n }\n }\n}\n\nexport default AvatarList\n","import { find } from 'lodash'\n\nconst StatusPopover = {\n name: 'StatusPopover',\n props: [\n 'statusId'\n ],\n data () {\n return {\n popperOptions: {\n modifiers: {\n preventOverflow: { padding: { top: 50 }, boundariesElement: 'viewport' }\n }\n }\n }\n },\n computed: {\n status () {\n return find(this.$store.state.statuses.allStatuses, { id: this.statusId })\n }\n },\n components: {\n Status: () => import('../status/status.vue')\n },\n methods: {\n enter () {\n if (!this.status) {\n this.$store.dispatch('fetchStatus', this.statusId)\n }\n }\n }\n}\n\nexport default StatusPopover\n","import { reduce, filter, findIndex, clone, get } from 'lodash'\nimport Status from '../status/status.vue'\n\nconst sortById = (a, b) => {\n const idA = a.type === 'retweet' ? a.retweeted_status.id : a.id\n const idB = b.type === 'retweet' ? b.retweeted_status.id : b.id\n const seqA = Number(idA)\n const seqB = Number(idB)\n const isSeqA = !Number.isNaN(seqA)\n const isSeqB = !Number.isNaN(seqB)\n if (isSeqA && isSeqB) {\n return seqA < seqB ? -1 : 1\n } else if (isSeqA && !isSeqB) {\n return -1\n } else if (!isSeqA && isSeqB) {\n return 1\n } else {\n return idA < idB ? -1 : 1\n }\n}\n\nconst sortAndFilterConversation = (conversation, statusoid) => {\n if (statusoid.type === 'retweet') {\n conversation = filter(\n conversation,\n (status) => (status.type === 'retweet' || status.id !== statusoid.retweeted_status.id)\n )\n } else {\n conversation = filter(conversation, (status) => status.type !== 'retweet')\n }\n return conversation.filter(_ => _).sort(sortById)\n}\n\nconst conversation = {\n data () {\n return {\n highlight: null,\n expanded: false\n }\n },\n props: [\n 'statusId',\n 'collapsable',\n 'isPage',\n 'pinnedStatusIdsObject',\n 'inProfile'\n ],\n created () {\n if (this.isPage) {\n this.fetchConversation()\n }\n },\n computed: {\n status () {\n return this.$store.state.statuses.allStatusesObject[this.statusId]\n },\n originalStatusId () {\n if (this.status.retweeted_status) {\n return this.status.retweeted_status.id\n } else {\n return this.statusId\n }\n },\n conversationId () {\n return this.getConversationId(this.statusId)\n },\n conversation () {\n if (!this.status) {\n return []\n }\n\n if (!this.isExpanded) {\n return [this.status]\n }\n\n const conversation = clone(this.$store.state.statuses.conversationsObject[this.conversationId])\n const statusIndex = findIndex(conversation, { id: this.originalStatusId })\n if (statusIndex !== -1) {\n conversation[statusIndex] = this.status\n }\n\n return sortAndFilterConversation(conversation, this.status)\n },\n replies () {\n let i = 1\n // eslint-disable-next-line camelcase\n return reduce(this.conversation, (result, { id, in_reply_to_status_id }) => {\n /* eslint-disable camelcase */\n const irid = in_reply_to_status_id\n /* eslint-enable camelcase */\n if (irid) {\n result[irid] = result[irid] || []\n result[irid].push({\n name: `#${i}`,\n id: id\n })\n }\n i++\n return result\n }, {})\n },\n isExpanded () {\n return this.expanded || this.isPage\n }\n },\n components: {\n Status\n },\n watch: {\n statusId (newVal, oldVal) {\n const newConversationId = this.getConversationId(newVal)\n const oldConversationId = this.getConversationId(oldVal)\n if (newConversationId && oldConversationId && newConversationId === oldConversationId) {\n this.setHighlight(this.originalStatusId)\n } else {\n this.fetchConversation()\n }\n },\n expanded (value) {\n if (value) {\n this.fetchConversation()\n }\n }\n },\n methods: {\n fetchConversation () {\n if (this.status) {\n this.$store.state.api.backendInteractor.fetchConversation({ id: this.statusId })\n .then(({ ancestors, descendants }) => {\n this.$store.dispatch('addNewStatuses', { statuses: ancestors })\n this.$store.dispatch('addNewStatuses', { statuses: descendants })\n this.setHighlight(this.originalStatusId)\n })\n } else {\n this.$store.state.api.backendInteractor.fetchStatus({ id: this.statusId })\n .then((status) => {\n this.$store.dispatch('addNewStatuses', { statuses: [status] })\n this.fetchConversation()\n })\n }\n },\n getReplies (id) {\n return this.replies[id] || []\n },\n focused (id) {\n return (this.isExpanded) && id === this.statusId\n },\n setHighlight (id) {\n if (!id) return\n this.highlight = id\n this.$store.dispatch('fetchFavsAndRepeats', id)\n },\n getHighlight () {\n return this.isExpanded ? this.highlight : null\n },\n toggleExpanded () {\n this.expanded = !this.expanded\n },\n getConversationId (statusId) {\n const status = this.$store.state.statuses.allStatusesObject[statusId]\n return get(status, 'retweeted_status.statusnet_conversation_id', get(status, 'statusnet_conversation_id'))\n }\n }\n}\n\nexport default conversation\n","import Timeline from '../timeline/timeline.vue'\nconst PublicAndExternalTimeline = {\n components: {\n Timeline\n },\n computed: {\n timeline () { return this.$store.state.statuses.timelines.publicAndExternal }\n },\n created () {\n this.$store.dispatch('startFetchingTimeline', { timeline: 'publicAndExternal' })\n },\n destroyed () {\n this.$store.dispatch('stopFetching', 'publicAndExternal')\n }\n}\n\nexport default PublicAndExternalTimeline\n","import Timeline from '../timeline/timeline.vue'\nconst FriendsTimeline = {\n components: {\n Timeline\n },\n computed: {\n timeline () { return this.$store.state.statuses.timelines.friends }\n }\n}\n\nexport default FriendsTimeline\n","import Timeline from '../timeline/timeline.vue'\n\nconst TagTimeline = {\n created () {\n this.$store.commit('clearTimeline', { timeline: 'tag' })\n this.$store.dispatch('startFetchingTimeline', { timeline: 'tag', tag: this.tag })\n },\n components: {\n Timeline\n },\n computed: {\n tag () { return this.$route.params.tag },\n timeline () { return this.$store.state.statuses.timelines.tag }\n },\n watch: {\n tag () {\n this.$store.commit('clearTimeline', { timeline: 'tag' })\n this.$store.dispatch('startFetchingTimeline', { timeline: 'tag', tag: this.tag })\n }\n },\n destroyed () {\n this.$store.dispatch('stopFetching', 'tag')\n }\n}\n\nexport default TagTimeline\n","import Conversation from '../conversation/conversation.vue'\n\nconst conversationPage = {\n components: {\n Conversation\n },\n computed: {\n statusId () {\n return this.$route.params.id\n }\n }\n}\n\nexport default conversationPage\n","import Notifications from '../notifications/notifications.vue'\n\nconst tabModeDict = {\n mentions: ['mention'],\n 'likes+repeats': ['repeat', 'like'],\n follows: ['follow']\n}\n\nconst Interactions = {\n data () {\n return {\n filterMode: tabModeDict['mentions']\n }\n },\n methods: {\n onModeSwitch (key) {\n this.filterMode = tabModeDict[key]\n }\n },\n components: {\n Notifications\n }\n}\n\nexport default Interactions\n","import Notification from '../notification/notification.vue'\nimport notificationsFetcher from '../../services/notifications_fetcher/notifications_fetcher.service.js'\nimport {\n notificationsFromStore,\n visibleNotificationsFromStore,\n unseenNotificationsFromStore\n} from '../../services/notification_utils/notification_utils.js'\n\nconst Notifications = {\n props: {\n // Disables display of panel header\n noHeading: Boolean,\n // Disables panel styles, unread mark, potentially other notification-related actions\n // meant for \"Interactions\" timeline\n minimalMode: Boolean,\n // Custom filter mode, an array of strings, possible values 'mention', 'repeat', 'like', 'follow', used to override global filter for use in \"Interactions\" timeline\n filterMode: Array\n },\n data () {\n return {\n bottomedOut: false\n }\n },\n computed: {\n mainClass () {\n return this.minimalMode ? '' : 'panel panel-default'\n },\n notifications () {\n return notificationsFromStore(this.$store)\n },\n error () {\n return this.$store.state.statuses.notifications.error\n },\n unseenNotifications () {\n return unseenNotificationsFromStore(this.$store)\n },\n visibleNotifications () {\n return visibleNotificationsFromStore(this.$store, this.filterMode)\n },\n unseenCount () {\n return this.unseenNotifications.length\n },\n loading () {\n return this.$store.state.statuses.notifications.loading\n }\n },\n components: {\n Notification\n },\n watch: {\n unseenCount (count) {\n if (count > 0) {\n this.$store.dispatch('setPageTitle', `(${count})`)\n } else {\n this.$store.dispatch('setPageTitle', '')\n }\n }\n },\n methods: {\n markAsSeen () {\n this.$store.dispatch('markNotificationsAsSeen')\n },\n fetchOlderNotifications () {\n if (this.loading) {\n return\n }\n\n const store = this.$store\n const credentials = store.state.users.currentUser.credentials\n store.commit('setNotificationsLoading', { value: true })\n notificationsFetcher.fetchAndUpdate({\n store,\n credentials,\n older: true\n }).then(notifs => {\n store.commit('setNotificationsLoading', { value: false })\n if (notifs.length === 0) {\n this.bottomedOut = true\n }\n })\n }\n }\n}\n\nexport default Notifications\n","import Status from '../status/status.vue'\nimport UserAvatar from '../user_avatar/user_avatar.vue'\nimport UserCard from '../user_card/user_card.vue'\nimport Timeago from '../timeago/timeago.vue'\nimport { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'\nimport generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'\n\nconst Notification = {\n data () {\n return {\n userExpanded: false,\n betterShadow: this.$store.state.interface.browserSupport.cssFilter,\n unmuted: false\n }\n },\n props: [ 'notification' ],\n components: {\n Status,\n UserAvatar,\n UserCard,\n Timeago\n },\n methods: {\n toggleUserExpanded () {\n this.userExpanded = !this.userExpanded\n },\n generateUserProfileLink (user) {\n return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)\n },\n getUser (notification) {\n return this.$store.state.users.usersObject[notification.from_profile.id]\n },\n toggleMute () {\n this.unmuted = !this.unmuted\n }\n },\n computed: {\n userClass () {\n return highlightClass(this.notification.from_profile)\n },\n userStyle () {\n const highlight = this.$store.getters.mergedConfig.highlight\n const user = this.notification.from_profile\n return highlightStyle(highlight[user.screen_name])\n },\n userInStore () {\n return this.$store.getters.findUser(this.notification.from_profile.id)\n },\n user () {\n if (this.userInStore) {\n return this.userInStore\n }\n return this.notification.from_profile\n },\n userProfileLink () {\n return this.generateUserProfileLink(this.user)\n },\n needMute () {\n return this.user.muted\n }\n }\n}\n\nexport default Notification\n","import Timeline from '../timeline/timeline.vue'\n\nconst DMs = {\n computed: {\n timeline () {\n return this.$store.state.statuses.timelines.dms\n }\n },\n components: {\n Timeline\n }\n}\n\nexport default DMs\n","import get from 'lodash/get'\nimport UserCard from '../user_card/user_card.vue'\nimport FollowCard from '../follow_card/follow_card.vue'\nimport Timeline from '../timeline/timeline.vue'\nimport Conversation from '../conversation/conversation.vue'\nimport List from '../list/list.vue'\nimport withLoadMore from '../../hocs/with_load_more/with_load_more'\n\nconst FollowerList = withLoadMore({\n fetch: (props, $store) => $store.dispatch('fetchFollowers', props.userId),\n select: (props, $store) => get($store.getters.findUser(props.userId), 'followerIds', []).map(id => $store.getters.findUser(id)),\n destroy: (props, $store) => $store.dispatch('clearFollowers', props.userId),\n childPropName: 'items',\n additionalPropNames: ['userId']\n})(List)\n\nconst FriendList = withLoadMore({\n fetch: (props, $store) => $store.dispatch('fetchFriends', props.userId),\n select: (props, $store) => get($store.getters.findUser(props.userId), 'friendIds', []).map(id => $store.getters.findUser(id)),\n destroy: (props, $store) => $store.dispatch('clearFriends', props.userId),\n childPropName: 'items',\n additionalPropNames: ['userId']\n})(List)\n\nconst defaultTabKey = 'statuses'\n\nconst UserProfile = {\n data () {\n return {\n error: false,\n userId: null,\n tab: defaultTabKey\n }\n },\n created () {\n const routeParams = this.$route.params\n this.load(routeParams.name || routeParams.id)\n this.tab = get(this.$route, 'query.tab', defaultTabKey)\n },\n destroyed () {\n this.stopFetching()\n },\n computed: {\n timeline () {\n return this.$store.state.statuses.timelines.user\n },\n favorites () {\n return this.$store.state.statuses.timelines.favorites\n },\n media () {\n return this.$store.state.statuses.timelines.media\n },\n isUs () {\n return this.userId && this.$store.state.users.currentUser.id &&\n this.userId === this.$store.state.users.currentUser.id\n },\n user () {\n return this.$store.getters.findUser(this.userId)\n },\n isExternal () {\n return this.$route.name === 'external-user-profile'\n },\n followsTabVisible () {\n return this.isUs || !this.user.hide_follows\n },\n followersTabVisible () {\n return this.isUs || !this.user.hide_followers\n }\n },\n methods: {\n load (userNameOrId) {\n const startFetchingTimeline = (timeline, userId) => {\n // Clear timeline only if load another user's profile\n if (userId !== this.$store.state.statuses.timelines[timeline].userId) {\n this.$store.commit('clearTimeline', { timeline })\n }\n this.$store.dispatch('startFetchingTimeline', { timeline, userId })\n }\n\n const loadById = (userId) => {\n this.userId = userId\n startFetchingTimeline('user', userId)\n startFetchingTimeline('media', userId)\n if (this.isUs) {\n startFetchingTimeline('favorites', userId)\n }\n // Fetch all pinned statuses immediately\n this.$store.dispatch('fetchPinnedStatuses', userId)\n }\n\n // Reset view\n this.userId = null\n this.error = false\n\n // Check if user data is already loaded in store\n const user = this.$store.getters.findUser(userNameOrId)\n if (user) {\n loadById(user.id)\n } else {\n this.$store.dispatch('fetchUser', userNameOrId)\n .then(({ id }) => loadById(id))\n .catch((reason) => {\n const errorMessage = get(reason, 'error.error')\n if (errorMessage === 'No user with such user_id') { // Known error\n this.error = this.$t('user_profile.profile_does_not_exist')\n } else if (errorMessage) {\n this.error = errorMessage\n } else {\n this.error = this.$t('user_profile.profile_loading_error')\n }\n })\n }\n },\n stopFetching () {\n this.$store.dispatch('stopFetching', 'user')\n this.$store.dispatch('stopFetching', 'favorites')\n this.$store.dispatch('stopFetching', 'media')\n },\n switchUser (userNameOrId) {\n this.stopFetching()\n this.load(userNameOrId)\n },\n onTabSwitch (tab) {\n this.tab = tab\n this.$router.replace({ query: { tab } })\n }\n },\n watch: {\n '$route.params.id': function (newVal) {\n if (newVal) {\n this.switchUser(newVal)\n }\n },\n '$route.params.name': function (newVal) {\n if (newVal) {\n this.switchUser(newVal)\n }\n },\n '$route.query': function (newVal) {\n this.tab = newVal.tab || defaultTabKey\n }\n },\n components: {\n UserCard,\n Timeline,\n FollowerList,\n FriendList,\n FollowCard,\n Conversation\n }\n}\n\nexport default UserProfile\n","import BasicUserCard from '../basic_user_card/basic_user_card.vue'\nimport RemoteFollow from '../remote_follow/remote_follow.vue'\nimport FollowButton from '../follow_button/follow_button.vue'\n\nconst FollowCard = {\n props: [\n 'user',\n 'noFollowsYou'\n ],\n components: {\n BasicUserCard,\n RemoteFollow,\n FollowButton\n },\n computed: {\n isMe () {\n return this.$store.state.users.currentUser.id === this.user.id\n },\n loggedIn () {\n return this.$store.state.users.currentUser\n }\n }\n}\n\nexport default FollowCard\n","import UserCard from '../user_card/user_card.vue'\nimport UserAvatar from '../user_avatar/user_avatar.vue'\nimport generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'\n\nconst BasicUserCard = {\n props: [\n 'user'\n ],\n data () {\n return {\n userExpanded: false\n }\n },\n components: {\n UserCard,\n UserAvatar\n },\n methods: {\n toggleUserExpanded () {\n this.userExpanded = !this.userExpanded\n },\n userProfileLink (user) {\n return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)\n }\n }\n}\n\nexport default BasicUserCard\n","\n