From d5a1e08bf1aed97ff4708844a52eaf5b155a6002 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Sun, 31 Mar 2019 17:46:17 -0500 Subject: [PATCH 01/15] Add default mail adapter settings to config --- config/config.exs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/config.exs b/config/config.exs index 0df38d75a..dccf7b263 100644 --- a/config/config.exs +++ b/config/config.exs @@ -378,6 +378,8 @@ base: System.get_env("LDAP_BASE") || "dc=example,dc=com", uid: System.get_env("LDAP_UID") || "cn" +config :pleroma, Pleroma.Mailer, adapter: Swoosh.Adapters.Sendmail + # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. import_config "#{Mix.env()}.exs" From b46e6f0949eb88be064515a4d3713759155945e9 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 16:10:47 +0300 Subject: [PATCH 02/15] Fix backup/restore page to have proper headings --- docs/admin/backup.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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`) From 7c69c6f624e9e244acaac44c8ed57329aed53166 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 16:22:12 +0300 Subject: [PATCH 03/15] change bold text to be proper geadings in introduction.md --- docs/introduction.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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: From bff8cde0cf01e8b474ad3f5915c3716e885f52b3 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 16:23:32 +0300 Subject: [PATCH 04/15] 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(-) 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. From 949cfde065dbfc4d8ba1824f4cd3675d603e137e Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 16:26:46 +0300 Subject: [PATCH 05/15] 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(-) 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. From 3c9abf5dee569e0862c9d799edeb22b8e0d6f8ba Mon Sep 17 00:00:00 2001 From: Karen Konou Date: Mon, 1 Apr 2019 18:02:58 +0200 Subject: [PATCH 06/15] Fix dead links and add note about new docs site --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 47d2abf6d..5d7f249b3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Pleroma +**Note**: This readme as well as complete documentation is also availible at + ## About Pleroma Pleroma is a microblogging server software that can federate (= exchange messages with) other servers that support the same federation standards (OStatus and ActivityPub). What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement either OStatus or ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed. @@ -8,7 +10,7 @@ Pleroma is written in Elixir, high-performance and can run on small devices like For clients it supports both the [GNU Social API with Qvitter extensions](https://twitter-api.readthedocs.io/en/latest/index.html) and the [Mastodon client API](https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md). -- [Client Applications for Pleroma](docs/Clients.md) +- [Client Applications for Pleroma](docs/clients.md) No release has been made yet, but several servers have been online for months already. If you want to run your own server, feel free to contact us at @lain@pleroma.soykaf.com or in our dev chat at #pleroma on freenode or via matrix at . @@ -28,7 +30,7 @@ While we don’t provide docker files, other people have written very good ones. * Run `mix deps.get` to install elixir dependencies. * Run `mix pleroma.instance gen`. This will ask you questions about your instance and generate a configuration file in `config/generated_config.exs`. Check that and copy it to either `config/dev.secret.exs` or `config/prod.secret.exs`. It will also create a `config/setup_db.psql`, which you should run as the PostgreSQL superuser (i.e., `sudo -u postgres psql -f config/setup_db.psql`). It will create the database, user, and password you gave `mix pleroma.gen.instance` earlier, as well as set up the necessary extensions in the database. PostgreSQL superuser privileges are only needed for this step. -* For these next steps, the default will be to run pleroma using the dev configuration file, `config/dev.secret.exs`. To run them using the prod config file, prefix each command at the shell with `MIX_ENV=prod`. For example: `MIX_ENV=prod mix phx.server`. Documentation for the config can be found at [`docs/config.md`](docs/config.md) in the repository, or at the "Configuration" page on +* For these next steps, the default will be to run pleroma using the dev configuration file, `config/dev.secret.exs`. To run them using the prod config file, prefix each command at the shell with `MIX_ENV=prod`. For example: `MIX_ENV=prod mix phx.server`. Documentation for the config can be found at [`docs/config.md`](docs/config.md) in the repository, or at the "Configuration" page on * Run `mix ecto.migrate` to run the database migrations. You will have to do this again after certain updates. * You can check if your instance is configured correctly by running it with `mix phx.server` and checking the instance info endpoint at `/api/v1/instance`. If it shows your uri, name and email correctly, you are configured correctly. If it shows something like `localhost:4000`, your configuration is probably wrong, unless you are running a local development setup. * The common and convenient way for adding HTTPS is by using Nginx as a reverse proxy. You can look at example Nginx configuration in `installation/pleroma.nginx`. If you need TLS/SSL certificates for HTTPS, you can look get some for free with letsencrypt: . The simplest way to obtain and install a certificate is to use [Certbot.](https://certbot.eff.org) Depending on your specific setup, certbot may be able to get a certificate and configure your web server automatically. @@ -66,7 +68,7 @@ This is useful for running Pleroma inside Tor or I2P. ## Customization and contribution -The [Pleroma Wiki](https://git.pleroma.social/pleroma/pleroma/wikis/home) offers manuals and guides on how to further customize your instance to your liking and how you can contribute to the project. +The [Pleroma Documentation](https://docs-develop.pleroma.social/readme.html) offers manuals and guides on how to further customize your instance to your liking and how you can contribute to the project. ## Troubleshooting From 41f02e87a1968a51c30cc0f0e99926b77d4f8494 Mon Sep 17 00:00:00 2001 From: Karen Konou Date: Mon, 1 Apr 2019 18:13:42 +0200 Subject: [PATCH 07/15] Link to docs page instead of to clients.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d7f249b3..154abee40 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Pleroma is written in Elixir, high-performance and can run on small devices like For clients it supports both the [GNU Social API with Qvitter extensions](https://twitter-api.readthedocs.io/en/latest/index.html) and the [Mastodon client API](https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md). -- [Client Applications for Pleroma](docs/clients.md) +- [Client Applications for Pleroma](https://docs-develop.pleroma.social/clients.html) No release has been made yet, but several servers have been online for months already. If you want to run your own server, feel free to contact us at @lain@pleroma.soykaf.com or in our dev chat at #pleroma on freenode or via matrix at . From a309b49c2d555d4961db443a37bbf02719749a35 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 19:19:06 +0300 Subject: [PATCH 08/15] 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 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] -``` From e2b94d8f330041724b9c7d2b89c5020e463eb378 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 19:24:50 +0300 Subject: [PATCH 09/15] 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(-) 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 From 537307750109ef95d190d493a244bd9c4e72b5a6 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 19:27:40 +0300 Subject: [PATCH 10/15] update mastodon api link in README to point to a non-outdated docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 47d2abf6d..8223afcb3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Pleroma is a microblogging server software that can federate (= exchange message Pleroma is written in Elixir, high-performance and can run on small devices like a Raspberry Pi. -For clients it supports both the [GNU Social API with Qvitter extensions](https://twitter-api.readthedocs.io/en/latest/index.html) and the [Mastodon client API](https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md). +For clients it supports both the [GNU Social API with Qvitter extensions](https://twitter-api.readthedocs.io/en/latest/index.html) and the [Mastodon client API](https://docs.joinmastodon.org/api/guidelines/). - [Client Applications for Pleroma](docs/Clients.md) From f56eef8d8c2400f2ecc1d346758a70d89deda8dc Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 2 Apr 2019 01:53:25 +0200 Subject: [PATCH 11/15] router: Add fake identity proof endpoint --- lib/pleroma/web/router.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index 9ccb4e535..f4418cec0 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -218,6 +218,7 @@ defmodule Pleroma.Web.Router do get("/accounts/search", MastodonAPIController, :account_search) get("/accounts/:id/lists", MastodonAPIController, :account_lists) + get("/accounts/:id/identity_proofs", MastodonAPIController, :empty_array) get("/follow_requests", MastodonAPIController, :follow_requests) get("/blocks", MastodonAPIController, :blocks) From 4861558b93e9ff063cd32b1cae30ec37d8d53211 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 2 Apr 2019 08:58:09 +0300 Subject: [PATCH 12/15] Separate CI jobs to 3 stages to allow them to be executed in parallel --- .gitlab-ci.yml | 63 +++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dbdf59f65..9d95ff7af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,5 @@ image: elixir:1.8.1 -services: - - name: postgres:9.6.2 - command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] variables: POSTGRES_DB: pleroma_test @@ -17,56 +14,58 @@ cache: - deps - _build stages: - - lint + - build - test - - analysis - - docs_build - - docs_deploy + - deploy before_script: - mix local.hex --force - mix local.rebar --force - - mix deps.get + +build: + stage: build + script: + - mix deps.get --only test - mix compile --force - - mix ecto.create - - mix ecto.migrate - -lint: - stage: lint - script: - - mix format --check-formatted - -unit-testing: - stage: test - script: - - mix test --trace --preload-modules - -analysis: - stage: analysis - script: - - mix credo --strict --only=warnings,todo,fixme,consistency,readability docs_build: - stage: docs_build - services: + stage: build only: - master@pleroma/pleroma - develop@pleroma/pleroma variables: MIX_ENV: dev - before_script: - - mix local.hex --force - - mix local.rebar --force + script: - mix deps.get - mix compile - script: - mix docs artifacts: paths: - priv/static/doc +unit-testing: + stage: test + services: + - name: postgres:9.6.2 + command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] + script: + - mix ecto.create + - mix ecto.migrate + - mix test --trace --preload-modules + +lint: + stage: test + script: + - mix format --check-formatted + +analysis: + stage: test + script: + - mix credo --strict --only=warnings,todo,fixme,consistency,readability + + docs_deploy: - stage: docs_deploy + stage: deploy image: alpine:3.9 services: only: From 7827b929fc9816f556dc352c572f6c2ed1f1e470 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 2 Apr 2019 09:02:21 +0300 Subject: [PATCH 13/15] huh --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d95ff7af..9f3e8568f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,7 @@ before_script: build: stage: build script: - - mix deps.get --only test + - mix deps.get - mix compile --force docs_build: From 5ee54d81837f7e59e942f524259f361c438dfba4 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 2 Apr 2019 09:07:58 +0300 Subject: [PATCH 14/15] what the fuck --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f3e8568f..70fe82ee0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,6 +61,7 @@ lint: analysis: stage: test script: + - mix deps.get - mix credo --strict --only=warnings,todo,fixme,consistency,readability From 8c71ea5a1a1d4b4e75debb23b801535e19353413 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 2 Apr 2019 09:13:34 +0300 Subject: [PATCH 15/15] remove reduntant services in docs deploy and change job names to kebab case --- .gitlab-ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 70fe82ee0..c07f1a5d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,5 @@ image: elixir:1.8.1 - variables: POSTGRES_DB: pleroma_test POSTGRES_USER: postgres @@ -28,7 +27,7 @@ build: - mix deps.get - mix compile --force -docs_build: +docs-build: stage: build only: - master@pleroma/pleroma @@ -65,10 +64,9 @@ analysis: - mix credo --strict --only=warnings,todo,fixme,consistency,readability -docs_deploy: +docs-deploy: stage: deploy image: alpine:3.9 - services: only: - master@pleroma/pleroma - develop@pleroma/pleroma