From ddf5e6254a4e7099ba965de0e79dbd74e51c143d Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 05:46:21 +0300 Subject: [PATCH 01/46] Fix nginx webroot method config --- installation/pleroma.nginx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/installation/pleroma.nginx b/installation/pleroma.nginx index 7425da33f..7fc4aeea5 100644 --- a/installation/pleroma.nginx +++ b/installation/pleroma.nginx @@ -14,7 +14,6 @@ server { listen 80; listen [::]:80; - return 301 https://$server_name$request_uri; # Uncomment this if you need to use the 'webroot' method with certbot. Make sure # that the directory exists and that it is accessible by the webserver. If you followed @@ -23,8 +22,11 @@ server { # to get the certificate, and then uncomment it. # # location ~ /\.well-known/acme-challenge { - # root /var/lib/letsencrypt/.well-known/acme-challenge; + # alias /var/lib/letsencrypt/.well-known/acme-challenge; # } + location / { + return 301 https://$server_name$request_uri; + } } # Enable SSL session caching for improved performance From 7e35bdbd3c51771532f77b58829c6f0e2dcd08ca Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 05:46:47 +0300 Subject: [PATCH 02/46] Copy the nginx config to the release directory --- mix.exs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 9fdf6e83a..dc2df01a2 100644 --- a/mix.exs +++ b/mix.exs @@ -37,7 +37,7 @@ def project do pleroma: [ include_executables_for: [:unix], applications: [ex_syslogger: :load, syslog: :load], - steps: [:assemble, ©_files/1] + steps: [:assemble, ©_files/1, ©_nginx_config/1] ] ] ] @@ -48,6 +48,11 @@ def copy_files(%{path: target_path} = release) do release end + def copy_nginx_config(%{path: target_path} = release) do + File.cp!("./installation/pleroma.nginx", Path.join([target_path, "installation", "pleroma.nginx"])) + release + end + # Configuration for the OTP application. # # Type `mix help compile.app` for more information. From dd238887743cba24b8fa1971ae0a4f806a212f13 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 05:48:13 +0300 Subject: [PATCH 03/46] OTP release install guide sceleton --- docs/installation/releases_en.md | 188 +++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 docs/installation/releases_en.md diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md new file mode 100644 index 000000000..c0eafa75a --- /dev/null +++ b/docs/installation/releases_en.md @@ -0,0 +1,188 @@ +# Installing on Linux using OTP releases + +## Pre-requisites +* A machine running Linux with GNU (e.g. Debian, Ubuntu) or musl (e.g. Alpine) libc and `x86_64`, `aarch64` or `armv7l` CPU, you have root access to. If you are not sure if it's compatible see [Detecting flavour section](#detecting-flavour) below +* A (sub)domain pointed to the machine + +You will be running commands as root. If you aren't root already, please elevate your priviledges by executing `sudo su`/`su`. + +While in theory OTP releases are possbile to install on any compatible machine, for the sake of simplicity this guide focuses only on Debian/Ubuntu/Alpine. + +### Detecting flavour + +Paste the following into the shell: +```sh +arch="$(arch)";if [ "$arch" = "x86_64" ];then arch="amd64";elif [ "$arch" = "armv7l" ];then arch="arm";elif [ "$arch" = "aarch64" ];then arch="arm64";else echo "Unsupported arch: $arch">&2;exit 1;fi;if getconf GNU_LIBC_VERSION>/dev/null;then libc_postfix="";elif [ "$(ldd 2>&1|head -c 9)" = "musl libc" ];then libc_postfix="-musl";elif [ "$(find /lib/libc.musl*|wc -l)" ];then libc_postfix="-musl";else echo "Unsupported libc">&2;exit 1;fi;echo "$arch$libc_postfix" +``` + +If your platform is supported the output will contain the flavour string, you will need it later. If not, this just means that we don't build releases for your platform, you can still try the regular install. + +### Installing the required packages + +Other than things bundled in the OTP release Pleroma depends on: +* curl (to download the release build) +* unzip (needed to unpack release builds) +* ncurses (ERTS won't run without it) +* PostgreSQL (also utilizes extensions in postgresql-contrib) +* nginx (could be swapped with another webserver but this guide covers only it) +* certbot (for Let's Encrypt certificates, could be swapped with another ACME client, but this guide covers only it) + +Debian/Ubuntu: +```sh +apt install curl unzip ncurses postgresql posqtgresql-contrib nginx certbot +``` +Alpine: +```sh +apk add curl unzip ncurses postgresql posqtgresql-contrib nginx certbot +``` + +## Setup +### Configuring PostgreSQL +#### (Optional) Installing RUM indexes +RUM indexes are an alternative indexing scheme that is not included in PostgreSQL by default. You can read more about them on the [Configuration page](config.html#rum-indexing-for-full-text-search). They are completely optional and most of the time are not worth it, especially if you are running a single user instance (unless you absolutely need ordered search results). + +Debian/Ubuntu: +```sh +apt install postgresql-rum +``` +Alpine: +```sh +apk install gcc make +git clone https://github.com/postgrespro/rum /tmp/rum +cd /tmp/rum +make USE_PGXS=1 +make USE_PGXS=1 install +make USE_PGXS=1 installcheck +cd +rm -r /tmp/rum +``` +#### (Optional) Performance configuration +For optimal performance, you may use [PGTune](https://pgtune.leopard.in.ua), don't forget to restart postgresql after editing the configuration + +Debian/Ubuntu: +```sh +systemctl restart postgresql +``` +Alpine: +```sh +rc-service postgresql restart +``` +### Installing Pleroma +```sh +# Create the Pleroma user +adduser -S -s /bin/false -h /opt/pleroma -H pleroma + +# Set the flavour environment variable to the string you got in Detecting flavour section. +# For example if the flavour is `arm64-musl` the command will be +export FLAVOUR="arm64-musl" + +# Clone the release build into a temporary directory and unpack it +su pleroma -s $SHELL -lc " +echo '$FLAVOUR' +curl 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/master/download?job=$FLAVOUR' -o /tmp/pleroma.zip +unzip /tmp/pleroma.zip -d /tmp/ +" + +# Move the release to the home directory and delete temporary files +su pleroma -s $SHELL -lc " +mv /tmp/release/* /opt/pleroma +rmdir /tmp/release +rm /tmp/pleroma.zip +" +# Create uploads directory and set proper permissions (skip if planning to use a remote uploader) +# Note: It does not have to be `/var/lib/pleroma/uploads`, the config generator will ask about the upload directory later + +mkdir -p /var/lib/pleroma/uploads +chown -R pleroma:pleroma /var/lib/pleroma + +# Create custom public files directory (custom emojis, frontend bundle overrides, robots.txt, etc.) +# Note: It does not have to be `/var/lib/pleroma/static`, the config generator will ask about the custom public files directory later +mkdir -p /var/lib/pleroma/static +chown -R pleroma:pleroma /var/lib/pleroma + +# Create a config directory +mkdir -p /etc/pleroma +chown -R pleroma:pleroma /etc/pleroma + +# Run the config generator +su pleroma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/pleroma/config.exs --output-psql /tmp/setup_db.psql" + +# Create the postgres database +psql -U postgres -d postgres -f /tmp/setup_db.psql + +# Create the database schema +./bin/pleroma_ctl create +./bin/pleroma_ctl migrate + +# Start the instance to verify that everything is working as expected +./bin/pleroma daemon + +# Wait for about 20 seconds and query the instance endpoint, if it shows your uri, name and email correctly, you are configured correctly +sleep 20 && curl http://localhost:4000/api/v1/instance + +# Stop the instance +./bin/pleroma stop +``` + +### Setting up nginx and getting Let's Encrypt SSL certificaties + +```sh +# Get a Let's Encrypt certificate +certbot certonly --standalone --preferred-challenges http -d yourinstance.tld + +# Copy the Pleroma nginx configuration to the nginx folder +# The location of nginx configs is dependent on the distro + +# For Debian/Ubuntu: +cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.nginx +ln -s /etc/nginx/sites-available/pleroma.nginx /etc/nginx/sites-enabled/pleroma.nginx +# For Alpine +cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/conf.d/pleroma.conf +# If your distro does not have either of those you can append +# `include /etc/nginx/pleroma.conf` to the end of the http section in /etc/nginx/nginx.conf and +cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/pleroma.conf + +# Edit the nginx config replacing example.tld with your (sub)domain +$EDITOR path-to-the-config + +# Verify that the config is valid +nginx -t + +# Start nginx +# For Debian/Ubuntu: +systemctl start nginx +# For Alpine +rc-service nginx start +``` + +At this point if you open your (sub)domain in a browser you should see a 502 error, that's because pleroma is not started yet. + +### Setting up a system service +Debian/Ubuntu: +```sh +# Copy the service into a proper directory +cp /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service + +# Start pleroma and enable it on boot +systemctl start pleroma +systemctl enable pleroma +``` +Alpine: +```sh +# Copy the service into a proper directory +cp /opt/pleroma/installation/init.d/pleroma /etc/init.d/pleroma + +# Start pleroma and enable it on boot +rc-service pleroma start +rc-update add pleroma +``` + +If everything worked, you should see Pleroma-FE when visiting your domain. If that didn't happen, try reviewing the installation steps, starting Pleroma in the foreground and seeing if there are any errrors. + +Still doesn't work? Feel free to contact us on [#pleroma on freenode](https://webchat.freenode.net/?channels=%23pleroma) or via matrix at , you can also [file an issue on our Gitlab](https://git.pleroma.social/pleroma/pleroma/issues/new) + +## Post installation + +### Setting up auto-renew Let's Encrypt certificate +### Running Mix tasks +### Updating From 267f6bedd885a00a94f8d383a6793d34b018762a Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 05:57:46 +0300 Subject: [PATCH 04/46] Formatting --- mix.exs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index dc2df01a2..bd8a10c66 100644 --- a/mix.exs +++ b/mix.exs @@ -49,7 +49,11 @@ def copy_files(%{path: target_path} = release) do end def copy_nginx_config(%{path: target_path} = release) do - File.cp!("./installation/pleroma.nginx", Path.join([target_path, "installation", "pleroma.nginx"])) + File.cp!( + "./installation/pleroma.nginx", + Path.join([target_path, "installation", "pleroma.nginx"]) + ) + release end From d3d98beaad9127517c7ad8d027f052a23807772b Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:04:39 +0300 Subject: [PATCH 05/46] Correct package names for Debian --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index c0eafa75a..4645f7aff 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -29,7 +29,7 @@ Other than things bundled in the OTP release Pleroma depends on: Debian/Ubuntu: ```sh -apt install curl unzip ncurses postgresql posqtgresql-contrib nginx certbot +apt install curl unzip libncurses5 postgresql postgresql-contrib nginx certbot ``` Alpine: ```sh From f9515a36112c8f6a8a40dbda234aaa6bb5de3827 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:14:02 +0300 Subject: [PATCH 06/46] Add a note about RUM indexes package on Debian/Ubuntu --- docs/installation/releases_en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 4645f7aff..39749b40b 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -41,9 +41,9 @@ apk add curl unzip ncurses postgresql posqtgresql-contrib nginx certbot #### (Optional) Installing RUM indexes RUM indexes are an alternative indexing scheme that is not included in PostgreSQL by default. You can read more about them on the [Configuration page](config.html#rum-indexing-for-full-text-search). They are completely optional and most of the time are not worth it, especially if you are running a single user instance (unless you absolutely need ordered search results). -Debian/Ubuntu: +Debian/Ubuntu (available only on Buster/19.04): ```sh -apt install postgresql-rum +apt install postgresql-11-rum ``` Alpine: ```sh From 4669a56aa37bf02aa6564ef53758879e3a58a6b2 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:22:34 +0300 Subject: [PATCH 07/46] Add notes on RUM indexes --- docs/installation/releases_en.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 39749b40b..918ae83e1 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -110,10 +110,17 @@ su pleroma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/pleroma/c # Create the postgres database psql -U postgres -d postgres -f /tmp/setup_db.psql +# If you have installed RUM indexes add +# `config :pleroma, :database, rum_enabled: true` +# to the end of /etc/pleroma/config.exs before proceeding + # Create the database schema ./bin/pleroma_ctl create ./bin/pleroma_ctl migrate +# If you have installed RUM indexes also run +./bin/pleroma_ctl migrate --migrations-path priv/repo/optional_migrations/rum_indexing/ + # Start the instance to verify that everything is working as expected ./bin/pleroma daemon From 16e9304cecc420b9dbdb17f0db13a9a0010ad6cf Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:32:34 +0300 Subject: [PATCH 08/46] Change to long adduser options because the short ones only work on busybox --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 918ae83e1..df1b02231 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -70,7 +70,7 @@ rc-service postgresql restart ### Installing Pleroma ```sh # Create the Pleroma user -adduser -S -s /bin/false -h /opt/pleroma -H pleroma +adduser --system --shell /bin/false --home /opt/pleroma pleroma # Set the flavour environment variable to the string you got in Detecting flavour section. # For example if the flavour is `arm64-musl` the command will be From e824025c52bec84a44bc4307407071daa99e805f Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:37:38 +0300 Subject: [PATCH 09/46] Remove a useless echo --- docs/installation/releases_en.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index df1b02231..e1a2e97e6 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -78,7 +78,6 @@ export FLAVOUR="arm64-musl" # Clone the release build into a temporary directory and unpack it su pleroma -s $SHELL -lc " -echo '$FLAVOUR' curl 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/master/download?job=$FLAVOUR' -o /tmp/pleroma.zip unzip /tmp/pleroma.zip -d /tmp/ " From 4bec121798218f8abf8d2915fa7c26ccb23a4f4a Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:39:03 +0300 Subject: [PATCH 10/46] Do not set ownership group in chown commands --- docs/installation/releases_en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index e1a2e97e6..9fbb4b26e 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -92,16 +92,16 @@ rm /tmp/pleroma.zip # Note: It does not have to be `/var/lib/pleroma/uploads`, the config generator will ask about the upload directory later mkdir -p /var/lib/pleroma/uploads -chown -R pleroma:pleroma /var/lib/pleroma +chown -R pleroma /var/lib/pleroma # Create custom public files directory (custom emojis, frontend bundle overrides, robots.txt, etc.) # Note: It does not have to be `/var/lib/pleroma/static`, the config generator will ask about the custom public files directory later mkdir -p /var/lib/pleroma/static -chown -R pleroma:pleroma /var/lib/pleroma +chown -R pleroma /var/lib/pleroma # Create a config directory mkdir -p /etc/pleroma -chown -R pleroma:pleroma /etc/pleroma +chown -R pleroma /etc/pleroma # Run the config generator su pleroma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/pleroma/config.exs --output-psql /tmp/setup_db.psql" From 89fead9250a5bd9b6712a285e8a827f1aec69615 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:42:04 +0300 Subject: [PATCH 11/46] Default DB configuration to false and set the default database name to `pleroma` instead of `pleroma_dev` --- lib/mix/tasks/pleroma/instance.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mix/tasks/pleroma/instance.ex b/lib/mix/tasks/pleroma/instance.ex index 2c4e414cf..9e26c066b 100644 --- a/lib/mix/tasks/pleroma/instance.ex +++ b/lib/mix/tasks/pleroma/instance.ex @@ -112,12 +112,12 @@ def run(["gen" | rest]) do options, :db_configurable, "Do you want to store the configuration in the database (allows controlling it from admin-fe)? (y/n)", - "y" + "n" ) === "y" dbhost = get_option(options, :dbhost, "What is the hostname of your database?", "localhost") - dbname = get_option(options, :dbname, "What is the name of your database?", "pleroma_dev") + dbname = get_option(options, :dbname, "What is the name of your database?", "pleroma") dbuser = get_option( From 8b170b96c7c9ae727bdfe2d6856375b183f56180 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 16:59:48 +0000 Subject: [PATCH 12/46] Apply suggestion to docs/installation/releases_en.md --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 9fbb4b26e..352dc3dfc 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -118,7 +118,7 @@ psql -U postgres -d postgres -f /tmp/setup_db.psql ./bin/pleroma_ctl migrate # If you have installed RUM indexes also run -./bin/pleroma_ctl migrate --migrations-path priv/repo/optional_migrations/rum_indexing/ +# ./bin/pleroma_ctl migrate --migrations-path priv/repo/optional_migrations/rum_indexing/ # Start the instance to verify that everything is working as expected ./bin/pleroma daemon From de77d7621a781cf409663a8d5e931227e3b2cf82 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 16:59:56 +0000 Subject: [PATCH 13/46] Apply suggestion to docs/installation/releases_en.md --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 352dc3dfc..48fffa6e2 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -24,7 +24,7 @@ Other than things bundled in the OTP release Pleroma depends on: * unzip (needed to unpack release builds) * ncurses (ERTS won't run without it) * PostgreSQL (also utilizes extensions in postgresql-contrib) -* nginx (could be swapped with another webserver but this guide covers only it) +* nginx (could be swapped with another reverse proxy but this guide covers only it) * certbot (for Let's Encrypt certificates, could be swapped with another ACME client, but this guide covers only it) Debian/Ubuntu: From 743bd648832eb1fd6033c3484059c08f88af40f3 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 17:00:12 +0000 Subject: [PATCH 14/46] Apply suggestion to docs/installation/releases_en.md --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 48fffa6e2..c682a8d61 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -15,7 +15,7 @@ Paste the following into the shell: arch="$(arch)";if [ "$arch" = "x86_64" ];then arch="amd64";elif [ "$arch" = "armv7l" ];then arch="arm";elif [ "$arch" = "aarch64" ];then arch="arm64";else echo "Unsupported arch: $arch">&2;exit 1;fi;if getconf GNU_LIBC_VERSION>/dev/null;then libc_postfix="";elif [ "$(ldd 2>&1|head -c 9)" = "musl libc" ];then libc_postfix="-musl";elif [ "$(find /lib/libc.musl*|wc -l)" ];then libc_postfix="-musl";else echo "Unsupported libc">&2;exit 1;fi;echo "$arch$libc_postfix" ``` -If your platform is supported the output will contain the flavour string, you will need it later. If not, this just means that we don't build releases for your platform, you can still try the regular install. +If your platform is supported the output will contain the flavour string, you will need it later. If not, this just means that we don't build releases for your platform, you can still try installing from source. ### Installing the required packages From ee4e7c6570dd959fe5c65fc5e18967af5a870735 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 02:07:05 +0300 Subject: [PATCH 15/46] Remove the getting started steps from pleroma.instance gen task They are not compatible with every platform, different for OTP releases and may become outdated. We are better off just telling people to refer to the installation guides for their particular platform --- lib/mix/tasks/pleroma/instance.ex | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/lib/mix/tasks/pleroma/instance.ex b/lib/mix/tasks/pleroma/instance.ex index 9b14871c9..7022d173d 100644 --- a/lib/mix/tasks/pleroma/instance.ex +++ b/lib/mix/tasks/pleroma/instance.ex @@ -186,28 +186,16 @@ def run(["gen" | rest]) do dbpass: dbpass ) - shell_info( - "Writing config to #{config_path}. You should rename it to config/prod.secret.exs or config/dev.secret.exs." - ) + shell_info("Writing config to #{config_path}.") File.write(config_path, result_config) - shell_info("Writing #{psql_path}.") + shell_info("Writing the postgres script to #{psql_path}.") File.write(psql_path, result_psql) write_robots_txt(indexable, template_dir) shell_info( - "\n" <> - """ - To get started: - 1. Verify the contents of the generated files. - 2. Run `sudo -u postgres psql -f #{escape_sh_path(psql_path)}`. - """ <> - if config_path in ["config/dev.secret.exs", "config/prod.secret.exs"] do - "" - else - "3. Run `mv #{escape_sh_path(config_path)} 'config/prod.secret.exs'`." - end + "\n All files successfully written! Refer to the installation instructions for your platform for next steps" ) else shell_error( From d1d648b0ecfb0924d7921796d7edef9512e030b0 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 02:09:45 +0300 Subject: [PATCH 16/46] Correct the psql command --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index c682a8d61..10d8879af 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -107,7 +107,7 @@ chown -R pleroma /etc/pleroma su pleroma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/pleroma/config.exs --output-psql /tmp/setup_db.psql" # Create the postgres database -psql -U postgres -d postgres -f /tmp/setup_db.psql +su postgres -s $SHELL -lc "psql -f /tmp/setup_db.psql" # If you have installed RUM indexes add # `config :pleroma, :database, rum_enabled: true` From 23608149bc72d740e6259e460e43ff276583516d Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 02:20:55 +0300 Subject: [PATCH 17/46] Execute migration commands as the pleroma user and add a note about the need to uncomment the RUM command --- docs/installation/releases_en.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 10d8879af..31e3ac30d 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -114,20 +114,20 @@ su postgres -s $SHELL -lc "psql -f /tmp/setup_db.psql" # to the end of /etc/pleroma/config.exs before proceeding # Create the database schema -./bin/pleroma_ctl create -./bin/pleroma_ctl migrate +su pleroma -s $SHELL -lc "./bin/pleroma_ctl create" +su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate" -# If you have installed RUM indexes also run -# ./bin/pleroma_ctl migrate --migrations-path priv/repo/optional_migrations/rum_indexing/ +# If you have installed RUM indexes uncommend and run +# su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate --migrations-path priv/repo/optional_migrations/rum_indexing/" # Start the instance to verify that everything is working as expected -./bin/pleroma daemon +su pleroma -s $SHELL -lc "./bin/pleroma daemon" # Wait for about 20 seconds and query the instance endpoint, if it shows your uri, name and email correctly, you are configured correctly sleep 20 && curl http://localhost:4000/api/v1/instance # Stop the instance -./bin/pleroma stop +su pleroma -s $SHELL -lc "./bin/pleroma stop" ``` ### Setting up nginx and getting Let's Encrypt SSL certificaties From 120f84c83dcebb9b46cb158b9e1f4af9cf0aee28 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 04:35:17 +0300 Subject: [PATCH 18/46] Executing create is unnecessary after the postgres script is executed --- docs/installation/releases_en.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 31e3ac30d..5ccd50c47 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -114,7 +114,6 @@ su postgres -s $SHELL -lc "psql -f /tmp/setup_db.psql" # to the end of /etc/pleroma/config.exs before proceeding # Create the database schema -su pleroma -s $SHELL -lc "./bin/pleroma_ctl create" su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate" # If you have installed RUM indexes uncommend and run From 38a803a1f86b459d193aa234d00b1af3895edab1 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 05:00:41 +0300 Subject: [PATCH 19/46] Add a systemd service for OTP releases --- rel/files/installation/pleroma.service | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 rel/files/installation/pleroma.service diff --git a/rel/files/installation/pleroma.service b/rel/files/installation/pleroma.service new file mode 100644 index 000000000..e47cf58dc --- /dev/null +++ b/rel/files/installation/pleroma.service @@ -0,0 +1,36 @@ +[Unit] +Description=Pleroma social network +After=network.target postgresql.service nginx.service + +[Service] +KillMode=process +Restart=on-failure + +; Name of the user that runs the Pleroma service. +User=pleroma + +; Make sure that all paths fit your installation. +; Path to the home directory of the user running the Pleroma service. +Environment="HOME=/opt/pleroma" +; Path to the folder containing the Pleroma installation. +WorkingDirectory=/opt/pleroma +; Path to the Pleroma binary. +ExecStart=/opt/pleroma/bin/pleroma start +ExecStop=/opt/pleroma/bin/pleroma stop + +; Some security directives. +; Use private /tmp and /var/tmp folders inside a new file system namespace, which are discarded after the process stops. +PrivateTmp=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. +ProtectHome=true +; Mount /usr, /boot, and /etc as read-only for processes invoked by this service. +ProtectSystem=full +; 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. Disabled by default because it may not work on devices like the Raspberry Pi. +PrivateDevices=false +; Ensures that the service process and all its children can never gain new privileges through execve(). +NoNewPrivileges=true +; Drops the sysadmin capability from the daemon. +CapabilityBoundingSet=~CAP_SYS_ADMIN + +[Install] +WantedBy=multi-user.target From 1d2332ce79c374f4958b5d554ea96d382e9806fb Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 05:20:36 +0300 Subject: [PATCH 20/46] Use uname -m instead of arch for more portability --- docs/installation/releases_en.md | 2 +- rel/files/bin/pleroma_ctl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 5ccd50c47..7dde26771 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -12,7 +12,7 @@ While in theory OTP releases are possbile to install on any compatible machine, Paste the following into the shell: ```sh -arch="$(arch)";if [ "$arch" = "x86_64" ];then arch="amd64";elif [ "$arch" = "armv7l" ];then arch="arm";elif [ "$arch" = "aarch64" ];then arch="arm64";else echo "Unsupported arch: $arch">&2;exit 1;fi;if getconf GNU_LIBC_VERSION>/dev/null;then libc_postfix="";elif [ "$(ldd 2>&1|head -c 9)" = "musl libc" ];then libc_postfix="-musl";elif [ "$(find /lib/libc.musl*|wc -l)" ];then libc_postfix="-musl";else echo "Unsupported libc">&2;exit 1;fi;echo "$arch$libc_postfix" +arch="$(uname -m)";if [ "$arch" = "x86_64" ];then arch="amd64";elif [ "$arch" = "armv7l" ];then arch="arm";elif [ "$arch" = "aarch64" ];then arch="arm64";else echo "Unsupported arch: $arch">&2;exit 1;fi;if getconf GNU_LIBC_VERSION>/dev/null;then libc_postfix="";elif [ "$(ldd 2>&1|head -c 9)" = "musl libc" ];then libc_postfix="-musl";elif [ "$(find /lib/libc.musl*|wc -l)" ];then libc_postfix="-musl";else echo "Unsupported libc">&2;exit 1;fi;echo "$arch$libc_postfix" ``` If your platform is supported the output will contain the flavour string, you will need it later. If not, this just means that we don't build releases for your platform, you can still try installing from source. diff --git a/rel/files/bin/pleroma_ctl b/rel/files/bin/pleroma_ctl index b0e1874a9..9c67b209b 100755 --- a/rel/files/bin/pleroma_ctl +++ b/rel/files/bin/pleroma_ctl @@ -2,7 +2,7 @@ # XXX: This should be removed when elixir's releases get custom command support detect_flavour() { - arch="$(arch)" + arch="$(uname -m)" if [ "$arch" = "x86_64" ]; then arch="amd64" elif [ "$arch" = "armv7l" ]; then From dd05dc65d31d5d54662e7c5d81ed393ae25d14dd Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 08:30:32 +0300 Subject: [PATCH 21/46] Do not exit on fail in the one-liner because it closes ssh connection and fix dependencies for alpine --- docs/installation/releases_en.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 7dde26771..31b639d32 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -12,7 +12,7 @@ While in theory OTP releases are possbile to install on any compatible machine, Paste the following into the shell: ```sh -arch="$(uname -m)";if [ "$arch" = "x86_64" ];then arch="amd64";elif [ "$arch" = "armv7l" ];then arch="arm";elif [ "$arch" = "aarch64" ];then arch="arm64";else echo "Unsupported arch: $arch">&2;exit 1;fi;if getconf GNU_LIBC_VERSION>/dev/null;then libc_postfix="";elif [ "$(ldd 2>&1|head -c 9)" = "musl libc" ];then libc_postfix="-musl";elif [ "$(find /lib/libc.musl*|wc -l)" ];then libc_postfix="-musl";else echo "Unsupported libc">&2;exit 1;fi;echo "$arch$libc_postfix" +arch="$(uname -m)";if [ "$arch" = "x86_64" ];then arch="amd64";elif [ "$arch" = "armv7l" ];then arch="arm";elif [ "$arch" = "aarch64" ];then arch="arm64";else echo "Unsupported arch: $arch">&2;fi;if getconf GNU_LIBC_VERSION>/dev/null;then libc_postfix="";elif [ "$(ldd 2>&1|head -c 9)" = "musl libc" ];then libc_postfix="-musl";elif [ "$(find /lib/libc.musl*|wc -l)" ];then libc_postfix="-musl";else echo "Unsupported libc">&2;fi;echo "$arch$libc_postfix" ``` If your platform is supported the output will contain the flavour string, you will need it later. If not, this just means that we don't build releases for your platform, you can still try installing from source. @@ -33,7 +33,9 @@ apt install curl unzip libncurses5 postgresql postgresql-contrib nginx certbot ``` Alpine: ```sh -apk add curl unzip ncurses postgresql posqtgresql-contrib nginx certbot +echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories +apk update +apk add curl unzip ncurses postgresql postgresql-contrib nginx certbot ``` ## Setup From 50e3cf9d5e4c957f4a979bbeed29787209bdfa13 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 08:31:02 +0300 Subject: [PATCH 22/46] Correct a typo in the apk command --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 31b639d32..9c108c4ff 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -49,7 +49,7 @@ apt install postgresql-11-rum ``` Alpine: ```sh -apk install gcc make +apk add gcc make git clone https://github.com/postgrespro/rum /tmp/rum cd /tmp/rum make USE_PGXS=1 From 177faf15c24453fc67bb5bedc6189055e686e2a3 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 08:36:36 +0300 Subject: [PATCH 23/46] Correct dependencies for RUM on alpine and remove installcheck --- docs/installation/releases_en.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 9c108c4ff..ce46d0d29 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -49,12 +49,11 @@ apt install postgresql-11-rum ``` Alpine: ```sh -apk add gcc make +apk add gcc make git postgresql-dev musl-dev git clone https://github.com/postgrespro/rum /tmp/rum cd /tmp/rum make USE_PGXS=1 make USE_PGXS=1 install -make USE_PGXS=1 installcheck cd rm -r /tmp/rum ``` From bb40c33dd65aaeafaf3b74f4557deb75b0da8e93 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 13:24:33 +0300 Subject: [PATCH 24/46] Add an OpenRC service for OTP releases --- rel/files/installation/init.d/pleroma | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 rel/files/installation/init.d/pleroma diff --git a/rel/files/installation/init.d/pleroma b/rel/files/installation/init.d/pleroma new file mode 100755 index 000000000..de007c5e3 --- /dev/null +++ b/rel/files/installation/init.d/pleroma @@ -0,0 +1,18 @@ +#!/sbin/openrc-run + +# Requires OpenRC >= 0.35 +directory=/opt/pleroma + +command=/opt/pleroma/bin/pleroma +command_args="start" +command_user=pleroma +command_background=1 + +# Ask process to terminate within 30 seconds, otherwise kill it +retry="SIGTERM/30/SIGKILL/5" + +pidfile="/var/run/pleroma.pid" + +depend() { + need nginx postgresql +} From e00e4c0e7a43aaa5c4be43e105712101167f4cbd Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 13:40:37 +0300 Subject: [PATCH 25/46] Add a warning about OTP releases on Alpine 3.10 --- docs/installation/releases_en.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index ce46d0d29..e8bdf007d 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -32,8 +32,10 @@ Debian/Ubuntu: apt install curl unzip libncurses5 postgresql postgresql-contrib nginx certbot ``` Alpine: + +**Warning:** There has been some changes to musl on Alpine 3.10 which need an Elixir rebuild. Since the build machines are running Alpine 3.9 running the builds on 3.10 will likely fail with "dlsym: Resource temporarily unavailable". If you have not updated yet, replace `latest-stable` with `v3.9` in `/etc/apk/repositories`. If you have, try downgrading `musl` to `1.1.20-r3` ```sh -echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories +echo "http://nl.alpinelinux.org/alpine/v3.9/community" >> /etc/apk/repositories apk update apk add curl unzip ncurses postgresql postgresql-contrib nginx certbot ``` @@ -149,7 +151,7 @@ cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/conf.d/pleroma.conf cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/pleroma.conf # Edit the nginx config replacing example.tld with your (sub)domain -$EDITOR path-to-the-config +$EDITOR path-to-nginx-config # Verify that the config is valid nginx -t From c013d3f3c89a638e20e786a528be598cfa225af7 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 20:26:59 +0300 Subject: [PATCH 26/46] Fix the webroot method in the nginx config --- installation/pleroma.nginx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/pleroma.nginx b/installation/pleroma.nginx index 7fc4aeea5..de380a6ca 100644 --- a/installation/pleroma.nginx +++ b/installation/pleroma.nginx @@ -22,7 +22,7 @@ server { # to get the certificate, and then uncomment it. # # location ~ /\.well-known/acme-challenge { - # alias /var/lib/letsencrypt/.well-known/acme-challenge; + # root /var/lib/letsencrypt/; # } location / { return 301 https://$server_name$request_uri; From 7a4c4518b8cdff5684f3287f373e3e6acf72293c Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 21:18:34 +0300 Subject: [PATCH 27/46] Remove a note about needing to add RUM to config manually, as it is now in the config generator --- docs/installation/releases_en.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index e8bdf007d..7f53aedb8 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -112,10 +112,6 @@ su pleroma -s $SHELL -lc "./bin/pleroma_ctl instance gen --output /etc/pleroma/c # Create the postgres database su postgres -s $SHELL -lc "psql -f /tmp/setup_db.psql" -# If you have installed RUM indexes add -# `config :pleroma, :database, rum_enabled: true` -# to the end of /etc/pleroma/config.exs before proceeding - # Create the database schema su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate" From 9d487ba57949a4102aa2eb67b26842f1c0ef418c Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 02:42:47 +0300 Subject: [PATCH 28/46] Add docs about SSL certificate auto-renew --- docs/installation/releases_en.md | 52 ++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 7f53aedb8..30fbf5177 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -140,7 +140,7 @@ certbot certonly --standalone --preferred-challenges http -d yourinstance.tld # For Debian/Ubuntu: cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/pleroma.nginx ln -s /etc/nginx/sites-available/pleroma.nginx /etc/nginx/sites-enabled/pleroma.nginx -# For Alpine +# For Alpine: cp /opt/pleroma/installation/pleroma.nginx /etc/nginx/conf.d/pleroma.conf # If your distro does not have either of those you can append # `include /etc/nginx/pleroma.conf` to the end of the http section in /etc/nginx/nginx.conf and @@ -155,7 +155,7 @@ nginx -t # Start nginx # For Debian/Ubuntu: systemctl start nginx -# For Alpine +# For Alpine: rc-service nginx start ``` @@ -188,5 +188,53 @@ Still doesn't work? Feel free to contact us on [#pleroma on freenode](https://we ## Post installation ### Setting up auto-renew Let's Encrypt certificate +```sh +# Create the directory for webroot challenges +mkdir -p /var/lib/letsencrypt + +# Uncomment the webroot method +$EDITOR path-to-nginx-config + +# Verify that the config is valid +nginx -t +``` +Debian/Ubuntu: +```sh +# Restart nginx +systemctl restart nginx + +# Ensure the webroot menthod and post hook is working +certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --dry-run --post-hook 'systemctl nginx reload' + +# Add it to the daily cron +echo '#!/bin/sh +certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --dry-run --post-hook "systemctl reload nginx" +' > /etc/cron.daily/renew-pleroma-cert +chmod +x /etc/cron.daily/renew-pleroma-cert + +# If everything worked the output should contain /etc/cron.daily/renew-pleroma-cert +run-parts --test /etc/cron.daily +``` +Alpine: +```sh +# Restart nginx +rc-service nginx restart + +# Start the cron daemon and make it start on boot +rc-service crond start +rc-update add crond + +# Ensure the webroot menthod and post hook is working +certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --dry-run --post-hook 'rc-service nginx reload' + +# Add it to the daily cron +echo '#!/bin/sh +certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --dry-run --post-hook "rc-service nginx reload" +' > /etc/periodic/daily/renew-pleroma-cert +chmod +x /etc/periodic/daily/renew-pleroma-cert + +# If everything worked this should output /etc/periodic/daily/renew-pleroma-cert +run-parts --test /etc/periodic/daily +``` ### Running Mix tasks ### Updating From 18eabca9789cdb96c77279aa4cff5b34e558c803 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 02:55:43 +0300 Subject: [PATCH 29/46] Add a section about updating --- docs/installation/releases_en.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 30fbf5177..6c05f4cd9 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -238,3 +238,12 @@ run-parts --test /etc/periodic/daily ``` ### Running Mix tasks ### Updating +Generally, doing the following is enough: +```sh +# Download the new release +su pleroma -s $SHELL -lc "./bin/pleroma_ctl update" + +# Migrate the database, you are advised to stop the instance before doing that +su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate" +``` +But you should **always check the release notes/changelog** in case there are config deprecations, special update steps, etc. From 299cefa2bdbbde171501c5fa516e37b5e9733953 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 03:05:02 +0300 Subject: [PATCH 30/46] Add a section on executing mix tasks --- docs/installation/releases_en.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index 6c05f4cd9..b9ac1b955 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -236,7 +236,13 @@ chmod +x /etc/periodic/daily/renew-pleroma-cert # If everything worked this should output /etc/periodic/daily/renew-pleroma-cert run-parts --test /etc/periodic/daily ``` -### Running Mix tasks +### Running mix tasks +Throughout the wiki and guides there is a lot of references to mix tasks. Since `mix` is a build tool, you can't just call `mix pleroma.task`, instead you should call `pleroma_ctl` stripping pleroma/ecto namespace. + +So for example, if the task is `mix pleroma.user set admin --admin`, you should run it like this: +```sh +su pleroma -s $SHELL -lc "./bin/pleroma_ctl user set admin --admin" +``` ### Updating Generally, doing the following is enough: ```sh From 997e766929172eddade2416c9e915806a402a8d1 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 07:39:23 +0300 Subject: [PATCH 31/46] Remove sudo in the nginx config command example --- installation/pleroma.nginx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/pleroma.nginx b/installation/pleroma.nginx index de380a6ca..e3c70de54 100644 --- a/installation/pleroma.nginx +++ b/installation/pleroma.nginx @@ -17,7 +17,7 @@ server { # Uncomment this if you need to use the 'webroot' method with certbot. Make sure # that the directory exists and that it is accessible by the webserver. If you followed - # the guide, you already ran 'sudo mkdir -p /var/lib/letsencrypt' to create the folder. + # the guide, you already ran 'mkdir -p /var/lib/letsencrypt' to create the folder. # You may need to load this file with the ssl server block commented out, run certbot # to get the certificate, and then uncomment it. # From 66e92dc0ca9fe50dad5a758cf2b16543bff03c2e Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 07:43:45 +0300 Subject: [PATCH 32/46] Add a Further Reading section to the OTP install guide --- docs/installation/releases_en.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md index b9ac1b955..e9d913604 100644 --- a/docs/installation/releases_en.md +++ b/docs/installation/releases_en.md @@ -253,3 +253,10 @@ su pleroma -s $SHELL -lc "./bin/pleroma_ctl update" su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate" ``` But you should **always check the release notes/changelog** in case there are config deprecations, special update steps, etc. + +## Further reading +* [Configuration](config.html) +* [Pleroma's base config.exs](https://git.pleroma.social/pleroma/pleroma/blob/master/config/config.exs) +* [Hardening your instance](hardening.html) +* [Pleroma Clients](clients.html) +* [Emoji pack manager](Mix.Tasks.Pleroma.Emoji.html) From 1d3c5e434df83ce2da1b1c67090192b115b4e905 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 07:44:10 +0300 Subject: [PATCH 33/46] releases_en.md -> otp_en.md --- docs/installation/{releases_en.md => otp_en.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/installation/{releases_en.md => otp_en.md} (100%) diff --git a/docs/installation/releases_en.md b/docs/installation/otp_en.md similarity index 100% rename from docs/installation/releases_en.md rename to docs/installation/otp_en.md From 40a62839ffeb5358e600d3bbc5fab4843afdc1af Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 08:35:35 +0300 Subject: [PATCH 34/46] Use build-base instead of individual packages --- docs/installation/otp_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/otp_en.md b/docs/installation/otp_en.md index e9d913604..667d3cef7 100644 --- a/docs/installation/otp_en.md +++ b/docs/installation/otp_en.md @@ -51,7 +51,7 @@ apt install postgresql-11-rum ``` Alpine: ```sh -apk add gcc make git postgresql-dev musl-dev +apk add git build-base postgresql-dev git clone https://github.com/postgrespro/rum /tmp/rum cd /tmp/rum make USE_PGXS=1 From 7fc226e0fe6d446b0e6614f9a531f6747b1bb34c Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 24 Jun 2019 02:50:28 +0300 Subject: [PATCH 35/46] Remove the warning about alpine as the issue is now solved --- docs/installation/otp_en.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/installation/otp_en.md b/docs/installation/otp_en.md index 667d3cef7..fa71f23e1 100644 --- a/docs/installation/otp_en.md +++ b/docs/installation/otp_en.md @@ -33,9 +33,8 @@ apt install curl unzip libncurses5 postgresql postgresql-contrib nginx certbot ``` Alpine: -**Warning:** There has been some changes to musl on Alpine 3.10 which need an Elixir rebuild. Since the build machines are running Alpine 3.9 running the builds on 3.10 will likely fail with "dlsym: Resource temporarily unavailable". If you have not updated yet, replace `latest-stable` with `v3.9` in `/etc/apk/repositories`. If you have, try downgrading `musl` to `1.1.20-r3` ```sh -echo "http://nl.alpinelinux.org/alpine/v3.9/community" >> /etc/apk/repositories +echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories apk update apk add curl unzip ncurses postgresql postgresql-contrib nginx certbot ``` From 5b76c3141f7945f76b8f3f84990cce8332152f71 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 24 Jun 2019 10:08:33 +0300 Subject: [PATCH 36/46] Use supervise-daemon(8) for the alpine service --- rel/files/installation/init.d/pleroma | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rel/files/installation/init.d/pleroma b/rel/files/installation/init.d/pleroma index de007c5e3..dea1db26c 100755 --- a/rel/files/installation/init.d/pleroma +++ b/rel/files/installation/init.d/pleroma @@ -1,5 +1,7 @@ #!/sbin/openrc-run +supervisor=supervise-daemon + # Requires OpenRC >= 0.35 directory=/opt/pleroma @@ -14,5 +16,6 @@ retry="SIGTERM/30/SIGKILL/5" pidfile="/var/run/pleroma.pid" depend() { - need nginx postgresql + want nginx + need postgresql } From 687f0aee51ad5ed4483317febe47be3f0685992c Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 24 Jun 2019 11:51:02 +0300 Subject: [PATCH 37/46] Basic skeleton of "Switching a from-source install to OTP releases" --- .../migrating_from_source_otp_en.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs/installation/migrating_from_source_otp_en.md diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md new file mode 100644 index 000000000..2f7a450d6 --- /dev/null +++ b/docs/installation/migrating_from_source_otp_en.md @@ -0,0 +1,18 @@ +# Switching a from-source install to OTP releases +## Why would one want to switch? +Benefits of OTP releases over from-source installs include: +* Less space used. OTP releases come without source code, build tools, have docs and debug symbols stripped from the compiled bytecode and do not cointain tests (100mb because of all the fixtures) and docs. +* Minimal system dependencies. Excluding the database and reverse proxy, all you need to download and run a release is `curl`, `unzip` and `ncurses`. Because Erlang runtime and Elixir are shipped with Pleroma, one can use the latest BEAM optimizations and Pleroma features, without having to worry about outdated system repos or a missing `erlang-*` package. +* Potentially less bugs and better performance. This extends on the previous point, because we have control over exactly what gets shipped, we can tweak the VM arguments and forget about weird bugs due to Erlang/Elixir version mismatches. +* Faster and less bug-prone mix tasks. On a from-source install one has to wait untill a new Pleroma node is started for each mix task and they execute outside of the instance context (for example if you deleted a user via a mix task, the instance will have no knowledge of that and continue to display status count and follows before the cache expires). Mix tasks in OTP releases are executed by calling into a running instance via RPC, which solves both of these problems. + +### Sounds great, how do I switch? +Currently we support Linux machines with GNU (e.g. Debian, Ubuntu) or musl (e.g. Alpine) libc and `x86_64`, `aarch64` or `armv7l` CPUs. If you are unsure you can check the [Detecting flavour](otp_en.html#detecting-flavour) section in OTP install guide. If your platform is supported, proceed with the guide, if not check the [My platform is not supported](#my-platform-is-not-supported) section. +### I don't think it is worth the effort, can I stay on a from-source install? +Yes, currently there are no plans to deprecate them. +### My platform is not supported +If you believe your platform is a popular choice for running Pleroma instances, or has the potential to become one you can [file an issue on our Gitlab](https://git.pleroma.social/pleroma/pleroma/issues/new). If not, guides on how to build and update releases by yourself will be available soon. +## Moving uploads/instance static directory +## Moving emoji +## Moving the config +## Installing the release From 57d18b06ab2b763922a7894aece982adf97c139e Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 25 Jun 2019 04:55:41 +0300 Subject: [PATCH 38/46] Remove the useless specification of test size and make the main points bold --- docs/installation/migrating_from_source_otp_en.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md index 2f7a450d6..ab140767e 100644 --- a/docs/installation/migrating_from_source_otp_en.md +++ b/docs/installation/migrating_from_source_otp_en.md @@ -1,10 +1,10 @@ # Switching a from-source install to OTP releases ## Why would one want to switch? Benefits of OTP releases over from-source installs include: -* Less space used. OTP releases come without source code, build tools, have docs and debug symbols stripped from the compiled bytecode and do not cointain tests (100mb because of all the fixtures) and docs. -* Minimal system dependencies. Excluding the database and reverse proxy, all you need to download and run a release is `curl`, `unzip` and `ncurses`. Because Erlang runtime and Elixir are shipped with Pleroma, one can use the latest BEAM optimizations and Pleroma features, without having to worry about outdated system repos or a missing `erlang-*` package. -* Potentially less bugs and better performance. This extends on the previous point, because we have control over exactly what gets shipped, we can tweak the VM arguments and forget about weird bugs due to Erlang/Elixir version mismatches. -* Faster and less bug-prone mix tasks. On a from-source install one has to wait untill a new Pleroma node is started for each mix task and they execute outside of the instance context (for example if you deleted a user via a mix task, the instance will have no knowledge of that and continue to display status count and follows before the cache expires). Mix tasks in OTP releases are executed by calling into a running instance via RPC, which solves both of these problems. +* **Less space used.** OTP releases come without source code, build tools, have docs and debug symbols stripped from the compiled bytecode and do not cointain tests and docs. +* **Minimal system dependencies.** Excluding the database and reverse proxy, all you need to download and run a release is `curl`, `unzip` and `ncurses`. Because Erlang runtime and Elixir are shipped with Pleroma, one can use the latest BEAM optimizations and Pleroma features, without having to worry about outdated system repos or a missing `erlang-*` package. +* **Potentially less bugs and better performance.** This extends on the previous point, because we have control over exactly what gets shipped, we can tweak the VM arguments and forget about weird bugs due to Erlang/Elixir version mismatches. +* **Faster and less bug-prone mix tasks.** On a from-source install one has to wait untill a new Pleroma node is started for each mix task and they execute outside of the instance context (for example if you deleted a user via a mix task, the instance will have no knowledge of that and continue to display status count and follows before the cache expires). Mix tasks in OTP releases are executed by calling into a running instance via RPC, which solves both of these problems. ### Sounds great, how do I switch? Currently we support Linux machines with GNU (e.g. Debian, Ubuntu) or musl (e.g. Alpine) libc and `x86_64`, `aarch64` or `armv7l` CPUs. If you are unsure you can check the [Detecting flavour](otp_en.html#detecting-flavour) section in OTP install guide. If your platform is supported, proceed with the guide, if not check the [My platform is not supported](#my-platform-is-not-supported) section. From 44aa895b78f7b37372df4b2ec2e4ba1177516a28 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 25 Jun 2019 05:50:25 +0300 Subject: [PATCH 39/46] Add a note that OTP releases don't contain revision history --- docs/installation/migrating_from_source_otp_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md index ab140767e..33e1eaaf0 100644 --- a/docs/installation/migrating_from_source_otp_en.md +++ b/docs/installation/migrating_from_source_otp_en.md @@ -1,7 +1,7 @@ # Switching a from-source install to OTP releases ## Why would one want to switch? Benefits of OTP releases over from-source installs include: -* **Less space used.** OTP releases come without source code, build tools, have docs and debug symbols stripped from the compiled bytecode and do not cointain tests and docs. +* **Less space used.** OTP releases come without source code, build tools, have docs and debug symbols stripped from the compiled bytecode and do not cointain tests, docs, revision history. * **Minimal system dependencies.** Excluding the database and reverse proxy, all you need to download and run a release is `curl`, `unzip` and `ncurses`. Because Erlang runtime and Elixir are shipped with Pleroma, one can use the latest BEAM optimizations and Pleroma features, without having to worry about outdated system repos or a missing `erlang-*` package. * **Potentially less bugs and better performance.** This extends on the previous point, because we have control over exactly what gets shipped, we can tweak the VM arguments and forget about weird bugs due to Erlang/Elixir version mismatches. * **Faster and less bug-prone mix tasks.** On a from-source install one has to wait untill a new Pleroma node is started for each mix task and they execute outside of the instance context (for example if you deleted a user via a mix task, the instance will have no knowledge of that and continue to display status count and follows before the cache expires). Mix tasks in OTP releases are executed by calling into a running instance via RPC, which solves both of these problems. From e404335af8fc214b84f9fe633830ba549bd322f7 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 26 Jun 2019 11:34:58 +0300 Subject: [PATCH 40/46] Add all the remaining sections to Switching to OTP releases --- .../migrating_from_source_otp_en.md | 137 +++++++++++++++++- 1 file changed, 130 insertions(+), 7 deletions(-) diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md index 33e1eaaf0..0f790b4df 100644 --- a/docs/installation/migrating_from_source_otp_en.md +++ b/docs/installation/migrating_from_source_otp_en.md @@ -2,17 +2,140 @@ ## Why would one want to switch? Benefits of OTP releases over from-source installs include: * **Less space used.** OTP releases come without source code, build tools, have docs and debug symbols stripped from the compiled bytecode and do not cointain tests, docs, revision history. -* **Minimal system dependencies.** Excluding the database and reverse proxy, all you need to download and run a release is `curl`, `unzip` and `ncurses`. Because Erlang runtime and Elixir are shipped with Pleroma, one can use the latest BEAM optimizations and Pleroma features, without having to worry about outdated system repos or a missing `erlang-*` package. +* **Minimal system dependencies.** Excluding the database and reverse proxy, only `curl`, `unzip` and `ncurses` are needed to download and run the release. Because Erlang runtime and Elixir are shipped with Pleroma, one can use the latest BEAM optimizations and Pleroma features, without having to worry about outdated system repos or a missing `erlang-*` package. * **Potentially less bugs and better performance.** This extends on the previous point, because we have control over exactly what gets shipped, we can tweak the VM arguments and forget about weird bugs due to Erlang/Elixir version mismatches. -* **Faster and less bug-prone mix tasks.** On a from-source install one has to wait untill a new Pleroma node is started for each mix task and they execute outside of the instance context (for example if you deleted a user via a mix task, the instance will have no knowledge of that and continue to display status count and follows before the cache expires). Mix tasks in OTP releases are executed by calling into a running instance via RPC, which solves both of these problems. +* **Faster and less bug-prone mix tasks.** On a from-source install one has to wait untill a new Pleroma node is started for each mix task and they execute outside of the instance context (for example if a user was deleted via a mix task, the instance will have no knowledge of that and continue to display status count and follows before the cache expires). Mix tasks in OTP releases are executed by calling into a running instance via RPC, which solves both of these problems. ### Sounds great, how do I switch? -Currently we support Linux machines with GNU (e.g. Debian, Ubuntu) or musl (e.g. Alpine) libc and `x86_64`, `aarch64` or `armv7l` CPUs. If you are unsure you can check the [Detecting flavour](otp_en.html#detecting-flavour) section in OTP install guide. If your platform is supported, proceed with the guide, if not check the [My platform is not supported](#my-platform-is-not-supported) section. +Currently we support Linux machines with GNU (e.g. Debian, Ubuntu) or musl (e.g. Alpine) libc and `x86_64`, `aarch64` or `armv7l` CPUs. If you are unsure, check the [Detecting flavour](otp_en.html#detecting-flavour) section in OTP install guide. If your platform is supported, proceed with the guide, if not check the [My platform is not supported](#my-platform-is-not-supported) section. ### I don't think it is worth the effort, can I stay on a from-source install? Yes, currently there are no plans to deprecate them. + ### My platform is not supported -If you believe your platform is a popular choice for running Pleroma instances, or has the potential to become one you can [file an issue on our Gitlab](https://git.pleroma.social/pleroma/pleroma/issues/new). If not, guides on how to build and update releases by yourself will be available soon. -## Moving uploads/instance static directory -## Moving emoji -## Moving the config +If you think your platform is a popular choice for running Pleroma instances, or has the potential to become one, you can [file an issue on our Gitlab](https://git.pleroma.social/pleroma/pleroma/issues/new). If not, guides on how to build and update releases by yourself will be available soon. +## Pre-requisites +You will be running commands as root. If you aren't root already, please elevate your priviledges by executing `sudo su`/`su`. + +The system needs to have `curl` and `unzip` installed for downloading and unpacking release builds. + +Debian/Ubuntu: +```sh +apt install curl unzip +``` +Alpine: +``` +apk add curl unzip + +``` +## Moving content out of the application directory +When using OTP releases the application directory changes with every version so it would be a bother to keep content there (and also dangerous unless `--no-rm` option is used when updating). Fortunately almost all paths in Pleroma are configurable, so it is possible to move them out of there. + +Pleroma should be stopped before proceeding. + +### Moving uploads/custom public files directory +```sh +# Create uploads directory and set proper permissions (skip if using a remote uploader) +# Note: It does not have to be `/var/lib/pleroma/uploads`, you can configure it to be something else later +mkdir -p /var/lib/pleroma/uploads +chown -R pleroma /var/lib/pleroma + +# Create custom public files directory +# Note: It does not have to be `/var/lib/pleroma/static`, you can configure it to be something else later +mkdir -p /var/lib/pleroma/static +chown -R pleroma /var/lib/pleroma + +# If you use the local uploader with default settings your uploads should be located in `~pleroma/uploads` +mv ~pleroma/uploads /var/lib/pleroma/uploads + +# If you have created the custom public files directory with default settings it should be located in `~pleroma/instance/static` +mv ~pleroma/instance/static /var/lib/pleroma/static +``` + +### Moving emoji +Assuming you have all emojis in subdirectories of `priv/static/emoji` moving them can be done with +```sh +mkdir /var/lib/pleroma/static/emoji +ls -d ~pleroma/priv/static/emoji/*/ | xargs -i sh -c 'mv "{}" "/var/lib/pleroma/static/emoji/$(basename {})"' +``` + +But, if for some reason you have custom emojis in the root directory you should copy the whole directory instead. +```sh +mv ~pleroma/priv/static/emoji /var/lib/pleroma/static/emoji +``` +and then copy custom emojis to `/var/lib/pleroma/static/emoji/custom`. + +This is needed because storing custom emojis in the root directory is deprecated, but if you just move them to `/var/lib/pleroma/static/emoji/custom` it will break emoji urls on old posts. + +Note that globs have been replaced with `pack_extensions`, so if your emojis are not in png/gif you should [modify the default value](config.html#emoji). + +### Moving the config +```sh +# Create the config directory +# The default path for Pleroma config is /etc/pleroma/config.exs +# but it can be set via PLEROMA_CONFIG_PATH environment variable +mkdir -p /etc/pleroma + +# Move the config file +mv ~pleroma/config/prod.secret.exs /etc/pleroma/config.exs + +# Change `use Mix.Config` at the top to `import Config` +$EDITOR /etc/pleroma/config.exs +``` ## Installing the release +```sh +# Delete all files in pleroma user's directory +rm -r ~pleroma/* + +# Clone the release build into a temporary directory and unpack it +su pleroma -s $SHELL -lc " +curl 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/master/download?job=$FLAVOUR' -o /tmp/pleroma.zip +unzip /tmp/pleroma.zip -d /tmp/ +" + +# Move the release to the home directory and delete temporary files +su pleroma -s $SHELL -lc " +mv /tmp/release/* /opt/pleroma +rmdir /tmp/release +rm /tmp/pleroma.zip +" + +# Start the instance to verify that everything is working as expected +su pleroma -s $SHELL -lc "./bin/pleroma daemon" + +# Wait for about 20 seconds and query the instance endpoint, if it shows your uri, name and email correctly, you are configured correctly +sleep 20 && curl http://localhost:4000/api/v1/instance + +# Stop the instance +su pleroma -s $SHELL -lc "./bin/pleroma stop" +``` + +## Setting up a system service +OTP releases have different service files than from-source installs so they need to be copied over again. + +Debian/Ubuntu: +```sh +# Copy the service into a proper directory +cp ~pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service + +# Reload service files +systemctl reload-daemon + +# Reenable pleroma to start on boot +systemctl reenable pleroma + +# Start pleroma +systemctl start pleroma +``` + +Alpine: +```sh +# Copy the service into a proper directory +cp -f ~pleroma/installation/init.d/pleroma /etc/init.d/pleroma + +# Start pleroma +rc-service pleroma start +``` +## Running mix tasks +Refer to [Running mix tasks](otp_en.html#running-mix-tasks) section from OTP release installation guide. +## Updating +Refer to [Updating](otp_en.html#updating) section from OTP release installation guide. From 877f91c0c489a7c33a6078dab4d00ceffc4af659 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 26 Jun 2019 15:20:22 +0300 Subject: [PATCH 41/46] Do not assume ~pleroma == /opt/pleroma --- docs/installation/migrating_from_source_otp_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md index 0f790b4df..add71d6af 100644 --- a/docs/installation/migrating_from_source_otp_en.md +++ b/docs/installation/migrating_from_source_otp_en.md @@ -94,7 +94,7 @@ unzip /tmp/pleroma.zip -d /tmp/ # Move the release to the home directory and delete temporary files su pleroma -s $SHELL -lc " -mv /tmp/release/* /opt/pleroma +mv /tmp/release/* ~pleroma/ rmdir /tmp/release rm /tmp/pleroma.zip " From f5f1bb35c3736dd591f6689813c7fe95650e4bba Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 26 Jun 2019 15:24:06 +0300 Subject: [PATCH 42/46] Instructions on getting the flavour --- docs/installation/migrating_from_source_otp_en.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md index add71d6af..46dc7b53b 100644 --- a/docs/installation/migrating_from_source_otp_en.md +++ b/docs/installation/migrating_from_source_otp_en.md @@ -82,10 +82,15 @@ mv ~pleroma/config/prod.secret.exs /etc/pleroma/config.exs $EDITOR /etc/pleroma/config.exs ``` ## Installing the release +Before proceeding, get the flavour from [Detecting flavour](otp_en.html#detecting-flavour) section in OTP installation guide. ```sh # Delete all files in pleroma user's directory rm -r ~pleroma/* +# Set the flavour environment variable to the string you got in Detecting flavour section. +# For example if the flavour is `arm64-musl` the command will be +export FLAVOUR="arm64-musl" + # Clone the release build into a temporary directory and unpack it su pleroma -s $SHELL -lc " curl 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/master/download?job=$FLAVOUR' -o /tmp/pleroma.zip From 4f44732100a23475a645d9e7070ca0a17934ee49 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 27 Jun 2019 09:45:13 +0300 Subject: [PATCH 43/46] Add a note on what OTP releases are --- docs/installation/migrating_from_source_otp_en.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md index 46dc7b53b..4d6f20ee0 100644 --- a/docs/installation/migrating_from_source_otp_en.md +++ b/docs/installation/migrating_from_source_otp_en.md @@ -1,4 +1,6 @@ # Switching a from-source install to OTP releases +## What are OTP releases? +OTP releases are as close as you can get to binary releases with Erlang/Elixir. The release is self-contained, and provides everything needed to boot it, it is easily administered via the provided shell script to open up a remote console, start/stop/restart the release, start in the background, send remote commands, and more. ## Why would one want to switch? Benefits of OTP releases over from-source installs include: * **Less space used.** OTP releases come without source code, build tools, have docs and debug symbols stripped from the compiled bytecode and do not cointain tests, docs, revision history. From ceebe95c2751fa03c65f60a9f5a01b00de4a5bce Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 27 Jun 2019 09:51:00 +0300 Subject: [PATCH 44/46] Add a deprecation warning to the readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 928f75dc7..c6b176f4b 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,9 @@ For clients it supports both the [GNU Social API with Qvitter extensions](https: 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 . ## Installation +**Note:** The guide below may be outdated and in most cases shouldn't be used. Instead check out our [wiki](https://docs.pleroma.social) for platform-specific installation instructions, most likely [Installing on Linux using OTP releases](https://docs.pleroma.social/otp_en.html) is the guide you need. ### Docker - While we don’t provide docker files, other people have written very good ones. Take a look at or . ### Dependencies From e91f09cfe6ebc6619e0eac204a71bef9562b9396 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 27 Jun 2019 09:59:21 +0300 Subject: [PATCH 45/46] Add a note about OS/Distro packages in the readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c6b176f4b..41d454a03 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ If you want to run your own server, feel free to contact us at @lain@pleroma.soy ## Installation **Note:** The guide below may be outdated and in most cases shouldn't be used. Instead check out our [wiki](https://docs.pleroma.social) for platform-specific installation instructions, most likely [Installing on Linux using OTP releases](https://docs.pleroma.social/otp_en.html) is the guide you need. +### OS/Distro packages +Currently Pleroma is not packaged by any OS/Distros, but feel free to reach out to us at [#pleroma-dev on freenode](https://webchat.freenode.net/?channels=%23pleroma-dev) or via matrix at for assistance. If you want to change default options in your Pleroma package, please **discuss it with us first**. + ### Docker While we don’t provide docker files, other people have written very good ones. Take a look at or . From eeb419e3a0e8ad97b0061f5da9938bbf4f52c5c9 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 28 Jun 2019 09:41:34 +0300 Subject: [PATCH 46/46] Add a note about the develop branch --- docs/installation/migrating_from_source_otp_en.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md index 4d6f20ee0..0b41d0c0e 100644 --- a/docs/installation/migrating_from_source_otp_en.md +++ b/docs/installation/migrating_from_source_otp_en.md @@ -1,6 +1,8 @@ # Switching a from-source install to OTP releases ## What are OTP releases? OTP releases are as close as you can get to binary releases with Erlang/Elixir. The release is self-contained, and provides everything needed to boot it, it is easily administered via the provided shell script to open up a remote console, start/stop/restart the release, start in the background, send remote commands, and more. +### Can I still run the develop branch if I decide to use them? +Yes, we produce builds for every commit in `develop`. However `develop` is considered unstable, please don't use it in production because of faster access to new features, unless you need them as an app developer. ## Why would one want to switch? Benefits of OTP releases over from-source installs include: * **Less space used.** OTP releases come without source code, build tools, have docs and debug symbols stripped from the compiled bytecode and do not cointain tests, docs, revision history. @@ -94,6 +96,7 @@ rm -r ~pleroma/* export FLAVOUR="arm64-musl" # Clone the release build into a temporary directory and unpack it +# Replace `master` with `develop` if you want to run the develop branch su pleroma -s $SHELL -lc " curl 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/master/download?job=$FLAVOUR' -o /tmp/pleroma.zip unzip /tmp/pleroma.zip -d /tmp/