From 3601f03147bd104f6acff64e7c8d5d4d3e1f53a2 Mon Sep 17 00:00:00 2001 From: Alex S Date: Mon, 1 Apr 2019 17:17:57 +0700 Subject: Adding tag to emoji ets table changes in apis --- docs/api/pleroma_api.md | 6 +++--- docs/config/custom_emoji.md | 24 ++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md index 478c9d874..2e8fb04d2 100644 --- a/docs/api/pleroma_api.md +++ b/docs/api/pleroma_api.md @@ -10,7 +10,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * Authentication: not required * Params: none * Response: JSON -* Example response: `{"kalsarikannit_f":"/finmoji/128px/kalsarikannit_f-128.png","perkele":"/finmoji/128px/perkele-128.png","blobdab":"/emoji/blobdab.png","happiness":"/finmoji/128px/happiness-128.png"}` +* Example response: `[{"kalsarikannit_f":{"tags":["Finmoji"],"image_url":"/finmoji/128px/kalsarikannit_f-128.png"}},{"perkele":{"tags":["Finmoji"],"image_url":"/finmoji/128px/perkele-128.png"}},{"blobdab":{"tags":["SomeTag"],"image_url":"/emoji/blobdab.png"}},"happiness":{"tags":["Finmoji"],"image_url":"/finmoji/128px/happiness-128.png"}}]` * Note: Same data as Mastodon API’s `/api/v1/custom_emojis` but in a different format ## `/api/pleroma/follow_import` @@ -27,14 +27,14 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * Method: `GET` * Authentication: not required * Params: none -* Response: Provider specific JSON, the only guaranteed parameter is `type` +* Response: Provider specific JSON, the only guaranteed parameter is `type` * Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint"}` ## `/api/pleroma/delete_account` ### Delete an account * Method `POST` * Authentication: required -* Params: +* Params: * `password`: user's password * Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise * Example response: `{"error": "Invalid password."}` diff --git a/docs/config/custom_emoji.md b/docs/config/custom_emoji.md index e833d2080..e47a75c8e 100644 --- a/docs/config/custom_emoji.md +++ b/docs/config/custom_emoji.md @@ -11,8 +11,28 @@ image files (in `/priv/static/emoji/custom`): `happy.png` and `sad.png` content of `config/custom_emoji.txt`: ``` -happy, /emoji/custom/happy.png -sad, /emoji/custom/sad.png +happy, /emoji/custom/happy.png, Tag1,Tag2 +sad, /emoji/custom/sad.png, Tag1 +foo, /emoji/custom/foo.png ``` The files should be PNG (APNG is okay with `.png` for `image/png` Content-type) and under 50kb for compatibility with mastodon. + +# Emoji tags + +Changing default tags: + +* For `Finmoji`, `emoji.txt` and `custom_emoji.txt` are added default tags, which can be configured in the `config.exs`: +* For emoji loaded from globs: + - `priv/static/emoji/custom/*.png` - `custom_tag`, can be configured in `config.exs` + - `priv/static/emoji/custom/TagName/*.png` - folder (`TagName`) is used as tag + + +``` +config :pleroma, :emoji, + shortcode_globs: ["/emoji/custom/**/*.png"], + custom_tag: "Custom", # Default tag for emoji in `priv/static/emoji/custom` path + finmoji_tag: "Finmoji", # Default tag for Finmoji + emoji_tag: "Emoji", # Default tag for emoji.txt + custom_emoji_tag: "Custom" # Default tag for custom_emoji.txt +``` -- cgit v1.2.3 From 851c5bf0936fbc58bf509f79531e6cdc070efde5 Mon Sep 17 00:00:00 2001 From: Alex S Date: Tue, 2 Apr 2019 15:57:57 +0700 Subject: updating custom_emoji docs --- docs/config/custom_emoji.md | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/config/custom_emoji.md b/docs/config/custom_emoji.md index e47a75c8e..d37220a72 100644 --- a/docs/config/custom_emoji.md +++ b/docs/config/custom_emoji.md @@ -18,21 +18,36 @@ foo, /emoji/custom/foo.png The files should be PNG (APNG is okay with `.png` for `image/png` Content-type) and under 50kb for compatibility with mastodon. -# Emoji tags - -Changing default tags: - -* For `Finmoji`, `emoji.txt` and `custom_emoji.txt` are added default tags, which can be configured in the `config.exs`: -* For emoji loaded from globs: - - `priv/static/emoji/custom/*.png` - `custom_tag`, can be configured in `config.exs` - - `priv/static/emoji/custom/TagName/*.png` - folder (`TagName`) is used as tag +# Emoji tags (groups) +Default tags are set in `config.exs`. +``` +config :pleroma, :emoji, + shortcode_globs: ["/emoji/custom/**/*.png"], + groups: [ + Finmoji: "/finmoji/128px/*-128.png", + Custom: ["/emoji/*.png", "/emoji/custom/*.png"] + ] +``` +Order of the `groups` matters, so to override default tags just put your group on the top of the list. E.g: ``` config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"], - custom_tag: "Custom", # Default tag for emoji in `priv/static/emoji/custom` path - finmoji_tag: "Finmoji", # Default tag for Finmoji - emoji_tag: "Emoji", # Default tag for emoji.txt - custom_emoji_tag: "Custom" # Default tag for custom_emoji.txt + groups: [ + "Finmoji special": "/finmoji/128px/a_trusted_friend-128.png", # special file + "Cirno": "/emoji/custom/cirno*.png", # png files in /emoji/custom/ which start with `cirno` + "Special group": "/emoji/custom/special_folder/*.png", # png files in /emoji/custom/special_folder/ + "Another group": "/emoji/custom/special_folder/*/.png", # png files in /emoji/custom/special_folder/ subfolders + Finmoji: "/finmoji/128px/*-128.png", + Custom: ["/emoji/*.png", "/emoji/custom/*.png"] + ] ``` + +Priority of tag assign in emoji.txt and custom.txt: + +`tag in file > special group setting in config.exs > default setting in config.exs` + +Priority for globs: + +`special group setting in config.exs > default setting in config.exs` -- cgit v1.2.3 From 08d64b977f74abb7cb42bf985116eba91d9a6166 Mon Sep 17 00:00:00 2001 From: Alex S Date: Tue, 2 Apr 2019 16:13:34 +0700 Subject: little changes and typos --- docs/config/custom_emoji.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/config/custom_emoji.md b/docs/config/custom_emoji.md index d37220a72..49a451fcc 100644 --- a/docs/config/custom_emoji.md +++ b/docs/config/custom_emoji.md @@ -30,7 +30,7 @@ config :pleroma, :emoji, ] ``` -Order of the `groups` matters, so to override default tags just put your group on the top of the list. E.g: +Order of the `groups` matters, so to override default tags just put your group on top of the list. E.g: ``` config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"], @@ -44,7 +44,7 @@ config :pleroma, :emoji, ] ``` -Priority of tag assign in emoji.txt and custom.txt: +Priority of tags assigns in emoji.txt and custom.txt: `tag in file > special group setting in config.exs > default setting in config.exs` -- cgit v1.2.3 From 3465b7ba9ad0e26128f18fd4e36aece767ba269e Mon Sep 17 00:00:00 2001 From: Alex S Date: Tue, 2 Apr 2019 20:32:37 +0700 Subject: syntax highlighting --- docs/config/custom_emoji.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/config/custom_emoji.md b/docs/config/custom_emoji.md index 49a451fcc..96fcb2fc6 100644 --- a/docs/config/custom_emoji.md +++ b/docs/config/custom_emoji.md @@ -21,7 +21,7 @@ The files should be PNG (APNG is okay with `.png` for `image/png` Content-type) # Emoji tags (groups) Default tags are set in `config.exs`. -``` +```elixir config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"], groups: [ @@ -31,7 +31,7 @@ config :pleroma, :emoji, ``` Order of the `groups` matters, so to override default tags just put your group on top of the list. E.g: -``` +```elixir config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"], groups: [ -- cgit v1.2.3 From d140738edf75467420b35c500716cf89de66548d Mon Sep 17 00:00:00 2001 From: Alex S Date: Tue, 2 Apr 2019 20:35:41 +0700 Subject: second level of headertext change in doc --- docs/config/custom_emoji.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config/custom_emoji.md b/docs/config/custom_emoji.md index 96fcb2fc6..419a7d0e2 100644 --- a/docs/config/custom_emoji.md +++ b/docs/config/custom_emoji.md @@ -18,7 +18,7 @@ foo, /emoji/custom/foo.png The files should be PNG (APNG is okay with `.png` for `image/png` Content-type) and under 50kb for compatibility with mastodon. -# Emoji tags (groups) +## Emoji tags (groups) Default tags are set in `config.exs`. ```elixir -- cgit v1.2.3 From cfa6e7289f5cfdb1fce17eb89bc0513ff624480d Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Thu, 4 Apr 2019 16:10:43 +0700 Subject: Improve Transmogrifier.upgrade_user_from_ap_id/2 --- docs/config.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 97a0e6ffa..dd3cc3727 100644 --- a/docs/config.md +++ b/docs/config.md @@ -200,14 +200,14 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i - `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` + - `scheme` - e.g `http`, `https` - `port` - `path` **Important note**: 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: +Example: ```elixir config :pleroma, Pleroma.Web.Endpoint, url: [host: "example.com", port: 2020, scheme: "https"], @@ -296,9 +296,11 @@ curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerando [Pleroma Job Queue](https://git.pleroma.social/pleroma/pleroma_job_queue) configuration: a list of queues with maximum concurrent jobs. Pleroma has the following queues: + * `federator_outgoing` - Outgoing federation * `federator_incoming` - Incoming federation * `mailer` - Email sender, see [`Pleroma.Mailer`](#pleroma-mailer) +* `transmogrifier` - Transmogrifier Example: -- cgit v1.2.3 From 5564cd421dfc706208df0b7447b0d692dffe052e Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 4 Apr 2019 12:19:31 -0500 Subject: Document Prometheus --- docs/api/prometheus.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/api/prometheus.md (limited to 'docs') diff --git a/docs/api/prometheus.md b/docs/api/prometheus.md new file mode 100644 index 000000000..19c564e3c --- /dev/null +++ b/docs/api/prometheus.md @@ -0,0 +1,22 @@ +# Prometheus Metrics + +Pleroma includes support for exporting metrics via the [prometheus_ex](https://github.com/deadtrickster/prometheus.ex) library. + +## `/api/pleroma/app_metrics` +### Exports Prometheus application metrics +* Method: `GET` +* Authentication: not required +* Params: none +* Response: JSON + +## Grafana +### Config example +The following is a config example to use with [Grafana](https://grafana.com) + +``` + - job_name: 'beam' + metrics_path: /api/pleroma/app_metrics + scheme: https + static_configs: + - targets: ['pleroma.soykaf.com'] +``` -- cgit v1.2.3 From 47a236f7537ad4366d07361d184c84f3912648f1 Mon Sep 17 00:00:00 2001 From: Ivan Tashkinov Date: Fri, 5 Apr 2019 15:12:02 +0300 Subject: [#923] OAuth consumer mode refactoring, new tests, tests adjustments, readme. --- docs/config.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 06d6fd757..36d7f1273 100644 --- a/docs/config.md +++ b/docs/config.md @@ -412,3 +412,58 @@ Pleroma account will be created with the same name as the LDAP user name. * `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator * `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication + +## :auth + +Authentication / authorization settings. + +* `oauth_consumer_strategies`: lists enabled OAuth consumer strategies; by default it's set by OAUTH_CONSUMER_STRATEGIES environment variable. + +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). + +Note: each strategy is shipped as a separate dependency; in order to get the strategies, run `OAUTH_CONSUMER_STRATEGIES="..." mix deps.get`, +e.g. `OAUTH_CONSUMER_STRATEGIES="twitter facebook google microsoft" mix deps.get`. +The server should also be started with `OAUTH_CONSUMER_STRATEGIES="..." mix phx.server` in case you enable any strategies. + +Note: each strategy requires separate setup (on external provider side and Pleroma side). Below are the guidelines on setting up most popular strategies. + +* For Twitter, [register an app](https://developer.twitter.com/en/apps), configure callback URL to https:///oauth/twitter/callback + +* For Facebook, [register an app](https://developers.facebook.com/apps), configure callback URL to https:///oauth/facebook/callback, enable Facebook Login service at https://developers.facebook.com/apps//fb-login/settings/ + +* For Google, [register an app](https://console.developers.google.com), configure callback URL to https:///oauth/google/callback + +* For Microsoft, [register an app](https://portal.azure.com), configure callback URL to https:///oauth/microsoft/callback + +Once the app is configured on external OAuth provider side, add app's credentials and strategy-specific settings (if any — e.g. see Microsoft below) to `config/prod.secret.exs`, +per strategy's documentation (e.g. [ueberauth_twitter](https://github.com/ueberauth/ueberauth_twitter)). Example config basing on environment variables: + +``` +# Twitter +config :ueberauth, Ueberauth.Strategy.Twitter.OAuth, + consumer_key: System.get_env("TWITTER_CONSUMER_KEY"), + consumer_secret: System.get_env("TWITTER_CONSUMER_SECRET") + +# Facebook +config :ueberauth, Ueberauth.Strategy.Facebook.OAuth, + client_id: System.get_env("FACEBOOK_APP_ID"), + client_secret: System.get_env("FACEBOOK_APP_SECRET"), + redirect_uri: System.get_env("FACEBOOK_REDIRECT_URI") + +# Google +config :ueberauth, Ueberauth.Strategy.Google.OAuth, + client_id: System.get_env("GOOGLE_CLIENT_ID"), + client_secret: System.get_env("GOOGLE_CLIENT_SECRET"), + redirect_uri: System.get_env("GOOGLE_REDIRECT_URI") + +# Microsoft +config :ueberauth, Ueberauth.Strategy.Microsoft.OAuth, + client_id: System.get_env("MICROSOFT_CLIENT_ID"), + client_secret: System.get_env("MICROSOFT_CLIENT_SECRET") + +config :ueberauth, Ueberauth, + providers: [ + microsoft: {Ueberauth.Strategy.Microsoft, [callback_params: []]} + ] +``` -- cgit v1.2.3 From f1712cd2f1ec6061f70d259f8f5e2b7e9f408d8c Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Fri, 5 Apr 2019 19:38:44 +0700 Subject: Use PleromaJobQueue in Pleroma.Web.Push --- docs/config.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 06d6fd757..6f3119573 100644 --- a/docs/config.md +++ b/docs/config.md @@ -218,14 +218,14 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i - `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` + - `scheme` - e.g `http`, `https` - `port` - `path` **Important note**: 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: +Example: ```elixir config :pleroma, Pleroma.Web.Endpoint, url: [host: "example.com", port: 2020, scheme: "https"], @@ -317,6 +317,7 @@ Pleroma has the following queues: * `federator_outgoing` - Outgoing federation * `federator_incoming` - Incoming federation * `mailer` - Email sender, see [`Pleroma.Mailer`](#pleroma-mailer) +* `web_push` - Web push notifications Example: -- cgit v1.2.3 From fc92a0fd8d5be0352f4791b79bda04960f36f707 Mon Sep 17 00:00:00 2001 From: eugenijm Date: Tue, 2 Apr 2019 01:31:01 +0300 Subject: Added limits and media attachments for scheduled activities. --- docs/config.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 06d6fd757..df21beff3 100644 --- a/docs/config.md +++ b/docs/config.md @@ -218,14 +218,14 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i - `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` + - `scheme` - e.g `http`, `https` - `port` - `path` **Important note**: 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: +Example: ```elixir config :pleroma, Pleroma.Web.Endpoint, url: [host: "example.com", port: 2020, scheme: "https"], @@ -412,3 +412,8 @@ Pleroma account will be created with the same name as the LDAP user name. * `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator * `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication + +## Pleroma.ScheduledActivity + +* `daily_user_limit`: the number of scheduled activities a user is allowed to create in a single day +* `total_user_limit`: the number of scheduled activities a user is allowed to create in total -- cgit v1.2.3 From 2056efa714460faaf25f6bc03ab643f5a2e8cd3d Mon Sep 17 00:00:00 2001 From: eugenijm Date: Wed, 3 Apr 2019 18:55:04 +0300 Subject: Add scheduler for sending scheduled activities to the queue --- docs/config.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index df21beff3..ba0759e87 100644 --- a/docs/config.md +++ b/docs/config.md @@ -317,6 +317,7 @@ Pleroma has the following queues: * `federator_outgoing` - Outgoing federation * `federator_incoming` - Incoming federation * `mailer` - Email sender, see [`Pleroma.Mailer`](#pleroma-mailer) +* `scheduled_activities` - Scheduled activities, see [`Pleroma.ScheduledActivities`](#pleromascheduledactivity) Example: @@ -413,7 +414,8 @@ Pleroma account will be created with the same name as the LDAP user name. * `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator * `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication -## Pleroma.ScheduledActivity +## Pleroma.ScheduledActivity -* `daily_user_limit`: the number of scheduled activities a user is allowed to create in a single day -* `total_user_limit`: the number of scheduled activities a user is allowed to create in total +* `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 -- cgit v1.2.3 From e3328bc1382315c9067c099995a29db70d9d0433 Mon Sep 17 00:00:00 2001 From: Ivan Tashkinov Date: Sun, 7 Apr 2019 11:08:37 +0300 Subject: [#923] Removed
elements from auth forms, adjusted docs, minor auth settings refactoring. --- docs/config.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 36d7f1273..686f1f36b 100644 --- a/docs/config.md +++ b/docs/config.md @@ -390,6 +390,11 @@ config :auto_linker, ] ``` +## 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 @@ -408,16 +413,15 @@ Pleroma account will be created with the same name as the LDAP user name. * `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" -## Pleroma.Web.Auth.Authenticator - -* `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator -* `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication - ## :auth Authentication / authorization settings. -* `oauth_consumer_strategies`: lists enabled OAuth consumer strategies; by default it's set by OAUTH_CONSUMER_STRATEGIES environment variable. +* `auth_template`: authentication form template. By default it's `show.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/show.html.eex`. +* `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. + +# 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). -- cgit v1.2.3 From 4a6855d9eedf07159520b2205c554c891e70c7d4 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 1 Jan 2017 03:10:08 +0300 Subject: Provide plaintext representations of content/cw in MastoAPI --- docs/api/differences_in_mastoapi_responses.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md index 215f43155..923d94db2 100644 --- a/docs/api/differences_in_mastoapi_responses.md +++ b/docs/api/differences_in_mastoapi_responses.md @@ -20,6 +20,8 @@ Has these additional fields under the `pleroma` object: - `local`: true if the post was made on the local instance. - `conversation_id`: the ID of the conversation the status is associated with (if any) +- `content`: a map consisting of alternate representations of the `content` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain` +- `spoiler_text`: a map consisting of alternate representations of the `spoiler_text` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain` ## Attachments -- cgit v1.2.3 From 6adea5a7b29289e88c39206338b2a9092159f4d1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 18 Dec 2018 17:09:01 +0100 Subject: Move to docs --- docs/Pleroma-API.md | 26 ++++++++ docs/config.md | 177 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+) create mode 100644 docs/Pleroma-API.md create mode 100644 docs/config.md (limited to 'docs') diff --git a/docs/Pleroma-API.md b/docs/Pleroma-API.md new file mode 100644 index 000000000..cda3894f0 --- /dev/null +++ b/docs/Pleroma-API.md @@ -0,0 +1,26 @@ +# Authentication + +Requests that require it can be authenticated with [an OAuth token](https://tools.ietf.org/html/rfc6749), the `_pleroma_key` cookie, or [HTTP Basic Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). + +# Request parameters + +Request parameters can be passed via [query strings](https://en.wikipedia.org/wiki/Query_string) or as [form data](https://www.w3.org/TR/html401/interact/forms.html). Files must be uploaded as `multipart/form-data`. + +# Endpoints + +## `/api/pleroma/emoji` +### Lists the custom emoji on that server. +* Method: `GET` +* Authentication: not required +* Params: none +* Response: JSON +* Example response: `{"kalsarikannit_f":"/finmoji/128px/kalsarikannit_f-128.png","perkele":"/finmoji/128px/perkele-128.png","blobdab":"/emoji/blobdab.png","happiness":"/finmoji/128px/happiness-128.png"}` + +## `/api/pleroma/follow_import` +### Imports your follows, for example from a Mastodon CSV file. +* Method: `POST` +* Authentication: required +* Params: + * `list`: STRING or FILE containing a whitespace-separated list of accounts to follow + * Response: HTTP 200 on success, 500 on error + * Note: Users that can't be followed are silently skipped. diff --git a/docs/config.md b/docs/config.md new file mode 100644 index 000000000..edabd6e0f --- /dev/null +++ b/docs/config.md @@ -0,0 +1,177 @@ +# Configuration + +This file describe the configuration, it is recommended to edit the relevant *.secret.exs file instead of the others founds in the ``config`` directory. +If you run Pleroma with ``MIX_ENV=prod`` the file is ``prod.secret.exs``, otherwise it is ``dev.secret.exs``. + +## Pleroma.Upload +* `uploader`: Select which `Pleroma.Uploaders` to use +* `filters`: List of `Pleroma.Upload.Filter` to use. +* `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. +* `proxy_opts`: Proxy options, see `Pleroma.ReverseProxy` documentation. + +Note: `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 + +## Pleroma.Upload.Filter.Mogrify + +* `args`: List of actions for the `mogrify` command like `"strip"` or `["strip", {"impode", "1"}]`. + +## Pleroma.Upload.Filter.Dedupe + +No specific configuration. + +## 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. + +## Pleroma.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. + +An example for Sendgrid adapter: + +``` +config :pleroma, Pleroma.Mailer, + adapter: Swoosh.Adapters.Sendgrid, + api_key: "YOUR_API_KEY" +``` + +An example for SMTP adapter: +``` +config :pleroma, Pleroma.Mailer, + adapter: Swoosh.Adapters.SMTP, + relay: "smtp.gmail.com", + username: "YOUR_USERNAME@gmail.com", + password: "YOUR_SMTP_PASSWORD", + port: 465, + ssl: true, + tls: :always, + auth: :always +``` + +## :uri_schemes +* `valid_schemes`: List of the scheme part that is considered valid to be an URL + +## :instance +* `name`: The instance’s name +* `email`: Email used to reach an Administrator/Moderator of the instance +* `description`: The instance’s description, can be seen in nodeinfo and ``/api/v1/instance`` +* `limit`: Posts character limit (CW/Subject included in the counter) +* `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 +* `registrations_open`: Enable registrations for anyone, invitations can be enabled when false. +* `invites_enabled`: Enable user invitations for admins (depends on `registrations_open: false`). +* `federating`: Enable federation with other instances +* `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.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:. +* `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) +* `finmoji_enabled`: Whenether to enable the finmojis in the custom emojis. +* `mrf_transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo). +* `scope_copy`: Copy the scope (private/unlisted/public) in replies to posts by default. +* `subject_line_behavior`: Allows changing the default behaviour of subject lines in replies. Valid values: + * "email": Copy and preprend re:, as in email. + * "masto": Copy verbatim, as in Mastodon. + * "noop": Don't copy the subject. +* `always_show_subject_input`: When set to false, auto-hide the subject field when it's empty. +* `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. + +## :fe +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`: Whenether to mask the logo +* `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, …) + +## :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 + +## :mrf_rejectnonpublic +* `allow_followersonly`: whether to allow followers-only posts +* `allow_direct`: whether to allow direct messages + +## :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)]`. + +## :gopher +* `enabled`: Enables the gopher interface +* `ip`: IP address to bind to +* `port`: Port to bind to + +## :activitypub +* ``accept_blocks``: Whether to accept incoming block activities from other instances +* ``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 + +## :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"`. + +## :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: + +``` +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_retained`: The time in seconds for which the captcha is valid (stored in the cache) + +### 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 \ No newline at end of file -- cgit v1.2.3 From d6b133ec51d53ae5ba878e150b9b377e7dab4a3a Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 18 Dec 2018 18:33:39 +0100 Subject: Pleroma-API.md: Additionnal endpoints --- docs/Pleroma-API.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/Pleroma-API.md b/docs/Pleroma-API.md index cda3894f0..84a5924fa 100644 --- a/docs/Pleroma-API.md +++ b/docs/Pleroma-API.md @@ -22,5 +22,74 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * Authentication: required * Params: * `list`: STRING or FILE containing a whitespace-separated list of accounts to follow - * Response: HTTP 200 on success, 500 on error - * Note: Users that can't be followed are silently skipped. +* Response: HTTP 200 on success, 500 on error +* Note: Users that can't be followed are silently skipped. + +## `/api/pleroma/captcha` +### Get a new captcha +* Method: `GET` +* Authentication: not required +* Params: none +* Response: Provider specific JSON, the only guaranteed parameter is `type` +* Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint"}` + +## `/api/pleroma/delete_account` +### Delete an account +* Method `POST` +* Authentication: required +* Params: + * `password`: user's password +* Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise +* Example response: `{"error": "Invalid password."}` + +## `/api/account/register` +### Register a new user +* Method `POST` +* Authentication: not required +* Params: + * `nickname` + * `fullname` + * `bio` + * `email` + * `password` + * `confirm` + * `captcha_solution`: optional, contains provider-specific captcha solution, + * `captcha_token`: optional, contains provider-specific captcha token +* Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}` +* Example response: +``` +{ + "background_image": null, + "cover_photo": "https://pleroma.soykaf.com/images/banner.png", + "created_at": "Tue Dec 18 16:55:56 +0000 2018", + "default_scope": "public", + "description": "blushy-crushy fediverse idol + pleroma dev\nlet's be friends \nぷれろまの生徒会長。謎の外人。日本語OK. \n公主病.", + "description_html": "blushy-crushy fediverse idol + pleroma dev.
let's be friends
ぷれろまの生徒会長。謎の外人。日本語OK.
公主病.", + "favourites_count": 0, + "fields": [], + "followers_count": 0, + "following": false, + "follows_you": false, + "friends_count": 0, + "id": 6, + "is_local": true, + "locked": false, + "name": "lain", + "name_html": "lain", + "no_rich_text": false, + "pleroma": { + "tags": [] + }, + "profile_image_url": "https://pleroma.soykaf.com/images/avi.png", + "profile_image_url_https": "https://pleroma.soykaf.com/images/avi.png", + "profile_image_url_original": "https://pleroma.soykaf.com/images/avi.png", + "profile_image_url_profile_size": "https://pleroma.soykaf.com/images/avi.png", + "rights": { + "delete_others_notice": false + }, + "screen_name": "lain", + "statuses_count": 0, + "statusnet_blocking": false, + "statusnet_profile_url": "https://pleroma.soykaf.com/users/lain" +} +``` \ No newline at end of file -- cgit v1.2.3 From 336e37d98f1b86c0332c9f260e27455a14714fa6 Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Fri, 21 Dec 2018 00:32:37 +0300 Subject: Make captcha (kocaptcha) stateless Also rename seconds_retained to seconds_valid since that's how it is now. Put it down from 180 to 20 seconds. The answer data is now stored in an encrypted text transfered to the client and back, so no ETS is needed --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index c35769f21..cfeca8eb4 100644 --- a/docs/config.md +++ b/docs/config.md @@ -168,7 +168,7 @@ Web Push Notifications configuration. You can use the mix task `mix web_push.gen ## Pleroma.Captcha * `enabled`: Whether the captcha should be shown on registration * `method`: The method/service to use for captcha -* `seconds_retained`: The time in seconds for which the captcha is valid (stored in the cache) +* `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, -- cgit v1.2.3 From c92f91ffebd848b7b9840b238d72455db285d564 Mon Sep 17 00:00:00 2001 From: Karen Konou Date: Sun, 23 Dec 2018 10:41:56 +0100 Subject: Add documentation --- docs/config.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index c35769f21..819ac91f8 100644 --- a/docs/config.md +++ b/docs/config.md @@ -121,6 +121,9 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i * `allow_followersonly`: whether to allow followers-only posts * `allow_direct`: whether to allow direct messages +## :mrf_hellthreadmitigation +* `threshold`: Number of mentioned users after which the message gets discarded as spam + ## :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. -- cgit v1.2.3 From c76179419d5d4bb2423496856ad931974b56d6d5 Mon Sep 17 00:00:00 2001 From: Karen Konou Date: Sun, 23 Dec 2018 11:14:29 +0100 Subject: Renamed the things --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 819ac91f8..728916f82 100644 --- a/docs/config.md +++ b/docs/config.md @@ -121,7 +121,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i * `allow_followersonly`: whether to allow followers-only posts * `allow_direct`: whether to allow direct messages -## :mrf_hellthreadmitigation +## :mrf_hellthread * `threshold`: Number of mentioned users after which the message gets discarded as spam ## :media_proxy -- cgit v1.2.3 From 5811e65e67591b06238de66470c03744e0d83e2d Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 26 Dec 2018 12:39:35 +0100 Subject: Add some hard limits on inserted activities. --- docs/config.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 728916f82..0aeaf934e 100644 --- a/docs/config.md +++ b/docs/config.md @@ -63,6 +63,7 @@ config :pleroma, Pleroma.Mailer, * `email`: Email used to reach an Administrator/Moderator of the instance * `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 -- cgit v1.2.3 From 286632dfa224f8b49cc8656a29efe17f4e2219a1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 31 Dec 2018 12:13:17 +0100 Subject: Add docs/Admin-API.md [ci skip] --- docs/Admin-API.md | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/Pleroma-API.md | 5 ++- 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 docs/Admin-API.md (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md new file mode 100644 index 000000000..3b19d1aa6 --- /dev/null +++ b/docs/Admin-API.md @@ -0,0 +1,100 @@ +# Admin API +Authentication is required and the user must be an admin. + +## `/api/pleroma/admin/user` +### Remove a user +* Method `DELETE` +* Params: + * `nickname` +* Response: User’s nickname +### Create a user +* Method: `POST` +* Params: + * `nickname` + * `email` + * `password` +* Response: User’s nickname + +## `/api/pleroma/admin/users/tag` +### Tag a list of users +* Method: `PUT` +* Params: + * `nickname` + * `tags` +### Untag a list of users +* Method: `DELETE` +* Params: + * `nickname` + * `tags` + +## `/api/pleroma/admin/permission_group/:nickname` +### Get user user permission groups membership +* Method: `GET` +* Params: none +* Response: +```JSON +{ + "is_moderator": bool, + "is_admin": bool +} +``` + +## `/api/pleroma/admin/permission_group/:nickname/:permission_group` +Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist. + +### Get user user permission groups membership +* Method: `GET` +* Params: none +* Response: +```JSON +{ + "is_moderator": bool, + "is_admin": bool +} +``` +### Add user in permission group +* Method: `POST` +* Params: none +* Response: + * On failure: ``{"error": "…"}`` + * On success: JSON of the ``user.info`` +### Remove user from permission group +* Method: `DELETE` +* Params: none +* Response: + * On failure: ``{"error": "…"}`` + * On success: JSON of the ``user.info`` +* Note: An admin cannot revoke their own admin status. + +## `/api/pleroma/admin/relay` +### Follow a Relay +* Methods: `POST` +* Params: + * `relay_url` +* Response: + * On success: URL of the followed relay +### Unfollow a Relay +* Methods: `DELETE` +* Params: + * `relay_url` +* Response: + * On success: URL of the unfollowed relay + +## `/api/pleroma/admin/invite_token` +### Get a account registeration invite token +* Methods: `GET` +* Params: none +* Response: invite token (base64 string) + +## `/api/pleroma/admin/email_invite` +### Sends registration invite via email +* Methods: `POST` +* Params: + * `email` + * `name`, optionnal + +## `/api/pleroma/admin/password_reset` +### Get a password reset token for a given nickname +* Methods: `GET` +* Params: none +* Response: password reset token (base64 string) diff --git a/docs/Pleroma-API.md b/docs/Pleroma-API.md index 84a5924fa..da58babf9 100644 --- a/docs/Pleroma-API.md +++ b/docs/Pleroma-API.md @@ -92,4 +92,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi "statusnet_blocking": false, "statusnet_profile_url": "https://pleroma.soykaf.com/users/lain" } -``` \ No newline at end of file +``` + +## `/api/pleroma/admin/`… +See [Admin-API](Admin-API.md) -- cgit v1.2.3 From 1a0391c8a474c282823d3b2ab7a0cae62328c5b3 Mon Sep 17 00:00:00 2001 From: lain Date: Tue, 1 Jan 2019 17:40:42 +0100 Subject: Add documentation. --- docs/config.md | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 0aeaf934e..f4bcae3fd 100644 --- a/docs/config.md +++ b/docs/config.md @@ -193,3 +193,14 @@ You can then do ``` curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerandomtoken" ``` + +## Pleroma.Web.Federator + +* `max_jobs`: The maximum amount of parallel federation jobs running at the same time. + +## Pleroma.Web.Federator.RetryQueue + +* `enabled`: If set to `true`, failed federation jobs will be retried +* `max_jobs`: The maximum amount of parallel federation jbos running at the same time. +* `initial_timeout`: The initial timeout in seconds +* `max_retries`: The maximum number of times a federation job is retried -- cgit v1.2.3 From c9b99d4486be83f3161c889558290cb9be758007 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 2 Jan 2019 23:07:48 +0100 Subject: config/config.exs: Add syslog backends --- docs/config.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 1c3219efe..e3b2fb35c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -94,6 +94,10 @@ config :pleroma, Pleroma.Mailer, * `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. +## :logger +* `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog +See: [logger’s documentation](https://hexdocs.pm/logger/Logger.html) and [ex_syslogger’s documentation](https://hexdocs.pm/ex_syslogger/) + ## :fe This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:instance`` is set to false. -- cgit v1.2.3 From 0fae04c4e3961baf1f31ae664e5a7fa5de19158e Mon Sep 17 00:00:00 2001 From: lain Date: Tue, 8 Jan 2019 09:55:33 +0100 Subject: Add a setting for users to autofollow on sign up. --- docs/config.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index e3b2fb35c..1a9706f5b 100644 --- a/docs/config.md +++ b/docs/config.md @@ -93,6 +93,7 @@ config :pleroma, Pleroma.Mailer, * `always_show_subject_input`: When set to false, auto-hide the subject field when it's empty. * `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. +* `autofollowed_nicknames`: Set to nicknames of (local) users that every new user should automatically follow. ## :logger * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog -- cgit v1.2.3 From 6428ef77adef6aa3fca1fbcdcfffc5db5fc953d5 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Tue, 8 Jan 2019 16:11:03 +0700 Subject: add default configuration for the pinned statuses and some doc --- docs/config.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 1c3219efe..c903b53bf 100644 --- a/docs/config.md +++ b/docs/config.md @@ -93,6 +93,7 @@ config :pleroma, Pleroma.Mailer, * `always_show_subject_input`: When set to false, auto-hide the subject field when it's empty. * `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. ## :fe This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:instance`` is set to false. -- cgit v1.2.3 From 9eba6b96dc5e44e70c1af1d76d3c30e10e705e0f Mon Sep 17 00:00:00 2001 From: scarlett Date: Fri, 11 Jan 2019 09:55:33 +0000 Subject: Fix spellign. --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 7eb2d5671..e3738271b 100644 --- a/docs/config.md +++ b/docs/config.md @@ -207,6 +207,6 @@ curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerando ## Pleroma.Web.Federator.RetryQueue * `enabled`: If set to `true`, failed federation jobs will be retried -* `max_jobs`: The maximum amount of parallel federation jbos running at the same time. +* `max_jobs`: The maximum amount of parallel federation jobs running at the same time. * `initial_timeout`: The initial timeout in seconds * `max_retries`: The maximum number of times a federation job is retried -- cgit v1.2.3 From bfe2a11a6b64b868d18727359b83edc51ce5bb80 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 16 Jan 2019 10:45:56 +0300 Subject: Add config doc --- docs/config.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index e3738271b..c2104a9e8 100644 --- a/docs/config.md +++ b/docs/config.md @@ -210,3 +210,8 @@ curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerando * `max_jobs`: The maximum amount of parallel federation jobs running at the same time. * `initial_timeout`: The initial timeout in seconds * `max_retries`: The maximum number of times a federation job is retried + +## Pleroma.Web.Metadata +* `providers`: a list of metadata providers to enable. Providers avalible: + * Pleroma.Web.Metadata.Providers.OpenGraph + * Pleroma.Web.Metadata.Providers.TwitterCard -- cgit v1.2.3 From 4d5f15cd422abd3a2dce6f6022c75014c18c73cf Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 17 Jan 2019 11:00:02 +0300 Subject: Introduce optional unfurling of nsfw content --- docs/config.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index c2104a9e8..b9ad2aef7 100644 --- a/docs/config.md +++ b/docs/config.md @@ -212,6 +212,7 @@ curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerando * `max_retries`: The maximum number of times a federation job is retried ## Pleroma.Web.Metadata -* `providers`: a list of metadata providers to enable. Providers avalible: +* `providers`: a list of metadata providers to enable. Providers availible: * Pleroma.Web.Metadata.Providers.OpenGraph * Pleroma.Web.Metadata.Providers.TwitterCard +* `unfurl_nsfw`: If set to `true` nsfw attachments will be shown in previews -- cgit v1.2.3 From 8c368d42a20ea21d5d382838843ca1c57a86e882 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 17 Jan 2019 15:48:14 +0000 Subject: Make attachment links configurable Thanks @href! --- docs/config.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index e3738271b..6bf7b9ea7 100644 --- a/docs/config.md +++ b/docs/config.md @@ -95,6 +95,7 @@ config :pleroma, Pleroma.Mailer, 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 ## :logger * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog -- cgit v1.2.3 From e221c681dcd387aa445c35957a32fdc0189a0955 Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 23 Jan 2019 12:40:57 +0100 Subject: New frontend configuration mechanism. --- docs/config.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 6bf7b9ea7..ff4a1012c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -101,7 +101,24 @@ config :pleroma, Pleroma.Mailer, * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog See: [logger’s documentation](https://hexdocs.pm/logger/Logger.html) and [ex_syslogger’s documentation](https://hexdocs.pm/ex_syslogger/) + +## :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` are configured. + +Frontends can access these settings at `/api/pleroma/frontend_configurations` + +To add your own configuration for PleromaFE, use it like this: + +`config :pleroma, :frontend_configurations, :pleroma_fe, %{theme: "my-theme", ...}` + +These settings need to be complete, they will overide the defaults. + ## :fe +__THIS IS DEPRACTED__ + +If you are using this method, please change it to the `frontend_configurations` method. + 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`` -- cgit v1.2.3 From 656ed7c84a5d8e423999457f66d8259ec8aa9a44 Mon Sep 17 00:00:00 2001 From: Ivan Tashkinov Date: Fri, 25 Jan 2019 15:10:21 +0300 Subject: [#534] Configurable outgoing federation reachability timeout. --- docs/config.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 6bf7b9ea7..3f4588299 100644 --- a/docs/config.md +++ b/docs/config.md @@ -72,6 +72,7 @@ config :pleroma, Pleroma.Mailer, * `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_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) -- cgit v1.2.3 From 37520e1e793aa190a4e32a937c3ea80481eafc08 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 27 Jan 2019 14:30:21 +0100 Subject: docs/Pleroma-API.md: Add note about emoji endpoints similarities [ci skip] --- docs/Pleroma-API.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/Pleroma-API.md b/docs/Pleroma-API.md index da58babf9..0c4586dd3 100644 --- a/docs/Pleroma-API.md +++ b/docs/Pleroma-API.md @@ -15,6 +15,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * Params: none * Response: JSON * Example response: `{"kalsarikannit_f":"/finmoji/128px/kalsarikannit_f-128.png","perkele":"/finmoji/128px/perkele-128.png","blobdab":"/emoji/blobdab.png","happiness":"/finmoji/128px/happiness-128.png"}` +* Note: Same data as Mastodon API’s `/api/v1/custom_emojis` but in a different format ## `/api/pleroma/follow_import` ### Imports your follows, for example from a Mastodon CSV file. -- cgit v1.2.3 From bcc559e4e61988c9d2c74dd407329b1a4c458400 Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 28 Jan 2019 13:06:28 +0100 Subject: Update config.md --- docs/config.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index ff4a1012c..7af6119bd 100644 --- a/docs/config.md +++ b/docs/config.md @@ -115,9 +115,9 @@ To add your own configuration for PleromaFE, use it like this: These settings need to be complete, they will overide the defaults. ## :fe -__THIS IS DEPRACTED__ +__THIS IS DEPRECATED__ -If you are using this method, please change it to the `frontend_configurations` method. +If you are using this method, please change it to the `frontend_configurations` method. Please set this option to false in your config like this: `config :pleroma, :fe, false`. This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:instance`` is set to false. -- cgit v1.2.3 From 55affbca7fcb214c71b3f8378b0de869c4d4d072 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Mon, 28 Jan 2019 22:17:17 +0700 Subject: add a job queue --- docs/config.md | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 5464fa90d..84a1e3607 100644 --- a/docs/config.md +++ b/docs/config.md @@ -36,14 +36,15 @@ This filter replaces the filename (not the path) of an upload. For complete obfu An example for Sendgrid adapter: -``` +```exs config :pleroma, Pleroma.Mailer, adapter: Swoosh.Adapters.Sendgrid, api_key: "YOUR_API_KEY" ``` An example for SMTP adapter: -``` + +```exs config :pleroma, Pleroma.Mailer, adapter: Swoosh.Adapters.SMTP, relay: "smtp.gmail.com", @@ -163,7 +164,7 @@ their ActivityPub ID. An example: -``` +```exs config :pleroma, :mrf_user_allowlist, "example.org": ["https://example.org/users/admin"] ``` @@ -192,18 +193,34 @@ the source code is here: https://github.com/koto-bank/kocaptcha. The default end 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: -``` +```exs config :pleroma, :admin_token, "somerandomtoken" ``` You can then do -``` + +```sh curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerandomtoken" ``` -## Pleroma.Web.Federator +## Pleroma.Jobs + +A list of job queues and their settings. + +Job queue settings: + +* `max_jobs`: The maximum amount of parallel jobs running at the same time. + +Example: + +```exs +config :pleroma, Pleroma.Jobs, + federator_incoming: [max_jobs: 50], + federator_outgoing: [max_jobs: 50] +``` + +This config contains two queues: `federator_incoming` and `federator_outgoing`. Both have the `max_jobs` set to `50`. -* `max_jobs`: The maximum amount of parallel federation jobs running at the same time. ## Pleroma.Web.Federator.RetryQueue -- cgit v1.2.3 From 3f9d0c08ea1197bc73bfbbab4a95aecef4a3ae13 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 29 Jan 2019 19:11:34 +0100 Subject: docs/Pleroma-API.md: Fix ex_doc title by changing the first h1 to it [ci skip] --- docs/Pleroma-API.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/Pleroma-API.md b/docs/Pleroma-API.md index 0c4586dd3..3ebea565c 100644 --- a/docs/Pleroma-API.md +++ b/docs/Pleroma-API.md @@ -1,13 +1,9 @@ -# Authentication +# Pleroma API Requests that require it can be authenticated with [an OAuth token](https://tools.ietf.org/html/rfc6749), the `_pleroma_key` cookie, or [HTTP Basic Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). -# Request parameters - Request parameters can be passed via [query strings](https://en.wikipedia.org/wiki/Query_string) or as [form data](https://www.w3.org/TR/html401/interact/forms.html). Files must be uploaded as `multipart/form-data`. -# Endpoints - ## `/api/pleroma/emoji` ### Lists the custom emoji on that server. * Method: `GET` -- cgit v1.2.3 From aa492af6c26fb7505d36c80f9ff2fac6d7c38b61 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 30 Jan 2019 11:33:06 +0100 Subject: docs/config.md: Fix typo, provide an example key with camelCase and where to find more [ci skip] --- docs/config.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 8740c3fae..5799f003e 100644 --- a/docs/config.md +++ b/docs/config.md @@ -110,9 +110,9 @@ Frontends can access these settings at `/api/pleroma/frontend_configurations` To add your own configuration for PleromaFE, use it like this: -`config :pleroma, :frontend_configurations, :pleroma_fe, %{theme: "my-theme", ...}` +`config :pleroma, :frontend_configurations, :pleroma_fe: %{redirectRootNoLogin: "/main/all", ...}` -These settings need to be complete, they will overide the defaults. +These settings need to be complete, they will override the defaults. See `priv/static/static/config.json` for the available keys. ## :fe __THIS IS DEPRECATED__ -- cgit v1.2.3 From 7db517ff06dcf5f9a1ebfa822c98d2d1591930e8 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 30 Jan 2019 11:51:12 +0100 Subject: =?UTF-8?q?docs/config.md:=20Fix=20syntax,=20pleroma=5Ffe=20isn?= =?UTF-8?q?=E2=80=99t=20an=20atom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 5799f003e..d100ead10 100644 --- a/docs/config.md +++ b/docs/config.md @@ -110,7 +110,7 @@ Frontends can access these settings at `/api/pleroma/frontend_configurations` To add your own configuration for PleromaFE, use it like this: -`config :pleroma, :frontend_configurations, :pleroma_fe: %{redirectRootNoLogin: "/main/all", ...}` +`config :pleroma, :frontend_configurations, pleroma_fe: %{redirectRootNoLogin: "/main/all", ...}` These settings need to be complete, they will override the defaults. See `priv/static/static/config.json` for the available keys. -- cgit v1.2.3 From 4aff4efa8d53988d00381b1346241359cf787e87 Mon Sep 17 00:00:00 2001 From: href Date: Wed, 30 Jan 2019 12:38:38 +0100 Subject: Use multiple hackney pools * federation (ap, salmon) * media (rich media, media proxy) * upload (uploader proxy) Each "part" will stop fighting others ones -- a huge federation outbound could before make the media proxy fail to checkout a connection in time. splitted media and uploaded media for the good reason than an upload pool will have all connections to the same host (the uploader upstream). it also has a longer default retention period for connections. --- docs/config.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 8740c3fae..a00532d16 100644 --- a/docs/config.md +++ b/docs/config.md @@ -234,3 +234,20 @@ curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerando * Pleroma.Web.Metadata.Providers.OpenGraph * Pleroma.Web.Metadata.Providers.TwitterCard * `unfurl_nsfw`: If set to `true` nsfw attachments will be shown in previews + +## :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 + -- cgit v1.2.3 From a0dc95d0849fecdc2251efade18435e98f16f682 Mon Sep 17 00:00:00 2001 From: Alice Date: Thu, 31 Jan 2019 13:14:22 +0000 Subject: Clarify the description of the `logo_mask` configuration key. --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 4f4a4378c..1d76f9ce4 100644 --- a/docs/config.md +++ b/docs/config.md @@ -123,7 +123,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i * `theme`: Which theme to use, they are defined in ``styles.json`` * `logo`: URL of the logo, defaults to Pleroma’s logo -* `logo_mask`: Whenether to mask the 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. -- cgit v1.2.3 From 7057891db649e1a72abfda13418d8c4bddd4ec92 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 31 Jan 2019 18:18:20 +0300 Subject: Make rich media support toggleable --- docs/config.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 4f4a4378c..902c1e188 100644 --- a/docs/config.md +++ b/docs/config.md @@ -235,6 +235,9 @@ curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerando * Pleroma.Web.Metadata.Providers.TwitterCard * `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 + ## :hackney_pools Advanced. Tweaks Hackney (http client) connections pools. -- cgit v1.2.3 From a7c55c61bb581ddbd8159261e167b08486547b20 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 31 Jan 2019 23:23:53 +0100 Subject: docs/Pleroma-API.md: Add missing token field documentation [ci skip] --- docs/Pleroma-API.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/Pleroma-API.md b/docs/Pleroma-API.md index 3ebea565c..e1448d3f0 100644 --- a/docs/Pleroma-API.md +++ b/docs/Pleroma-API.md @@ -52,6 +52,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * `confirm` * `captcha_solution`: optional, contains provider-specific captcha solution, * `captcha_token`: optional, contains provider-specific captcha token + * `token`: invite token required when the registerations aren't public. * Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}` * Example response: ``` -- cgit v1.2.3 From 0c08bd4181cda08112a9e12ba92cdfb25c602da1 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Sun, 3 Feb 2019 16:39:42 +0000 Subject: Update Mogrify docs and warning for deprecated syntax to encourage users to enable both strip and auto-orient --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index c14746d93..ce37084b9 100644 --- a/docs/config.md +++ b/docs/config.md @@ -17,7 +17,7 @@ Note: `strip_exif` has been replaced by `Pleroma.Upload.Filter.Mogrify`. ## Pleroma.Upload.Filter.Mogrify -* `args`: List of actions for the `mogrify` command like `"strip"` or `["strip", {"impode", "1"}]`. +* `args`: List of actions for the `mogrify` command like `"strip"` or `["strip", "auto-orient", {"impode", "1"}]`. ## Pleroma.Upload.Filter.Dedupe -- cgit v1.2.3 From 10130fa7d6a2dca4250ada1144fcfcfe75c26f45 Mon Sep 17 00:00:00 2001 From: Karen Konou Date: Sun, 3 Feb 2019 20:27:28 +0100 Subject: made toggleable, added docs --- docs/config.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index c14746d93..a1fd8e3f4 100644 --- a/docs/config.md +++ b/docs/config.md @@ -148,7 +148,8 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i * `allow_direct`: whether to allow direct messages ## :mrf_hellthread -* `threshold`: Number of mentioned users after which the message gets discarded as spam +* `delist_threshold`: Number of mentioned users after which the message gets delisted. Set to 0 to disable. +* `reject_threshold`: Number of mentioned users after which the messaged gets rejected. Set to 0 to disable. ## :media_proxy * `enabled`: Enables proxying of remote media to the instance’s proxy -- cgit v1.2.3 From e10cda7541f5d76a32d0bf27d90a51c5fc8e7fcf Mon Sep 17 00:00:00 2001 From: Karen Konou Date: Sun, 3 Feb 2019 22:46:06 +0100 Subject: implemented tweaks --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index a1fd8e3f4..ed253e906 100644 --- a/docs/config.md +++ b/docs/config.md @@ -148,7 +148,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i * `allow_direct`: whether to allow direct messages ## :mrf_hellthread -* `delist_threshold`: Number of mentioned users after which the message gets delisted. Set to 0 to disable. +* `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. ## :media_proxy -- cgit v1.2.3 From ab80c8ebb85271e9b5456c36316b7ebc98d96f1e Mon Sep 17 00:00:00 2001 From: Michael Loftis Date: Wed, 6 Feb 2019 17:54:30 +0000 Subject: adds a couple of explicit examples for ExSyslogger --- docs/config.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index e042d216f..ba6807760 100644 --- a/docs/config.md +++ b/docs/config.md @@ -100,6 +100,26 @@ config :pleroma, Pleroma.Mailer, ## :logger * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog + +An example to enable ONLY ExSyslogger (f/ex in ``prod.secret.exs``) with info and debug suppressed: +``` +config :logger, + backends: [{ExSyslogger, :ex_syslogger}] + +config :logger, :ex_syslogger, + level: :warn +``` + +Another example, keeping console output and adding the pid to syslog output: +``` +config :logger, + backends: [:console, {ExSyslogger, :ex_syslogger}] + +config :logger, :ex_syslogger, + level: :warn, + option: [:pid, :ndelay] +``` + See: [logger’s documentation](https://hexdocs.pm/logger/Logger.html) and [ex_syslogger’s documentation](https://hexdocs.pm/ex_syslogger/) -- cgit v1.2.3 From 46aa8c18a211034bc102cfffec61c9cc8c3cdf02 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 8 Feb 2019 12:38:24 +0300 Subject: Add keyword policy --- docs/config.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index e042d216f..55d618925 100644 --- a/docs/config.md +++ b/docs/config.md @@ -151,6 +151,11 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i * `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) +* `ftl_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) + ## :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. -- cgit v1.2.3 From 8a0b755c19ef9c896f69de2b1bf22418a3aedf6f Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 8 Feb 2019 13:12:09 +0300 Subject: rename ftl_removal to federated_timeline_removal to keep consistent naming with SimplePolicy --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 55d618925..c0eb4ceb4 100644 --- a/docs/config.md +++ b/docs/config.md @@ -153,7 +153,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i ## :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) -* `ftl_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) +* `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) ## :media_proxy -- cgit v1.2.3 From 38ff9b3568c637bd69a4bdadbdeb147d7871b09a Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 8 Feb 2019 15:12:44 +0300 Subject: fix typo in config.md --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 08523ac53..89393449c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -173,7 +173,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i ## :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) +* `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) ## :media_proxy -- cgit v1.2.3 From 9a23f8f3ea9e788978055f0ad3a10db105f68cc6 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 8 Feb 2019 20:23:26 +0300 Subject: Add tests and fix a typo in docs --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 89393449c..74badd0da 100644 --- a/docs/config.md +++ b/docs/config.md @@ -174,7 +174,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i ## :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) +* `replace`: A list of tuples containing `{pattern, replacement}`, `pattern` can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html) ## :media_proxy * `enabled`: Enables proxying of remote media to the instance’s proxy -- cgit v1.2.3 From d0cf58d0320b26eca4d274f54f6b12176c3cd38b Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 28 Jan 2019 05:50:08 +0100 Subject: WIP: docs/Clients.md: Add documentation about clients supporting pleroma [ci skip] --- docs/Clients.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 docs/Clients.md (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md new file mode 100644 index 000000000..f90f82bfe --- /dev/null +++ b/docs/Clients.md @@ -0,0 +1,47 @@ +# Pleroma Clients +Note: Additionnal clients may be working but theses are officially supporting Pleroma. + +## Roma +- Homepage: +- Source Code: ??? +- Platforms: iOS, Android + +## Roma for Desktop +- Homepage: +- Source Code: ??? +- Platforms: Windows, Mac, (Linux?) + +## Mastalab +- Source Code: +- Contact: [@tom79@mastodon.social](https://mastodon.social/users/tom79) +- Platforms: Android + +## Whalebird +- Homepage: +- Source Code: +- Contact: [@h3poteto@pleroma.io](https://pleroma.io/users/h3poteto) +- Platforms: Windows, Mac, Linux + +## Tusky +- Homepage: +- Source Code: +- Contact: [@ConnyDuck@mastodon.social](https://mastodon.social/users/ConnyDuck) +- Platforms: Android + +## Tootdon +- Homepage: , +- Source Code: ??? +- Contact: [@tootdon@mstdn.jp](https://mstdn.jp/users/tootdon) +- Platforms: Android, iOS + +## Amaroq +- Homepage: +- Source Code: +- Contact: [@eurasierboy@mastodon.social](https://mastodon.social/users/eurasierboy) +- Platforms: iOS + +## Subway Tooter +- Source Code: +- Homepage: +- Contact: [@tateisu@mastodon.juggler.jp](https://mastodon.juggler.jp/users/tateisu), [@SubwayTooter@mastodon.juggler.jp](https://mastodon.juggler.jp/users/SubwayTooter) +- Platforms: Android -- cgit v1.2.3 From 5f767be3311101cb97a161dc0b164c406151cf3d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 28 Jan 2019 18:20:10 +0100 Subject: docs/Clients.md: Add Brutaldon, Sengi, Halcyon, Pinafore --- docs/Clients.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md index f90f82bfe..22d9bcf0e 100644 --- a/docs/Clients.md +++ b/docs/Clients.md @@ -1,5 +1,30 @@ # Pleroma Clients Note: Additionnal clients may be working but theses are officially supporting Pleroma. +Feel free to contact us to be added to this list! + +## Brutaldon +- Homepage: +- Source Code: +- Contact: [@gcupc@glitch.social](https://glitch.social/users/gcupc) +- Platforms: Web + +## Sengi +- Source Code: +- Contact: [@sengi_app@mastodon.social](https://mastodon.social/users/sengi_app) +- Platforms: Web +- Note(2019-01-28): The development is currently in a early stage. + +## Halcyon +- Source Code: +- Contact: [@halcyon@social.csswg.org](https://social.csswg.org/users/halcyon) +- Platforms: Web + +## Pinafore +- Homepage: +- Source Code: +- Contact: [@pinafore@mastodon.technology](https://mastodon.technology/users/pinafore) +- Note: Pleroma support is a secondary goal +- Platforms: Web ## Roma - Homepage: -- cgit v1.2.3 From 91a41ec67099d01647de65ac2b0393c61b24da0e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 28 Jan 2019 18:28:25 +0100 Subject: docs/Clients.md: Add per-type sections helps differenciate between Electrons and others like Brutaldon. [ci skip] --- docs/Clients.md | 77 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 38 insertions(+), 39 deletions(-) (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md index 22d9bcf0e..3f783347e 100644 --- a/docs/Clients.md +++ b/docs/Clients.md @@ -2,71 +2,70 @@ Note: Additionnal clients may be working but theses are officially supporting Pleroma. Feel free to contact us to be added to this list! -## Brutaldon -- Homepage: -- Source Code: -- Contact: [@gcupc@glitch.social](https://glitch.social/users/gcupc) -- Platforms: Web - -## Sengi -- Source Code: -- Contact: [@sengi_app@mastodon.social](https://mastodon.social/users/sengi_app) -- Platforms: Web -- Note(2019-01-28): The development is currently in a early stage. - -## Halcyon -- Source Code: -- Contact: [@halcyon@social.csswg.org](https://social.csswg.org/users/halcyon) -- Platforms: Web +## Desktop +### Roma for Desktop +- Homepage: +- Source Code: ??? +- Platforms: Windows, Mac, (Linux?) -## Pinafore -- Homepage: -- Source Code: -- Contact: [@pinafore@mastodon.technology](https://mastodon.technology/users/pinafore) -- Note: Pleroma support is a secondary goal -- Platforms: Web +### Whalebird +- Homepage: +- Source Code: +- Contact: [@h3poteto@pleroma.io](https://pleroma.io/users/h3poteto) +- Platforms: Windows, Mac, Linux -## Roma +## Handheld +### Roma - Homepage: - Source Code: ??? - Platforms: iOS, Android -## Roma for Desktop -- Homepage: -- Source Code: ??? -- Platforms: Windows, Mac, (Linux?) - -## Mastalab +### Mastalab - Source Code: - Contact: [@tom79@mastodon.social](https://mastodon.social/users/tom79) - Platforms: Android -## Whalebird -- Homepage: -- Source Code: -- Contact: [@h3poteto@pleroma.io](https://pleroma.io/users/h3poteto) -- Platforms: Windows, Mac, Linux - -## Tusky +### Tusky - Homepage: - Source Code: - Contact: [@ConnyDuck@mastodon.social](https://mastodon.social/users/ConnyDuck) - Platforms: Android -## Tootdon +### Tootdon - Homepage: , - Source Code: ??? - Contact: [@tootdon@mstdn.jp](https://mstdn.jp/users/tootdon) - Platforms: Android, iOS -## Amaroq +### Amaroq - Homepage: - Source Code: - Contact: [@eurasierboy@mastodon.social](https://mastodon.social/users/eurasierboy) - Platforms: iOS -## Subway Tooter +### Subway Tooter - Source Code: - Homepage: - Contact: [@tateisu@mastodon.juggler.jp](https://mastodon.juggler.jp/users/tateisu), [@SubwayTooter@mastodon.juggler.jp](https://mastodon.juggler.jp/users/SubwayTooter) - Platforms: Android + +## Alternative Web Interfaces +### Brutaldon +- Homepage: +- Source Code: +- Contact: [@gcupc@glitch.social](https://glitch.social/users/gcupc) + +### Sengi +- Source Code: +- Contact: [@sengi_app@mastodon.social](https://mastodon.social/users/sengi_app) +- Note(2019-01-28): The development is currently in a early stage. + +### Halcyon +- Source Code: +- Contact: [@halcyon@social.csswg.org](https://social.csswg.org/users/halcyon) + +### Pinafore +- Homepage: +- Source Code: +- Contact: [@pinafore@mastodon.technology](https://mastodon.technology/users/pinafore) +- Note: Pleroma support is a secondary goal -- cgit v1.2.3 From f2d5989ffa92bd4a18d9107a6ae57177482fc5b2 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 28 Jan 2019 18:39:29 +0100 Subject: docs/Clients.md: Add Social (GNOME) [ci skip] --- docs/Clients.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md index 3f783347e..696f31643 100644 --- a/docs/Clients.md +++ b/docs/Clients.md @@ -14,6 +14,12 @@ Feel free to contact us to be added to this list! - Contact: [@h3poteto@pleroma.io](https://pleroma.io/users/h3poteto) - Platforms: Windows, Mac, Linux +### Social +- Source Code: +- Contact: [@brainblasted@social.libre.fi](https://social.libre.fi/users/brainblasted) +- Platforms: Linux (GNOME) +- Note(2019-01-28): Not at a pre-alpha stage yet + ## Handheld ### Roma - Homepage: -- cgit v1.2.3 From daa25f3403bac0abce06a7d68cae57f11c04bcfb Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 10 Feb 2019 14:24:48 +0100 Subject: docs/Clients.md: Add Twidere, Remove SubwayTooter, sort alphabetically [ci skip] --- docs/Clients.md | 60 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md index 696f31643..8e39fd7c4 100644 --- a/docs/Clients.md +++ b/docs/Clients.md @@ -8,34 +8,34 @@ Feel free to contact us to be added to this list! - Source Code: ??? - Platforms: Windows, Mac, (Linux?) -### Whalebird -- Homepage: -- Source Code: -- Contact: [@h3poteto@pleroma.io](https://pleroma.io/users/h3poteto) -- Platforms: Windows, Mac, Linux - ### Social - Source Code: - Contact: [@brainblasted@social.libre.fi](https://social.libre.fi/users/brainblasted) - Platforms: Linux (GNOME) - Note(2019-01-28): Not at a pre-alpha stage yet +### Whalebird +- Homepage: +- Source Code: +- Contact: [@h3poteto@pleroma.io](https://pleroma.io/users/h3poteto) +- Platforms: Windows, Mac, Linux + ## Handheld -### Roma -- Homepage: -- Source Code: ??? -- Platforms: iOS, Android +### Amaroq +- Homepage: +- Source Code: +- Contact: [@eurasierboy@mastodon.social](https://mastodon.social/users/eurasierboy) +- Platforms: iOS ### Mastalab - Source Code: - Contact: [@tom79@mastodon.social](https://mastodon.social/users/tom79) - Platforms: Android -### Tusky -- Homepage: -- Source Code: -- Contact: [@ConnyDuck@mastodon.social](https://mastodon.social/users/ConnyDuck) -- Platforms: Android +### Roma +- Homepage: +- Source Code: ??? +- Platforms: iOS, Android ### Tootdon - Homepage: , @@ -43,29 +43,24 @@ Feel free to contact us to be added to this list! - Contact: [@tootdon@mstdn.jp](https://mstdn.jp/users/tootdon) - Platforms: Android, iOS -### Amaroq -- Homepage: -- Source Code: -- Contact: [@eurasierboy@mastodon.social](https://mastodon.social/users/eurasierboy) -- Platforms: iOS - -### Subway Tooter -- Source Code: -- Homepage: -- Contact: [@tateisu@mastodon.juggler.jp](https://mastodon.juggler.jp/users/tateisu), [@SubwayTooter@mastodon.juggler.jp](https://mastodon.juggler.jp/users/SubwayTooter) +### Tusky +- Homepage: +- Source Code: +- Contact: [@ConnyDuck@mastodon.social](https://mastodon.social/users/ConnyDuck) - Platforms: Android +### Twidere +- Homepage: +- Source Code: , +- Contact: +- Platform: Android, iOS + ## Alternative Web Interfaces ### Brutaldon - Homepage: - Source Code: - Contact: [@gcupc@glitch.social](https://glitch.social/users/gcupc) -### Sengi -- Source Code: -- Contact: [@sengi_app@mastodon.social](https://mastodon.social/users/sengi_app) -- Note(2019-01-28): The development is currently in a early stage. - ### Halcyon - Source Code: - Contact: [@halcyon@social.csswg.org](https://social.csswg.org/users/halcyon) @@ -75,3 +70,8 @@ Feel free to contact us to be added to this list! - Source Code: - Contact: [@pinafore@mastodon.technology](https://mastodon.technology/users/pinafore) - Note: Pleroma support is a secondary goal + +### Sengi +- Source Code: +- Contact: [@sengi_app@mastodon.social](https://mastodon.social/users/sengi_app) +- Note(2019-01-28): The development is currently in a early stage. -- cgit v1.2.3 From 94385313b56e99f234b1a5173e6a39829fbc6150 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 10 Feb 2019 14:42:32 +0100 Subject: docs/Clients.md: Add Nekonium [ci skip] --- docs/Clients.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md index 8e39fd7c4..28f8afafd 100644 --- a/docs/Clients.md +++ b/docs/Clients.md @@ -27,6 +27,12 @@ Feel free to contact us to be added to this list! - Contact: [@eurasierboy@mastodon.social](https://mastodon.social/users/eurasierboy) - Platforms: iOS +### Nekonium +- Homepage: [F-Droid Repository](https://repo.gdgd.jp.net/), [Google Play](https://play.google.com/store/apps/details?id=com.apps.nekonium), [Amazon](https://www.amazon.co.jp/dp/B076FXPRBC/) +- Source: +- Contact: [@lin@pleroma.gdgd.jp.net](https://pleroma.gdgd.jp.net/users/lin) +- Platforms: Android + ### Mastalab - Source Code: - Contact: [@tom79@mastodon.social](https://mastodon.social/users/tom79) -- cgit v1.2.3 From db407e4d504ce9f72db9e26b39944f13daee5f22 Mon Sep 17 00:00:00 2001 From: succfemboi Date: Sun, 10 Feb 2019 16:18:04 +0100 Subject: add feather to webclients --- docs/Clients.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md index 28f8afafd..057f12392 100644 --- a/docs/Clients.md +++ b/docs/Clients.md @@ -67,6 +67,10 @@ Feel free to contact us to be added to this list! - Source Code: - Contact: [@gcupc@glitch.social](https://glitch.social/users/gcupc) +### Feather +- Source Code: +- Contact: [@kaniini@pleroma.site](https://pleroma.site/kaniini) + ### Halcyon - Source Code: - Contact: [@halcyon@social.csswg.org](https://social.csswg.org/users/halcyon) -- cgit v1.2.3 From 84f22d1cb8cf953bf8f48c04d82ae05f780ec407 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Tue, 12 Feb 2019 02:35:15 +0000 Subject: Mark streaming feature for mobile/web apps in Clients.md --- docs/Clients.md | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md index 057f12392..043d04a0f 100644 --- a/docs/Clients.md +++ b/docs/Clients.md @@ -26,60 +26,71 @@ Feel free to contact us to be added to this list! - Source Code: - Contact: [@eurasierboy@mastodon.social](https://mastodon.social/users/eurasierboy) - Platforms: iOS +- Features: No Streaming ### Nekonium - Homepage: [F-Droid Repository](https://repo.gdgd.jp.net/), [Google Play](https://play.google.com/store/apps/details?id=com.apps.nekonium), [Amazon](https://www.amazon.co.jp/dp/B076FXPRBC/) - Source: - Contact: [@lin@pleroma.gdgd.jp.net](https://pleroma.gdgd.jp.net/users/lin) - Platforms: Android +- Features: Streaming Ready ### Mastalab - Source Code: - Contact: [@tom79@mastodon.social](https://mastodon.social/users/tom79) - Platforms: Android +- Features: Streaming Ready ### Roma - Homepage: - Source Code: ??? - Platforms: iOS, Android +- Features: No Streaming ### Tootdon - Homepage: , - Source Code: ??? - Contact: [@tootdon@mstdn.jp](https://mstdn.jp/users/tootdon) - Platforms: Android, iOS +- Features: No Streaming ### Tusky - Homepage: - Source Code: - Contact: [@ConnyDuck@mastodon.social](https://mastodon.social/users/ConnyDuck) - Platforms: Android +- Features: No Streaming ### Twidere - Homepage: - Source Code: , - Contact: - Platform: Android, iOS +- Features: No Streaming ## Alternative Web Interfaces ### Brutaldon - Homepage: - Source Code: - Contact: [@gcupc@glitch.social](https://glitch.social/users/gcupc) +- Features: No Streaming ### Feather - Source Code: - Contact: [@kaniini@pleroma.site](https://pleroma.site/kaniini) +- Features: No Streaming ### Halcyon - Source Code: - Contact: [@halcyon@social.csswg.org](https://social.csswg.org/users/halcyon) +- Features: Streaming Ready ### Pinafore - Homepage: - Source Code: - Contact: [@pinafore@mastodon.technology](https://mastodon.technology/users/pinafore) - Note: Pleroma support is a secondary goal +- Features: No Streaming ### Sengi - Source Code: -- cgit v1.2.3 From 16b7c07115ae5359541ac07752dd7d433035046d Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Wed, 13 Feb 2019 07:51:14 +0000 Subject: Mark streaming feature for desktop apps in Clients.md --- docs/Clients.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md index 043d04a0f..c3d776488 100644 --- a/docs/Clients.md +++ b/docs/Clients.md @@ -7,6 +7,7 @@ Feel free to contact us to be added to this list! - Homepage: - Source Code: ??? - Platforms: Windows, Mac, (Linux?) +- Features: Streaming Ready ### Social - Source Code: @@ -19,6 +20,7 @@ Feel free to contact us to be added to this list! - Source Code: - Contact: [@h3poteto@pleroma.io](https://pleroma.io/users/h3poteto) - Platforms: Windows, Mac, Linux +- Features: Streaming Ready ## Handheld ### Amaroq -- cgit v1.2.3 From d812a347ca936dba764eb223fde029d83ca3fba0 Mon Sep 17 00:00:00 2001 From: lain Date: Sat, 16 Feb 2019 16:42:34 +0100 Subject: Add optional welcome message. --- docs/config.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 74badd0da..78daa488e 100644 --- a/docs/config.md +++ b/docs/config.md @@ -97,6 +97,8 @@ config :pleroma, Pleroma.Mailer, * `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 user that sends the welcome message. ## :logger * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog -- cgit v1.2.3 From 27375e55757a7034aa2ad6c94a8d6c82b1128b34 Mon Sep 17 00:00:00 2001 From: lain Date: Sat, 16 Feb 2019 17:25:06 +0100 Subject: WelcomeMessage: specify that the user has to be local. --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 78daa488e..0c1051dee 100644 --- a/docs/config.md +++ b/docs/config.md @@ -98,7 +98,7 @@ config :pleroma, Pleroma.Mailer, * `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 user that sends the welcome message. +* `welcome_user_nickname`: The nickname of the local user that sends the welcome message. ## :logger * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog -- cgit v1.2.3 From 96c725328b556833d59de23093fb4aeba9bb5684 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 16 Feb 2019 20:38:25 +0300 Subject: Remove a limit on attachments in Mastodon API and document the changes in responses from vanilla mastodon --- docs/Differences-in-MastodonAPI-Responses.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/Differences-in-MastodonAPI-Responses.md (limited to 'docs') diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md new file mode 100644 index 000000000..cfa34593e --- /dev/null +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -0,0 +1,9 @@ +# Differences in Mastodon API responses from vanilla Mastodon + +## Flake IDs + +Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mastodon's ids they are sortable strings + +## Attachment cap + +Some apps operate under the assumption that no more than 4 attachments ccan be returned, however Pleroma can return any amount of attachments -- cgit v1.2.3 From c788f1543c4a2436c93409423d93284467e431e2 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 16 Feb 2019 21:14:07 +0300 Subject: Add a section on how to identify a pleroma instance, clarify that post upload limit is not capped too --- docs/Differences-in-MastodonAPI-Responses.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index cfa34593e..488dc9389 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -1,9 +1,11 @@ # Differences in Mastodon API responses from vanilla Mastodon +A Pleroma instance can be identified by " (compatible; Pleroma )" present in `version` field in response from `/api/v1/instance` + ## Flake IDs Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mastodon's ids they are sortable strings ## Attachment cap -Some apps operate under the assumption that no more than 4 attachments ccan be returned, however Pleroma can return any amount of attachments +Some apps operate under the assumption that no more than 4 attachments ccan be returned or uploaded. Pleroma however does not enforce any limits on attachment count neither when returning the status object nor when posting. -- cgit v1.2.3 From 4df455f69bef5270c7e6a57022237ff75f13687c Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 3 Feb 2019 12:31:12 +0100 Subject: [MastoAPI] Add switching of frontend flavours --- docs/Pleroma-API.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs') diff --git a/docs/Pleroma-API.md b/docs/Pleroma-API.md index e1448d3f0..379d3dbed 100644 --- a/docs/Pleroma-API.md +++ b/docs/Pleroma-API.md @@ -94,3 +94,17 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi ## `/api/pleroma/admin/`… See [Admin-API](Admin-API.md) + +## `/api/v1/pleroma/flavour/:flavour` +* Method `POST` +* Authentication: required +* Response: JSON string. Returns the user flavour or the default one on success, otherwise returns `{"error": "error_msg"}` +* Example response: "glitch" +* Note: This is intended to be used only by mastofe + +## `/api/v1/pleroma/flavour` +* Method `GET` +* Authentication: required +* Response: JSON string. Returns the user flavour or the default one. +* Example response: "glitch" +* Note: This is intended to be used only by mastofe -- cgit v1.2.3 From 6a8a8e90dafdd905fbcec3dd0159b7931b8642c2 Mon Sep 17 00:00:00 2001 From: lambda Date: Sun, 17 Feb 2019 17:01:22 +0000 Subject: Update Differences-in-MastodonAPI-Responses.md --- docs/Differences-in-MastodonAPI-Responses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index 488dc9389..f6a5b6461 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -8,4 +8,4 @@ Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mas ## Attachment cap -Some apps operate under the assumption that no more than 4 attachments ccan be returned or uploaded. Pleroma however does not enforce any limits on attachment count neither when returning the status object nor when posting. +Some apps operate under the assumption that no more than 4 attachments can be returned or uploaded. Pleroma however does not enforce any limits on attachment count neither when returning the status object nor when posting. -- cgit v1.2.3 From 25b9e7a8c39602e6463a867089948a7957cfab9f Mon Sep 17 00:00:00 2001 From: eugenijm Date: Tue, 19 Feb 2019 18:40:57 +0300 Subject: Added admin API for changing user activation status --- docs/Admin-API.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 3b19d1aa6..016444d58 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -66,6 +66,14 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret * On success: JSON of the ``user.info`` * Note: An admin cannot revoke their own admin status. +## `/api/pleroma/admin/activation_status/:nickname` + +### Active or deactivate a user +* Method: `PUT` +* Params: + * `nickname` + * `status` BOOLEAN field, false value means deactivation. + ## `/api/pleroma/admin/relay` ### Follow a Relay * Methods: `POST` -- cgit v1.2.3 From bff9eb5ef7ad446376f68807d4e51db5f2de9515 Mon Sep 17 00:00:00 2001 From: Egor Date: Wed, 20 Feb 2019 16:51:25 +0000 Subject: Reports --- docs/config.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 6647549a2..14723b727 100644 --- a/docs/config.md +++ b/docs/config.md @@ -100,6 +100,7 @@ config :pleroma, Pleroma.Mailer, * `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_size`: The maximum size of the report comment (Default: `1000`) ## :logger * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog -- cgit v1.2.3 From e278d470232f4e8081bbbe358137400074673e75 Mon Sep 17 00:00:00 2001 From: link0ff Date: Fri, 22 Feb 2019 15:03:43 +0200 Subject: OpenLDAP support --- docs/config.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 14723b727..a497fb4ca 100644 --- a/docs/config.md +++ b/docs/config.md @@ -301,3 +301,12 @@ For each pool, the options are: * `max_connections` - how much connections a pool can hold * `timeout` - retention duration for connections +## :ldap + +* `enabled`: enables LDAP authentication +* `host`: LDAP server hostname +* `port`: LDAP port, e.g. 389 or 636 +* `ssl`: true to use SSL +* `sslopts`: additional SSL options +* `base`: LDAP base, e.g. "dc=example,dc=com" +* `uid`: attribute type to authenticate the user, e.g. when "cn", the filter will be "cn=username,base" -- cgit v1.2.3 From c3ac9424d2affe87df82c14dc243f507fa639343 Mon Sep 17 00:00:00 2001 From: Egor Date: Tue, 26 Feb 2019 23:32:26 +0000 Subject: AutoLinker --- docs/config.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 14723b727..d1bf2a6f4 100644 --- a/docs/config.md +++ b/docs/config.md @@ -107,7 +107,7 @@ config :pleroma, Pleroma.Mailer, An example to enable ONLY ExSyslogger (f/ex in ``prod.secret.exs``) with info and debug suppressed: ``` -config :logger, +config :logger, backends: [{ExSyslogger, :ex_syslogger}] config :logger, :ex_syslogger, @@ -301,3 +301,28 @@ 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: + +```exs +config :auto_linker, + opts: [ + scheme: true, + extra: true, + class: false, + strip_prefix: false, + new_window: false, + rel: false + ] +``` -- cgit v1.2.3 From ed7fd6b47e93e0874e3d79f124b71693e43dbb2c Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Wed, 27 Feb 2019 03:08:03 +0300 Subject: Add missing docs and tests --- docs/Admin-API.md | 191 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 128 insertions(+), 63 deletions(-) (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 016444d58..508981d38 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -1,108 +1,173 @@ # Admin API + Authentication is required and the user must be an admin. +## `/api/pleroma/admin/users` + +### List users + +- Method `GET` +- Response: + +```JSON +[ + { + "deactivated": bool, + "id": integer, + "nickname": string + }, + ... +] +``` + ## `/api/pleroma/admin/user` + ### Remove a user -* Method `DELETE` -* Params: - * `nickname` -* Response: User’s nickname + +- Method `DELETE` +- Params: + - `nickname` +- Response: User’s nickname + ### Create a user -* Method: `POST` -* Params: - * `nickname` - * `email` - * `password` -* Response: User’s nickname + +- Method: `POST` +- Params: + - `nickname` + - `email` + - `password` +- Response: User’s nickname + +## `/api/pleroma/admin/users/:nickname/toggle_activation` + +### Toggle user activation + +- Method: `PATCH` +- Params: + - `nickname` +- Response: User’s object + +```JSON +{ + "deactivated": bool, + "id": integer, + "nickname": string +} +``` ## `/api/pleroma/admin/users/tag` + ### Tag a list of users -* Method: `PUT` -* Params: - * `nickname` - * `tags` + +- Method: `PUT` +- Params: + - `nickname` + - `tags` + ### Untag a list of users -* Method: `DELETE` -* Params: - * `nickname` - * `tags` + +- Method: `DELETE` +- Params: + - `nickname` + - `tags` ## `/api/pleroma/admin/permission_group/:nickname` + ### Get user user permission groups membership -* Method: `GET` -* Params: none -* Response: + +- Method: `GET` +- Params: none +- Response: + ```JSON { - "is_moderator": bool, - "is_admin": bool + "is_moderator": bool, + "is_admin": bool } ``` ## `/api/pleroma/admin/permission_group/:nickname/:permission_group` + Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist. ### Get user user permission groups membership -* Method: `GET` -* Params: none -* Response: + +- Method: `GET` +- Params: none +- Response: + ```JSON { - "is_moderator": bool, - "is_admin": bool + "is_moderator": bool, + "is_admin": bool } ``` + ### Add user in permission group -* Method: `POST` -* Params: none -* Response: - * On failure: ``{"error": "…"}`` - * On success: JSON of the ``user.info`` + +- Method: `POST` +- Params: none +- Response: + - On failure: `{"error": "…"}` + - On success: JSON of the `user.info` + ### Remove user from permission group -* Method: `DELETE` -* Params: none -* Response: - * On failure: ``{"error": "…"}`` - * On success: JSON of the ``user.info`` -* Note: An admin cannot revoke their own admin status. + +- Method: `DELETE` +- Params: none +- Response: + - On failure: `{"error": "…"}` + - On success: JSON of the `user.info` +- Note: An admin cannot revoke their own admin status. ## `/api/pleroma/admin/activation_status/:nickname` ### Active or deactivate a user -* Method: `PUT` -* Params: - * `nickname` - * `status` BOOLEAN field, false value means deactivation. + +- Method: `PUT` +- Params: + - `nickname` + - `status` BOOLEAN field, false value means deactivation. ## `/api/pleroma/admin/relay` + ### Follow a Relay -* Methods: `POST` -* Params: - * `relay_url` -* Response: - * On success: URL of the followed relay + +- Methods: `POST` +- Params: + - `relay_url` +- Response: + - On success: URL of the followed relay + ### Unfollow a Relay -* Methods: `DELETE` -* Params: - * `relay_url` -* Response: - * On success: URL of the unfollowed relay + +- Methods: `DELETE` +- Params: + - `relay_url` +- Response: + - On success: URL of the unfollowed relay ## `/api/pleroma/admin/invite_token` + ### Get a account registeration invite token -* Methods: `GET` -* Params: none -* Response: invite token (base64 string) + +- Methods: `GET` +- Params: none +- Response: invite token (base64 string) ## `/api/pleroma/admin/email_invite` + ### Sends registration invite via email -* Methods: `POST` -* Params: - * `email` - * `name`, optionnal + +- Methods: `POST` +- Params: + - `email` + - `name`, optionnal ## `/api/pleroma/admin/password_reset` + ### Get a password reset token for a given nickname -* Methods: `GET` -* Params: none -* Response: password reset token (base64 string) + +- Methods: `GET` +- Params: none +- Response: password reset token (base64 string) -- cgit v1.2.3 From c4235f96bde49def1fb6927ba79a49a0f75cd60a Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 27 Feb 2019 16:37:42 +0100 Subject: Add `with_muted` param. --- docs/Differences-in-MastodonAPI-Responses.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index f6a5b6461..3026e1173 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -9,3 +9,7 @@ Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mas ## Attachment cap Some apps operate under the assumption that no more than 4 attachments can be returned or uploaded. Pleroma however does not enforce any limits on attachment count neither when returning the status object nor when posting. + +## Timelines + +Adding the parameter `with_muted=true` to the timeline queries will also return activities by muted (not by blocked!) users. -- cgit v1.2.3 From adac7455122d37058bff2e4a805066f2cd24fbf9 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Fri, 1 Mar 2019 17:34:14 +0300 Subject: Add docs to /users/search --- docs/Admin-API.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 508981d38..ed19bc875 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -20,6 +20,26 @@ Authentication is required and the user must be an admin. ] ``` +## `/api/pleroma/admin/users/search?query={query}` + +### Search users + +- Method `GET` +- Params: + - `query` +- Response: + +```JSON +[ + { + "deactivated": bool, + "id": integer, + "nickname": string + }, + ... +] +``` + ## `/api/pleroma/admin/user` ### Remove a user -- cgit v1.2.3 From 5b08b470f69738f4528455a58fefe3a8d4acae02 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Fri, 1 Mar 2019 20:13:02 +0300 Subject: Add "local" params to users search --- docs/Admin-API.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index ed19bc875..4403620bf 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -20,13 +20,14 @@ Authentication is required and the user must be an admin. ] ``` -## `/api/pleroma/admin/users/search?query={query}` +## `/api/pleroma/admin/users/search?query={query}&local={local}` -### Search users +### Search users by name or nickname - Method `GET` - Params: - - `query` + - `query`: **string** search term + - `local`: **bool** whether to return only local users - Response: ```JSON -- cgit v1.2.3 From 08c6aeeed7ff5db242050d06e707f99b6d75684d Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Sat, 2 Mar 2019 17:32:46 +0300 Subject: Add docs --- docs/Admin-API.md | 49 +++++++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 18 deletions(-) (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 4403620bf..407647645 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -7,20 +7,27 @@ Authentication is required and the user must be an admin. ### List users - Method `GET` +- Params: + - `page`: **integer** page number + - `page_size`: **integer** number of users per page (default is `50`) - Response: ```JSON -[ +{ + "page_size": integer, + "count": integer, + "users": [ { - "deactivated": bool, - "id": integer, - "nickname": string + "deactivated": bool, + "id": integer, + "nickname": string }, ... -] + ] +} ``` -## `/api/pleroma/admin/users/search?query={query}&local={local}` +## `/api/pleroma/admin/users/search?query={query}&local={local}&page={page}&page_size={page_size}` ### Search users by name or nickname @@ -28,17 +35,23 @@ Authentication is required and the user must be an admin. - Params: - `query`: **string** search term - `local`: **bool** whether to return only local users + - `page`: **integer** page number + - `page_size`: **integer** number of users per page (default is `50`) - Response: ```JSON -[ +{ + "page_size": integer, + "count": integer, + "users": [ { - "deactivated": bool, - "id": integer, - "nickname": string + "deactivated": bool, + "id": integer, + "nickname": string }, ... -] + ] +} ``` ## `/api/pleroma/admin/user` @@ -70,9 +83,9 @@ Authentication is required and the user must be an admin. ```JSON { - "deactivated": bool, - "id": integer, - "nickname": string + "deactivated": bool, + "id": integer, + "nickname": string } ``` @@ -102,8 +115,8 @@ Authentication is required and the user must be an admin. ```JSON { - "is_moderator": bool, - "is_admin": bool + "is_moderator": bool, + "is_admin": bool } ``` @@ -119,8 +132,8 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret ```JSON { - "is_moderator": bool, - "is_admin": bool + "is_moderator": bool, + "is_admin": bool } ``` -- cgit v1.2.3 From 88a672fe88deae53d5459d651859be65555e6af2 Mon Sep 17 00:00:00 2001 From: link0ff Date: Sun, 3 Mar 2019 21:20:36 +0200 Subject: Move LDAP code to LDAPAuthenticator. Use Authenticator for token_exchange with grant_type as well --- docs/config.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index d7349d54f..8d6770959 100644 --- a/docs/config.md +++ b/docs/config.md @@ -336,3 +336,8 @@ config :auto_linker, * `sslopts`: additional SSL options * `base`: LDAP base, e.g. "dc=example,dc=com" * `uid`: attribute type to authenticate the user, e.g. when "cn", the filter will be "cn=username,base" + +## Pleroma.Web.Auth.Authenticator + +* `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator +* `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication -- cgit v1.2.3 From e34710b9888d5a3602971111c3a376bf8442fb84 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Mon, 4 Mar 2019 21:33:53 +0300 Subject: Format & update docs --- docs/Admin-API.md | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 407647645..7f60b768a 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -2,41 +2,16 @@ Authentication is required and the user must be an admin. -## `/api/pleroma/admin/users` +## `/api/pleroma/admin/users?query={query}&local={local}&page={page}&page_size={page_size}` ### List users - Method `GET` - Params: - - `page`: **integer** page number - - `page_size`: **integer** number of users per page (default is `50`) -- Response: - -```JSON -{ - "page_size": integer, - "count": integer, - "users": [ - { - "deactivated": bool, - "id": integer, - "nickname": string - }, - ... - ] -} -``` - -## `/api/pleroma/admin/users/search?query={query}&local={local}&page={page}&page_size={page_size}` - -### Search users by name or nickname - -- Method `GET` -- Params: - - `query`: **string** search term - - `local`: **bool** whether to return only local users - - `page`: **integer** page number - - `page_size`: **integer** number of users per page (default is `50`) + - `query`: **string** *optional* search term + - `local`: **bool** *optional* whether to return only local users + - `page`: **integer** *optional* page number + - `page_size`: **integer** *optional* number of users per page (default is `50`) - Response: ```JSON -- cgit v1.2.3 From 02359d686ca5f7feb1b83d77a35118bd55efdb52 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Mon, 4 Mar 2019 21:36:47 +0300 Subject: local -> only_local --- docs/Admin-API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 7f60b768a..24944440a 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -2,14 +2,14 @@ Authentication is required and the user must be an admin. -## `/api/pleroma/admin/users?query={query}&local={local}&page={page}&page_size={page_size}` +## `/api/pleroma/admin/users?query={query}&only_local={only_local}&page={page}&page_size={page_size}` ### List users - Method `GET` - Params: - `query`: **string** *optional* search term - - `local`: **bool** *optional* whether to return only local users + - `only_local`: **bool** *optional* whether to return only local users - `page`: **integer** *optional* page number - `page_size`: **integer** *optional* number of users per page (default is `50`) - Response: -- cgit v1.2.3 From 2d30fc279f2a3a5af68918c32c474a2fe8eaf664 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Tue, 5 Mar 2019 02:11:15 +0300 Subject: Typo --- docs/Admin-API.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 24944440a..64e112f9b 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -9,7 +9,7 @@ Authentication is required and the user must be an admin. - Method `GET` - Params: - `query`: **string** *optional* search term - - `only_local`: **bool** *optional* whether to return only local users + - `local_only`: **bool** *optional* whether to return only local users - `page`: **integer** *optional* page number - `page_size`: **integer** *optional* number of users per page (default is `50`) - Response: -- cgit v1.2.3 From a283a1fcd026f33ecdd246fef6d035f95b2071a1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 6 Mar 2019 02:25:13 +0100 Subject: Add default config for masto_fe Related to: https://git.pleroma.social/pleroma/mastofe/merge_requests/22 --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index d1bf2a6f4..465bc1d2b 100644 --- a/docs/config.md +++ b/docs/config.md @@ -129,7 +129,7 @@ See: [logger’s documentation](https://hexdocs.pm/logger/Logger.html) and [ex_s ## :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` are configured. +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. Frontends can access these settings at `/api/pleroma/frontend_configurations` -- cgit v1.2.3 From 76160122f6d7bf52aee929328acb4d216e4c3504 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Wed, 6 Mar 2019 05:01:38 +0300 Subject: Keep heading short --- docs/Admin-API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 64e112f9b..2edb31f3c 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -2,12 +2,12 @@ Authentication is required and the user must be an admin. -## `/api/pleroma/admin/users?query={query}&only_local={only_local}&page={page}&page_size={page_size}` +## `/api/pleroma/admin/users` ### List users - Method `GET` -- Params: +- Query Params: - `query`: **string** *optional* search term - `local_only`: **bool** *optional* whether to return only local users - `page`: **integer** *optional* page number -- cgit v1.2.3 From 5021b7836fd0aabd2253416ec48dfcba60a1227c Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Thu, 7 Mar 2019 00:13:26 +0300 Subject: Fetch user's outbox posts on first federation with that user --- docs/config.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 465bc1d2b..a09ea95f3 100644 --- a/docs/config.md +++ b/docs/config.md @@ -285,6 +285,10 @@ This config contains two queues: `federator_incoming` and `federator_outgoing`. ## :rich_media * `enabled`: if enabled the instance will parse metadata from attached links to generate link previews +## :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. -- cgit v1.2.3 From 4826c06172c32e691404eac2da9825e23908e9bc Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Mon, 11 Mar 2019 01:40:34 +0000 Subject: Rename Mastalab -> Fedilab in Clients.md --- docs/Clients.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md index c3d776488..ed3a2938f 100644 --- a/docs/Clients.md +++ b/docs/Clients.md @@ -30,6 +30,12 @@ Feel free to contact us to be added to this list! - Platforms: iOS - Features: No Streaming +### Fedilab +- Source Code: +- Contact: [@tom79@mastodon.social](https://mastodon.social/users/tom79) +- Platforms: Android +- Features: Streaming Ready + ### Nekonium - Homepage: [F-Droid Repository](https://repo.gdgd.jp.net/), [Google Play](https://play.google.com/store/apps/details?id=com.apps.nekonium), [Amazon](https://www.amazon.co.jp/dp/B076FXPRBC/) - Source: @@ -37,12 +43,6 @@ Feel free to contact us to be added to this list! - Platforms: Android - Features: Streaming Ready -### Mastalab -- Source Code: -- Contact: [@tom79@mastodon.social](https://mastodon.social/users/tom79) -- Platforms: Android -- Features: Streaming Ready - ### Roma - Homepage: - Source Code: ??? -- cgit v1.2.3 From 85632a38f995d8a8b208422fdc13c00860cfd1b6 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 11 Mar 2019 08:33:57 +0300 Subject: Update homepages and provide source code links for Roma apps in Clients.md --- docs/Clients.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md index ed3a2938f..da5806e98 100644 --- a/docs/Clients.md +++ b/docs/Clients.md @@ -4,8 +4,8 @@ Feel free to contact us to be added to this list! ## Desktop ### Roma for Desktop -- Homepage: -- Source Code: ??? +- Homepage: +- Source Code: - Platforms: Windows, Mac, (Linux?) - Features: Streaming Ready @@ -44,8 +44,8 @@ Feel free to contact us to be added to this list! - Features: Streaming Ready ### Roma -- Homepage: -- Source Code: ??? +- Homepage: +- Source Code: [Android](https://github.com/roma-apps/roma-android), [iOS](https://github.com/roma-apps/roma-ios) - Platforms: iOS, Android - Features: No Streaming -- cgit v1.2.3 From 6caa500cf12689351325e088e086b62967d30508 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 11 Mar 2019 08:36:56 +0300 Subject: Change order of source code to align with platforms --- docs/Clients.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/Clients.md b/docs/Clients.md index da5806e98..dc3e83bcc 100644 --- a/docs/Clients.md +++ b/docs/Clients.md @@ -45,7 +45,7 @@ Feel free to contact us to be added to this list! ### Roma - Homepage: -- Source Code: [Android](https://github.com/roma-apps/roma-android), [iOS](https://github.com/roma-apps/roma-ios) +- Source Code: [iOS](https://github.com/roma-apps/roma-ios), [Android](https://github.com/roma-apps/roma-android) - Platforms: iOS, Android - Features: No Streaming -- cgit v1.2.3 From 4811eefa6e4cbdaa92fc2e003037506539e493b1 Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 11 Mar 2019 13:48:27 +0100 Subject: MastoAPI StatusView: Add locality indicator. --- docs/Differences-in-MastodonAPI-Responses.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index 3026e1173..bb3cf33c8 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -13,3 +13,9 @@ Some apps operate under the assumption that no more than 4 attachments can be re ## Timelines Adding the parameter `with_muted=true` to the timeline queries will also return activities by muted (not by blocked!) users. + +## Statuses + +Has these additional fields under the 'pleroma' object: + +- `local`: true if the post was made on the local instance. -- cgit v1.2.3 From 66774b5567c10005b2be810433d7f3d401e12520 Mon Sep 17 00:00:00 2001 From: lambda Date: Mon, 11 Mar 2019 13:21:03 +0000 Subject: Update Differences-in-MastodonAPI-Responses.md --- docs/Differences-in-MastodonAPI-Responses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index bb3cf33c8..667664f4e 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -16,6 +16,6 @@ Adding the parameter `with_muted=true` to the timeline queries will also return ## Statuses -Has these additional fields under the 'pleroma' object: +Has these additional fields under the `pleroma` object: - `local`: true if the post was made on the local instance. -- cgit v1.2.3 From 3474066f6dc98003583dcd8537028b515be0e126 Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 11 Mar 2019 15:18:32 +0100 Subject: MastoAPI Accounts: Add fetching by nickname. This is to make it easier for the frontends to handle domain.com/users/nickname urls. --- docs/Differences-in-MastodonAPI-Responses.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index 667664f4e..7b11fe90f 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -19,3 +19,7 @@ Adding the parameter `with_muted=true` to the timeline queries will also return Has these additional fields under the `pleroma` object: - `local`: true if the post was made on the local instance. + +## Accounts + +- `/api/v1/accounts/:id`: The `id` parameter can also be the `nickname` of the user. This only works in this endpoint, not the deeper nested ones for following etc. -- cgit v1.2.3 From 9338f061a303ae3d57a8ea1af524c2ca51929f8d Mon Sep 17 00:00:00 2001 From: link0ff Date: Tue, 12 Mar 2019 18:20:02 +0200 Subject: Support LDAP method start_tls --- docs/config.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 8d6770959..7052b1eb4 100644 --- a/docs/config.md +++ b/docs/config.md @@ -329,13 +329,21 @@ config :auto_linker, ## :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 +* `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`: attribute type to authenticate the user, e.g. when "cn", the filter will be "cn=username,base" +* `uid`: LDAP attribute name to authenticate the user, e.g. when "cn", the filter will be "cn=username,base" ## Pleroma.Web.Auth.Authenticator -- cgit v1.2.3 From e2fe796c63f9df18d30810ad9daa1e7027da120f Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 14 Mar 2019 22:02:48 +0300 Subject: Add some tests --- docs/config.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index a09ea95f3..e34ffe980 100644 --- a/docs/config.md +++ b/docs/config.md @@ -6,6 +6,7 @@ If you run Pleroma with ``MIX_ENV=prod`` the file is ``prod.secret.exs``, otherw ## Pleroma.Upload * `uploader`: Select which `Pleroma.Uploaders` to use * `filters`: List of `Pleroma.Upload.Filter` 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. * `proxy_opts`: Proxy options, see `Pleroma.ReverseProxy` documentation. -- cgit v1.2.3 From 3dadaa4432b442d75b0ac0425aa05527d52f0e7a Mon Sep 17 00:00:00 2001 From: William Pearson Date: Sun, 20 Jan 2019 01:44:00 +0000 Subject: robots.txt Add default robots.txt that allows bots access to all paths. Add mix task to generate robots.txt taht allows bots access to no paths. Document custom emojis, MRF and static_dir static_dir documentation includes docs for the robots.txt Mix task. --- docs/Custom-Emoji.md | 16 ++++ docs/Message-Rewrite-Facility-configuration.md | 118 +++++++++++++++++++++++++ docs/static_dir.md | 20 +++++ 3 files changed, 154 insertions(+) create mode 100644 docs/Custom-Emoji.md create mode 100644 docs/Message-Rewrite-Facility-configuration.md create mode 100644 docs/static_dir.md (limited to 'docs') diff --git a/docs/Custom-Emoji.md b/docs/Custom-Emoji.md new file mode 100644 index 000000000..d4af5c97c --- /dev/null +++ b/docs/Custom-Emoji.md @@ -0,0 +1,16 @@ +To add custom emoji: +* Add the image file(s) to `priv/static/emoji/custom` +* In case of conflicts: add the desired shortcode with the path to `config/custom_emoji.txt`, comma-separated and one per line +* Force recompilation (``mix clean && mix compile``) + +Example: + +image files (in `/priv/static/emoji/custom`): `happy.png` and `sad.png` + +content of `config/custom_emoji.txt`: +``` +happy, /emoji/custom/happy.png +sad, /emoji/custom/sad.png +``` + +The files should be PNG (APNG is okay with `.png` for `image/png` Content-type) and under 50kb for compatibility with mastodon. diff --git a/docs/Message-Rewrite-Facility-configuration.md b/docs/Message-Rewrite-Facility-configuration.md new file mode 100644 index 000000000..708098b41 --- /dev/null +++ b/docs/Message-Rewrite-Facility-configuration.md @@ -0,0 +1,118 @@ +The Message Rewrite Facility (MRF) is a subsystem that is implemented as a series of hooks that allows the administrator to rewrite or discard messages. + +Possible uses include: + +* marking incoming messages with media from a given account or instance as sensitive +* rejecting messages from a specific instance +* removing/unlisting messages from the public timelines +* removing media from messages +* sending only public messages to a specific instance + +The MRF provides user-configurable policies. The default policy is `NoOpPolicy`, which disables the MRF functionality. Pleroma also includes an easy to use policy called `SimplePolicy` which maps messages matching certain pre-defined criterion to actions built into the policy module. +It is possible to use multiple, active MRF policies at the same time. + +## Quarantine Instances + +You have the ability to prevent from private / followers-only messages from federating with specific instances. Which means they will only get the public or unlisted messages from your instance. + +If, for example, you're using `MIX_ENV=prod` aka using production mode, you would open your configuration file located in `config/prod.secret.exs` and edit or add the option under your `:instance` config object. Then you would specify the instance within quotes. +``` +config :pleroma, :instance, + [...] + quarantined_instances: ["instance.example", "other.example"] +``` + +## Using `SimplePolicy` + +`SimplePolicy` is capable of handling most common admin tasks. + +To use `SimplePolicy`, you must enable it. Do so by adding the following to your `:instance` config object, so that it looks like this: + +``` +config :pleroma, :instance, + [...] + rewrite_policy: Pleroma.Web.ActivityPub.MRF.SimplePolicy +``` + +Once `SimplePolicy` is enabled, you can configure various groups in the `:mrf_simple` config object. These groups are: + +* `media_removal`: Servers in this group will have media stripped from incoming messages. +* `media_nsfw`: Servers in this group will have the #nsfw tag and sensitive setting injected into incoming messages which contain media. +* `reject`: Servers in this group will have their messages rejected. +* `federated_timeline_removal`: Servers in this group will have their messages unlisted from the public timelines by flipping the `to` and `cc` fields. + +Servers should be configured as lists. + +### Example + +This example will enable `SimplePolicy`, block media from `illegalporn.biz`, mark media as NSFW from `porn.biz` and `porn.business`, reject messages from `spam.com` and remove messages from `spam.university` from the federated timeline: + +``` +config :pleroma, :instance, + rewrite_policy: [Pleroma.Web.ActivityPub.MRF.SimplePolicy] + +config :pleroma, :mrf_simple, + media_removal: ["illegalporn.biz"], + media_nsfw: ["porn.biz", "porn.business"], + reject: ["spam.com"], + federated_timeline_removal: ["spam.university"] + +``` + +### Use with Care + +The effects of MRF policies can be very drastic. It is important to use this functionality carefully. Always try to talk to an admin before writing an MRF policy concerning their instance. + +## Writing your own MRF Policy + +As discussed above, the MRF system is a modular system that supports pluggable policies. This means that an admin may write a custom MRF policy in Elixir or any other language that runs on the Erlang VM, by specifying the module name in the `rewrite_policy` config setting. + +For example, here is a sample policy module which rewrites all messages to "new message content": + +```!elixir +# This is a sample MRF policy which rewrites all Notes to have "new message +# content." +defmodule Site.RewritePolicy do + @behavior Pleroma.Web.ActivityPub.MRF + + # Catch messages which contain Note objects with actual data to filter. + # Capture the object as `object`, the message content as `content` and the + # message itself as `message`. + @impl true + def filter(%{"type" => Create", "object" => {"type" => "Note", "content" => content} = object} = message) + when is_binary(content) do + # Subject / CW is stored as summary instead of `name` like other AS2 objects + # because of Mastodon doing it that way. + summary = object["summary"] + + # Message edits go here. + content = "new message content" + + # Assemble the mutated object. + object = + object + |> Map.put("content", content) + |> Map.put("summary", summary) + + # Assemble the mutated message. + message = Map.put(message, "object", object) + {:ok, message} + end + + # Let all other messages through without modifying them. + @impl true + def filter(message), do: {:ok, message} +end +``` + +If you save this file as `lib/site/mrf/rewrite_policy.ex`, it will be included when you next rebuild Pleroma. You can enable it in the configuration like so: + +``` +config :pleroma, :instance, + rewrite_policy: [ + Pleroma.Web.ActivityPub.MRF.SimplePolicy, + Site.RewritePolicy + ] +``` + +Please note that the Pleroma developers consider custom MRF policy modules to fall under the purview of the AGPL. As such, you are obligated to release the sources to your custom MRF policy modules upon request. \ No newline at end of file diff --git a/docs/static_dir.md b/docs/static_dir.md new file mode 100644 index 000000000..0cc52b99a --- /dev/null +++ b/docs/static_dir.md @@ -0,0 +1,20 @@ +# Static Directory + +Static frontend files are shipped in `priv/static/` and tracked by version control in this repository. If you want to overwrite or update these without the possibility of merge conflicts, you can write your custom versions to `instance/static/`. + +``` +config :pleroma, :instance, + static_dir: "instance/static/", +``` + +You can overwrite this value in your configuration to use a different static instance directory. + +## robots.txt + +By default, the `robots.txt` that ships in `priv/static/` is permissive. It allows well-behaved search engines to index all of your instance's URIs. + +If you want to generate a restrictive `robots.txt`, you can run the following mix task. The generated `robots.txt` will be written in your instance static directory. + +``` +mix pleroma.robots_txt disallow_all +``` -- cgit v1.2.3 From d7a34b604b15f9e7f73cda834f513d6f62643005 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 15 Mar 2019 11:58:12 +0300 Subject: Extend MastoAPI to provide attachment mimetypes --- docs/Differences-in-MastodonAPI-Responses.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index 7b11fe90f..621de6603 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -20,6 +20,12 @@ Has these additional fields under the `pleroma` object: - `local`: true if the post was made on the local instance. +## Attachments + +Has these additional fields under the `pleroma` object: + +- `mime_type`: mime type of the attachment. + ## Accounts - `/api/v1/accounts/:id`: The `id` parameter can also be the `nickname` of the user. This only works in this endpoint, not the deeper nested ones for following etc. -- cgit v1.2.3 From f5b54acc8160dc1ecf4523d98e971eff8bc983de Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 15 Mar 2019 10:58:15 +0100 Subject: Fix headers and add !929 docs to extras [ci skip] --- docs/Custom-Emoji.md | 2 ++ docs/Message-Rewrite-Facility-configuration.md | 1 + 2 files changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/Custom-Emoji.md b/docs/Custom-Emoji.md index d4af5c97c..9d90e5822 100644 --- a/docs/Custom-Emoji.md +++ b/docs/Custom-Emoji.md @@ -1,3 +1,5 @@ +# Custom emoji + To add custom emoji: * Add the image file(s) to `priv/static/emoji/custom` * In case of conflicts: add the desired shortcode with the path to `config/custom_emoji.txt`, comma-separated and one per line diff --git a/docs/Message-Rewrite-Facility-configuration.md b/docs/Message-Rewrite-Facility-configuration.md index 708098b41..35ce52ea9 100644 --- a/docs/Message-Rewrite-Facility-configuration.md +++ b/docs/Message-Rewrite-Facility-configuration.md @@ -1,3 +1,4 @@ +# Message Rewrite Facility configuration The Message Rewrite Facility (MRF) is a subsystem that is implemented as a series of hooks that allows the administrator to rewrite or discard messages. Possible uses include: -- cgit v1.2.3 From 43fb03be5a8968c1df23938ed4f5a93825ab476c Mon Sep 17 00:00:00 2001 From: eugenijm Date: Fri, 15 Mar 2019 20:06:28 +0300 Subject: Allow to mark a single notification as read --- docs/Pleroma-API.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs') diff --git a/docs/Pleroma-API.md b/docs/Pleroma-API.md index 379d3dbed..478c9d874 100644 --- a/docs/Pleroma-API.md +++ b/docs/Pleroma-API.md @@ -108,3 +108,11 @@ See [Admin-API](Admin-API.md) * Response: JSON string. Returns the user flavour or the default one. * Example response: "glitch" * Note: This is intended to be used only by mastofe + +## `/api/pleroma/notifications/read` +### Mark a single notification as read +* Method `POST` +* Authentication: required +* Params: + * `id`: notifications's id +* Response: JSON. Returns `{"status": "success"}` if the reading was successful, otherwise returns `{"error": "error_msg"}` -- cgit v1.2.3 From 9971bf5be19d922aedad6f9931c7774e099220fa Mon Sep 17 00:00:00 2001 From: eugenijm Date: Mon, 18 Mar 2019 03:54:50 +0300 Subject: Added documentation for Pleroma-specific is_seen in Mastodon API --- docs/Differences-in-MastodonAPI-Responses.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index 621de6603..5e89cde5e 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -29,3 +29,9 @@ Has these additional fields under the `pleroma` object: ## Accounts - `/api/v1/accounts/:id`: The `id` parameter can also be the `nickname` of the user. This only works in this endpoint, not the deeper nested ones for following etc. + +## Notifications + +Has these additional fields under the `pleroma` object: + +- `is_seen`: true if the notification was read by the user -- cgit v1.2.3 From 325c106cb597ea75886f142287b345ac57cb2b25 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Mon, 18 Mar 2019 19:48:56 +0000 Subject: Document additional pleroma changes to /api/v1/accounts/:id --- docs/Differences-in-MastodonAPI-Responses.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs') diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index 5e89cde5e..14b67ca7d 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -30,6 +30,14 @@ Has these additional fields under the `pleroma` object: - `/api/v1/accounts/:id`: The `id` parameter can also be the `nickname` of the user. This only works in this endpoint, not the deeper nested ones for following etc. +Has these additional fields under the `pleroma` object: + +- `tags`: Lists an array of tags for the user +- `relationship{}`: Includes fields as documented for Mastodon API https://docs.joinmastodon.org/api/entities/#relationship +- `is_moderator`: boolean, true if user is a moderator +- `is_admin`: boolean, true if user is an admin +- `confirmation_pending`: boolean, true if a new user account is waiting on email confirmation to be activated + ## Notifications Has these additional fields under the `pleroma` object: -- cgit v1.2.3 From 8468f3f6d48693d2a27a257e5555aa71decff3df Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 20 Mar 2019 21:09:36 +0100 Subject: Add safe dm mode option. --- docs/config.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 201180373..78967204b 100644 --- a/docs/config.md +++ b/docs/config.md @@ -101,7 +101,8 @@ config :pleroma, Pleroma.Mailer, * `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_size`: The maximum size of the report comment (Default: `1000`) +* `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`) ## :logger * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog -- cgit v1.2.3 From 80bc9ed2ba9aa86edf8c1756c9ee59ad2a9bf20b Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Mon, 18 Mar 2019 15:47:58 +0100 Subject: Add a gopher url port config option This lets the user advertise a different port in the gopher urls, for example listening locally on port 7070 but telling clients to connect to the regular port 70. --- docs/config.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 201180373..4fa6bd62d 100644 --- a/docs/config.md +++ b/docs/config.md @@ -190,6 +190,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i * `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`) ## :activitypub * ``accept_blocks``: Whether to accept incoming block activities from other instances -- cgit v1.2.3 From ae8fa5d0aab3561bf66506766e2beb03a251e499 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 21 Mar 2019 23:27:42 +0000 Subject: docs: document `conversation_id` extension --- docs/Differences-in-MastodonAPI-Responses.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md index 14b67ca7d..d993d1383 100644 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ b/docs/Differences-in-MastodonAPI-Responses.md @@ -19,6 +19,7 @@ Adding the parameter `with_muted=true` to the timeline queries will also return Has these additional fields under the `pleroma` object: - `local`: true if the post was made on the local instance. +- `conversation_id`: the ID of the conversation the status is associated with (if any) ## Attachments -- cgit v1.2.3 From 3cf7539bca56ce1118bbedaba547d371f3f20eed Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Wed, 27 Mar 2019 03:51:59 +0500 Subject: Add more user filters + move search to its own module --- docs/Admin-API.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 2edb31f3c..84adca6ff 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -8,10 +8,15 @@ Authentication is required and the user must be an admin. - Method `GET` - Query Params: - - `query`: **string** *optional* search term - - `local_only`: **bool** *optional* whether to return only local users - - `page`: **integer** *optional* page number - - `page_size`: **integer** *optional* number of users per page (default is `50`) + - *optional* `query`: **string** search term + - *optional* `filters`: **string** comma-separated string of filters: + - `local`: only local users + - `external`: only external users + - `active`: only active users + - `deactivated`: only deactivated users + - *optional* `page`: **integer** page number + - *optional* `page_size`: **integer** number of users per page (default is `50`) +- Example: `https://mypleroma.org/api/pleroma/admin/users?query=john&filters=local,active&page=1&page_size=10` - Response: ```JSON @@ -22,7 +27,13 @@ Authentication is required and the user must be an admin. { "deactivated": bool, "id": integer, - "nickname": string + "nickname": string, + "roles": { + "admin": bool, + "moderator": bool + }, + "local": bool, + "tags": array }, ... ] @@ -99,7 +110,7 @@ Authentication is required and the user must be an admin. Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist. -### Get user user permission groups membership +### Get user user permission groups membership per permission group - Method: `GET` - Params: none -- cgit v1.2.3 From 10c81fc902c639633bddff64a3e7450a6796d180 Mon Sep 17 00:00:00 2001 From: eugenijm Date: Wed, 27 Mar 2019 21:19:00 +0300 Subject: Add user show endpoint for Pleroma admin API --- docs/Admin-API.md | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs') diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 84adca6ff..53b68ffd4 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -149,6 +149,17 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret - `nickname` - `status` BOOLEAN field, false value means deactivation. +## `/api/pleroma/admin/users/:nickname` + +### Retrive the details of a user + +- Method: `GET` +- Params: + - `nickname` +- Response: + - On failure: `Not found` + - On success: JSON of the user + ## `/api/pleroma/admin/relay` ### Follow a Relay -- cgit v1.2.3 From cd90695a349f33b84f287794bae6070e9eec446a Mon Sep 17 00:00:00 2001 From: eugenijm Date: Thu, 28 Mar 2019 14:52:09 +0300 Subject: Add PUT /api/pleroma/notification_settings endpoint --- docs/Pleroma-API.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/Pleroma-API.md b/docs/Pleroma-API.md index 478c9d874..bb7ed3744 100644 --- a/docs/Pleroma-API.md +++ b/docs/Pleroma-API.md @@ -27,14 +27,14 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * Method: `GET` * Authentication: not required * Params: none -* Response: Provider specific JSON, the only guaranteed parameter is `type` +* Response: Provider specific JSON, the only guaranteed parameter is `type` * Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint"}` ## `/api/pleroma/delete_account` ### Delete an account * Method `POST` * Authentication: required -* Params: +* Params: * `password`: user's password * Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise * Example response: `{"error": "Invalid password."}` @@ -116,3 +116,13 @@ See [Admin-API](Admin-API.md) * Params: * `id`: notifications's id * Response: JSON. Returns `{"status": "success"}` if the reading was successful, otherwise returns `{"error": "error_msg"}` +## `/api/pleroma/notification_settings` +### Updates user notification settings +* Method `PUT` +* Authentication: required +* Params: + * `followers`: BOOLEAN field, receives notifications from followers + * `follows`: BOOLEAN field, receives notifications from people the user follows + * `remote`: BOOLEAN field, receives notifications from people on remote instances + * `local`: BOOLEAN field, receives notifications from people on the local instance +* Response: JSON. Returns `{"status": "success"}` if the update was successful, otherwise returns `{"error": "error_msg"}` -- cgit v1.2.3 From dfae0050af385786c5799ee886de315f69d36a78 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 19:46:30 +0300 Subject: Move out of Gitlab Wiki I understand that this change is quite unreadable and hard to review, sorry for forgetting to do atomic commits. This patch does not change too much content wise, it just * Gets everything from gitlab wiki * Removes some specific gitlab hacks * Formats all documentation file names to be in snake case so they look the same way as our code does --- docs/.Clients.md.swp | Bin 0 -> 16384 bytes docs/Admin-API.md | 193 -------------- docs/Clients.md | 100 -------- docs/Custom-Emoji.md | 18 -- docs/Differences-in-MastodonAPI-Responses.md | 46 ---- docs/Message-Rewrite-Facility-configuration.md | 119 --------- docs/Pleroma-API.md | 118 --------- docs/admin/admin_tasks.md | 44 ++++ docs/admin/backup.md | 15 ++ docs/admin/updating.md | 9 + docs/api/admin_api.md | 194 +++++++++++++++ docs/api/differences_in_mastoapi_responses.md | 46 ++++ docs/api/pleroma_api.md | 121 +++++++++ docs/clients.md | 100 ++++++++ .../General-tips-for-customizing-Pleroma-FE.md | 17 ++ docs/config/custom_emoji.md | 18 ++ docs/config/hardening.md | 103 ++++++++ docs/config/howto_change_ip_and_port.md | 7 + docs/config/howto_mediaproxy.md | 32 +++ docs/config/howto_proxy.md | 12 + docs/config/howto_user_recomendation.md | 31 +++ docs/config/i2p.md | 197 +++++++++++++++ docs/config/mrf.md | 119 +++++++++ docs/config/onion_federation.md | 159 ++++++++++++ docs/config/small_customizations.md | 35 +++ docs/config/static_dir.md | 20 ++ docs/fuckgitlablol.sh | 12 + docs/installation/alpine_linux_en.md | 215 ++++++++++++++++ docs/installation/arch_linux_en.md | 214 ++++++++++++++++ docs/installation/centos7_en.md | 277 +++++++++++++++++++++ docs/installation/debian_based_en.md | 202 +++++++++++++++ docs/installation/debian_based_jp.md | 191 ++++++++++++++ docs/installation/netbsd_en.md | 198 +++++++++++++++ docs/installation/openbsd_en.md | 222 +++++++++++++++++ docs/installation/openbsd_fi.md | 110 ++++++++ docs/introduction.md | 55 ++++ docs/static_dir.md | 20 -- 37 files changed, 2975 insertions(+), 614 deletions(-) create mode 100644 docs/.Clients.md.swp delete mode 100644 docs/Admin-API.md delete mode 100644 docs/Clients.md delete mode 100644 docs/Custom-Emoji.md delete mode 100644 docs/Differences-in-MastodonAPI-Responses.md delete mode 100644 docs/Message-Rewrite-Facility-configuration.md delete mode 100644 docs/Pleroma-API.md create mode 100644 docs/admin/admin_tasks.md create mode 100644 docs/admin/backup.md create mode 100644 docs/admin/updating.md create mode 100644 docs/api/admin_api.md create mode 100644 docs/api/differences_in_mastoapi_responses.md create mode 100644 docs/api/pleroma_api.md create mode 100644 docs/clients.md create mode 100644 docs/config/General-tips-for-customizing-Pleroma-FE.md create mode 100644 docs/config/custom_emoji.md create mode 100644 docs/config/hardening.md create mode 100644 docs/config/howto_change_ip_and_port.md create mode 100644 docs/config/howto_mediaproxy.md create mode 100644 docs/config/howto_proxy.md create mode 100644 docs/config/howto_user_recomendation.md create mode 100644 docs/config/i2p.md create mode 100644 docs/config/mrf.md create mode 100644 docs/config/onion_federation.md create mode 100644 docs/config/small_customizations.md create mode 100644 docs/config/static_dir.md create mode 100755 docs/fuckgitlablol.sh create mode 100644 docs/installation/alpine_linux_en.md create mode 100644 docs/installation/arch_linux_en.md create mode 100644 docs/installation/centos7_en.md create mode 100644 docs/installation/debian_based_en.md create mode 100644 docs/installation/debian_based_jp.md create mode 100644 docs/installation/netbsd_en.md create mode 100644 docs/installation/openbsd_en.md create mode 100644 docs/installation/openbsd_fi.md create mode 100644 docs/introduction.md delete mode 100644 docs/static_dir.md (limited to 'docs') diff --git a/docs/.Clients.md.swp b/docs/.Clients.md.swp new file mode 100644 index 000000000..1f5aa2776 Binary files /dev/null and b/docs/.Clients.md.swp differ diff --git a/docs/Admin-API.md b/docs/Admin-API.md deleted file mode 100644 index 84adca6ff..000000000 --- a/docs/Admin-API.md +++ /dev/null @@ -1,193 +0,0 @@ -# Admin API - -Authentication is required and the user must be an admin. - -## `/api/pleroma/admin/users` - -### List users - -- Method `GET` -- Query Params: - - *optional* `query`: **string** search term - - *optional* `filters`: **string** comma-separated string of filters: - - `local`: only local users - - `external`: only external users - - `active`: only active users - - `deactivated`: only deactivated users - - *optional* `page`: **integer** page number - - *optional* `page_size`: **integer** number of users per page (default is `50`) -- Example: `https://mypleroma.org/api/pleroma/admin/users?query=john&filters=local,active&page=1&page_size=10` -- Response: - -```JSON -{ - "page_size": integer, - "count": integer, - "users": [ - { - "deactivated": bool, - "id": integer, - "nickname": string, - "roles": { - "admin": bool, - "moderator": bool - }, - "local": bool, - "tags": array - }, - ... - ] -} -``` - -## `/api/pleroma/admin/user` - -### Remove a user - -- Method `DELETE` -- Params: - - `nickname` -- Response: User’s nickname - -### Create a user - -- Method: `POST` -- Params: - - `nickname` - - `email` - - `password` -- Response: User’s nickname - -## `/api/pleroma/admin/users/:nickname/toggle_activation` - -### Toggle user activation - -- Method: `PATCH` -- Params: - - `nickname` -- Response: User’s object - -```JSON -{ - "deactivated": bool, - "id": integer, - "nickname": string -} -``` - -## `/api/pleroma/admin/users/tag` - -### Tag a list of users - -- Method: `PUT` -- Params: - - `nickname` - - `tags` - -### Untag a list of users - -- Method: `DELETE` -- Params: - - `nickname` - - `tags` - -## `/api/pleroma/admin/permission_group/:nickname` - -### Get user user permission groups membership - -- Method: `GET` -- Params: none -- Response: - -```JSON -{ - "is_moderator": bool, - "is_admin": bool -} -``` - -## `/api/pleroma/admin/permission_group/:nickname/:permission_group` - -Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist. - -### Get user user permission groups membership per permission group - -- Method: `GET` -- Params: none -- Response: - -```JSON -{ - "is_moderator": bool, - "is_admin": bool -} -``` - -### Add user in permission group - -- Method: `POST` -- Params: none -- Response: - - On failure: `{"error": "…"}` - - On success: JSON of the `user.info` - -### Remove user from permission group - -- Method: `DELETE` -- Params: none -- Response: - - On failure: `{"error": "…"}` - - On success: JSON of the `user.info` -- Note: An admin cannot revoke their own admin status. - -## `/api/pleroma/admin/activation_status/:nickname` - -### Active or deactivate a user - -- Method: `PUT` -- Params: - - `nickname` - - `status` BOOLEAN field, false value means deactivation. - -## `/api/pleroma/admin/relay` - -### Follow a Relay - -- Methods: `POST` -- Params: - - `relay_url` -- Response: - - On success: URL of the followed relay - -### Unfollow a Relay - -- Methods: `DELETE` -- Params: - - `relay_url` -- Response: - - On success: URL of the unfollowed relay - -## `/api/pleroma/admin/invite_token` - -### Get a account registeration invite token - -- Methods: `GET` -- Params: none -- Response: invite token (base64 string) - -## `/api/pleroma/admin/email_invite` - -### Sends registration invite via email - -- Methods: `POST` -- Params: - - `email` - - `name`, optionnal - -## `/api/pleroma/admin/password_reset` - -### Get a password reset token for a given nickname - -- Methods: `GET` -- Params: none -- Response: password reset token (base64 string) diff --git a/docs/Clients.md b/docs/Clients.md deleted file mode 100644 index dc3e83bcc..000000000 --- a/docs/Clients.md +++ /dev/null @@ -1,100 +0,0 @@ -# Pleroma Clients -Note: Additionnal clients may be working but theses are officially supporting Pleroma. -Feel free to contact us to be added to this list! - -## Desktop -### Roma for Desktop -- Homepage: -- Source Code: -- Platforms: Windows, Mac, (Linux?) -- Features: Streaming Ready - -### Social -- Source Code: -- Contact: [@brainblasted@social.libre.fi](https://social.libre.fi/users/brainblasted) -- Platforms: Linux (GNOME) -- Note(2019-01-28): Not at a pre-alpha stage yet - -### Whalebird -- Homepage: -- Source Code: -- Contact: [@h3poteto@pleroma.io](https://pleroma.io/users/h3poteto) -- Platforms: Windows, Mac, Linux -- Features: Streaming Ready - -## Handheld -### Amaroq -- Homepage: -- Source Code: -- Contact: [@eurasierboy@mastodon.social](https://mastodon.social/users/eurasierboy) -- Platforms: iOS -- Features: No Streaming - -### Fedilab -- Source Code: -- Contact: [@tom79@mastodon.social](https://mastodon.social/users/tom79) -- Platforms: Android -- Features: Streaming Ready - -### Nekonium -- Homepage: [F-Droid Repository](https://repo.gdgd.jp.net/), [Google Play](https://play.google.com/store/apps/details?id=com.apps.nekonium), [Amazon](https://www.amazon.co.jp/dp/B076FXPRBC/) -- Source: -- Contact: [@lin@pleroma.gdgd.jp.net](https://pleroma.gdgd.jp.net/users/lin) -- Platforms: Android -- Features: Streaming Ready - -### Roma -- Homepage: -- Source Code: [iOS](https://github.com/roma-apps/roma-ios), [Android](https://github.com/roma-apps/roma-android) -- Platforms: iOS, Android -- Features: No Streaming - -### Tootdon -- Homepage: , -- Source Code: ??? -- Contact: [@tootdon@mstdn.jp](https://mstdn.jp/users/tootdon) -- Platforms: Android, iOS -- Features: No Streaming - -### Tusky -- Homepage: -- Source Code: -- Contact: [@ConnyDuck@mastodon.social](https://mastodon.social/users/ConnyDuck) -- Platforms: Android -- Features: No Streaming - -### Twidere -- Homepage: -- Source Code: , -- Contact: -- Platform: Android, iOS -- Features: No Streaming - -## Alternative Web Interfaces -### Brutaldon -- Homepage: -- Source Code: -- Contact: [@gcupc@glitch.social](https://glitch.social/users/gcupc) -- Features: No Streaming - -### Feather -- Source Code: -- Contact: [@kaniini@pleroma.site](https://pleroma.site/kaniini) -- Features: No Streaming - -### Halcyon -- Source Code: -- Contact: [@halcyon@social.csswg.org](https://social.csswg.org/users/halcyon) -- Features: Streaming Ready - -### Pinafore -- Homepage: -- Source Code: -- Contact: [@pinafore@mastodon.technology](https://mastodon.technology/users/pinafore) -- Note: Pleroma support is a secondary goal -- Features: No Streaming - -### Sengi -- Source Code: -- Contact: [@sengi_app@mastodon.social](https://mastodon.social/users/sengi_app) -- Note(2019-01-28): The development is currently in a early stage. diff --git a/docs/Custom-Emoji.md b/docs/Custom-Emoji.md deleted file mode 100644 index 9d90e5822..000000000 --- a/docs/Custom-Emoji.md +++ /dev/null @@ -1,18 +0,0 @@ -# Custom emoji - -To add custom emoji: -* Add the image file(s) to `priv/static/emoji/custom` -* In case of conflicts: add the desired shortcode with the path to `config/custom_emoji.txt`, comma-separated and one per line -* Force recompilation (``mix clean && mix compile``) - -Example: - -image files (in `/priv/static/emoji/custom`): `happy.png` and `sad.png` - -content of `config/custom_emoji.txt`: -``` -happy, /emoji/custom/happy.png -sad, /emoji/custom/sad.png -``` - -The files should be PNG (APNG is okay with `.png` for `image/png` Content-type) and under 50kb for compatibility with mastodon. diff --git a/docs/Differences-in-MastodonAPI-Responses.md b/docs/Differences-in-MastodonAPI-Responses.md deleted file mode 100644 index d993d1383..000000000 --- a/docs/Differences-in-MastodonAPI-Responses.md +++ /dev/null @@ -1,46 +0,0 @@ -# Differences in Mastodon API responses from vanilla Mastodon - -A Pleroma instance can be identified by " (compatible; Pleroma )" present in `version` field in response from `/api/v1/instance` - -## Flake IDs - -Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mastodon's ids they are sortable strings - -## Attachment cap - -Some apps operate under the assumption that no more than 4 attachments can be returned or uploaded. Pleroma however does not enforce any limits on attachment count neither when returning the status object nor when posting. - -## Timelines - -Adding the parameter `with_muted=true` to the timeline queries will also return activities by muted (not by blocked!) users. - -## Statuses - -Has these additional fields under the `pleroma` object: - -- `local`: true if the post was made on the local instance. -- `conversation_id`: the ID of the conversation the status is associated with (if any) - -## Attachments - -Has these additional fields under the `pleroma` object: - -- `mime_type`: mime type of the attachment. - -## Accounts - -- `/api/v1/accounts/:id`: The `id` parameter can also be the `nickname` of the user. This only works in this endpoint, not the deeper nested ones for following etc. - -Has these additional fields under the `pleroma` object: - -- `tags`: Lists an array of tags for the user -- `relationship{}`: Includes fields as documented for Mastodon API https://docs.joinmastodon.org/api/entities/#relationship -- `is_moderator`: boolean, true if user is a moderator -- `is_admin`: boolean, true if user is an admin -- `confirmation_pending`: boolean, true if a new user account is waiting on email confirmation to be activated - -## Notifications - -Has these additional fields under the `pleroma` object: - -- `is_seen`: true if the notification was read by the user diff --git a/docs/Message-Rewrite-Facility-configuration.md b/docs/Message-Rewrite-Facility-configuration.md deleted file mode 100644 index 35ce52ea9..000000000 --- a/docs/Message-Rewrite-Facility-configuration.md +++ /dev/null @@ -1,119 +0,0 @@ -# Message Rewrite Facility configuration -The Message Rewrite Facility (MRF) is a subsystem that is implemented as a series of hooks that allows the administrator to rewrite or discard messages. - -Possible uses include: - -* marking incoming messages with media from a given account or instance as sensitive -* rejecting messages from a specific instance -* removing/unlisting messages from the public timelines -* removing media from messages -* sending only public messages to a specific instance - -The MRF provides user-configurable policies. The default policy is `NoOpPolicy`, which disables the MRF functionality. Pleroma also includes an easy to use policy called `SimplePolicy` which maps messages matching certain pre-defined criterion to actions built into the policy module. -It is possible to use multiple, active MRF policies at the same time. - -## Quarantine Instances - -You have the ability to prevent from private / followers-only messages from federating with specific instances. Which means they will only get the public or unlisted messages from your instance. - -If, for example, you're using `MIX_ENV=prod` aka using production mode, you would open your configuration file located in `config/prod.secret.exs` and edit or add the option under your `:instance` config object. Then you would specify the instance within quotes. -``` -config :pleroma, :instance, - [...] - quarantined_instances: ["instance.example", "other.example"] -``` - -## Using `SimplePolicy` - -`SimplePolicy` is capable of handling most common admin tasks. - -To use `SimplePolicy`, you must enable it. Do so by adding the following to your `:instance` config object, so that it looks like this: - -``` -config :pleroma, :instance, - [...] - rewrite_policy: Pleroma.Web.ActivityPub.MRF.SimplePolicy -``` - -Once `SimplePolicy` is enabled, you can configure various groups in the `:mrf_simple` config object. These groups are: - -* `media_removal`: Servers in this group will have media stripped from incoming messages. -* `media_nsfw`: Servers in this group will have the #nsfw tag and sensitive setting injected into incoming messages which contain media. -* `reject`: Servers in this group will have their messages rejected. -* `federated_timeline_removal`: Servers in this group will have their messages unlisted from the public timelines by flipping the `to` and `cc` fields. - -Servers should be configured as lists. - -### Example - -This example will enable `SimplePolicy`, block media from `illegalporn.biz`, mark media as NSFW from `porn.biz` and `porn.business`, reject messages from `spam.com` and remove messages from `spam.university` from the federated timeline: - -``` -config :pleroma, :instance, - rewrite_policy: [Pleroma.Web.ActivityPub.MRF.SimplePolicy] - -config :pleroma, :mrf_simple, - media_removal: ["illegalporn.biz"], - media_nsfw: ["porn.biz", "porn.business"], - reject: ["spam.com"], - federated_timeline_removal: ["spam.university"] - -``` - -### Use with Care - -The effects of MRF policies can be very drastic. It is important to use this functionality carefully. Always try to talk to an admin before writing an MRF policy concerning their instance. - -## Writing your own MRF Policy - -As discussed above, the MRF system is a modular system that supports pluggable policies. This means that an admin may write a custom MRF policy in Elixir or any other language that runs on the Erlang VM, by specifying the module name in the `rewrite_policy` config setting. - -For example, here is a sample policy module which rewrites all messages to "new message content": - -```!elixir -# This is a sample MRF policy which rewrites all Notes to have "new message -# content." -defmodule Site.RewritePolicy do - @behavior Pleroma.Web.ActivityPub.MRF - - # Catch messages which contain Note objects with actual data to filter. - # Capture the object as `object`, the message content as `content` and the - # message itself as `message`. - @impl true - def filter(%{"type" => Create", "object" => {"type" => "Note", "content" => content} = object} = message) - when is_binary(content) do - # Subject / CW is stored as summary instead of `name` like other AS2 objects - # because of Mastodon doing it that way. - summary = object["summary"] - - # Message edits go here. - content = "new message content" - - # Assemble the mutated object. - object = - object - |> Map.put("content", content) - |> Map.put("summary", summary) - - # Assemble the mutated message. - message = Map.put(message, "object", object) - {:ok, message} - end - - # Let all other messages through without modifying them. - @impl true - def filter(message), do: {:ok, message} -end -``` - -If you save this file as `lib/site/mrf/rewrite_policy.ex`, it will be included when you next rebuild Pleroma. You can enable it in the configuration like so: - -``` -config :pleroma, :instance, - rewrite_policy: [ - Pleroma.Web.ActivityPub.MRF.SimplePolicy, - Site.RewritePolicy - ] -``` - -Please note that the Pleroma developers consider custom MRF policy modules to fall under the purview of the AGPL. As such, you are obligated to release the sources to your custom MRF policy modules upon request. \ No newline at end of file diff --git a/docs/Pleroma-API.md b/docs/Pleroma-API.md deleted file mode 100644 index 478c9d874..000000000 --- a/docs/Pleroma-API.md +++ /dev/null @@ -1,118 +0,0 @@ -# Pleroma API - -Requests that require it can be authenticated with [an OAuth token](https://tools.ietf.org/html/rfc6749), the `_pleroma_key` cookie, or [HTTP Basic Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). - -Request parameters can be passed via [query strings](https://en.wikipedia.org/wiki/Query_string) or as [form data](https://www.w3.org/TR/html401/interact/forms.html). Files must be uploaded as `multipart/form-data`. - -## `/api/pleroma/emoji` -### Lists the custom emoji on that server. -* Method: `GET` -* Authentication: not required -* Params: none -* Response: JSON -* Example response: `{"kalsarikannit_f":"/finmoji/128px/kalsarikannit_f-128.png","perkele":"/finmoji/128px/perkele-128.png","blobdab":"/emoji/blobdab.png","happiness":"/finmoji/128px/happiness-128.png"}` -* Note: Same data as Mastodon API’s `/api/v1/custom_emojis` but in a different format - -## `/api/pleroma/follow_import` -### Imports your follows, for example from a Mastodon CSV file. -* Method: `POST` -* Authentication: required -* Params: - * `list`: STRING or FILE containing a whitespace-separated list of accounts to follow -* Response: HTTP 200 on success, 500 on error -* Note: Users that can't be followed are silently skipped. - -## `/api/pleroma/captcha` -### Get a new captcha -* Method: `GET` -* Authentication: not required -* Params: none -* Response: Provider specific JSON, the only guaranteed parameter is `type` -* Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint"}` - -## `/api/pleroma/delete_account` -### Delete an account -* Method `POST` -* Authentication: required -* Params: - * `password`: user's password -* Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise -* Example response: `{"error": "Invalid password."}` - -## `/api/account/register` -### Register a new user -* Method `POST` -* Authentication: not required -* Params: - * `nickname` - * `fullname` - * `bio` - * `email` - * `password` - * `confirm` - * `captcha_solution`: optional, contains provider-specific captcha solution, - * `captcha_token`: optional, contains provider-specific captcha token - * `token`: invite token required when the registerations aren't public. -* Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}` -* Example response: -``` -{ - "background_image": null, - "cover_photo": "https://pleroma.soykaf.com/images/banner.png", - "created_at": "Tue Dec 18 16:55:56 +0000 2018", - "default_scope": "public", - "description": "blushy-crushy fediverse idol + pleroma dev\nlet's be friends \nぷれろまの生徒会長。謎の外人。日本語OK. \n公主病.", - "description_html": "blushy-crushy fediverse idol + pleroma dev.
let's be friends
ぷれろまの生徒会長。謎の外人。日本語OK.
公主病.", - "favourites_count": 0, - "fields": [], - "followers_count": 0, - "following": false, - "follows_you": false, - "friends_count": 0, - "id": 6, - "is_local": true, - "locked": false, - "name": "lain", - "name_html": "lain", - "no_rich_text": false, - "pleroma": { - "tags": [] - }, - "profile_image_url": "https://pleroma.soykaf.com/images/avi.png", - "profile_image_url_https": "https://pleroma.soykaf.com/images/avi.png", - "profile_image_url_original": "https://pleroma.soykaf.com/images/avi.png", - "profile_image_url_profile_size": "https://pleroma.soykaf.com/images/avi.png", - "rights": { - "delete_others_notice": false - }, - "screen_name": "lain", - "statuses_count": 0, - "statusnet_blocking": false, - "statusnet_profile_url": "https://pleroma.soykaf.com/users/lain" -} -``` - -## `/api/pleroma/admin/`… -See [Admin-API](Admin-API.md) - -## `/api/v1/pleroma/flavour/:flavour` -* Method `POST` -* Authentication: required -* Response: JSON string. Returns the user flavour or the default one on success, otherwise returns `{"error": "error_msg"}` -* Example response: "glitch" -* Note: This is intended to be used only by mastofe - -## `/api/v1/pleroma/flavour` -* Method `GET` -* Authentication: required -* Response: JSON string. Returns the user flavour or the default one. -* Example response: "glitch" -* Note: This is intended to be used only by mastofe - -## `/api/pleroma/notifications/read` -### Mark a single notification as read -* Method `POST` -* Authentication: required -* Params: - * `id`: notifications's id -* Response: JSON. Returns `{"status": "success"}` if the reading was successful, otherwise returns `{"error": "error_msg"}` diff --git a/docs/admin/admin_tasks.md b/docs/admin/admin_tasks.md new file mode 100644 index 000000000..883095cdb --- /dev/null +++ b/docs/admin/admin_tasks.md @@ -0,0 +1,44 @@ +# Admin tasks +## Important + +If your instance is running in prod mode (most likely it is) make sure to prefix every command with `MIX_ENV=prod`. + +## User management + +It is possible to obtain a list of all available tasks with their options by executing `mix help pleroma.user` + +### Adding users + +Use `mix pleroma.user invite` to generate an invite link for a new user. + +Also, `mix pleroma.user new NICKNAME EMAIL [OPTION...]` can be used to register an account. + +### Making a user a moderator/admin/locked + +Run `mix pleroma.user set username --[no-]moderator` to make user a moderator or remove the moderator status. + +To make the user admin or locked use `mix pleroma.user set NICKNAME --[no-]admin` and `mix pleroma.user set NICKNAME --[no-]locked` respectively + +### Resetting a password + +Run `mix pleroma.user reset_password NICKNAME` to generate a password reset link that you can then send to the user. + +### Banning users + +Run `mix pleroma.user rm NICKNAME` to remove a local account. + +To deactivate(block from the server completely)/reactivate local and remote user accounts run: + +`mix pleroma.user toggle_activated NICKNAME@instancename` + +## Relay managment + +It is possible to obtain a list of all available tasks with their options by executing `mix help pleroma.relay` + +### Following a relay + +Run `mix pleroma.relay follow RELAY_URL` + +### Unfollowing a relay + +Run `mix pleroma.relay unfollow RELAY_URL` diff --git a/docs/admin/backup.md b/docs/admin/backup.md new file mode 100644 index 000000000..b373996f5 --- /dev/null +++ b/docs/admin/backup.md @@ -0,0 +1,15 @@ +# Backup your instance + +1. Stop the Pleroma service. +2. Go to the working directory of Pleroma (default is `/opt/pleroma`) +3. Run `sudo -Hu postgres pg_dump -d --format=custom -f ` +4. Copy `pleroma.pgdump`, `config/prod.secret.exs` and the `uploads` folder to your backup destination. If you have other modifications, copy those changes too. +5. Restart the Pleroma service. + +## Restore your instance + +1. Stop the Pleroma service. +2. Go to the working directory of Pleroma (default is `/opt/pleroma`) +3. Copy the above mentioned files back to their original position. +4. Run `sudo -Hu postgres pg_restore -d -v -1 ` +5. Restart the Pleroma service. diff --git a/docs/admin/updating.md b/docs/admin/updating.md new file mode 100644 index 000000000..33ce1ab4f --- /dev/null +++ b/docs/admin/updating.md @@ -0,0 +1,9 @@ +# Updating your instance +1. Stop the Pleroma service. +2. Go to the working directory of Pleroma (default is `/opt/pleroma`) +3. Run `git pull`. This pulls the latest changes from upstream. +4. Run `mix deps.get`. This pulls in any new dependencies. +5. Run `mix ecto.migrate`[^1]. This task performs database migrations, if there were any. +6. Restart the Pleroma service. + +[^1]: Prefix with `MIX_ENV=prod` to run it using the production config file. diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md new file mode 100644 index 000000000..ea9b9308c --- /dev/null +++ b/docs/api/admin_api.md @@ -0,0 +1,194 @@ +# Admin API +# Admin API + +Authentication is required and the user must be an admin. + +## `/api/pleroma/admin/users` + +### List users + +- Method `GET` +- Query Params: + - *optional* `query`: **string** search term + - *optional* `filters`: **string** comma-separated string of filters: + - `local`: only local users + - `external`: only external users + - `active`: only active users + - `deactivated`: only deactivated users + - *optional* `page`: **integer** page number + - *optional* `page_size`: **integer** number of users per page (default is `50`) +- Example: `https://mypleroma.org/api/pleroma/admin/users?query=john&filters=local,active&page=1&page_size=10` +- Response: + +```JSON +{ + "page_size": integer, + "count": integer, + "users": [ + { + "deactivated": bool, + "id": integer, + "nickname": string, + "roles": { + "admin": bool, + "moderator": bool + }, + "local": bool, + "tags": array + }, + ... + ] +} +``` + +## `/api/pleroma/admin/user` + +### Remove a user + +- Method `DELETE` +- Params: + - `nickname` +- Response: User’s nickname + +### Create a user + +- Method: `POST` +- Params: + - `nickname` + - `email` + - `password` +- Response: User’s nickname + +## `/api/pleroma/admin/users/:nickname/toggle_activation` + +### Toggle user activation + +- Method: `PATCH` +- Params: + - `nickname` +- Response: User’s object + +```JSON +{ + "deactivated": bool, + "id": integer, + "nickname": string +} +``` + +## `/api/pleroma/admin/users/tag` + +### Tag a list of users + +- Method: `PUT` +- Params: + - `nickname` + - `tags` + +### Untag a list of users + +- Method: `DELETE` +- Params: + - `nickname` + - `tags` + +## `/api/pleroma/admin/permission_group/:nickname` + +### Get user user permission groups membership + +- Method: `GET` +- Params: none +- Response: + +```JSON +{ + "is_moderator": bool, + "is_admin": bool +} +``` + +## `/api/pleroma/admin/permission_group/:nickname/:permission_group` + +Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist. + +### Get user user permission groups membership per permission group + +- Method: `GET` +- Params: none +- Response: + +```JSON +{ + "is_moderator": bool, + "is_admin": bool +} +``` + +### Add user in permission group + +- Method: `POST` +- Params: none +- Response: + - On failure: `{"error": "…"}` + - On success: JSON of the `user.info` + +### Remove user from permission group + +- Method: `DELETE` +- Params: none +- Response: + - On failure: `{"error": "…"}` + - On success: JSON of the `user.info` +- Note: An admin cannot revoke their own admin status. + +## `/api/pleroma/admin/activation_status/:nickname` + +### Active or deactivate a user + +- Method: `PUT` +- Params: + - `nickname` + - `status` BOOLEAN field, false value means deactivation. + +## `/api/pleroma/admin/relay` + +### Follow a Relay + +- Methods: `POST` +- Params: + - `relay_url` +- Response: + - On success: URL of the followed relay + +### Unfollow a Relay + +- Methods: `DELETE` +- Params: + - `relay_url` +- Response: + - On success: URL of the unfollowed relay + +## `/api/pleroma/admin/invite_token` + +### Get a account registeration invite token + +- Methods: `GET` +- Params: none +- Response: invite token (base64 string) + +## `/api/pleroma/admin/email_invite` + +### Sends registration invite via email + +- Methods: `POST` +- Params: + - `email` + - `name`, optionnal + +## `/api/pleroma/admin/password_reset` + +### Get a password reset token for a given nickname + +- Methods: `GET` +- Params: none +- Response: password reset token (base64 string) diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md new file mode 100644 index 000000000..d993d1383 --- /dev/null +++ b/docs/api/differences_in_mastoapi_responses.md @@ -0,0 +1,46 @@ +# Differences in Mastodon API responses from vanilla Mastodon + +A Pleroma instance can be identified by " (compatible; Pleroma )" present in `version` field in response from `/api/v1/instance` + +## Flake IDs + +Pleroma uses 128-bit ids as opposed to Mastodon's 64 bits. However just like Mastodon's ids they are sortable strings + +## Attachment cap + +Some apps operate under the assumption that no more than 4 attachments can be returned or uploaded. Pleroma however does not enforce any limits on attachment count neither when returning the status object nor when posting. + +## Timelines + +Adding the parameter `with_muted=true` to the timeline queries will also return activities by muted (not by blocked!) users. + +## Statuses + +Has these additional fields under the `pleroma` object: + +- `local`: true if the post was made on the local instance. +- `conversation_id`: the ID of the conversation the status is associated with (if any) + +## Attachments + +Has these additional fields under the `pleroma` object: + +- `mime_type`: mime type of the attachment. + +## Accounts + +- `/api/v1/accounts/:id`: The `id` parameter can also be the `nickname` of the user. This only works in this endpoint, not the deeper nested ones for following etc. + +Has these additional fields under the `pleroma` object: + +- `tags`: Lists an array of tags for the user +- `relationship{}`: Includes fields as documented for Mastodon API https://docs.joinmastodon.org/api/entities/#relationship +- `is_moderator`: boolean, true if user is a moderator +- `is_admin`: boolean, true if user is an admin +- `confirmation_pending`: boolean, true if a new user account is waiting on email confirmation to be activated + +## Notifications + +Has these additional fields under the `pleroma` object: + +- `is_seen`: true if the notification was read by the user diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md new file mode 100644 index 000000000..bd3fcaa5d --- /dev/null +++ b/docs/api/pleroma_api.md @@ -0,0 +1,121 @@ +# Pleroma API + +Requests that require it can be authenticated with [an OAuth token](https://tools.ietf.org/html/rfc6749), the `_pleroma_key` cookie, or [HTTP Basic Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization). + +Request parameters can be passed via [query strings](https://en.wikipedia.org/wiki/Query_string) or as [form data](https://www.w3.org/TR/html401/interact/forms.html). Files must be uploaded as `multipart/form-data`. + +## `/api/pleroma/emoji` +### Lists the custom emoji on that server. +* Method: `GET` +* Authentication: not required +* Params: none +* Response: JSON +* Example response: `{"kalsarikannit_f":"/finmoji/128px/kalsarikannit_f-128.png","perkele":"/finmoji/128px/perkele-128.png","blobdab":"/emoji/blobdab.png","happiness":"/finmoji/128px/happiness-128.png"}` +* Note: Same data as Mastodon API’s `/api/v1/custom_emojis` but in a different format + +## `/api/pleroma/follow_import` +### Imports your follows, for example from a Mastodon CSV file. +* Method: `POST` +* Authentication: required +* Params: + * `list`: STRING or FILE containing a whitespace-separated list of accounts to follow +* Response: HTTP 200 on success, 500 on error +* Note: Users that can't be followed are silently skipped. + +## `/api/pleroma/captcha` +### Get a new captcha +* Method: `GET` +* Authentication: not required +* Params: none +* Response: Provider specific JSON, the only guaranteed parameter is `type` +* Example response: `{"type": "kocaptcha", "token": "whatever", "url": "https://captcha.kotobank.ch/endpoint"}` + +## `/api/pleroma/delete_account` +### Delete an account +* Method `POST` +* Authentication: required +* Params: + * `password`: user's password +* Response: JSON. Returns `{"status": "success"}` if the deletion was successful, `{"error": "[error message]"}` otherwise +* Example response: `{"error": "Invalid password."}` + +## `/api/account/register` +### Register a new user +* Method `POST` +* Authentication: not required +* Params: + * `nickname` + * `fullname` + * `bio` + * `email` + * `password` + * `confirm` + * `captcha_solution`: optional, contains provider-specific captcha solution, + * `captcha_token`: optional, contains provider-specific captcha token + * `token`: invite token required when the registerations aren't public. +* Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}` +* Example response: +``` +{ + "background_image": null, + "cover_photo": "https://pleroma.soykaf.com/images/banner.png", + "created_at": "Tue Dec 18 16:55:56 +0000 2018", + "default_scope": "public", + "description": "blushy-crushy fediverse idol + pleroma dev +let's be friends +ぷれろまの生徒会長。謎の外人。日本語OK. +公主病.", + "description_html": "blushy-crushy fediverse idol + pleroma dev.
let's be friends
ぷれろまの生徒会長。謎の外人。日本語OK.
公主病.", + "favourites_count": 0, + "fields": [], + "followers_count": 0, + "following": false, + "follows_you": false, + "friends_count": 0, + "id": 6, + "is_local": true, + "locked": false, + "name": "lain", + "name_html": "lain", + "no_rich_text": false, + "pleroma": { + "tags": [] + }, + "profile_image_url": "https://pleroma.soykaf.com/images/avi.png", + "profile_image_url_https": "https://pleroma.soykaf.com/images/avi.png", + "profile_image_url_original": "https://pleroma.soykaf.com/images/avi.png", + "profile_image_url_profile_size": "https://pleroma.soykaf.com/images/avi.png", + "rights": { + "delete_others_notice": false + }, + "screen_name": "lain", + "statuses_count": 0, + "statusnet_blocking": false, + "statusnet_profile_url": "https://pleroma.soykaf.com/users/lain" +} +``` + +## `/api/pleroma/admin/`… +See [Admin-API](Admin-API.md) + +## `/api/v1/pleroma/flavour/:flavour` +* Method `POST` +* Authentication: required +* Response: JSON string. Returns the user flavour or the default one on success, otherwise returns `{"error": "error_msg"}` +* Example response: "glitch" +* Note: This is intended to be used only by mastofe + +## `/api/v1/pleroma/flavour` +* Method `GET` +* Authentication: required +* Response: JSON string. Returns the user flavour or the default one. +* Example response: "glitch" +* Note: This is intended to be used only by mastofe + +## `/api/pleroma/notifications/read` +### Mark a single notification as read +* Method `POST` +* Authentication: required +* Params: + * `id`: notifications's id +* Response: JSON. Returns `{"status": "success"}` if the reading was successful, otherwise returns `{"error": "error_msg"}` diff --git a/docs/clients.md b/docs/clients.md new file mode 100644 index 000000000..dc3e83bcc --- /dev/null +++ b/docs/clients.md @@ -0,0 +1,100 @@ +# Pleroma Clients +Note: Additionnal clients may be working but theses are officially supporting Pleroma. +Feel free to contact us to be added to this list! + +## Desktop +### Roma for Desktop +- Homepage: +- Source Code: +- Platforms: Windows, Mac, (Linux?) +- Features: Streaming Ready + +### Social +- Source Code: +- Contact: [@brainblasted@social.libre.fi](https://social.libre.fi/users/brainblasted) +- Platforms: Linux (GNOME) +- Note(2019-01-28): Not at a pre-alpha stage yet + +### Whalebird +- Homepage: +- Source Code: +- Contact: [@h3poteto@pleroma.io](https://pleroma.io/users/h3poteto) +- Platforms: Windows, Mac, Linux +- Features: Streaming Ready + +## Handheld +### Amaroq +- Homepage: +- Source Code: +- Contact: [@eurasierboy@mastodon.social](https://mastodon.social/users/eurasierboy) +- Platforms: iOS +- Features: No Streaming + +### Fedilab +- Source Code: +- Contact: [@tom79@mastodon.social](https://mastodon.social/users/tom79) +- Platforms: Android +- Features: Streaming Ready + +### Nekonium +- Homepage: [F-Droid Repository](https://repo.gdgd.jp.net/), [Google Play](https://play.google.com/store/apps/details?id=com.apps.nekonium), [Amazon](https://www.amazon.co.jp/dp/B076FXPRBC/) +- Source: +- Contact: [@lin@pleroma.gdgd.jp.net](https://pleroma.gdgd.jp.net/users/lin) +- Platforms: Android +- Features: Streaming Ready + +### Roma +- Homepage: +- Source Code: [iOS](https://github.com/roma-apps/roma-ios), [Android](https://github.com/roma-apps/roma-android) +- Platforms: iOS, Android +- Features: No Streaming + +### Tootdon +- Homepage: , +- Source Code: ??? +- Contact: [@tootdon@mstdn.jp](https://mstdn.jp/users/tootdon) +- Platforms: Android, iOS +- Features: No Streaming + +### Tusky +- Homepage: +- Source Code: +- Contact: [@ConnyDuck@mastodon.social](https://mastodon.social/users/ConnyDuck) +- Platforms: Android +- Features: No Streaming + +### Twidere +- Homepage: +- Source Code: , +- Contact: +- Platform: Android, iOS +- Features: No Streaming + +## Alternative Web Interfaces +### Brutaldon +- Homepage: +- Source Code: +- Contact: [@gcupc@glitch.social](https://glitch.social/users/gcupc) +- Features: No Streaming + +### Feather +- Source Code: +- Contact: [@kaniini@pleroma.site](https://pleroma.site/kaniini) +- Features: No Streaming + +### Halcyon +- Source Code: +- Contact: [@halcyon@social.csswg.org](https://social.csswg.org/users/halcyon) +- Features: Streaming Ready + +### Pinafore +- Homepage: +- Source Code: +- Contact: [@pinafore@mastodon.technology](https://mastodon.technology/users/pinafore) +- Note: Pleroma support is a secondary goal +- Features: No Streaming + +### Sengi +- Source Code: +- Contact: [@sengi_app@mastodon.social](https://mastodon.social/users/sengi_app) +- Note(2019-01-28): The development is currently in a early stage. diff --git a/docs/config/General-tips-for-customizing-Pleroma-FE.md b/docs/config/General-tips-for-customizing-Pleroma-FE.md new file mode 100644 index 000000000..15c4882dd --- /dev/null +++ b/docs/config/General-tips-for-customizing-Pleroma-FE.md @@ -0,0 +1,17 @@ +# General tips for customizing Pleroma FE +There are some configuration scripts for Pleroma BE and FE: + +1. `config/prod.secret.exs` +1. `config/config.exs` +1. `priv/static/static/config.json` + +The `prod.secret.exs` affects first. `config.exs` is for fallback or default. `config.json` is for GNU-social-BE-Pleroma-FE instances. + +Usually all you have to do is: + +1. Copy the section in the `config/config.exs` which you want to activate. +1. Paste into `config/prod.secret.exs`. +1. Edit `config/prod.secret.exs`. +1. Restart the Pleroma daemon. + +`prod.secret.exs` is for the `MIX_ENV=prod` environment. `dev.secret.exs` is for the `MIX_ENV=dev` environment respectively. diff --git a/docs/config/custom_emoji.md b/docs/config/custom_emoji.md new file mode 100644 index 000000000..e833d2080 --- /dev/null +++ b/docs/config/custom_emoji.md @@ -0,0 +1,18 @@ +# Custom Emoji + +To add custom emoji: +* Add the image file(s) to `priv/static/emoji/custom` +* In case of conflicts: add the desired shortcode with the path to `config/custom_emoji.txt`, comma-separated and one per line +* Force recompilation (``mix clean && mix compile``) + +Example: + +image files (in `/priv/static/emoji/custom`): `happy.png` and `sad.png` + +content of `config/custom_emoji.txt`: +``` +happy, /emoji/custom/happy.png +sad, /emoji/custom/sad.png +``` + +The files should be PNG (APNG is okay with `.png` for `image/png` Content-type) and under 50kb for compatibility with mastodon. diff --git a/docs/config/hardening.md b/docs/config/hardening.md new file mode 100644 index 000000000..b54c28850 --- /dev/null +++ b/docs/config/hardening.md @@ -0,0 +1,103 @@ +# Hardening your instance +Here are some suggestions which improve the security of parts of your Pleroma instance. + +## Configuration file + +These changes should go into `prod.secret.exs` or `dev.secret.exs`, depending on your `MIX_ENV` value. + +### `http` + +> Recommended value: `[ip: {127, 0, 0, 1}]` + +This sets the Pleroma application server to only listen to the localhost interface. This way, you can only reach your server over the Internet by going through the reverse proxy. By default, Pleroma listens on all interfaces. + +### `secure_cookie_flag` + +> Recommended value: `true` + +This sets the `secure` flag on Pleroma’s session cookie. This makes sure, that the cookie is only accepted over encrypted HTTPs connections. This implicitly renames the cookie from `pleroma_key` to `__Host-pleroma-key` which enforces some restrictions. (see [cookie prefixes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#Cookie_prefixes)) + +### `:http_security` + +> Recommended value: `true` + +This will send additional HTTP security headers to the clients, including: + +* `X-XSS-Protection: "1; mode=block"` +* `X-Permitted-Cross-Domain-Policies: "none"` +* `X-Frame-Options: "DENY"` +* `X-Content-Type-Options: "nosniff"` +* `X-Download-Options: "noopen"` + +A content security policy (CSP) will also be set: + +```csp +content-security-policy: + default-src 'none'; + base-uri 'self'; + frame-ancestors 'none'; + img-src 'self' data: https:; + media-src 'self' https:; + style-src 'self' 'unsafe-inline'; + font-src 'self'; + script-src 'self'; + connect-src 'self' wss://example.tld; + manifest-src 'self'; + upgrade-insecure-requests; +``` + +#### `sts` + +> Recommended value: `true` + +An additional “Strict transport security” header will be sent with the configured `sts_max_age` parameter. This tells the browser, that the domain should only be accessed over a secure HTTPs connection. + +#### `ct_max_age` + +An additional “Expect-CT” header will be sent with the configured `ct_max_age` parameter. This enforces the use of TLS certificates that are published in the certificate transparency log. (see [Expect-CT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect-CT)) + +#### `referrer_policy` + +> Recommended value: `same-origin` + +If you click on a link, your browser’s request to the other site will include from where it is coming from. The “Referrer policy” header tells the browser how and if it should send this information. (see [Referrer policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy)) + +## systemd + +A systemd unit example is provided at `installation/pleroma.service`. + +### PrivateTmp + +> Recommended value: `true` + +Use private `/tmp` and `/var/tmp` folders inside a new file system namespace, which are discarded after the process stops. + +### ProtectHome + +> Recommended value: `true` + +The `/home`, `/root`, and `/run/user` folders can not be accessed by this service anymore. If your Pleroma user has its home folder in one of the restricted places, or use one of these folders as its working directory, you have to set this to `false`. + +### ProtectSystem + +> Recommended value: `full` + +Mount `/usr`, `/boot`, and `/etc` as read-only for processes invoked by this service. + +### PrivateDevices + +> Recommended value: `true` + +Sets up a new `/dev` mount for the process and only adds API pseudo devices like `/dev/null`, `/dev/zero` or `/dev/random` but not physical devices. This may not work on devices like the Raspberry Pi, where you need to set this to `false`. + +### NoNewPrivileges + +> Recommended value: `true` + +Ensures that the service process and all its children can never gain new privileges through `execve()`. + +### CapabilityBoundingSet + +> Recommended value: `~CAP_SYS_ADMIN` + +Drops the sysadmin capability from the daemon. diff --git a/docs/config/howto_change_ip_and_port.md b/docs/config/howto_change_ip_and_port.md new file mode 100644 index 000000000..decddd35c --- /dev/null +++ b/docs/config/howto_change_ip_and_port.md @@ -0,0 +1,7 @@ +# How to change the port or IP Pleroma listens to +To change the port or IP Pleroma listens to, head over to your generated config inside the Pleroma folder at config/prod.secret.exs and edit the following according to your needs. +``` +config :pleroma, Pleroma.Web.Endpoint, + [...] + http: [ip: {127, 0, 0, 1}, port: 4000] +``` diff --git a/docs/config/howto_mediaproxy.md b/docs/config/howto_mediaproxy.md new file mode 100644 index 000000000..fb731112b --- /dev/null +++ b/docs/config/howto_mediaproxy.md @@ -0,0 +1,32 @@ +# How to activate mediaproxy +## Explanation + +Without the `mediaproxy` function, Pleroma don't store any remote content like pictures, video etc. locally. So every time you open Pleroma, the content is loaded from the source server, from where the post is coming. This can result in slowly loading content or/and increased bandwidth usage on the source server. +With the `mediaproxy` function you can use the cache ability of nginx, to cache these content, so user can access it faster, cause it's loaded from your server. + +## Activate it + +* Edit your nginx config and add the following location: +``` +location /proxy { + proxy_cache pleroma_media_cache; + proxy_cache_lock on; + proxy_pass http://localhost:4000; +} +``` +Also add the following on top of the configuration, outside of the `server` block: +``` +proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=10g inactive=720m use_temp_path=off; +``` +If you came here from one of the installation guides, take a look at the example configuration `/installation/pleroma.nginx`, where this part is already included. + +* Append the following to your `prod.secret.exs` or `dev.secret.exs` (depends on which mode your instance is running): +``` +config :pleroma, :media_proxy, + enabled: true, + redirect_on_failure: true + #base_url: "https://cache.pleroma.social" +``` +If you want to use a subdomain to serve the files, uncomment `base_url`, change the url and add a comma after `true` in the previous line. + +* Restart nginx and Pleroma diff --git a/docs/config/howto_proxy.md b/docs/config/howto_proxy.md new file mode 100644 index 000000000..10a635266 --- /dev/null +++ b/docs/config/howto_proxy.md @@ -0,0 +1,12 @@ +# How to configure upstream proxy for federation +If you want to proxify all http requests (e.g. for TOR) that pleroma makes to an upstream proxy server, edit you config file (`dev.secret.exs` or `prod.secret.exs`) and add the following: + +``` +config :pleroma, :http, + proxy_url: "127.0.0.1:8123" +``` + +The other way to do it, for example, with Tor you would most likely add something like this: +``` +config :pleroma, :http, proxy_url: {:socks5, :localhost, 9050} +``` diff --git a/docs/config/howto_user_recomendation.md b/docs/config/howto_user_recomendation.md new file mode 100644 index 000000000..27c0760dd --- /dev/null +++ b/docs/config/howto_user_recomendation.md @@ -0,0 +1,31 @@ +# How to activate user recommendation (Who to follow panel) +![who-to-follow-panel-small](/uploads/9de1b1300436c32461d272945f1bc23e/who-to-follow-panel-small.png) + +To show the *who to follow* panel, edit `config/prod.secret.exs` in the Pleroma backend. Following code activates the *who to follow* panel: + +```elixir +config :pleroma, :suggestions, + enabled: true, + third_party_engine: + "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}", + timeout: 300_000, + limit: 23, + web: "https://vinayaka.distsn.org/?{{host}}+{{user}}" + +``` + +`config/config.exs` already includes this code, but `enabled:` is `false`. + +`/api/v1/suggestions` is also provided when *who to follow* panel is enabled. + +For advanced customization, following code shows the newcomers of the fediverse at the *who to follow* panel: + +```elixir +config :pleroma, :suggestions, + enabled: true, + third_party_engine: + "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-new-suggestions-api.cgi?{{host}}+{{user}}", + timeout: 60_000, + limit: 23, + web: "https://vinayaka.distsn.org/user-new.html" +``` diff --git a/docs/config/i2p.md b/docs/config/i2p.md new file mode 100644 index 000000000..c477eb6e4 --- /dev/null +++ b/docs/config/i2p.md @@ -0,0 +1,197 @@ +# I2P Federation +# I2P Federation and Accessability + +This guide is going to focus on the Pleroma federation aspect. The actual installation is neatly explained in the official documentation, and more likely to remain up-to-date. +It might be added to this guide if there will be a need for that. + +We're going to use I2PD for its lightweightness over the official client. +Follow the documentation according to your distro: https://i2pd.readthedocs.io/en/latest/user-guide/install/#installing + +How to run it: https://i2pd.readthedocs.io/en/latest/user-guide/run/ + +## I2P Federation + +There are 2 ways to go about this. +One using the config, and one using external software (fedproxy). The external software works better so far. + +### Using the Config + +**Warning:** So far, everytime I followed this way of federating using I2P, the rest of my federation stopped working. I'm leaving this here in case it will help with making it work. + +Assuming you're running in prod, cd to your Pleroma folder and append the following to `config/prod.secret.exs`: +``` +config :pleroma, :http, proxy_url: {:socks5, :localhost, 4447} +``` +And then run the following: +``` +su pleroma +MIX_ENV=prod mix deps.get +MIX_ENV=prod mix ecto.migrate +exit +``` +You can restart I2PD here and finish if you don't wish to make your instance viewable or accessible over I2P. +``` +systemctl stop i2pd.service --no-block +systemctl start i2pd.service +``` +*Notice:* The stop command initiates a graceful shutdown process, i2pd stops after finishing to route transit tunnels (maximum 10 minutes). + +You can change the socks proxy port in `/etc/i2pd/i2pd.conf`. + +### Using Fedproxy + +Fedproxy passes through clearnet requests direct to where they are going. It doesn't force anything over Tor. + +To use [fedproxy](https://github.com/majestrate/fedproxy) you'll need to install Golang. +``` +apt install golang +``` +Use a different user than pleroma or root. Run the following to add the Gopath to your ~/.bashrc. +``` +echo "export GOPATH=/home/ren/.go" >> ~/.bashrc +``` +Restart that bash session (you can exit and log back in). +Run the following to get fedproxy. +``` +go get -u github.com/majestrate/fedproxy$ +cp $(GOPATH)/bin/fedproxy /usr/local/bin/fedproxy +``` +And then the following to start it for I2P only. +``` +fedproxy 127.0.0.1:2000 127.0.0.1:4447 +``` +If you want to also use it for Tor, add `127.0.0.1:9050` to that command. +You'll also need to modify your Pleroma config. + +Assuming you're running in prod, cd to your Pleroma folder and append the following to `config/prod.secret.exs`: +``` +config :pleroma, :http, proxy_url: {:socks5, :localhost, 2000} +``` +And then run the following: +``` +su pleroma +MIX_ENV=prod mix deps.get +MIX_ENV=prod mix ecto.migrate +exit +``` +You can restart I2PD here and finish if you don't wish to make your instance viewable or accessible over I2P. + +``` +systemctl stop i2pd.service --no-block +systemctl start i2pd.service +``` +*Notice:* The stop command initiates a graceful shutdown process, i2pd stops after finishing to route transit tunnels (maximum 10 minutes). + +You can change the socks proxy port in `/etc/i2pd/i2pd.conf`. + +## I2P Instance Access + +Make your instance accessible using I2P. + +Add the following to your I2PD config `/etc/i2pd/tunnels.conf`: +``` +[pleroma] +type = http +host = 127.0.0.1 +port = 14447 +keys = pleroma.dat +``` +Restart I2PD: +``` +systemctl stop i2pd.service --no-block +systemctl start i2pd.service +``` +*Notice:* The stop command initiates a graceful shutdown process, i2pd stops after finishing to route transit tunnels (maximum 10 minutes). + +Now you'll have to find your address. +To do that you can download and use I2PD tools.[^1] +Or you'll need to access your web-console on localhost:7070. +If you don't have a GUI, you'll have to SSH tunnel into it like this: +`ssh -L 7070:127.0.0.1:7070 user@ip -p port`. +Now you can access it at localhost:7070. +Go to I2P tunnels page. Look for Server tunnels and you will see an address that ends with `.b32.i2p` next to "pleroma". +This is your site's address. + +### I2P-only Instance + +If creating an I2P-only instance, open `config/prod.secret.exs` and under "config :pleroma, Pleroma.Web.Endpoint," edit "https" and "port: 443" to the following: +``` + url: [host: "i2paddress", scheme: "http", port: 80], +``` +In addition to that, replace the existing nginx config's contents with the example below. + +### Existing Instance (Clearnet Instance) + +If not an I2P-only instance, add the nginx config below to your existing config at `/etc/nginx/sites-enabled/pleroma.nginx`. + +And for both cases, disable CSP in Pleroma's config (STS is disabled by default) so you can define those yourself seperately from the clearnet (if your instance is also on the clearnet). +Copy the following into the `config/prod.secret.exs` in your Pleroma folder (/home/pleroma/pleroma/): +``` +config :pleroma, :http_security, + enabled: false +``` + +Use this as the Nginx config: +``` +proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=10g inactive=720m use_temp_path=off; +# The above already exists in a clearnet instance's config. +# If not, add it. + +server { + listen 127.0.0.1:14447; + server_name youri2paddress; + + # Comment to enable logs + access_log /dev/null; + error_log /dev/null; + + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/activity+json application/atom+xml; + + client_max_body_size 16m; + + location / { + + add_header X-XSS-Protection "1; mode=block"; + add_header X-Permitted-Cross-Domain-Policies none; + add_header X-Frame-Options DENY; + add_header X-Content-Type-Options nosniff; + add_header Referrer-Policy same-origin; + add_header X-Download-Options noopen; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + + proxy_pass http://localhost:4000; + + client_max_body_size 16m; + } + + location /proxy { + proxy_cache pleroma_media_cache; + proxy_cache_lock on; + proxy_ignore_client_abort on; + proxy_pass http://localhost:4000; + } +} +``` +reload Nginx: +``` +systemctl stop i2pd.service --no-block +systemctl start i2pd.service +``` +*Notice:* The stop command initiates a graceful shutdown process, i2pd stops after finishing to route transit tunnels (maximum 10 minutes). + +You should now be able to both access your instance using I2P and federate with other I2P instances! + +[^1]: [I2PD tools](https://github.com/purplei2p/i2pd-tools) to print information about a router info file or an I2P private key, generate an I2P private key, and generate vanity addresses. + +### Possible Issues + +Will be added when encountered. diff --git a/docs/config/mrf.md b/docs/config/mrf.md new file mode 100644 index 000000000..2cc16cef0 --- /dev/null +++ b/docs/config/mrf.md @@ -0,0 +1,119 @@ +# Message Rewrite Facility +The Message Rewrite Facility (MRF) is a subsystem that is implemented as a series of hooks that allows the administrator to rewrite or discard messages. + +Possible uses include: + +* marking incoming messages with media from a given account or instance as sensitive +* rejecting messages from a specific instance +* removing/unlisting messages from the public timelines +* removing media from messages +* sending only public messages to a specific instance + +The MRF provides user-configurable policies. The default policy is `NoOpPolicy`, which disables the MRF functionality. Pleroma also includes an easy to use policy called `SimplePolicy` which maps messages matching certain pre-defined criterion to actions built into the policy module. +It is possible to use multiple, active MRF policies at the same time. + +## Quarantine Instances + +You have the ability to prevent from private / followers-only messages from federating with specific instances. Which means they will only get the public or unlisted messages from your instance. + +If, for example, you're using `MIX_ENV=prod` aka using production mode, you would open your configuration file located in `config/prod.secret.exs` and edit or add the option under your `:instance` config object. Then you would specify the instance within quotes. +``` +config :pleroma, :instance, + [...] + quarantined_instances: ["instance.example", "other.example"] +``` + +## Using `SimplePolicy` + +`SimplePolicy` is capable of handling most common admin tasks. + +To use `SimplePolicy`, you must enable it. Do so by adding the following to your `:instance` config object, so that it looks like this: + +``` +config :pleroma, :instance, + [...] + rewrite_policy: Pleroma.Web.ActivityPub.MRF.SimplePolicy +``` + +Once `SimplePolicy` is enabled, you can configure various groups in the `:mrf_simple` config object. These groups are: + +* `media_removal`: Servers in this group will have media stripped from incoming messages. +* `media_nsfw`: Servers in this group will have the #nsfw tag and sensitive setting injected into incoming messages which contain media. +* `reject`: Servers in this group will have their messages rejected. +* `federated_timeline_removal`: Servers in this group will have their messages unlisted from the public timelines by flipping the `to` and `cc` fields. + +Servers should be configured as lists. + +### Example + +This example will enable `SimplePolicy`, block media from `illegalporn.biz`, mark media as NSFW from `porn.biz` and `porn.business`, reject messages from `spam.com` and remove messages from `spam.university` from the federated timeline: + +``` +config :pleroma, :instance, + rewrite_policy: [Pleroma.Web.ActivityPub.MRF.SimplePolicy] + +config :pleroma, :mrf_simple, + media_removal: ["illegalporn.biz"], + media_nsfw: ["porn.biz", "porn.business"], + reject: ["spam.com"], + federated_timeline_removal: ["spam.university"] + +``` + +### Use with Care + +The effects of MRF policies can be very drastic. It is important to use this functionality carefully. Always try to talk to an admin before writing an MRF policy concerning their instance. + +## Writing your own MRF Policy + +As discussed above, the MRF system is a modular system that supports pluggable policies. This means that an admin may write a custom MRF policy in Elixir or any other language that runs on the Erlang VM, by specifying the module name in the `rewrite_policy` config setting. + +For example, here is a sample policy module which rewrites all messages to "new message content": + +```elixir +# This is a sample MRF policy which rewrites all Notes to have "new message +# content." +defmodule Site.RewritePolicy do + @behavior Pleroma.Web.ActivityPub.MRF + + # Catch messages which contain Note objects with actual data to filter. + # Capture the object as `object`, the message content as `content` and the + # message itself as `message`. + @impl true + def filter(%{"type" => Create", "object" => {"type" => "Note", "content" => content} = object} = message) + when is_binary(content) do + # Subject / CW is stored as summary instead of `name` like other AS2 objects + # because of Mastodon doing it that way. + summary = object["summary"] + + # Message edits go here. + content = "new message content" + + # Assemble the mutated object. + object = + object + |> Map.put("content", content) + |> Map.put("summary", summary) + + # Assemble the mutated message. + message = Map.put(message, "object", object) + {:ok, message} + end + + # Let all other messages through without modifying them. + @impl true + def filter(message), do: {:ok, message} +end +``` + +If you save this file as `lib/site/mrf/rewrite_policy.ex`, it will be included when you next rebuild Pleroma. You can enable it in the configuration like so: + +``` +config :pleroma, :instance, + rewrite_policy: [ + Pleroma.Web.ActivityPub.MRF.SimplePolicy, + Site.RewritePolicy + ] +``` + +Please note that the Pleroma developers consider custom MRF policy modules to fall under the purview of the AGPL. As such, you are obligated to release the sources to your custom MRF policy modules upon request. diff --git a/docs/config/onion_federation.md b/docs/config/onion_federation.md new file mode 100644 index 000000000..99f104995 --- /dev/null +++ b/docs/config/onion_federation.md @@ -0,0 +1,159 @@ +# Easy Onion Federation (Tor) +Tor can free people from the necessity of a domain, in addition to helping protect their privacy. As Pleroma's goal is to empower the people and let as many as possible host an instance with as little resources as possible, the ability to host an instance with a small, cheap computer like a RaspberryPi along with Tor, would be a great way to achieve that. +In addition, federating with such instances will also help furthering that goal. + +This is a guide to show you how it can be easily done. + +This guide assumes you already got Pleroma working, and that it's running on the default port 4000. +Currently only has an Nginx example. + +To install Tor on Debian / Ubuntu: +``` +apt -yq install tor +``` +If using an old server version (older than Debian Stretch or Ubuntu 18.04), install from backports or PPA. +I recommend using a newer server version instead. + +To have the newest, V3 onion addresses (which I recommend) in Debian, install Tor from backports. +If you do not have backports, uncomment the stretch-backports links at the end of `/etc/apt/sources.list`. +Then install: +``` +apt update +apt -t stretch-backports -yq install tor +``` +**WARNING:** Onion instances not using a Tor version supporting V3 addresses will not be able to federate with you. + +Create the hidden service for your Pleroma instance in `/etc/tor/torrc`: +``` +HiddenServiceDir /var/lib/tor/pleroma_hidden_service/ +HiddenServicePort 80 127.0.0.1:8099 +HiddenServiceVersion 3 # Remove if Tor version is below 0.3 ( tor --version ) +``` +Restart Tor to generate an adress: +``` +systemctl restart tor@default.service +``` +Get the address: +``` +cat /var/lib/tor/pleroma_hidden_service/hostname +``` + +# Federation + +Next, edit your Pleroma config. +If running in prod, cd to your Pleroma directory, edit `config/prod.secret.exs` +and append this line: +``` +config :pleroma, :http, proxy_url: {:socks5, :localhost, 9050} +``` +In your Pleroma directory, assuming you're running prod, +run the following: +``` +su pleroma +MIX_ENV=prod mix deps.get +MIX_ENV=prod mix ecto.migrate +exit +``` +restart Pleroma (if using systemd): +``` +systemctl restart pleroma +``` + +# Tor Instance Access + +Make your instance accessible using Tor. + +## Tor-only Instance +If creating a Tor-only instance, open `config/prod.secret.exs` and under "config :pleroma, Pleroma.Web.Endpoint," edit "https" and "port: 443" to the following: +``` + url: [host: "onionaddress", scheme: "http", port: 80], +``` +In addition to that, replace the existing nginx config's contents with the example below. + +## Existing Instance (Clearnet Instance) +If not a Tor-only instance, +add the nginx config below to your existing config at `/etc/nginx/sites-enabled/pleroma.nginx`. + +--- +For both cases, disable CSP in Pleroma's config (STS is disabled by default) so you can define those yourself seperately from the clearnet (if your instance is also on the clearnet). +Copy the following into the `config/prod.secret.exs` in your Pleroma folder (/home/pleroma/pleroma/): +``` +config :pleroma, :http_security, + enabled: false +``` + +Use this as the Nginx config: +``` +proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=10g inactive=720m use_temp_path=off; +# The above already exists in a clearnet instance's config. +# If not, add it. + +server { + listen 127.0.0.1:8099; + server_name youronionaddress; + + # Comment to enable logs + access_log /dev/null; + error_log /dev/null; + + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/activity+json application/atom+xml; + + client_max_body_size 16m; + + location / { + + add_header X-XSS-Protection "1; mode=block"; + add_header X-Permitted-Cross-Domain-Policies none; + add_header X-Frame-Options DENY; + add_header X-Content-Type-Options nosniff; + add_header Referrer-Policy same-origin; + add_header X-Download-Options noopen; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + + proxy_pass http://localhost:4000; + + client_max_body_size 16m; + } + + location /proxy { + proxy_cache pleroma_media_cache; + proxy_cache_lock on; + proxy_ignore_client_abort on; + proxy_pass http://localhost:4000; + } +} +``` +reload Nginx: +``` +systemctl reload nginx +``` + +You should now be able to both access your instance using Tor and federate with other Tor instances! + +--- + +### Possible Issues + +* In Debian, make sure your hidden service folder `/var/lib/tor/pleroma_hidden_service/` and its contents, has debian-tor as both owner and group by using +``` +ls -la /var/lib/tor/ +``` +If it's not, run: +``` +chown -R debian-tor:debian-tor /var/lib/tor/pleroma_hidden_service/ +``` +* Make sure *only* the owner has *only* read and write permissions. +If not, run: +``` +chmod -R 600 /var/lib/tor/pleroma_hidden_service/ +``` +* If you have trouble logging in to the Mastodon Frontend when using Tor, use the Tor Browser Bundle. diff --git a/docs/config/small_customizations.md b/docs/config/small_customizations.md new file mode 100644 index 000000000..09e8d6041 --- /dev/null +++ b/docs/config/small_customizations.md @@ -0,0 +1,35 @@ +# Small customizations +Replace `dev.secret.exs` with `prod.secret.exs` according to your setup. + +# Thumbnail + +Replace `priv/static/instance/thumbnail.jpeg` with your selfie or other neat picture. It will appear in [Pleroma Instances](http://distsn.org/pleroma-instances.html). + +# Instance-specific panel + +![instance-specific panel demo](/uploads/296b19ec806b130e0b49b16bfe29ce8a/image.png) + +To show the instance specific panel, set `show_instance_panel` to `true` in `config/dev.secret.exs`. You can modify its content by editing `priv/static/instance/panel.html`. + +# Background + +You can change the background of your Pleroma instance by uploading it to `priv/static/static`, and then changing `"background"` in `config/dev.secret.exs` accordingly. + +# Logo + +![logo modification demo](/uploads/c70b14de60fa74245e7f0dcfa695ebff/image.png) + +If you want to give a brand to your instance, look no further. You can change the logo of your instance by uploading it to `priv/static/static`, and then changing `logo` in `config/dev.secret.exs` accordingly. + +# Theme + +All users of your instance will be able to change the theme they use by going to the settings (the cog in the top-right hand corner). However, if you wish to change the default theme, you can do so by editing `theme` in `config/dev.secret.exs` accordingly. + +# Terms of Service + +Terms of Service will be shown to all users on the registration page. It's the best place where to write down the rules for your instance. You can modify the rules by changing `priv/static/static/terms-of-service.html`. + +# Message Visibility + +To enable message visibility options when posting like in the Mastodon frontend, set +`scope_options_enabled` to `true` in `config/dev.secret.exs`. diff --git a/docs/config/static_dir.md b/docs/config/static_dir.md new file mode 100644 index 000000000..0cc52b99a --- /dev/null +++ b/docs/config/static_dir.md @@ -0,0 +1,20 @@ +# Static Directory + +Static frontend files are shipped in `priv/static/` and tracked by version control in this repository. If you want to overwrite or update these without the possibility of merge conflicts, you can write your custom versions to `instance/static/`. + +``` +config :pleroma, :instance, + static_dir: "instance/static/", +``` + +You can overwrite this value in your configuration to use a different static instance directory. + +## robots.txt + +By default, the `robots.txt` that ships in `priv/static/` is permissive. It allows well-behaved search engines to index all of your instance's URIs. + +If you want to generate a restrictive `robots.txt`, you can run the following mix task. The generated `robots.txt` will be written in your instance static directory. + +``` +mix pleroma.robots_txt disallow_all +``` diff --git a/docs/fuckgitlablol.sh b/docs/fuckgitlablol.sh new file mode 100755 index 000000000..32e7b8998 --- /dev/null +++ b/docs/fuckgitlablol.sh @@ -0,0 +1,12 @@ +#!/bin/sh +lstr=`ls -A1 *.md` +readarray -t lsarr <<<"$lstr" +for i in "${lsarr[@]}" +do + : + echo $i + title=`echo $i | sed 's/-/\ /g' | sed 's/\.md//g'` + echo $title + echo -e "# $title\n$(cat $i)" > $i +done + diff --git a/docs/installation/alpine_linux_en.md b/docs/installation/alpine_linux_en.md new file mode 100644 index 000000000..c493816d6 --- /dev/null +++ b/docs/installation/alpine_linux_en.md @@ -0,0 +1,215 @@ +# Installing on Alpine Linux +## Installation + +This guide is a step-by-step installation guide for Alpine Linux. It also assumes that you have administrative rights, either as root or a user with [sudo permissions](https://www.linode.com/docs/tools-reference/custom-kernels-distros/install-alpine-linux-on-your-linode/#configuration). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su -l -s $SHELL -c 'command'` instead. + +### Required packages + +* `postgresql` +* `elixir` +* `erlang` +* `erlang-parsetools` +* `erlang-xmerl` +* `git` +* Development Tools + +#### Optional packages used in this guide + +* `nginx` (preferred, example configs for other reverse proxies can be found in the repo) +* `certbot` (or any other ACME client for Let’s Encrypt certificates) + +### Prepare the system + +* First make sure to have the community repository enabled: + +```shell +echo "https://nl.alpinelinux.org/alpine/latest-stable/community" | sudo tee -a /etc/apk/repository +``` + +* Then update the system, if not already done: + +```shell +sudo apk update +sudo apk upgrade +``` + +* Install some tools, which are needed later: + +```shell +sudo apk add git build-base +``` + +### Install Elixir and Erlang + +* Install Erlang and Elixir: + +```shell +sudo apk add erlang erlang-runtime-tools erlang-xmerl elixir +``` + +* Install `erlang-eldap` if you want to enable ldap authenticator + +```shell +sudo apk add erlang-eldap +``` +### Install PostgreSQL + +* Install Postgresql server: + +```shell +sudo apk add postgresql postgresql-contrib +``` + +* Initialize database: + +```shell +sudo /etc/init.d/postgresql start +``` + +* Enable and start postgresql server: + +```shell +sudo rc-update add postgresql +``` + +### Install PleromaBE + +* Add a new system user for the Pleroma service: + +```shell +sudo adduser -S -s /bin/false -h /opt/pleroma -H pleroma +``` + +**Note**: To execute a single command as the Pleroma system user, use `sudo -Hu pleroma command`. You can also switch to a shell by using `sudo -Hu pleroma $SHELL`. If you don’t have and want `sudo` on your system, you can use `su` as root user (UID 0) for a single command by using `su -l pleroma -s $SHELL -c 'command'` and `su -l pleroma -s $SHELL` for starting a shell. + +* Git clone the PleromaBE repository and make the Pleroma user the owner of the directory: + +```shell +sudo mkdir -p /opt/pleroma +sudo chown -R pleroma:pleroma /opt/pleroma +sudo -Hu pleroma git clone https://git.pleroma.social/pleroma/pleroma /opt/pleroma +``` + +* Change to the new directory: + +```shell +cd /opt/pleroma +``` + +* Install the dependencies for Pleroma and answer with `yes` if it asks you to install `Hex`: + +```shell +sudo -Hu pleroma mix deps.get +``` + +* Generate the configuration: `sudo -Hu pleroma mix pleroma.instance gen` + * Answer with `yes` if it asks you to install `rebar3`. + * This may take some time, because parts of pleroma get compiled first. + * After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`. + +* Check the configuration and if all looks right, rename it, so Pleroma will load it (`prod.secret.exs` for productive instance, `dev.secret.exs` for development instances): + +```shell +mv config/{generated_config.exs,prod.secret.exs} +``` + +* The previous command creates also the file `config/setup_db.psql`, with which you can create the database: + +```shell +sudo -Hu postgres psql -f config/setup_db.psql +``` + +* Now run the database migration: + +```shell +sudo -Hu pleroma MIX_ENV=prod mix ecto.migrate +``` + +* Now you can start Pleroma already + +```shell +sudo -Hu pleroma MIX_ENV=prod mix phx.server +``` + +### Finalize installation + +If you want to open your newly installed instance to the world, you should run nginx or some other webserver/proxy in front of Pleroma and you should consider to create an OpenRC service file for Pleroma. + +#### Nginx + +* Install nginx, if not already done: + +```shell +sudo apk add nginx +``` + +* Setup your SSL cert, using your method of choice or certbot. If using certbot, first install it: + +```shell +sudo apk add certbot +``` + +and then set it up: + +```shell +sudo mkdir -p /var/lib/letsencrypt/ +sudo certbot certonly --email -d --standalone +``` + +If that doesn’t work, make sure, that nginx is not already running. If it still doesn’t work, try setting up nginx first (change ssl “on” to “off” and try again). + +* Copy the example nginx configuration to the nginx folder + +```shell +sudo cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/conf.d/pleroma.conf +``` + +* Before starting nginx edit the configuration and change it to your needs (e.g. change servername, change cert paths) +* Enable and start nginx: + +```shell +sudo rc-update add nginx +sudo service nginx start +``` + +If you need to renew the certificate in the future, uncomment the relevant location block in the nginx config and run: + +```shell +sudo certbot certonly --email -d --webroot -w /var/lib/letsencrypt/ +``` + +#### OpenRC service + +* Copy example service file: + +```shell +sudo cp /opt/pleroma/installation/init.d/pleroma /etc/init.d/pleroma +``` + +* Make sure to start it during the boot + +```shell +sudo rc-update add pleroma +``` + +#### Create your first user + +If your instance is up and running, you can create your first user with administrative rights with the following task: + +```shell +sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new --admin +``` + +#### Further reading + +* [Admin tasks](Admin tasks) +* [Backup your instance](Backup-your-instance) +* [Configuration tips](General tips for customizing pleroma fe) +* [Hardening your instance](Hardening-your-instance) +* [How to activate mediaproxy](How-to-activate-mediaproxy) +* [Small Pleroma-FE customizations](Small customizations) +* [Updating your instance](Updating-your-instance) + +## Questions + +Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**. diff --git a/docs/installation/arch_linux_en.md b/docs/installation/arch_linux_en.md new file mode 100644 index 000000000..4b3bbbbb0 --- /dev/null +++ b/docs/installation/arch_linux_en.md @@ -0,0 +1,214 @@ +# Installing on Arch Linux +## Installation + +This guide will assume that you have administrative rights, either as root or a user with [sudo permissions](https://wiki.archlinux.org/index.php/Sudo). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su -s $SHELL -c 'command'` instead. + +### Required packages + +* `postgresql` +* `elixir` +* `erlang-unixodbc` +* `git` +* `base-devel` + +#### Optional packages used in this guide + +* `nginx` (preferred, example configs for other reverse proxies can be found in the repo) +* `certbot` (or any other ACME client for Let’s Encrypt certificates) + +### Prepare the system + +* First update the system, if not already done: + +```shell +sudo pacman -Syu +``` + +* Install some of the above mentioned programs: + +```shell +sudo pacman -S git base-devel elixir erlang-unixodbc +``` + +### Install PostgreSQL + +[Arch Wiki article](https://wiki.archlinux.org/index.php/PostgreSQL) + +* Install the `postgresql` package: + +```shell +sudo pacman -S postgresql +``` + +* Initialize the database cluster: + +```shell +sudo -iu postgres initdb -D /var/lib/postgres/data +``` + +* Start and enable the `postgresql.service` + +```shell +sudo systemctl enable --now postgresql.service +``` + +### Install PleromaBE + +* Add a new system user for the Pleroma service: + +```shell +sudo useradd -r -s /bin/false -m -d /var/lib/pleroma -U pleroma +``` + +**Note**: To execute a single command as the Pleroma system user, use `sudo -Hu pleroma command`. You can also switch to a shell by using `sudo -Hu pleroma $SHELL`. If you don’t have and want `sudo` on your system, you can use `su` as root user (UID 0) for a single command by using `su -l pleroma -s $SHELL -c 'command'` and `su -l pleroma -s $SHELL` for starting a shell. + +* Git clone the PleromaBE repository and make the Pleroma user the owner of the directory: + +```shell +sudo mkdir -p /opt/pleroma +sudo chown -R pleroma:pleroma /opt/pleroma +sudo -Hu pleroma git clone https://git.pleroma.social/pleroma/pleroma /opt/pleroma +``` + +* Change to the new directory: + +```shell +cd /opt/pleroma +``` + +* Install the dependencies for Pleroma and answer with `yes` if it asks you to install `Hex`: + +```shell +sudo -Hu pleroma mix deps.get +``` + +* Generate the configuration: `sudo -Hu pleroma mix pleroma.instance gen` + * Answer with `yes` if it asks you to install `rebar3`. + * This may take some time, because parts of pleroma get compiled first. + * After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`. + +* Check the configuration and if all looks right, rename it, so Pleroma will load it (`prod.secret.exs` for productive instance, `dev.secret.exs` for development instances): + +```shell +mv config/{generated_config.exs,prod.secret.exs} +``` + +* The previous command creates also the file `config/setup_db.psql`, with which you can create the database: + +```shell +sudo -Hu postgres psql -f config/setup_db.psql +``` + +* Now run the database migration: + +```shell +sudo -Hu pleroma MIX_ENV=prod mix ecto.migrate +``` + +* Now you can start Pleroma already + +```shell +sudo -Hu pleroma MIX_ENV=prod mix phx.server +``` + +### Finalize installation + +If you want to open your newly installed instance to the world, you should run nginx or some other webserver/proxy in front of Pleroma and you should consider to create a systemd service file for Pleroma. + +#### Nginx + +* Install nginx, if not already done: + +```shell +sudo pacman -S nginx +``` + +* Create directories for available and enabled sites: + +```shell +sudo mkdir -p /etc/nginx/sites-{available,enabled} +``` + +* Append the following line at the end of the `http` block in `/etc/nginx/nginx.conf`: + +```Nginx +include sites-enabled/*; +``` + +* Setup your SSL cert, using your method of choice or certbot. If using certbot, first install it: + +```shell +sudo pacman -S certbot certbot-nginx +``` + +and then set it up: + +```shell +sudo mkdir -p /var/lib/letsencrypt/ +sudo certbot certonly --email -d --standalone +``` + +If that doesn’t work, make sure, that nginx is not already running. If it still doesn’t work, try setting up nginx first (change ssl “on” to “off” and try again). + +--- + +* Copy the example nginx configuration and activate it: + +```shell +sudo cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.nginx +sudo ln -s /etc/nginx/sites-available/pleroma.nginx /etc/nginx/sites-enabled/pleroma.nginx +``` + +* Before starting nginx edit the configuration and change it to your needs (e.g. change servername, change cert paths) +* Enable and start nginx: + +```shell +sudo systemctl enable --now nginx.service +``` + +If you need to renew the certificate in the future, uncomment the relevant location block in the nginx config and run: + +```shell +sudo certbot certonly --email -d --webroot -w /var/lib/letsencrypt/ +``` + +#### Other webserver/proxies + +You can find example configurations for them in `/opt/pleroma/installation/`. + +#### Systemd service + +* Copy example service file + +```shell +sudo cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service +``` + +* Edit the service file and make sure that all paths fit your installation +* Enable and start `pleroma.service`: + +```shell +sudo systemctl enable --now pleroma.service +``` + +#### Create your first user + +If your instance is up and running, you can create your first user with administrative rights with the following task: + +```shell +sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new --admin +``` + +#### Further reading + +* [Admin tasks](Admin tasks) +* [Backup your instance](Backup-your-instance) +* [Configuration tips](General tips for customizing pleroma fe) +* [Hardening your instance](Hardening-your-instance) +* [How to activate mediaproxy](How-to-activate-mediaproxy) +* [Small Pleroma-FE customizations](Small customizations) +* [Updating your instance](Updating-your-instance) + +## Questions + +Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**. diff --git a/docs/installation/centos7_en.md b/docs/installation/centos7_en.md new file mode 100644 index 000000000..76de21ed8 --- /dev/null +++ b/docs/installation/centos7_en.md @@ -0,0 +1,277 @@ +# Installing on CentOS 7 +## Installation + +This guide is a step-by-step installation guide for CentOS 7. It also assumes that you have administrative rights, either as root or a user with [sudo permissions](https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-centos-quickstart). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su -s $SHELL -c 'command'` instead. + +### Required packages + +* `postgresql` (9,6+, CentOS 7 comes with 9.2, we will install version 11 in this guide) +* `elixir` (1.5+) +* `erlang` +* `erlang-parsetools` +* `erlang-xmerl` +* `git` +* Development Tools + +#### Optional packages used in this guide + +* `nginx` (preferred, example configs for other reverse proxies can be found in the repo) +* `certbot` (or any other ACME client for Let’s Encrypt certificates) + +### Prepare the system + +* First update the system, if not already done: + +```shell +sudo yum update +``` + +* Install some of the above mentioned programs: + +```shell +sudo yum install wget git unzip +``` + +* Install development tools: + +```shell +sudo yum group install "Development Tools" +``` + +### Install Elixir and Erlang + +* Add the EPEL repo: + +```shell +sudo yum install epel-release +sudo yum -y update +``` + +* Install Erlang repository: + +```shell +wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm +sudo rpm -Uvh erlang-solutions-1.0-1.noarch.rpm +``` + +* Install Erlang: + +```shell +sudo yum install erlang erlang-parsetools erlang-xmerl +``` + +* Download [latest Elixir release from Github](https://github.com/elixir-lang/elixir/releases/tag/v1.8.1) (Example for the newest version at the time when this manual was written) + +```shell +wget -P /tmp/ https://github.com/elixir-lang/elixir/releases/download/v1.8.1/Precompiled.zip +``` + +* Create folder where you want to install Elixir, we’ll use: + +```shell +sudo mkdir -p /opt/elixir +``` + +* Unzip downloaded file there: + +```shell +sudo unzip /tmp/Precompiled.zip -d /opt/elixir +``` + +* Create symlinks for the pre-compiled binaries: + +```shell +for e in elixir elixirc iex mix; do sudo ln -s /opt/elixir/bin/${e} /usr/local/bin/${e}; done +``` + +### Install PostgreSQL + +* Add the Postgresql repository: + +```shell +sudo yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm +``` + +* Install the Postgresql server: + +```shell +sudo yum install postgresql11-server postgresql11-contrib +``` + +* Initialize database: + +```shell +sudo /usr/pgsql-11/bin/postgresql-11-setup initdb +``` + +* Open configuration file `/var/lib/pgsql/11/data/pg_hba.conf` and change the following lines from: + +```plain +# IPv4 local connections: +host all all 127.0.0.1/32 ident +# IPv6 local connections: +host all all ::1/128 ident +``` + +to + +```plain +# IPv4 local connections: +host all all 127.0.0.1/32 md5 +# IPv6 local connections: +host all all ::1/128 md5 +``` + +* Enable and start postgresql server: + +```shell +sudo systemctl enable --now postgresql-11.service +``` + +### Install PleromaBE + +* Add a new system user for the Pleroma service: + +```shell +sudo useradd -r -s /bin/false -m -d /var/lib/pleroma -U pleroma +``` + +**Note**: To execute a single command as the Pleroma system user, use `sudo -Hu pleroma command`. You can also switch to a shell by using `sudo -Hu pleroma $SHELL`. If you don’t have and want `sudo` on your system, you can use `su` as root user (UID 0) for a single command by using `su -l pleroma -s $SHELL -c 'command'` and `su -l pleroma -s $SHELL` for starting a shell. + +* Git clone the PleromaBE repository and make the Pleroma user the owner of the directory: + +```shell +sudo mkdir -p /opt/pleroma +sudo chown -R pleroma:pleroma /opt/pleroma +sudo -Hu pleroma git clone https://git.pleroma.social/pleroma/pleroma /opt/pleroma +``` + +* Change to the new directory: + +```shell +cd /opt/pleroma +``` + +* Install the dependencies for Pleroma and answer with `yes` if it asks you to install `Hex`: + +```shell +sudo -Hu pleroma mix deps.get +``` + +* Generate the configuration: `sudo -Hu pleroma mix pleroma.instance gen` + * Answer with `yes` if it asks you to install `rebar3`. + * This may take some time, because parts of pleroma get compiled first. + * After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`. + +* Check the configuration and if all looks right, rename it, so Pleroma will load it (`prod.secret.exs` for productive instance, `dev.secret.exs` for development instances): + +```shell +mv config/{generated_config.exs,prod.secret.exs} +``` + +* The previous command creates also the file `config/setup_db.psql`, with which you can create the database: + +```shell +sudo -Hu postgres psql -f config/setup_db.psql +``` + +* Now run the database migration: + +```shell +sudo -Hu pleroma MIX_ENV=prod mix ecto.migrate +``` + +* Now you can start Pleroma already + +```shell +sudo -Hu pleroma MIX_ENV=prod mix phx.server +``` + +### Finalize installation + +If you want to open your newly installed instance to the world, you should run nginx or some other webserver/proxy in front of Pleroma and you should consider to create a systemd service file for Pleroma. + +#### Nginx + +* Install nginx, if not already done: + +```shell +sudo yum install nginx +``` + +* Setup your SSL cert, using your method of choice or certbot. If using certbot, first install it: + +```shell +sudo yum install certbot-nginx +``` + +and then set it up: + +```shell +sudo mkdir -p /var/lib/letsencrypt/ +sudo certbot certonly --email -d --standalone +``` + +If that doesn’t work, make sure, that nginx is not already running. If it still doesn’t work, try setting up nginx first (change ssl “on” to “off” and try again). + +--- + +* Copy the example nginx configuration to the nginx folder + +```shell +sudo cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/conf.d/pleroma.conf +``` + +* Before starting nginx edit the configuration and change it to your needs (e.g. change servername, change cert paths) +* Enable and start nginx: + +```shell +sudo systemctl enable --now nginx +``` + +If you need to renew the certificate in the future, uncomment the relevant location block in the nginx config and run: + +```shell +sudo certbot certonly --email -d --webroot -w /var/lib/letsencrypt/ +``` + +#### Other webserver/proxies + +You can find example configurations for them in `/opt/pleroma/installation/`. + +#### Systemd service + +* Copy example service file + +```shell +sudo cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service +``` + +* Edit the service file and make sure that all paths fit your installation +* Enable and start `pleroma.service`: + +```shell +sudo systemctl enable --now pleroma.service +``` + +#### Create your first user + +If your instance is up and running, you can create your first user with administrative rights with the following task: + +```shell +sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new --admin +``` + +#### Further reading + +* [Admin tasks](Admin tasks) +* [Backup your instance](Backup-your-instance) +* [Configuration tips](General tips for customizing pleroma fe) +* [Hardening your instance](Hardening-your-instance) +* [How to activate mediaproxy](How-to-activate-mediaproxy) +* [Small Pleroma-FE customizations](Small customizations) +* [Updating your instance](Updating-your-instance) + +## Questions + +Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**. diff --git a/docs/installation/debian_based_en.md b/docs/installation/debian_based_en.md new file mode 100644 index 000000000..9613a329b --- /dev/null +++ b/docs/installation/debian_based_en.md @@ -0,0 +1,202 @@ +# Installing on Debian Based Distributions +## Installation + +This guide will assume you are on Debian Stretch. This guide should also work with Ubuntu 16.04 and 18.04. It also assumes that you have administrative rights, either as root or a user with [sudo permissions](https://www.digitalocean.com/community/tutorials/how-to-add-delete-and-grant-sudo-privileges-to-users-on-a-debian-vps). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su -s $SHELL -c 'command'` instead. + +### Required packages + +* `postgresql` (9.6+, Ubuntu 16.04 comes with 9.5, you can get a newer version from [here](https://www.postgresql.org/download/linux/ubuntu/)) +* `postgresql-contrib` (9.6+, same situtation as above) +* `elixir` (1.5+, [install from here, Debian and Ubuntu ship older versions](https://elixir-lang.org/install.html#unix-and-unix-like) or use [asdf](https://github.com/asdf-vm/asdf) as the pleroma user) +* `erlang-dev` +* `erlang-tools` +* `erlang-parsetools` +* `erlang-eldap`, if you want to enable ldap authenticator +* `erlang-xmerl` +* `git` +* `build-essential` + +#### Optional packages used in this guide + +* `nginx` (preferred, example configs for other reverse proxies can be found in the repo) +* `certbot` (or any other ACME client for Let’s Encrypt certificates) + +### Prepare the system + +* First update the system, if not already done: + +```shell +sudo apt update +sudo apt full-upgrade +``` + +* Install some of the above mentioned programs: + +```shell +sudo apt install git build-essential postgresql postgresql-contrib +``` + +### Install Elixir and Erlang + +* Download and add the Erlang repository: + +```shell +wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb +sudo dpkg -i /tmp/erlang-solutions_1.0_all.deb +``` + +* Install Elixir and Erlang: + +```shell +sudo apt update +sudo apt install elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools +``` + +### Install PleromaBE + +* Add a new system user for the Pleroma service: + +```shell +sudo useradd -r -s /bin/false -m -d /var/lib/pleroma -U pleroma +``` + +**Note**: To execute a single command as the Pleroma system user, use `sudo -Hu pleroma command`. You can also switch to a shell by using `sudo -Hu pleroma $SHELL`. If you don’t have and want `sudo` on your system, you can use `su` as root user (UID 0) for a single command by using `su -l pleroma -s $SHELL -c 'command'` and `su -l pleroma -s $SHELL` for starting a shell. + +* Git clone the PleromaBE repository and make the Pleroma user the owner of the directory: + +```shell +sudo mkdir -p /opt/pleroma +sudo chown -R pleroma:pleroma /opt/pleroma +sudo -Hu pleroma git clone https://git.pleroma.social/pleroma/pleroma /opt/pleroma +``` + +* Change to the new directory: + +```shell +cd /opt/pleroma +``` + +* Install the dependencies for Pleroma and answer with `yes` if it asks you to install `Hex`: + +```shell +sudo -Hu pleroma mix deps.get +``` + +* Generate the configuration: `sudo -Hu pleroma mix pleroma.instance gen` + * Answer with `yes` if it asks you to install `rebar3`. + * This may take some time, because parts of pleroma get compiled first. + * After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`. + +* Check the configuration and if all looks right, rename it, so Pleroma will load it (`prod.secret.exs` for productive instance, `dev.secret.exs` for development instances): + +```shell +mv config/{generated_config.exs,prod.secret.exs} +``` + +* The previous command creates also the file `config/setup_db.psql`, with which you can create the database: + +```shell +sudo -Hu postgres psql -f config/setup_db.psql +``` + +* Now run the database migration: + +```shell +sudo -Hu pleroma MIX_ENV=prod mix ecto.migrate +``` + +* Now you can start Pleroma already + +```shell +sudo -Hu pleroma MIX_ENV=prod mix phx.server +``` + +### Finalize installation + +If you want to open your newly installed instance to the world, you should run nginx or some other webserver/proxy in front of Pleroma and you should consider to create a systemd service file for Pleroma. + +#### Nginx + +* Install nginx, if not already done: + +```shell +sudo apt install nginx +``` + +* Setup your SSL cert, using your method of choice or certbot. If using certbot, first install it: + +```shell +sudo apt install certbot +``` + +and then set it up: + +```shell +sudo mkdir -p /var/lib/letsencrypt/ +sudo certbot certonly --email -d --standalone +``` + +If that doesn’t work, make sure, that nginx is not already running. If it still doesn’t work, try setting up nginx first (change ssl “on” to “off” and try again). + +--- + +* Copy the example nginx configuration and activate it: + +```shell +sudo cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.nginx +sudo ln -s /etc/nginx/sites-available/pleroma.nginx /etc/nginx/sites-enabled/pleroma.nginx +``` + +* Before starting nginx edit the configuration and change it to your needs (e.g. change servername, change cert paths) +* Enable and start nginx: + +```shell +sudo systemctl enable --now nginx.service +``` + +If you need to renew the certificate in the future, uncomment the relevant location block in the nginx config and run: + +```shell +sudo certbot certonly --email -d --webroot -w /var/lib/letsencrypt/ +``` + +#### Other webserver/proxies + +You can find example configurations for them in `/opt/pleroma/installation/`. + +#### Systemd service + +* Copy example service file + +```shell +sudo cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service +``` + +* Edit the service file and make sure that all paths fit your installation +* Enable and start `pleroma.service`: + +```shell +sudo systemctl enable --now pleroma.service +``` + +#### Create your first user + +If your instance is up and running, you can create your first user with administrative rights with the following task: + +```shell +sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new --admin +``` + +#### Further reading + +* [Admin tasks](Admin tasks) +* [Backup your instance](Backup-your-instance) +* [Configuration tips](General tips for customizing pleroma fe) +* [Hardening your instance](Hardening-your-instance) +* [How to activate mediaproxy](How-to-activate-mediaproxy) +* [Small Pleroma-FE customizations](Small customizations) +* [Updating your instance](Updating-your-instance) + +## Questions + +Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**. diff --git a/docs/installation/debian_based_jp.md b/docs/installation/debian_based_jp.md new file mode 100644 index 000000000..ac5dcaaee --- /dev/null +++ b/docs/installation/debian_based_jp.md @@ -0,0 +1,191 @@ +# Pleromaの入れ方 +## 日本語訳について + +この記事は [Installing on Debian based distributions](Installing on Debian based distributions) の日本語訳です。何かがおかしいと思ったら、原文を見てください。 + +## インストール + +このガイドはDebian Stretchを仮定しています。Ubuntu 16.04でも可能です。 + +### 必要なソフトウェア + +- PostgreSQL 9.6+ (postgresql-contrib-9.6 または他のバージョンの PSQL をインストールしてください) +- Elixir 1.5 以上 ([Debianのリポジトリからインストールしないこと!!! ここからインストールすること!](https://elixir-lang.org/install.html#unix-and-unix-like))。または [asdf](https://github.com/asdf-vm/asdf) を pleroma ユーザーでインストール。 +- erlang-dev +- erlang-tools +- erlang-parsetools +- erlang-xmerl (Jessieではバックポートからインストールすること!) +- git +- build-essential +- openssh +- openssl +- nginx prefered (Apacheも動くかもしれませんが、誰もテストしていません!) +- certbot (または何らかのACME Let's encryptクライアント) + +### システムを準備する + +* まずシステムをアップデートしてください。 +``` +apt update && apt dist-upgrade +``` + +* 複数のツールとpostgresqlをインストールします。あとで必要になるので。 +``` +apt install git build-essential openssl ssh sudo postgresql-9.6 postgresql-contrib-9.6 +``` +(postgresqlのバージョンは、あなたのディストロにあわせて変えてください。または、バージョン番号がいらないかもしれません。) + +### ElixirとErlangをインストールします + +* Erlangのリポジトリをダウンロードおよびインストールします。 +``` +wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i /tmp/erlang-solutions_1.0_all.deb +``` + +* ElixirとErlangをインストールします、 +``` +apt update && apt install elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools +``` + +### Pleroma BE (バックエンド) をインストールします + +* 新しいユーザーを作ります。 +``` +adduser pleroma +``` +(Give it any password you want, make it STRONG) + +* 新しいユーザーをsudoグループに入れます。 +``` +usermod -aG sudo pleroma +``` + +* 新しいユーザーに変身し、ホームディレクトリに移動します。 +``` +su pleroma +cd ~ +``` + +* Gitリポジトリをクローンします。 +``` +git clone https://git.pleroma.social/pleroma/pleroma +``` + +* 新しいディレクトリに移動します。 +``` +cd pleroma/ +``` + +* Pleromaが依存するパッケージをインストールします。Hexをインストールしてもよいか聞かれたら、yesを入力してください。 +``` +mix deps.get +``` + +* コンフィギュレーションを生成します。 +``` +mix pleroma.instance gen +``` + * rebar3をインストールしてもよいか聞かれたら、yesを入力してください。 + * この処理には時間がかかります。私もよく分かりませんが、何らかのコンパイルが行われているようです。 + * あなたのインスタンスについて、いくつかの質問があります。その回答は `config/generated_config.exs` というコンフィギュレーションファイルに保存されます。 + +**注意**: メディアプロクシを有効にすると回答して、なおかつ、キャッシュのURLは空欄のままにしている場合は、`generated_config.exs` を編集して、`base_url` で始まる行をコメントアウトまたは削除してください。そして、上にある行の `true` の後にあるコンマを消してください。 + +* コンフィギュレーションを確認して、もし問題なければ、ファイル名を変更してください。 +``` +mv config/{generated_config.exs,prod.secret.exs} +``` + +* これまでのコマンドで、すでに `config/setup_db.psql` というファイルが作られています。このファイルをもとに、データベースを作成します。 +``` +sudo su postgres -c 'psql -f config/setup_db.psql' +``` + +* そして、データベースのミグレーションを実行します。 +``` +MIX_ENV=prod mix ecto.migrate +``` + +* Pleromaを起動できるようになりました。 +``` +MIX_ENV=prod mix phx.server +``` + +### インストールを終わらせる + +あなたの新しいインスタンスを世界に向けて公開するには、nginxまたは何らかのウェブサーバー (プロクシ) を使用する必要があります。また、Pleroma のためにシステムサービスファイルを作成する必要があります。 + +#### Nginx + +* まだインストールしていないなら、nginxをインストールします。 +``` +apt install nginx +``` + +* SSLをセットアップします。他の方法でもよいですが、ここではcertbotを説明します。 +certbotを使うならば、まずそれをインストールします。 +``` +apt install certbot +``` +そしてセットアップします。 +``` +mkdir -p /var/lib/letsencrypt/.well-known +% certbot certonly --email your@emailaddress --webroot -w /var/lib/letsencrypt/ -d yourdomain +``` +もしうまくいかないときは、先にnginxを設定してください。ssl "on" を "off" に変えてから再試行してください。 + +--- + +* nginxコンフィギュレーションの例をnginxフォルダーにコピーします。 +``` +cp /home/pleroma/pleroma/installation/pleroma.nginx /etc/nginx/sites-enabled/pleroma.nginx +``` + +* nginxを起動する前に、コンフィギュレーションを編集してください。例えば、サーバー名、証明書のパスなどを変更する必要があります。 +* nginxを再起動します。 +``` +systemctl reload nginx.service +``` + +#### Systemd サービス + +* サービスファイルの例をコピーします。 +``` +cp /home/pleroma/pleroma/installation/pleroma.service /usr/lib/systemd/system/pleroma.service +``` + +* サービスファイルを変更します。すべてのパスが正しいことを確認してください。また、`[Service]` セクションに以下の行があることを確認してください。 +``` +Environment="MIX_ENV=prod" +``` + +* `pleroma.service` を enable および start してください。 +``` +systemctl enable --now pleroma.service +``` + +#### モデレーターを作る + +新たにユーザーを作ったら、モデレーター権限を与えたいかもしれません。以下のタスクで可能です。 +``` +mix set_moderator username [true|false] +``` + +モデレーターはすべてのポストを消すことができます。将来的には他のことも可能になるかもしれません。 + +#### メディアプロクシを有効にする + +`generate_config` でメディアプロクシを有効にしているなら、すでにメディアプロクシが動作しています。あとから設定を変更したいなら、[How to activate mediaproxy](How-to-activate-mediaproxy) を見てください。 + +#### コンフィギュレーションとカスタマイズ + +* [Configuration tips](General tips for customizing pleroma fe) +* [Small Pleroma-FE customizations](Small customizations) +* [Admin tasks](Admin tasks) + +## 質問ある? + +インストールについて質問がある、もしくは、うまくいかないときは、以下のところで質問できます。 + +* [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) +* **Freenode** の **#pleroma** IRCチャンネル diff --git a/docs/installation/netbsd_en.md b/docs/installation/netbsd_en.md new file mode 100644 index 000000000..e0ac98359 --- /dev/null +++ b/docs/installation/netbsd_en.md @@ -0,0 +1,198 @@ +# Installing on NetBSD + +## Required software + +pkgin should have been installed by the NetBSD installer if you selected +the right options. If it isn't installed, install it using pkg_add. + +Note that `postgresql11-contrib` is needed for the Postgres extensions +Pleroma uses. + +The `mksh` shell is needed to run the Elixir `mix` script. + +`# pkgin install acmesh elixir git-base git-docs mksh nginx postgresql11-server postgresql11-client postgresql11-contrib sudo` + +You can also build these packages using pkgsrc: +``` +databases/postgresql11-contrib +databases/postgresql11-client +databases/postgresql11-server +devel/git-base +devel/git-docs +lang/elixir +security/acmesh +security/sudo +shells/mksh +www/nginx +``` + +Copy the rc.d scripts to the right directory: + +``` +# cp /usr/pkg/share/examples/rc.d/nginx /usr/pkg/share/examples/rc.d/pgsql /etc/rc.d +``` + +Add nginx and Postgres to `/etc/rc.conf`: + +``` +nginx=YES +pgsql=YES +``` + +## Configuring postgres + +First, run `# /etc/rc.d/pgsql start`. Then, `$ sudo -Hu pgsql -g pgsql createdb`. + +## Configuring Pleroma + +Create a user for Pleroma: + +``` +# groupadd pleroma +# useradd -d /home/pleroma -m -g pleroma -s /usr/pkg/bin/mksh pleroma +# echo 'export LC_ALL="en_GB.UTF-8"' >> /home/pleroma/.profile +# su -l pleroma -c $SHELL +``` + +Clone the repository: + +``` +$ cd /home/pleroma +$ git clone https://git.pleroma.social/pleroma/pleroma.git +``` + +Configure Pleroma. Note that you need a domain name at this point: + +``` +$ cd /home/pleroma/pleroma +$ mix deps.get +$ mix pleroma.instance gen # You will be asked a few questions here. +``` + +Since Postgres is configured, we can now initialize the database. There should +now be a file in `config/setup_db.psql` that makes this easier. Edit it, and +*change the password* to a password of your choice. Make sure it is secure, since +it'll be protecting your database. Now initialize the database: + +``` +$ sudo -Hu pgsql -g pgsql psql -f config/setup_db.psql +``` + +Postgres allows connections from all users without a password by default. To +fix this, edit `/usr/pkg/pgsql/data/pg_hba.conf`. Change every `trust` to +`password`. + +Once this is done, restart Postgres with `# /etc/rc.d/pgsql restart`. + +Run the database migrations. +You will need to do this whenever you update with `git pull`: + +``` +$ MIX_ENV=prod mix ecto.migrate +``` + +## Configuring nginx + +Install the example configuration file +`/home/pleroma/pleroma/installation/pleroma.nginx` to +`/usr/pkg/etc/nginx.conf`. + +Note that it will need to be wrapped in a `http {}` block. You should add +settings for the nginx daemon outside of the http block, for example: + +``` +user nginx nginx; +error_log /var/log/nginx/error.log; +worker_processes 4; + +events { +} +``` + +Edit the defaults: + +* Change `ssl_certificate` and `ssl_trusted_certificate` to +`/etc/nginx/tls/fullchain`. +* Change `ssl_certificate_key` to `/etc/nginx/tls/key`. +* Change `example.tld` to your instance's domain name. + +## Configuring acme.sh + +We'll be using acme.sh in Stateless Mode for TLS certificate renewal. + +First, get your account fingerprint: + +``` +$ sudo -Hu nginx -g nginx acme.sh --register-account +``` + +You need to add the following to your nginx configuration for the server +running on port 80: + +``` + location ~ ^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)$ { + default_type text/plain; + return 200 "$1.6fXAG9VyG0IahirPEU2ZerUtItW2DHzDzD9wZaEKpqd"; + } +``` + +Replace the string after after `$1.` with your fingerprint. + +Start nginx: + +``` +# /etc/rc.d/nginx start +``` + +It should now be possible to issue a cert (replace `example.com` +with your domain name): + +``` +$ sudo -Hu nginx -g nginx acme.sh --issue -d example.com --stateless +``` + +Let's add auto-renewal to `/etc/daily.local` +(replace `example.com` with your domain): + +``` +/usr/pkg/bin/sudo -Hu nginx -g nginx \ + /usr/pkg/sbin/acme.sh -r \ + -d example.com \ + --cert-file /etc/nginx/tls/cert \ + --key-file /etc/nginx/tls/key \ + --ca-file /etc/nginx/tls/ca \ + --fullchain-file /etc/nginx/tls/fullchain \ + --stateless +``` + +## Creating a startup script for Pleroma + +Copy the startup script to the correct location and make sure it's executable: + +``` +# cp /home/pleroma/pleroma/installation/netbsd/rc.d/pleroma /etc/rc.d/pleroma +# chmod +x /etc/rc.d/pleroma +``` + +Add the following to `/etc/rc.conf`: + +``` +pleroma=YES +pleroma_home="/home/pleroma" +pleroma_user="pleroma" +``` + +Run `# /etc/rc.d/pleroma start` to start Pleroma. + +## Conclusion + +Restart nginx with `# /etc/rc.d/nginx restart` and you should be up and running. + +If you need further help, contact niaa on freenode. + +Make sure your time is in sync, or other instances will receive your posts with +incorrect timestamps. You should have ntpd running. + +## Instances running NetBSD + +* diff --git a/docs/installation/openbsd_en.md b/docs/installation/openbsd_en.md new file mode 100644 index 000000000..633b08e6c --- /dev/null +++ b/docs/installation/openbsd_en.md @@ -0,0 +1,222 @@ +# Installing on OpenBSD +This guide describes the installation and configuration of pleroma (and the required software to run it) on a single OpenBSD 6.4 server. +For any additional information regarding commands and configuration files mentioned here, check the man pages [online](https://man.openbsd.org/) or directly on your server with the man command. + +#### Required software +The following packages need to be installed: + * elixir + * gmake + * ImageMagick + * git + * postgresql-server + * postgresql-contrib + +To install them, run the following command (with doas or as root): +`pkg_add elixir gmake ImageMagick git postgresql-server postgresql-contrib` + +Pleroma requires a reverse proxy, OpenBSD has relayd in base (and is used in this guide) and packages/ports are available for nginx (www/nginx) and apache (www/apache-httpd). Independently of the reverse proxy, [acme-client(1)](https://man.openbsd.org/acme-client) can be used to get a certificate from Let's Encrypt. + +#### Creating the pleroma user +Pleroma will be run by a dedicated user, \_pleroma. Before creating it, insert the following lines in login.conf: +``` +pleroma:\ + :datasize-max=1536M:\ + :datasize-cur=1536M:\ + :openfiles-max=4096 +``` +This creates a "pleroma" login class and sets higher values than default for datasize and openfiles (see [login.conf(5)](https://man.openbsd.org/login.conf)), this is required to avoid having pleroma crash some time after starting. + +Create the \_pleroma user, assign it the pleroma login class and create its home directory (/home/\_pleroma/): `useradd -m -L pleroma _pleroma` + +#### Clone pleroma's directory +Enter a shell as the \_pleroma user. As root, run `su _pleroma -;cd`. Then clone the repository with `git clone https://git.pleroma.social/pleroma/pleroma.git`. Pleroma is now installed in /home/\_pleroma/pleroma/, it will be configured and started at the end of this guide. + +#### Postgresql +Start a shell as the \_postgresql user (as root run `su _postgresql -` then run the `initdb` command to initialize postgresql: +If you wish to not use the default location for postgresql's data (/var/postgresql/data), add the following switch at the end of the command: `-D ` and modify the `datadir` variable in the /etc/rc.d/postgresql script. + +When this is done, enable postgresql so that it starts on boot and start it. As root, run: +``` +rcctl enable postgresql +rcctl start postgresql +``` +To check that it started properly and didn't fail right after starting, you can run `ps aux | grep postgres`, there should be multiple lines of output. + +#### httpd +httpd will have three fuctions: + * redirect requests trying to reach the instance over http to the https URL + * serve a robots.txt file + * get Let's Encrypt certificates, with acme-client + +Insert the following config in httpd.conf: +``` +# $OpenBSD: httpd.conf,v 1.17 2017/04/16 08:50:49 ajacoutot Exp $ + +ext_inet="" +ext_inet6="" + +server "default" { + listen on $ext_inet port 80 # Comment to disable listening on IPv4 + listen on $ext_inet6 port 80 # Comment to disable listening on IPv6 + listen on 127.0.0.1 port 80 # Do NOT comment this line + + log syslog + directory no index + + location "/.well-known/acme-challenge/*" { + root "/acme" + request strip 2 + } + + location "/robots.txt" { root "/htdocs/local/" } + location "/*" { block return 302 "https://$HTTP_HOST$REQUEST_URI" } +} + +types { + include "/usr/share/misc/mime.types" +} +``` +Do not forget to change *\* to your server's address(es). If httpd should only listen on one protocol family, comment one of the two first *listen* options. + +Create the /var/www/htdocs/local/ folder and write the content of your robots.txt in /var/www/htdocs/local/robots.txt. +Check the configuration with `httpd -n`, if it is OK enable and start httpd (as root): +``` +rcctl enable httpd +rcctl start httpd +``` + +#### acme-client +acme-client is used to get SSL/TLS certificates from Let's Encrypt. +Insert the following configuration in /etc/acme-client.conf: +``` +# +# $OpenBSD: acme-client.conf,v 1.4 2017/03/22 11:14:14 benno Exp $ +# + +authority letsencrypt- { + #agreement url "https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf" + api url "https://acme-v01.api.letsencrypt.org/directory" + account key "/etc/acme/letsencrypt-privkey-.pem" +} + +domain { + domain key "/etc/ssl/private/.key" + domain certificate "/etc/ssl/.crt" + domain full chain certificate "/etc/ssl/.fullchain.pem" + sign with letsencrypt- + challengedir "/var/www/acme/" +} +``` +Replace *\* by the domain name you'll use for your instance. As root, run `acme-client -n` to check the config, then `acme-client -ADv ` to create account and domain keys, and request a certificate for the first time. +Make acme-client run everyday by adding it in /etc/daily.local. As root, run the following command: `echo "acme-client " >> /etc/daily.local`. + +Relayd will look for certificates and keys based on the address it listens on (see next part), the easiest way to make them available to relayd is to create a link, as root run: +``` +ln -s /etc/ssl/.fullchain.pem /etc/ssl/.crt +ln -s /etc/ssl/private/.key /etc/ssl/private/.key +``` +This will have to be done for each IPv4 and IPv6 address relayd listens on. + +#### relayd +relayd will be used as the reverse proxy sitting in front of pleroma. +Insert the following configuration in /etc/relayd.conf: +``` +# $OpenBSD: relayd.conf,v 1.4 2018/03/23 09:55:06 claudio Exp $ + +ext_inet="" +ext_inet6="" + +table { 127.0.0.1 } +table { 127.0.0.1 } + +http protocol plerup { # Protocol for upstream pleroma server + #tcp { nodelay, sack, socket buffer 65536, backlog 128 } # Uncomment and adjust as you see fit + tls ciphers "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305" + tls ecdhe secp384r1 + + # Forward some paths to the local server (as pleroma won't respond to them as you might want) + pass request quick path "/robots.txt" forward to + + # Append a bunch of headers + match request header append "X-Forwarded-For" value "$REMOTE_ADDR" # This two header and the next one are not strictly required by pleroma but adding them won't hurt + match request header append "X-Forwarded-By" value "$SERVER_ADDR:$SERVER_PORT" + + match response header append "X-XSS-Protection" value "1; mode=block" + match response header append "X-Permitted-Cross-Domain-Policies" value "none" + match response header append "X-Frame-Options" value "DENY" + match response header append "X-Content-Type-Options" value "nosniff" + match response header append "Referrer-Policy" value "same-origin" + match response header append "X-Download-Options" value "noopen" + match response header append "Content-Security-Policy" value "default-src 'none'; base-uri 'self'; form-action 'self'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://CHANGEME.tld; upgrade-insecure-requests;" # Modify "CHANGEME.tld" and set your instance's domain here + match request header append "Connection" value "upgrade" + #match response header append "Strict-Transport-Security" value "max-age=31536000; includeSubDomains" # Uncomment this only after you get HTTPS working. + + # If you do not want remote frontends to be able to access your Pleroma backend server, comment these lines + match response header append "Access-Control-Allow-Origin" value "*" + match response header append "Access-Control-Allow-Methods" value "POST, PUT, DELETE, GET, PATCH, OPTIONS" + match response header append "Access-Control-Allow-Headers" value "Authorization, Content-Type, Idempotency-Key" + match response header append "Access-Control-Expose-Headers" value "Link, X-RateLimit-Reset, X-RateLimit-Limit, X-RateLimit-Remaining, X-Request-Id" + # Stop commenting lines here +} + +relay wwwtls { + listen on $ext_inet port https tls # Comment to disable listening on IPv4 + listen on $ext_inet6 port https tls # Comment to disable listening on IPv6 + + protocol plerup + + forward to port 4000 check http "/" code 200 + forward to port 80 check http "/robots.txt" code 200 +} +``` +Again, change *\* to your server's address(es) and comment one of the two *listen* options if needed. Also change *wss://CHANGEME.tld* to *wss://\*. +Check the configuration with `relayd -n`, if it is OK enable and start relayd (as root): +``` +rcctl enable relayd +rcctl start relayd +``` + +#### pf +Enabling and configuring pf is highly recommended. +In /etc/pf.conf, insert the following configuration: +``` +# Macros +if="" +authorized_ssh_clients="any" + +# Skip traffic on loopback interface +set skip on lo + +# Default behavior +set block-policy drop +block in log all +pass out quick + +# Security features +match in all scrub (no-df random-id) +block in log from urpf-failed + +# Rules +pass in quick on $if inet proto icmp to ($if) icmp-type { echoreq unreach paramprob trace } # ICMP +pass in quick on $if inet6 proto icmp6 to ($if) icmp6-type { echoreq unreach paramprob timex toobig } # ICMPv6 +pass in quick on $if proto tcp to ($if) port { http https } # relayd/httpd +pass in quick on $if proto tcp from $authorized_ssh_clients to ($if) port ssh +``` +Replace *\* by your server's network interface name (which you can get with ifconfig). Consider replacing the content of the authorized\_ssh\_clients macro by, for exemple, your home IP address, to avoid SSH connection attempts from bots. + +Check pf's configuration by running `pfctl -nf /etc/pf.conf`, load it with `pfctl -f /etc/pf.conf` and enable pf at boot with `rcctl enable pf`. + +#### Configure and start pleroma +Enter a shell as \_pleroma (as root `su _pleroma -`) and enter pleroma's installation directory (`cd ~/pleroma/`). +Then follow the main installation guide: + * run `mix deps.get` + * run `mix pleroma.instance gen` and enter your instance's information when asked + * copy config/generated\_config.exs to config/prod.secret.exs. The default values should be sufficient but you should edit it and check that everything seems OK. + * exit your current shell back to a root one and run `psql -U postgres -f /home/_pleroma/config/setup_db.psql` to setup the database. + * return to a \_pleroma shell into pleroma's installation directory (`su _pleroma -;cd ~/pleroma`) and run `MIX_ENV=prod mix ecto.migrate` + +As \_pleroma in /home/\_pleroma/pleroma, you can now run `LC_ALL=en_US.UTF-8 MIX_ENV=prod mix phx.server` to start your instance. +In another SSH session/tmux window, check that it is working properly by running `ftp -MVo - http://127.0.0.1:4000/api/v1/instance`, you should get json output. Double-check that *uri*'s value is your instance's domain name. + +##### Starting pleroma at boot +An rc script to automatically start pleroma at boot hasn't been written yet, it can be run in a tmux session (tmux is in base). diff --git a/docs/installation/openbsd_fi.md b/docs/installation/openbsd_fi.md new file mode 100644 index 000000000..fa6faa62d --- /dev/null +++ b/docs/installation/openbsd_fi.md @@ -0,0 +1,110 @@ +# Pleroman asennus OpenBSD:llä + +Tarvitset: +* Oman domainin +* OpenBSD 6.3 -serverin +* Auttavan ymmärryksen unix-järjestelmistä + +Komennot, joiden edessä on '#', tulee ajaa käyttäjänä `root`. Tämä on +suositeltavaa tehdä komennon `doas` avulla, katso `doas (1)` ja `doas.conf (5)`. +Tästä eteenpäin oletuksena on, että domain "esimerkki.com" osoittaa +serverin IP-osoitteeseen. + +Jos asennuksen kanssa on ongelmia, IRC-kanava #pleroma Freenodessa tai +Matrix-kanava #freenode_#pleroma:matrix.org ovat hyviä paikkoja löytää apua +(englanniksi), `/msg eal kukkuu` jos haluat välttämättä puhua härmää. + +Asenna tarvittava ohjelmisto: + +`# pkg_add git elixir gmake postgresql-server-10.3 postgresql-contrib-10.3` + +Luo postgresql-tietokanta: + +`# su - _postgresql` + +`$ mkdir /var/postgresql/data` + +`$ initdb -D /var/postgresql/data -E UTF8` + +`$ createdb` + +Käynnistä tietokanta ja aseta se käynnistymään automaattisesti. + +`# rcctl start postgresql` + +`# rcctl enable postgresql` + +Luo käyttäjä pleromaa varten (kysyy muutaman kysymyksen): + +`# adduser pleroma` + +Vaihda pleroma-käyttäjään ja mene kotihakemistoosi: + +`# su - pleroma` + +Lataa pleroman lähdekoodi: + +`$ git clone https://git.pleroma.social/pleroma/pleroma.git` + +`$ cd pleroma` + +Asenna tarvittavat elixir-kirjastot: + +`$ mix deps.get` + +`$ mix deps.compile` + +Luo tarvittava konfiguraatio: + +`$ mix generate_config` + +`$ cp config/generated_config.exs config/prod.secret.exs` + +Aja luodut tietokantakomennot: + +`# su _postgres -c 'psql -f config/setup_db.psql'` + +`$ MIX_ENV=prod mix ecto.migrate` + +Käynnistä pleroma-prosessi: + +`$ MIX_ENV=prod mix compile` + +`$ MIX_ENV=prod mix phx.server` + +Tässä vaiheessa on hyvä tarkistaa että asetukset ovat oikein. Avaa selaimella, +curlilla tai vastaavalla työkalulla `esimerkki.com:4000/api/v1/instance` ja katso +että kohta "uri" on "https://esimerkki.com". + +Huom! Muista varmistaa että muuttuja MIX_ENV on "prod" mix-komentoja ajaessasi. +Mix lukee oikean konfiguraatiotiedoston sen mukaisesti. + +Ohessa enimmäkseen toimivaksi todettu rc.d-skripti pleroman käynnistämiseen. +Kirjoita se tiedostoon /etc/rc.d/pleroma. Tämän jälkeen aja +`# chmod +x /etc/rc.d/pleroma`, ja voit käynnistää pleroman komennolla +`# /etc/rc.d/pleroma start`. + +``` +#!/bin/ksh +#/etc/rc.d/pleroma + +daemon="cd /home/pleroma/pleroma;MIX_ENV=prod /usr/local/bin/elixir" +daemon_flags="--detached /usr/local/bin/mix phx.server" +daemon_user="pleroma" +rc_reload="NO" +rc_bg="YES" + +pexp="beam" + +. /etc/rc.d/rc.subr + +rc_cmd $1 +``` + +Tämän jälkeen tarvitset enää HTTP-serverin välittämään kutsut pleroma-prosessille. +Tiedostosta `install/pleroma.nginx` löytyy esimerkkikonfiguraatio, ja TLS-sertifikaatit +saat ilmaiseksi esimerkiksi [letsencryptiltä](https://certbot.eff.org/lets-encrypt/opbsd-nginx.html). +Nginx asentuu yksinkertaisesti komennolla `# pkg_add nginx`. + +Kun olet valmis, avaa https://esimerkki.com selaimessasi. Luo käyttäjä ja seuraa kiinnostavia +tyyppejä muilla palvelimilla! diff --git a/docs/introduction.md b/docs/introduction.md new file mode 100644 index 000000000..096a23277 --- /dev/null +++ b/docs/introduction.md @@ -0,0 +1,55 @@ +# Introduction to Pleroma +**What is Pleroma?** +Pleroma is a federated social networking platform, compatible with GNU social, Mastodon and other OStatus and ActivityPub implementations. It is free software licensed under the AGPLv3. +It actually consists of two components: a backend, named simply Pleroma, and a user-facing frontend, named Pleroma-FE. It also includes the Mastodon frontend, if that's your thing. +It's part of what we call the fediverse, a federated network of instances which speak common protocols and can communicate with each other. +One account on a instance is enough to talk to the entire fediverse! + +**How can I use it?** + +Pleroma instances are already widely deployed, a list can be found here: +http://distsn.org/pleroma-instances.html + +If you don't feel like joining an existing instance, but instead prefer to deploy your own instance, that's easy too! +Installation instructions can be found here: +[main Pleroma wiki](/) + +**I got an account, now what?** +Great! Now you can explore the fediverse! +- Open the login page for your Pleroma instance (for ex. https://pleroma.soykaf.com) and login with your username and password. +(If you don't have one yet, click on Register) :slightly_smiling_face: + +At this point you will have two columns in front of you. + +***left column*** +- first block: here you can see your avatar, your nickname a bio, and statistics (Statuses, Following, Followers). +Under that you have a text form which allows you to post new statuses. The icon on the left is for uploading media files and attach them to your post. The number under the text form is a character counter, every instance can have a different character limit (the default is 5000). +If you want to mention someone, type @ + name of the person. A drop-down menu will help you in finding the right person. :slight_smile: +To post your status, simply press Submit. + +- second block: Here you can switch between the different timelines: + - Timeline: all the people that you follow + - Mentions: all the statutes where you are mentioned + - Public Timeline: all the statutes from the local instance + - The Whole Known Network: everything, local and remote! + +- third block: this is the Chat block, where you communicate with people on the same instance in realtime. It is local-only, for now, but we're planning to make it extendable to the entire fediverse! :sweat_smile: + +- fourth block: This is the Notifications block, here you will get notified whenever somebody mentions you, follows you, repeats or favorites one of your statuses. + +***right column*** +This is where the interesting stuff happens! :slight_smile: +Depending on the timeline you will see different statuses, but each status has a standard structure: +- Icon + name + link to profile. An optional left-arrow if it's a reply to another status (hovering will reveal the replied-to status). +- A + button on the right allows you to Expand/Collapse an entire discussion thread. It also updates in realtime! +- A binocular icon allows you to open the status on the instance where it's originating from. +- The text of the status, including mentions. If you click on a mention, it will automatically open the profile page of that person. +- Four buttons (left to right): Reply, Repeat, Favorite, Delete. + +**Mastodon interface** +If the Pleroma interface isn't your thing, or you're just trying something new but you want to keep using the familiar Mastodon interface, we got that too! :smile: +Just add a "/web" after your instance url (for ex. https://pleroma.soycaf.com/web) and you'll end on the Mastodon web interface, but with a Pleroma backend! MAGIC! :fireworks: +For more information on the Mastodon interface, please look here: +https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/User-guide.md + +Remember, what you see is only the frontend part of Mastodon, the backend is still Pleroma. diff --git a/docs/static_dir.md b/docs/static_dir.md deleted file mode 100644 index 0cc52b99a..000000000 --- a/docs/static_dir.md +++ /dev/null @@ -1,20 +0,0 @@ -# Static Directory - -Static frontend files are shipped in `priv/static/` and tracked by version control in this repository. If you want to overwrite or update these without the possibility of merge conflicts, you can write your custom versions to `instance/static/`. - -``` -config :pleroma, :instance, - static_dir: "instance/static/", -``` - -You can overwrite this value in your configuration to use a different static instance directory. - -## robots.txt - -By default, the `robots.txt` that ships in `priv/static/` is permissive. It allows well-behaved search engines to index all of your instance's URIs. - -If you want to generate a restrictive `robots.txt`, you can run the following mix task. The generated `robots.txt` will be written in your instance static directory. - -``` -mix pleroma.robots_txt disallow_all -``` -- cgit v1.2.3 From d0026761b73ef1c806affcdfb7b645d2b4bddda2 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 20:13:22 +0300 Subject: cringe --- docs/.Clients.md.swp | Bin 16384 -> 0 bytes docs/fuckgitlablol.sh | 12 ------------ 2 files changed, 12 deletions(-) delete mode 100644 docs/.Clients.md.swp delete mode 100755 docs/fuckgitlablol.sh (limited to 'docs') diff --git a/docs/.Clients.md.swp b/docs/.Clients.md.swp deleted file mode 100644 index 1f5aa2776..000000000 Binary files a/docs/.Clients.md.swp and /dev/null differ diff --git a/docs/fuckgitlablol.sh b/docs/fuckgitlablol.sh deleted file mode 100755 index 32e7b8998..000000000 --- a/docs/fuckgitlablol.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -lstr=`ls -A1 *.md` -readarray -t lsarr <<<"$lstr" -for i in "${lsarr[@]}" -do - : - echo $i - title=`echo $i | sed 's/-/\ /g' | sed 's/\.md//g'` - echo $title - echo -e "# $title\n$(cat $i)" > $i -done - -- cgit v1.2.3 From e4601b2c1d5f7c2d5d8acf947b9f8dc8beee1747 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 20:16:14 +0300 Subject: remove admin tasks as they have their page in mix tasks category already --- docs/admin/admin_tasks.md | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 docs/admin/admin_tasks.md (limited to 'docs') diff --git a/docs/admin/admin_tasks.md b/docs/admin/admin_tasks.md deleted file mode 100644 index 883095cdb..000000000 --- a/docs/admin/admin_tasks.md +++ /dev/null @@ -1,44 +0,0 @@ -# Admin tasks -## Important - -If your instance is running in prod mode (most likely it is) make sure to prefix every command with `MIX_ENV=prod`. - -## User management - -It is possible to obtain a list of all available tasks with their options by executing `mix help pleroma.user` - -### Adding users - -Use `mix pleroma.user invite` to generate an invite link for a new user. - -Also, `mix pleroma.user new NICKNAME EMAIL [OPTION...]` can be used to register an account. - -### Making a user a moderator/admin/locked - -Run `mix pleroma.user set username --[no-]moderator` to make user a moderator or remove the moderator status. - -To make the user admin or locked use `mix pleroma.user set NICKNAME --[no-]admin` and `mix pleroma.user set NICKNAME --[no-]locked` respectively - -### Resetting a password - -Run `mix pleroma.user reset_password NICKNAME` to generate a password reset link that you can then send to the user. - -### Banning users - -Run `mix pleroma.user rm NICKNAME` to remove a local account. - -To deactivate(block from the server completely)/reactivate local and remote user accounts run: - -`mix pleroma.user toggle_activated NICKNAME@instancename` - -## Relay managment - -It is possible to obtain a list of all available tasks with their options by executing `mix help pleroma.relay` - -### Following a relay - -Run `mix pleroma.relay follow RELAY_URL` - -### Unfollowing a relay - -Run `mix pleroma.relay unfollow RELAY_URL` -- cgit v1.2.3 From d16e2a2e0435b2ff1ef5190279b35121180d14ca Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 20:16:59 +0300 Subject: Remove duplicated header from admin_api.md --- docs/api/admin_api.md | 1 - 1 file changed, 1 deletion(-) (limited to 'docs') diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md index ea9b9308c..84adca6ff 100644 --- a/docs/api/admin_api.md +++ b/docs/api/admin_api.md @@ -1,5 +1,4 @@ # Admin API -# Admin API Authentication is required and the user must be an admin. -- cgit v1.2.3 From 9bd80e60448e5ab1d3634d83589e8605f24d37d8 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 20:27:01 +0300 Subject: did it really take me 4 commits to fix this? --- docs/api/pleroma_api.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md index bd3fcaa5d..478c9d874 100644 --- a/docs/api/pleroma_api.md +++ b/docs/api/pleroma_api.md @@ -61,10 +61,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi "cover_photo": "https://pleroma.soykaf.com/images/banner.png", "created_at": "Tue Dec 18 16:55:56 +0000 2018", "default_scope": "public", - "description": "blushy-crushy fediverse idol + pleroma dev -let's be friends -ぷれろまの生徒会長。謎の外人。日本語OK. -公主病.", + "description": "blushy-crushy fediverse idol + pleroma dev\nlet's be friends \nぷれろまの生徒会長。謎の外人。日本語OK. \n公主病.", "description_html": "blushy-crushy fediverse idol + pleroma dev.
let's be friends
ぷれろまの生徒会長。謎の外人。日本語OK.
公主病.", "favourites_count": 0, "fields": [], -- cgit v1.2.3 From 634e09e1a8d0c26ad9a89875e3f713a0bf07ea3e Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 20:29:46 +0300 Subject: Remove duplicated header from i2p.md --- docs/config/i2p.md | 1 - 1 file changed, 1 deletion(-) (limited to 'docs') diff --git a/docs/config/i2p.md b/docs/config/i2p.md index c477eb6e4..62ced8b7a 100644 --- a/docs/config/i2p.md +++ b/docs/config/i2p.md @@ -1,4 +1,3 @@ -# I2P Federation # I2P Federation and Accessability This guide is going to focus on the Pleroma federation aspect. The actual installation is neatly explained in the official documentation, and more likely to remain up-to-date. -- cgit v1.2.3 From 9a39d1d84613bb11542a0628e8b762970bd18bd0 Mon Sep 17 00:00:00 2001 From: Egor Date: Fri, 29 Mar 2019 12:46:05 +0000 Subject: Replace Pleroma.Jobs with `pleroma_job_queue` --- docs/config.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index c1246ee25..c206358ab 100644 --- a/docs/config.md +++ b/docs/config.md @@ -253,25 +253,20 @@ You can then do curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerandomtoken" ``` -## Pleroma.Jobs +## :pleroma_job_queue -A list of job queues and their settings. - -Job queue settings: - -* `max_jobs`: The maximum amount of parallel jobs running at the same time. +[Pleroma Job Queue][https://git.pleroma.social/pleroma/pleroma_job_queue] configuration: a list of queues with maximum concurrent jobs. Example: -```exs -config :pleroma, Pleroma.Jobs, - federator_incoming: [max_jobs: 50], - federator_outgoing: [max_jobs: 50] +```elixir +config :pleroma_job_queue, :queues, + federator_incoming: 50, + federator_outgoing: 50 ``` This config contains two queues: `federator_incoming` and `federator_outgoing`. Both have the `max_jobs` set to `50`. - ## Pleroma.Web.Federator.RetryQueue * `enabled`: If set to `true`, failed federation jobs will be retried -- cgit v1.2.3 From 11584488d1301f6bd8a06d45b6bca0ff12f82889 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 29 Mar 2019 16:11:22 +0300 Subject: Improve PleromaJobQeue config documentation --- docs/config.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index c206358ab..b4e1ad275 100644 --- a/docs/config.md +++ b/docs/config.md @@ -255,7 +255,12 @@ curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerando ## :pleroma_job_queue -[Pleroma Job Queue][https://git.pleroma.social/pleroma/pleroma_job_queue] configuration: a list of queues with maximum concurrent jobs. +[Pleroma Job Queue](https://git.pleroma.social/pleroma/pleroma_job_queue) configuration: a list of queues with maximum concurrent jobs. + +Pleroma has the following qeues: +* `federator_outgoing` - Outgoing federation +* `federator_incoming` - Incoming federation +* `mailer` - Email sender, see [`Pleroma.Mailer`](#pleroma-mailer) Example: -- cgit v1.2.3 From afbc905a1caf62705a7c5332d7fd847509701e54 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 29 Mar 2019 16:38:18 +0300 Subject: qs --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index b4e1ad275..3624e295b 100644 --- a/docs/config.md +++ b/docs/config.md @@ -257,7 +257,7 @@ curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerando [Pleroma Job Queue](https://git.pleroma.social/pleroma/pleroma_job_queue) configuration: a list of queues with maximum concurrent jobs. -Pleroma has the following qeues: +Pleroma has the following queues: * `federator_outgoing` - Outgoing federation * `federator_incoming` - Incoming federation * `mailer` - Email sender, see [`Pleroma.Mailer`](#pleroma-mailer) -- cgit v1.2.3 From 42b779527c551595399771fbc3c0701d38a3ed3d Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 29 Mar 2019 22:15:20 +0300 Subject: document fake option --- docs/api/differences_in_mastoapi_responses.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md index d993d1383..f5ce7493d 100644 --- a/docs/api/differences_in_mastoapi_responses.md +++ b/docs/api/differences_in_mastoapi_responses.md @@ -44,3 +44,9 @@ Has these additional fields under the `pleroma` object: Has these additional fields under the `pleroma` object: - `is_seen`: true if the notification was read by the user + +## POST `/api/v1/statuses` + +Additional parameters can be added to the JSON body: + +- `fake`: boolean, if set to `true` the post won't be actually posted, but the status entitiy would still be rendered back. This could be useful for previewing rich text/custom emoji, for example. -- cgit v1.2.3 From b46e6f0949eb88be064515a4d3713759155945e9 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 16:10:47 +0300 Subject: Fix backup/restore page to have proper headings --- docs/admin/backup.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/admin/backup.md b/docs/admin/backup.md index b373996f5..2c70e7bf8 100644 --- a/docs/admin/backup.md +++ b/docs/admin/backup.md @@ -1,4 +1,6 @@ -# Backup your instance +# Backup/Restore your instance + +## Backup 1. Stop the Pleroma service. 2. Go to the working directory of Pleroma (default is `/opt/pleroma`) @@ -6,7 +8,7 @@ 4. Copy `pleroma.pgdump`, `config/prod.secret.exs` and the `uploads` folder to your backup destination. If you have other modifications, copy those changes too. 5. Restart the Pleroma service. -## Restore your instance +## Restore 1. Stop the Pleroma service. 2. Go to the working directory of Pleroma (default is `/opt/pleroma`) -- cgit v1.2.3 From 7c69c6f624e9e244acaac44c8ed57329aed53166 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 16:22:12 +0300 Subject: change bold text to be proper geadings in introduction.md --- docs/introduction.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/introduction.md b/docs/introduction.md index 096a23277..4af0747fe 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -1,11 +1,11 @@ # Introduction to Pleroma -**What is Pleroma?** +## What is Pleroma? Pleroma is a federated social networking platform, compatible with GNU social, Mastodon and other OStatus and ActivityPub implementations. It is free software licensed under the AGPLv3. It actually consists of two components: a backend, named simply Pleroma, and a user-facing frontend, named Pleroma-FE. It also includes the Mastodon frontend, if that's your thing. It's part of what we call the fediverse, a federated network of instances which speak common protocols and can communicate with each other. One account on a instance is enough to talk to the entire fediverse! -**How can I use it?** +## How can I use it? Pleroma instances are already widely deployed, a list can be found here: http://distsn.org/pleroma-instances.html @@ -14,14 +14,14 @@ If you don't feel like joining an existing instance, but instead prefer to deplo Installation instructions can be found here: [main Pleroma wiki](/) -**I got an account, now what?** +## I got an account, now what? Great! Now you can explore the fediverse! - Open the login page for your Pleroma instance (for ex. https://pleroma.soykaf.com) and login with your username and password. (If you don't have one yet, click on Register) :slightly_smiling_face: At this point you will have two columns in front of you. -***left column*** +### Left column - first block: here you can see your avatar, your nickname a bio, and statistics (Statuses, Following, Followers). Under that you have a text form which allows you to post new statuses. The icon on the left is for uploading media files and attach them to your post. The number under the text form is a character counter, every instance can have a different character limit (the default is 5000). If you want to mention someone, type @ + name of the person. A drop-down menu will help you in finding the right person. :slight_smile: @@ -37,7 +37,7 @@ To post your status, simply press Submit. - fourth block: This is the Notifications block, here you will get notified whenever somebody mentions you, follows you, repeats or favorites one of your statuses. -***right column*** +### Right column This is where the interesting stuff happens! :slight_smile: Depending on the timeline you will see different statuses, but each status has a standard structure: - Icon + name + link to profile. An optional left-arrow if it's a reply to another status (hovering will reveal the replied-to status). @@ -46,7 +46,7 @@ Depending on the timeline you will see different statuses, but each status has a - The text of the status, including mentions. If you click on a mention, it will automatically open the profile page of that person. - Four buttons (left to right): Reply, Repeat, Favorite, Delete. -**Mastodon interface** +## Mastodon interface If the Pleroma interface isn't your thing, or you're just trying something new but you want to keep using the familiar Mastodon interface, we got that too! :smile: Just add a "/web" after your instance url (for ex. https://pleroma.soycaf.com/web) and you'll end on the Mastodon web interface, but with a Pleroma backend! MAGIC! :fireworks: For more information on the Mastodon interface, please look here: -- cgit v1.2.3 From bff8cde0cf01e8b474ad3f5915c3716e885f52b3 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 16:23:32 +0300 Subject: Instruct to stop the service only after git pulling and getting deps to minimize downtimes --- docs/admin/updating.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/admin/updating.md b/docs/admin/updating.md index 33ce1ab4f..34166fb8d 100644 --- a/docs/admin/updating.md +++ b/docs/admin/updating.md @@ -1,8 +1,8 @@ # Updating your instance -1. Stop the Pleroma service. -2. Go to the working directory of Pleroma (default is `/opt/pleroma`) -3. Run `git pull`. This pulls the latest changes from upstream. -4. Run `mix deps.get`. This pulls in any new dependencies. +1. Go to the working directory of Pleroma (default is `/opt/pleroma`) +2. Run `git pull`. This pulls the latest changes from upstream. +3. Run `mix deps.get`. This pulls in any new dependencies. +4. Stop the Pleroma service. 5. Run `mix ecto.migrate`[^1]. This task performs database migrations, if there were any. 6. Restart the Pleroma service. -- cgit v1.2.3 From 949cfde065dbfc4d8ba1824f4cd3675d603e137e Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 16:26:46 +0300 Subject: restart makes no sense here as we instructed to stop the service before --- docs/admin/updating.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/admin/updating.md b/docs/admin/updating.md index 34166fb8d..84e6ef18d 100644 --- a/docs/admin/updating.md +++ b/docs/admin/updating.md @@ -4,6 +4,6 @@ 3. Run `mix deps.get`. This pulls in any new dependencies. 4. Stop the Pleroma service. 5. Run `mix ecto.migrate`[^1]. This task performs database migrations, if there were any. -6. Restart the Pleroma service. +6. Start the Pleroma service. [^1]: Prefix with `MIX_ENV=prod` to run it using the production config file. -- cgit v1.2.3 From a309b49c2d555d4961db443a37bbf02719749a35 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 19:19:06 +0300 Subject: Remove outdated howto change config and port and move it to config.md instead --- docs/config.md | 38 +++++++++++++++++++++++++++++++++ docs/config/howto_change_ip_and_port.md | 7 ------ 2 files changed, 38 insertions(+), 7 deletions(-) delete mode 100644 docs/config/howto_change_ip_and_port.md (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 3624e295b..f507d4461 100644 --- a/docs/config.md +++ b/docs/config.md @@ -193,6 +193,44 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i * `port`: Port to bind to * `dstport`: Port advertised in urls (optional, defaults to `port`) +## Pleroma.Web.Endpoint +`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 + - `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` + + +**Important note: 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 * ``accept_blocks``: Whether to accept incoming block activities from other instances * ``unfollow_blocked``: Whether blocks result in people getting unfollowed diff --git a/docs/config/howto_change_ip_and_port.md b/docs/config/howto_change_ip_and_port.md deleted file mode 100644 index decddd35c..000000000 --- a/docs/config/howto_change_ip_and_port.md +++ /dev/null @@ -1,7 +0,0 @@ -# How to change the port or IP Pleroma listens to -To change the port or IP Pleroma listens to, head over to your generated config inside the Pleroma folder at config/prod.secret.exs and edit the following according to your needs. -``` -config :pleroma, Pleroma.Web.Endpoint, - [...] - http: [ip: {127, 0, 0, 1}, port: 4000] -``` -- cgit v1.2.3 From e2b94d8f330041724b9c7d2b89c5020e463eb378 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 19:24:50 +0300 Subject: Make only important note bold rather than the whole paragraph because it looks better that way --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index f507d4461..97a0e6ffa 100644 --- a/docs/config.md +++ b/docs/config.md @@ -205,7 +205,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i - `path` -**Important note: 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** +**Important note**: 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 -- cgit v1.2.3 From fdb4357e9ba7a34a603997d50d85593ca2bf6395 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 2 Apr 2019 14:31:18 +0300 Subject: Rename fake param to preview and make the tests check that the object was not inserted to the db --- docs/api/differences_in_mastoapi_responses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md index f5ce7493d..7adf29676 100644 --- a/docs/api/differences_in_mastoapi_responses.md +++ b/docs/api/differences_in_mastoapi_responses.md @@ -49,4 +49,4 @@ Has these additional fields under the `pleroma` object: Additional parameters can be added to the JSON body: -- `fake`: boolean, if set to `true` the post won't be actually posted, but the status entitiy would still be rendered back. This could be useful for previewing rich text/custom emoji, for example. +- `preview`: boolean, if set to `true` the post won't be actually posted, but the status entitiy would still be rendered back. This could be useful for previewing rich text/custom emoji, for example. -- cgit v1.2.3 From 79cb34a4b0dd1c0ffe45e796f5ac6790e3b31025 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 2 Apr 2019 23:07:16 +0300 Subject: Fix preview not being usable in form data --- docs/api/differences_in_mastoapi_responses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md index 7adf29676..215f43155 100644 --- a/docs/api/differences_in_mastoapi_responses.md +++ b/docs/api/differences_in_mastoapi_responses.md @@ -47,6 +47,6 @@ Has these additional fields under the `pleroma` object: ## POST `/api/v1/statuses` -Additional parameters can be added to the JSON body: +Additional parameters can be added to the JSON body/Form data: - `preview`: boolean, if set to `true` the post won't be actually posted, but the status entitiy would still be rendered back. This could be useful for previewing rich text/custom emoji, for example. -- cgit v1.2.3 From 3b12eeda192e739e8328ef4202059bb482d1cff2 Mon Sep 17 00:00:00 2001 From: feld Date: Thu, 4 Apr 2019 19:52:22 +0000 Subject: Add ability to ship logs to a Slack channel --- docs/config.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index 97a0e6ffa..06d6fd757 100644 --- a/docs/config.md +++ b/docs/config.md @@ -105,7 +105,7 @@ config :pleroma, Pleroma.Mailer, * `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`) ## :logger -* `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog +* `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog, and `Quack.Logger` to log to Slack An example to enable ONLY ExSyslogger (f/ex in ``prod.secret.exs``) with info and debug suppressed: ``` @@ -128,6 +128,24 @@ config :logger, :ex_syslogger, See: [logger’s documentation](https://hexdocs.pm/logger/Logger.html) and [ex_syslogger’s documentation](https://hexdocs.pm/ex_syslogger/) +An example of logging info to local syslog, but warn to a Slack channel: +``` +config :logger, + backends: [ {ExSyslogger, :ex_syslogger}, Quack.Logger ], + level: :info + +config :logger, :ex_syslogger, + level: :info, + ident: "pleroma", + format: "$metadata[$level] $message" + +config :quack, + level: :warn, + meta: [:all], + webhook_url: "https://hooks.slack.com/services/YOUR-API-KEY-HERE" +``` + +See the [Quack Github](https://github.com/azohra/quack) for more details ## :frontend_configurations -- cgit v1.2.3 From da64a5aece131d6bd8c0d17dcda61c626b44c4d0 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 5 Apr 2019 11:29:34 -0500 Subject: Document the admin API endpoints for controlling follow/unfollow --- docs/api/admin_api.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs') diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md index 53b68ffd4..86cacebb1 100644 --- a/docs/api/admin_api.md +++ b/docs/api/admin_api.md @@ -58,6 +58,26 @@ Authentication is required and the user must be an admin. - `password` - Response: User’s nickname +## `/api/pleroma/admin/user/follow` +### Make a user follow another user + +- Methods: `POST` +- Params: + - `follower`: The nickname of the follower + - `followed`: The nickname of the followed +- Response: + - "ok" + +## `/api/pleroma/admin/user/unfollow` +### Make a user unfollow another user + +- Methods: `POST` +- Params: + - `follower`: The nickname of the follower + - `followed`: The nickname of the followed +- Response: + - "ok" + ## `/api/pleroma/admin/users/:nickname/toggle_activation` ### Toggle user activation -- cgit v1.2.3 From c05fe4da0a9ad119891d2fc6cf82ea3beb59fec7 Mon Sep 17 00:00:00 2001 From: Sadposter Date: Sat, 6 Apr 2019 16:20:06 +0100 Subject: Document subscription endpoints, fix typos Also adds a quick error case on the subscription endpoints to avoid 500s --- docs/api/pleroma_api.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md index 478c9d874..410f2a955 100644 --- a/docs/api/pleroma_api.md +++ b/docs/api/pleroma_api.md @@ -52,7 +52,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * `confirm` * `captcha_solution`: optional, contains provider-specific captcha solution, * `captcha_token`: optional, contains provider-specific captcha token - * `token`: invite token required when the registerations aren't public. + * `token`: invite token required when the registrations aren't public. * Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}` * Example response: ``` @@ -114,5 +114,53 @@ See [Admin-API](Admin-API.md) * Method `POST` * Authentication: required * Params: - * `id`: notifications's id + * `id`: notification's id * Response: JSON. Returns `{"status": "success"}` if the reading was successful, otherwise returns `{"error": "error_msg"}` + +## `/api/v1/pleroma/accounts/:id/subscribe` +### Subscribe to receive notifications for all statuses posted by a user +* Method `POST` +* Authentication: required +* Params: + * `id`: account id to subscribe to +* Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}` +* Example response: +```json +{ + id: "abcdefg", + following: true, + followed_by: false, + blocking: false, + muting: false, + muting_notifications: false, + subscribing: true, + requested: false, + domain_blocking: false, + showing_reblogs: true, + endorsed: false +} +``` + +## `/api/v1/pleroma/accounts/:id/unsubscribe` +### Unsubscribe to stop receiving notifications from user statuses +* Method `POST` +* Authentication: required +* Params: + * `id`: account id to unsubscribe from +* Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}` +* Example response: +```json +{ + id: "abcdefg", + following: true, + followed_by: false, + blocking: false, + muting: false, + muting_notifications: false, + subscribing: false, + requested: false, + domain_blocking: false, + showing_reblogs: true, + endorsed: false +} +``` -- cgit v1.2.3 From e6778003abcccdf35fe098a571023ed5f5a20323 Mon Sep 17 00:00:00 2001 From: Sadposter Date: Sat, 6 Apr 2019 16:24:21 +0100 Subject: JSON need quotes! --- docs/api/pleroma_api.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'docs') diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md index 410f2a955..75569e092 100644 --- a/docs/api/pleroma_api.md +++ b/docs/api/pleroma_api.md @@ -127,17 +127,17 @@ See [Admin-API](Admin-API.md) * Example response: ```json { - id: "abcdefg", - following: true, - followed_by: false, - blocking: false, - muting: false, - muting_notifications: false, - subscribing: true, - requested: false, - domain_blocking: false, - showing_reblogs: true, - endorsed: false + "id": "abcdefg", + "following": true, + "followed_by": false, + "blocking": false, + "muting": false, + "muting_notifications": false, + "subscribing": true, + "requested": false, + "domain_blocking": false, + "showing_reblogs": true, + "endorsed": false } ``` @@ -151,16 +151,16 @@ See [Admin-API](Admin-API.md) * Example response: ```json { - id: "abcdefg", - following: true, - followed_by: false, - blocking: false, - muting: false, - muting_notifications: false, - subscribing: false, - requested: false, - domain_blocking: false, - showing_reblogs: true, - endorsed: false + "id": "abcdefg", + "following": true, + "followed_by": false, + "blocking": false, + "muting": false, + "muting_notifications": false, + "subscribing": false, + "requested": false, + "domain_blocking": false, + "showing_reblogs": true, + "endorsed": false } ``` -- cgit v1.2.3 From b810aac117563a941b50180f19bca2d96a329a0a Mon Sep 17 00:00:00 2001 From: Alex S Date: Sun, 7 Apr 2019 19:48:52 +0700 Subject: added docs to docs/api/admin_api.md code style and little renamings --- docs/api/admin_api.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md index 86cacebb1..638b235b8 100644 --- a/docs/api/admin_api.md +++ b/docs/api/admin_api.md @@ -200,12 +200,65 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret ## `/api/pleroma/admin/invite_token` -### Get a account registeration invite token +### Get an account registration invite token - Methods: `GET` -- Params: none +- Params: + - *optional* `invite` => [ + - *optional* `max_use` (integer) + - *optional* `expire_at` (date string e.g. "2019-04-07") + ] - Response: invite token (base64 string) +## `/api/pleroma/admin/invites` + +### Get a list of generated invites + +- Methods: `GET` +- Params: none +- Response: + +```JSON +{ + + "invites": [ + { + "id": integer, + "token": string, + "used": boolean, + "expire_at": date, + "uses": integer, + "max_use": integer, + "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`) + }, + ... + ] +} +``` + +## `/api/pleroma/admin/revoke_invite` + +### Revoke invite by token + +- Methods: `POST` +- Params: + - `token` +- Response: + +```JSON +{ + "id": integer, + "token": string, + "used": boolean, + "expire_at": date, + "uses": integer, + "max_use": integer, + "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`) + +} +``` + + ## `/api/pleroma/admin/email_invite` ### Sends registration invite via email @@ -213,7 +266,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret - Methods: `POST` - Params: - `email` - - `name`, optionnal + - `name`, optional ## `/api/pleroma/admin/password_reset` -- cgit v1.2.3 From 012bb5dcc9bfbf6f3ea210ec4e865f3adcea9dfd Mon Sep 17 00:00:00 2001 From: Alex S Date: Mon, 8 Apr 2019 16:01:28 +0700 Subject: renaming expire_at -> expires_at keyword style change --- docs/api/admin_api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/api/admin_api.md b/docs/api/admin_api.md index 638b235b8..8befa8ea0 100644 --- a/docs/api/admin_api.md +++ b/docs/api/admin_api.md @@ -206,7 +206,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret - Params: - *optional* `invite` => [ - *optional* `max_use` (integer) - - *optional* `expire_at` (date string e.g. "2019-04-07") + - *optional* `expires_at` (date string e.g. "2019-04-07") ] - Response: invite token (base64 string) @@ -226,7 +226,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret "id": integer, "token": string, "used": boolean, - "expire_at": date, + "expires_at": date, "uses": integer, "max_use": integer, "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`) @@ -250,7 +250,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret "id": integer, "token": string, "used": boolean, - "expire_at": date, + "expires_at": date, "uses": integer, "max_use": integer, "invite_type": string (possible values: `one_time`, `reusable`, `date_limited`, `reusable_date_limited`) -- cgit v1.2.3 From b57b43027cf958d3a3a82b95f155ae27b235b543 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 9 Apr 2019 23:20:31 +0300 Subject: Change response format of /api/pleroma/emoji to the one that actually makes sense --- docs/api/pleroma_api.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md index 2e8fb04d2..6f2bc61bc 100644 --- a/docs/api/pleroma_api.md +++ b/docs/api/pleroma_api.md @@ -10,7 +10,29 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * Authentication: not required * Params: none * Response: JSON -* Example response: `[{"kalsarikannit_f":{"tags":["Finmoji"],"image_url":"/finmoji/128px/kalsarikannit_f-128.png"}},{"perkele":{"tags":["Finmoji"],"image_url":"/finmoji/128px/perkele-128.png"}},{"blobdab":{"tags":["SomeTag"],"image_url":"/emoji/blobdab.png"}},"happiness":{"tags":["Finmoji"],"image_url":"/finmoji/128px/happiness-128.png"}}]` +* Example response: +```json +{ + "girlpower": { + "tags": [ + "Finmoji" + ], + "image_url": "/finmoji/128px/girlpower-128.png" + }, + "education": { + "tags": [ + "Finmoji" + ], + "image_url": "/finmoji/128px/education-128.png" + }, + "finnishlove": { + "tags": [ + "Finmoji" + ], + "image_url": "/finmoji/128px/finnishlove-128.png" + } +} +``` * Note: Same data as Mastodon API’s `/api/v1/custom_emojis` but in a different format ## `/api/pleroma/follow_import` -- cgit v1.2.3 From 1791ee8ec4149bfe218caf51c5adb255fcc1e426 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 10 Apr 2019 06:05:05 +0200 Subject: s/Pleroma.Mailer/Pleroma.Emails.Mailer/ --- docs/config.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index b5ea58746..e286104df 100644 --- a/docs/config.md +++ b/docs/config.md @@ -31,14 +31,14 @@ This filter replaces the filename (not the path) of an upload. For complete obfu * `text`: Text to replace filenames in links. If empty, `{random}.extension` will be used. -## Pleroma.Mailer +## 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. An example for Sendgrid adapter: ```exs -config :pleroma, Pleroma.Mailer, +config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendgrid, api_key: "YOUR_API_KEY" ``` @@ -46,7 +46,7 @@ config :pleroma, Pleroma.Mailer, An example for SMTP adapter: ```exs -config :pleroma, Pleroma.Mailer, +config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.SMTP, relay: "smtp.gmail.com", username: "YOUR_USERNAME@gmail.com", @@ -317,7 +317,7 @@ Pleroma has the following queues: * `federator_outgoing` - Outgoing federation * `federator_incoming` - Incoming federation -* `mailer` - Email sender, see [`Pleroma.Mailer`](#pleroma-mailer) +* `mailer` - Email sender, see [`Pleroma.Emails.Mailer`](#pleroma-emails-mailer) * `transmogrifier` - Transmogrifier * `web_push` - Web push notifications * `scheduled_activities` - Scheduled activities, see [`Pleroma.ScheduledActivities`](#pleromascheduledactivity) -- cgit v1.2.3 From fe13a1d78c13fbe7b3027d442a6f6906440e5acc Mon Sep 17 00:00:00 2001 From: Alex S Date: Wed, 10 Apr 2019 17:57:41 +0700 Subject: adding notify_email setting for trigger emails --- docs/config.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index b5ea58746..7d3a482b3 100644 --- a/docs/config.md +++ b/docs/config.md @@ -63,6 +63,7 @@ config :pleroma, Pleroma.Mailer, ## :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. @@ -427,7 +428,7 @@ Pleroma account will be created with the same name as the LDAP user name. Authentication / authorization settings. -* `auth_template`: authentication form template. By default it's `show.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/show.html.eex`. +* `auth_template`: authentication form template. By default it's `show.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/show.html.eex`. * `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. @@ -440,7 +441,7 @@ Note: each strategy is shipped as a separate dependency; in order to get the str e.g. `OAUTH_CONSUMER_STRATEGIES="twitter facebook google microsoft" mix deps.get`. The server should also be started with `OAUTH_CONSUMER_STRATEGIES="..." mix phx.server` in case you enable any strategies. -Note: each strategy requires separate setup (on external provider side and Pleroma side). Below are the guidelines on setting up most popular strategies. +Note: each strategy requires separate setup (on external provider side and Pleroma side). Below are the guidelines on setting up most popular strategies. * For Twitter, [register an app](https://developer.twitter.com/en/apps), configure callback URL to https:///oauth/twitter/callback @@ -475,7 +476,7 @@ config :ueberauth, Ueberauth.Strategy.Google.OAuth, config :ueberauth, Ueberauth.Strategy.Microsoft.OAuth, client_id: System.get_env("MICROSOFT_CLIENT_ID"), client_secret: System.get_env("MICROSOFT_CLIENT_SECRET") - + config :ueberauth, Ueberauth, providers: [ microsoft: {Ueberauth.Strategy.Microsoft, [callback_params: []]} -- cgit v1.2.3 From 48982169dc97fce429019fe2b4d390eeec71cba3 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 13 Apr 2019 22:41:54 +0200 Subject: docs/installation/arch_linux_en.md: Remove useless ODBC See [1] for confirmation. 1: https://git.pleroma.social/pleroma/pleroma/merge_requests/1050#note_24402 --- docs/installation/arch_linux_en.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/installation/arch_linux_en.md b/docs/installation/arch_linux_en.md index 4b3bbbbb0..2b040cfbc 100644 --- a/docs/installation/arch_linux_en.md +++ b/docs/installation/arch_linux_en.md @@ -7,7 +7,6 @@ This guide will assume that you have administrative rights, either as root or a * `postgresql` * `elixir` -* `erlang-unixodbc` * `git` * `base-devel` @@ -27,7 +26,7 @@ sudo pacman -Syu * Install some of the above mentioned programs: ```shell -sudo pacman -S git base-devel elixir erlang-unixodbc +sudo pacman -S git base-devel elixir ``` ### Install PostgreSQL -- cgit v1.2.3 From 088f378408e7bc9b4dd916141cba813de3276e90 Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 15 Apr 2019 15:51:17 +0200 Subject: Custom Emoji docs: Make it clear that config.exs is not for lewd. --- docs/config/custom_emoji.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/config/custom_emoji.md b/docs/config/custom_emoji.md index 419a7d0e2..5ce9865a2 100644 --- a/docs/config/custom_emoji.md +++ b/docs/config/custom_emoji.md @@ -20,7 +20,7 @@ The files should be PNG (APNG is okay with `.png` for `image/png` Content-type) ## Emoji tags (groups) -Default tags are set in `config.exs`. +Default tags are set in `config.exs`. To set your own tags, copy the structure to your secrets file (`prod.secret.exs` or `dev.secret.exs`) and edit it. ```elixir config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"], -- cgit v1.2.3 From 10096bbf2b6c18104cb63b5486681d00eaa5fb6c Mon Sep 17 00:00:00 2001 From: Hakurei Reimu Date: Mon, 15 Apr 2019 12:31:37 +0800 Subject: add extra_cookie_attrs option to config Allow instance admins to set their own SameSite cookie policy from the config. Default value in the config is `Lax`. --- docs/config.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index e286104df..117fda960 100644 --- a/docs/config.md +++ b/docs/config.md @@ -221,6 +221,8 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i - `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. + **Important note**: 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 @@ -442,6 +444,8 @@ The server should also be started with `OAUTH_CONSUMER_STRATEGIES="..." mix phx. Note: each strategy requires separate setup (on external provider side and Pleroma side). Below are the guidelines on setting up most popular strategies. +Note: make sure that `"SameSite=Lax"` is set in `extra_cookie_attrs` when you have this feature enabled. OAuth consumer mode will not work with `"SameSite=Strict"` + * For Twitter, [register an app](https://developer.twitter.com/en/apps), configure callback URL to https:///oauth/twitter/callback * For Facebook, [register an app](https://developers.facebook.com/apps), configure callback URL to https:///oauth/facebook/callback, enable Facebook Login service at https://developers.facebook.com/apps//fb-login/settings/ -- cgit v1.2.3