From 75a37a68d4080a3781256cbe17b1e1b6c9944b18 Mon Sep 17 00:00:00 2001 From: feld Date: Thu, 30 May 2019 21:30:42 +0000 Subject: Install docs should clone from master branch --- docs/installation/alpine_linux_en.md | 2 +- docs/installation/arch_linux_en.md | 2 +- docs/installation/centos7_en.md | 2 +- docs/installation/debian_based_en.md | 2 +- docs/installation/debian_based_jp.md | 2 +- docs/installation/gentoo_en.md | 2 +- docs/installation/netbsd_en.md | 2 +- docs/installation/openbsd_en.md | 2 +- docs/installation/openbsd_fi.md | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) (limited to 'docs/installation') diff --git a/docs/installation/alpine_linux_en.md b/docs/installation/alpine_linux_en.md index c493816d6..e1d69c873 100644 --- a/docs/installation/alpine_linux_en.md +++ b/docs/installation/alpine_linux_en.md @@ -87,7 +87,7 @@ sudo adduser -S -s /bin/false -h /opt/pleroma -H pleroma ```shell sudo mkdir -p /opt/pleroma sudo chown -R pleroma:pleroma /opt/pleroma -sudo -Hu pleroma git clone https://git.pleroma.social/pleroma/pleroma /opt/pleroma +sudo -Hu pleroma git clone -b master https://git.pleroma.social/pleroma/pleroma /opt/pleroma ``` * Change to the new directory: diff --git a/docs/installation/arch_linux_en.md b/docs/installation/arch_linux_en.md index 2b040cfbc..26e1ab86a 100644 --- a/docs/installation/arch_linux_en.md +++ b/docs/installation/arch_linux_en.md @@ -66,7 +66,7 @@ sudo useradd -r -s /bin/false -m -d /var/lib/pleroma -U pleroma ```shell sudo mkdir -p /opt/pleroma sudo chown -R pleroma:pleroma /opt/pleroma -sudo -Hu pleroma git clone https://git.pleroma.social/pleroma/pleroma /opt/pleroma +sudo -Hu pleroma git clone -b master https://git.pleroma.social/pleroma/pleroma /opt/pleroma ``` * Change to the new directory: diff --git a/docs/installation/centos7_en.md b/docs/installation/centos7_en.md index 76de21ed8..19bff7461 100644 --- a/docs/installation/centos7_en.md +++ b/docs/installation/centos7_en.md @@ -143,7 +143,7 @@ sudo useradd -r -s /bin/false -m -d /var/lib/pleroma -U pleroma ```shell sudo mkdir -p /opt/pleroma sudo chown -R pleroma:pleroma /opt/pleroma -sudo -Hu pleroma git clone https://git.pleroma.social/pleroma/pleroma /opt/pleroma +sudo -Hu pleroma git clone -b master https://git.pleroma.social/pleroma/pleroma /opt/pleroma ``` * Change to the new directory: diff --git a/docs/installation/debian_based_en.md b/docs/installation/debian_based_en.md index 9c0ef92d4..7d39ca5f9 100644 --- a/docs/installation/debian_based_en.md +++ b/docs/installation/debian_based_en.md @@ -68,7 +68,7 @@ sudo useradd -r -s /bin/false -m -d /var/lib/pleroma -U pleroma ```shell sudo mkdir -p /opt/pleroma sudo chown -R pleroma:pleroma /opt/pleroma -sudo -Hu pleroma git clone https://git.pleroma.social/pleroma/pleroma /opt/pleroma +sudo -Hu pleroma git clone -b master https://git.pleroma.social/pleroma/pleroma /opt/pleroma ``` * Change to the new directory: diff --git a/docs/installation/debian_based_jp.md b/docs/installation/debian_based_jp.md index 41cce6792..7b4c1bd86 100644 --- a/docs/installation/debian_based_jp.md +++ b/docs/installation/debian_based_jp.md @@ -69,7 +69,7 @@ cd ~ * Gitリポジトリをクローンします。 ``` -git clone https://git.pleroma.social/pleroma/pleroma + git clone -b master https://git.pleroma.social/pleroma/pleroma ``` * 新しいディレクトリに移動します。 diff --git a/docs/installation/gentoo_en.md b/docs/installation/gentoo_en.md index fccaad378..b7c42a477 100644 --- a/docs/installation/gentoo_en.md +++ b/docs/installation/gentoo_en.md @@ -106,7 +106,7 @@ It is highly recommended you use your own fork for the `https://path/to/repo` pa ```shell pleroma$ cd ~ - pleroma$ git clone https://path/to/repo + pleroma$ git clone -b master https://path/to/repo ``` * Change to the new directory: diff --git a/docs/installation/netbsd_en.md b/docs/installation/netbsd_en.md index e0ac98359..a096d5354 100644 --- a/docs/installation/netbsd_en.md +++ b/docs/installation/netbsd_en.md @@ -58,7 +58,7 @@ Clone the repository: ``` $ cd /home/pleroma -$ git clone https://git.pleroma.social/pleroma/pleroma.git +$ git clone -b master https://git.pleroma.social/pleroma/pleroma.git ``` Configure Pleroma. Note that you need a domain name at this point: diff --git a/docs/installation/openbsd_en.md b/docs/installation/openbsd_en.md index 633b08e6c..46e7feffe 100644 --- a/docs/installation/openbsd_en.md +++ b/docs/installation/openbsd_en.md @@ -29,7 +29,7 @@ This creates a "pleroma" login class and sets higher values than default for dat Create the \_pleroma user, assign it the pleroma login class and create its home directory (/home/\_pleroma/): `useradd -m -L pleroma _pleroma` #### Clone pleroma's directory -Enter a shell as the \_pleroma user. As root, run `su _pleroma -;cd`. Then clone the repository with `git clone https://git.pleroma.social/pleroma/pleroma.git`. Pleroma is now installed in /home/\_pleroma/pleroma/, it will be configured and started at the end of this guide. +Enter a shell as the \_pleroma user. As root, run `su _pleroma -;cd`. Then clone the repository with ` git clone -b master https://git.pleroma.social/pleroma/pleroma.git`. Pleroma is now installed in /home/\_pleroma/pleroma/, it will be configured and started at the end of this guide. #### Postgresql Start a shell as the \_postgresql user (as root run `su _postgresql -` then run the `initdb` command to initialize postgresql: diff --git a/docs/installation/openbsd_fi.md b/docs/installation/openbsd_fi.md index fa6faa62d..39819a8c8 100644 --- a/docs/installation/openbsd_fi.md +++ b/docs/installation/openbsd_fi.md @@ -44,7 +44,7 @@ Vaihda pleroma-käyttäjään ja mene kotihakemistoosi: Lataa pleroman lähdekoodi: -`$ git clone https://git.pleroma.social/pleroma/pleroma.git` +`$ git clone -b master https://git.pleroma.social/pleroma/pleroma.git` `$ cd pleroma` -- cgit v1.2.3 From 88414151b41e6e060caf7c90be3341a986351395 Mon Sep 17 00:00:00 2001 From: feld Date: Thu, 30 May 2019 21:35:31 +0000 Subject: Formatting --- docs/installation/debian_based_jp.md | 2 +- docs/installation/openbsd_en.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/installation') diff --git a/docs/installation/debian_based_jp.md b/docs/installation/debian_based_jp.md index 7b4c1bd86..84b9666c8 100644 --- a/docs/installation/debian_based_jp.md +++ b/docs/installation/debian_based_jp.md @@ -69,7 +69,7 @@ cd ~ * Gitリポジトリをクローンします。 ``` - git clone -b master https://git.pleroma.social/pleroma/pleroma +git clone -b master https://git.pleroma.social/pleroma/pleroma ``` * 新しいディレクトリに移動します。 diff --git a/docs/installation/openbsd_en.md b/docs/installation/openbsd_en.md index 46e7feffe..fcba38b2c 100644 --- a/docs/installation/openbsd_en.md +++ b/docs/installation/openbsd_en.md @@ -29,7 +29,7 @@ This creates a "pleroma" login class and sets higher values than default for dat Create the \_pleroma user, assign it the pleroma login class and create its home directory (/home/\_pleroma/): `useradd -m -L pleroma _pleroma` #### Clone pleroma's directory -Enter a shell as the \_pleroma user. As root, run `su _pleroma -;cd`. Then clone the repository with ` git clone -b master https://git.pleroma.social/pleroma/pleroma.git`. Pleroma is now installed in /home/\_pleroma/pleroma/, it will be configured and started at the end of this guide. +Enter a shell as the \_pleroma user. As root, run `su _pleroma -;cd`. Then clone the repository with `git clone -b master https://git.pleroma.social/pleroma/pleroma.git`. Pleroma is now installed in /home/\_pleroma/pleroma/, it will be configured and started at the end of this guide. #### Postgresql Start a shell as the \_postgresql user (as root run `su _postgresql -` then run the `initdb` command to initialize postgresql: -- cgit v1.2.3 From dd238887743cba24b8fa1971ae0a4f806a212f13 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 05:48:13 +0300 Subject: OTP release install guide sceleton --- docs/installation/releases_en.md | 188 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 docs/installation/releases_en.md (limited to 'docs/installation') 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 -- cgit v1.2.3 From d3d98beaad9127517c7ad8d027f052a23807772b Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:04:39 +0300 Subject: Correct package names for Debian --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From f9515a36112c8f6a8a40dbda234aaa6bb5de3827 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:14:02 +0300 Subject: Add a note about RUM indexes package on Debian/Ubuntu --- docs/installation/releases_en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From 4669a56aa37bf02aa6564ef53758879e3a58a6b2 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:22:34 +0300 Subject: Add notes on RUM indexes --- docs/installation/releases_en.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs/installation') 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 -- cgit v1.2.3 From 16e9304cecc420b9dbdb17f0db13a9a0010ad6cf Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:32:34 +0300 Subject: 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(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From e824025c52bec84a44bc4307407071daa99e805f Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:37:38 +0300 Subject: Remove a useless echo --- docs/installation/releases_en.md | 1 - 1 file changed, 1 deletion(-) (limited to 'docs/installation') 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/ " -- cgit v1.2.3 From 4bec121798218f8abf8d2915fa7c26ccb23a4f4a Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 06:39:03 +0300 Subject: Do not set ownership group in chown commands --- docs/installation/releases_en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/installation') 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" -- cgit v1.2.3 From 8b170b96c7c9ae727bdfe2d6856375b183f56180 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 16:59:48 +0000 Subject: Apply suggestion to docs/installation/releases_en.md --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From de77d7621a781cf409663a8d5e931227e3b2cf82 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 16:59:56 +0000 Subject: Apply suggestion to docs/installation/releases_en.md --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installation') 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: -- cgit v1.2.3 From 743bd648832eb1fd6033c3484059c08f88af40f3 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 21 Jun 2019 17:00:12 +0000 Subject: Apply suggestion to docs/installation/releases_en.md --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From d1d648b0ecfb0924d7921796d7edef9512e030b0 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 02:09:45 +0300 Subject: Correct the psql command --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installation') 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` -- cgit v1.2.3 From 23608149bc72d740e6259e460e43ff276583516d Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 02:20:55 +0300 Subject: 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(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From 120f84c83dcebb9b46cb158b9e1f4af9cf0aee28 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 04:35:17 +0300 Subject: Executing create is unnecessary after the postgres script is executed --- docs/installation/releases_en.md | 1 - 1 file changed, 1 deletion(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From 1d2332ce79c374f4958b5d554ea96d382e9806fb Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 05:20:36 +0300 Subject: Use uname -m instead of arch for more portability --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installation') 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. -- cgit v1.2.3 From dd05dc65d31d5d54662e7c5d81ed393ae25d14dd Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 08:30:32 +0300 Subject: 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(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From 50e3cf9d5e4c957f4a979bbeed29787209bdfa13 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 08:31:02 +0300 Subject: Correct a typo in the apk command --- docs/installation/releases_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From 177faf15c24453fc67bb5bedc6189055e686e2a3 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 08:36:36 +0300 Subject: Correct dependencies for RUM on alpine and remove installcheck --- docs/installation/releases_en.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs/installation') 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 ``` -- cgit v1.2.3 From e00e4c0e7a43aaa5c4be43e105712101167f4cbd Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 13:40:37 +0300 Subject: Add a warning about OTP releases on Alpine 3.10 --- docs/installation/releases_en.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From 7a4c4518b8cdff5684f3287f373e3e6acf72293c Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 22 Jun 2019 21:18:34 +0300 Subject: 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(-) (limited to 'docs/installation') 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" -- cgit v1.2.3 From 9d487ba57949a4102aa2eb67b26842f1c0ef418c Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 02:42:47 +0300 Subject: Add docs about SSL certificate auto-renew --- docs/installation/releases_en.md | 52 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From 18eabca9789cdb96c77279aa4cff5b34e558c803 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 02:55:43 +0300 Subject: Add a section about updating --- docs/installation/releases_en.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs/installation') 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. -- cgit v1.2.3 From 299cefa2bdbbde171501c5fa516e37b5e9733953 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 03:05:02 +0300 Subject: Add a section on executing mix tasks --- docs/installation/releases_en.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From 66e92dc0ca9fe50dad5a758cf2b16543bff03c2e Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 07:43:45 +0300 Subject: Add a Further Reading section to the OTP install guide --- docs/installation/releases_en.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs/installation') 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) -- cgit v1.2.3 From 1d3c5e434df83ce2da1b1c67090192b115b4e905 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 07:44:10 +0300 Subject: releases_en.md -> otp_en.md --- docs/installation/otp_en.md | 262 +++++++++++++++++++++++++++++++++++++++ docs/installation/releases_en.md | 262 --------------------------------------- 2 files changed, 262 insertions(+), 262 deletions(-) create mode 100644 docs/installation/otp_en.md delete mode 100644 docs/installation/releases_en.md (limited to 'docs/installation') diff --git a/docs/installation/otp_en.md b/docs/installation/otp_en.md new file mode 100644 index 000000000..e9d913604 --- /dev/null +++ b/docs/installation/otp_en.md @@ -0,0 +1,262 @@ +# 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="$(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. + +### 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 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: +```sh +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 +apk update +apk add curl unzip ncurses postgresql postgresql-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 (available only on Buster/19.04): +```sh +apt install postgresql-11-rum +``` +Alpine: +```sh +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 +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 --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 +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 +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 /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 /var/lib/pleroma + +# Create a config directory +mkdir -p /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" + +# Create the postgres database +su postgres -s $SHELL -lc "psql -f /tmp/setup_db.psql" + +# Create the database schema +su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate" + +# 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 +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 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-nginx-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 +```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 +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 +# 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. + +## 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) diff --git a/docs/installation/releases_en.md b/docs/installation/releases_en.md deleted file mode 100644 index e9d913604..000000000 --- a/docs/installation/releases_en.md +++ /dev/null @@ -1,262 +0,0 @@ -# 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="$(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. - -### 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 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: -```sh -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 -apk update -apk add curl unzip ncurses postgresql postgresql-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 (available only on Buster/19.04): -```sh -apt install postgresql-11-rum -``` -Alpine: -```sh -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 -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 --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 -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 -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 /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 /var/lib/pleroma - -# Create a config directory -mkdir -p /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" - -# Create the postgres database -su postgres -s $SHELL -lc "psql -f /tmp/setup_db.psql" - -# Create the database schema -su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate" - -# 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 -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 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-nginx-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 -```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 -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 -# 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. - -## 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) -- cgit v1.2.3 From 40a62839ffeb5358e600d3bbc5fab4843afdc1af Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 08:35:35 +0300 Subject: Use build-base instead of individual packages --- docs/installation/otp_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installation') 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 -- cgit v1.2.3 From 7fc226e0fe6d446b0e6614f9a531f6747b1bb34c Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 24 Jun 2019 02:50:28 +0300 Subject: Remove the warning about alpine as the issue is now solved --- docs/installation/otp_en.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs/installation') 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 ``` -- cgit v1.2.3 From 687f0aee51ad5ed4483317febe47be3f0685992c Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 24 Jun 2019 11:51:02 +0300 Subject: Basic skeleton of "Switching a from-source install to OTP releases" --- docs/installation/migrating_from_source_otp_en.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs/installation/migrating_from_source_otp_en.md (limited to 'docs/installation') 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 -- cgit v1.2.3 From 57d18b06ab2b763922a7894aece982adf97c139e Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 25 Jun 2019 04:55:41 +0300 Subject: 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(-) (limited to 'docs/installation') 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. -- cgit v1.2.3 From 44aa895b78f7b37372df4b2ec2e4ba1177516a28 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 25 Jun 2019 05:50:25 +0300 Subject: 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(-) (limited to 'docs/installation') 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. -- cgit v1.2.3 From e404335af8fc214b84f9fe633830ba549bd322f7 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 26 Jun 2019 11:34:58 +0300 Subject: Add all the remaining sections to Switching to OTP releases --- docs/installation/migrating_from_source_otp_en.md | 137 ++++++++++++++++++++-- 1 file changed, 130 insertions(+), 7 deletions(-) (limited to 'docs/installation') 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. -- cgit v1.2.3 From 877f91c0c489a7c33a6078dab4d00ceffc4af659 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 26 Jun 2019 15:20:22 +0300 Subject: Do not assume ~pleroma == /opt/pleroma --- docs/installation/migrating_from_source_otp_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installation') 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 " -- cgit v1.2.3 From f5f1bb35c3736dd591f6689813c7fe95650e4bba Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 26 Jun 2019 15:24:06 +0300 Subject: Instructions on getting the flavour --- docs/installation/migrating_from_source_otp_en.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/installation') 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 -- cgit v1.2.3 From 4f44732100a23475a645d9e7070ca0a17934ee49 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 27 Jun 2019 09:45:13 +0300 Subject: Add a note on what OTP releases are --- docs/installation/migrating_from_source_otp_en.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/installation') 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. -- cgit v1.2.3 From eeb419e3a0e8ad97b0061f5da9938bbf4f52c5c9 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 28 Jun 2019 09:41:34 +0300 Subject: Add a note about the develop branch --- docs/installation/migrating_from_source_otp_en.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/installation') 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/ -- cgit v1.2.3 From e556c9666115c026541227f5dafc8b995330c66e Mon Sep 17 00:00:00 2001 From: Julien Wehmschulte Date: Fri, 28 Jun 2019 18:25:21 +0000 Subject: Update docs/installation/arch_linux_en.md, docs/installation/centos7_en.md, docs/installation/debian_based_en.md, docs/installation/debian_based_jp.md, docs/installation/gentoo_en.md files --- docs/installation/alpine_linux_en.md | 12 ++++++------ docs/installation/arch_linux_en.md | 12 ++++++------ docs/installation/centos7_en.md | 12 ++++++------ docs/installation/debian_based_en.md | 12 ++++++------ docs/installation/debian_based_jp.md | 8 ++++++-- docs/installation/gentoo_en.md | 12 ++++++------ 6 files changed, 36 insertions(+), 32 deletions(-) (limited to 'docs/installation') diff --git a/docs/installation/alpine_linux_en.md b/docs/installation/alpine_linux_en.md index e1d69c873..a9b5afd33 100644 --- a/docs/installation/alpine_linux_en.md +++ b/docs/installation/alpine_linux_en.md @@ -203,12 +203,12 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new Date: Sat, 29 Jun 2019 04:17:49 +0000 Subject: Update migrating_from_source_otp_en.md: Replace `reload-daemon` with `daemon-reload`. --- docs/installation/migrating_from_source_otp_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installation') diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md index 0b41d0c0e..df3e2f4a0 100644 --- a/docs/installation/migrating_from_source_otp_en.md +++ b/docs/installation/migrating_from_source_otp_en.md @@ -128,7 +128,7 @@ Debian/Ubuntu: cp ~pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service # Reload service files -systemctl reload-daemon +systemctl daemon-reload # Reenable pleroma to start on boot systemctl reenable pleroma -- cgit v1.2.3 From ab6de9b478bf9c2b46603c2761fd99b6506f8b08 Mon Sep 17 00:00:00 2001 From: Yuji Nakao Date: Sat, 29 Jun 2019 04:24:44 +0000 Subject: Move all upload contents despite upload folder itself. --- docs/installation/migrating_from_source_otp_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/installation') diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md index 0b41d0c0e..5264790f3 100644 --- a/docs/installation/migrating_from_source_otp_en.md +++ b/docs/installation/migrating_from_source_otp_en.md @@ -49,7 +49,7 @@ 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 +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 -- cgit v1.2.3 From eddcebf8ae699edd9e503dd7a3c51112ca063a21 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 29 Jun 2019 11:35:42 +0300 Subject: Add a warning about service files assuming installation paths --- docs/installation/migrating_from_source_otp_en.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/installation') diff --git a/docs/installation/migrating_from_source_otp_en.md b/docs/installation/migrating_from_source_otp_en.md index d07a0f622..b779be8cc 100644 --- a/docs/installation/migrating_from_source_otp_en.md +++ b/docs/installation/migrating_from_source_otp_en.md @@ -122,6 +122,8 @@ 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. +**Warning:** The service files assume pleroma user's home directory is `/opt/pleroma`, please make sure all paths fit your installation. + Debian/Ubuntu: ```sh # Copy the service into a proper directory -- cgit v1.2.3 From 044eb039c22f0cdececee85922b0c194f0944f42 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 30 Jun 2019 13:06:10 +0300 Subject: OTP Release install docs: Remove --dry-run in cron certbot command --- docs/installation/otp_en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/installation') diff --git a/docs/installation/otp_en.md b/docs/installation/otp_en.md index fa71f23e1..9b851e395 100644 --- a/docs/installation/otp_en.md +++ b/docs/installation/otp_en.md @@ -207,7 +207,7 @@ certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ -- # 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" +certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --post-hook "systemctl reload nginx" ' > /etc/cron.daily/renew-pleroma-cert chmod +x /etc/cron.daily/renew-pleroma-cert @@ -228,7 +228,7 @@ certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ -- # 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" +certbot renew --cert-name yourinstance.tld --webroot -w /var/lib/letsencrypt/ --post-hook "rc-service nginx reload" ' > /etc/periodic/daily/renew-pleroma-cert chmod +x /etc/periodic/daily/renew-pleroma-cert -- cgit v1.2.3 From 345a38778ee6861b36e7601e581eb14bebe31d82 Mon Sep 17 00:00:00 2001 From: Eugenij Date: Mon, 15 Jul 2019 21:43:04 +0000 Subject: Remove dead link from the installation docs --- docs/installation/alpine_linux_en.md | 1 - docs/installation/arch_linux_en.md | 1 - docs/installation/centos7_en.md | 1 - docs/installation/debian_based_en.md | 1 - docs/installation/debian_based_jp.md | 1 - docs/installation/gentoo_en.md | 1 - 6 files changed, 6 deletions(-) (limited to 'docs/installation') diff --git a/docs/installation/alpine_linux_en.md b/docs/installation/alpine_linux_en.md index a9b5afd33..1f300f353 100644 --- a/docs/installation/alpine_linux_en.md +++ b/docs/installation/alpine_linux_en.md @@ -202,7 +202,6 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new