From facb75079800d975c0141b84e55cf0d52d4a2b81 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 29 May 2021 11:24:22 -0500 Subject: Docs: install from source with asdf --- .gitignore | 3 --- .tool-versions | 2 ++ docs/installation/debian_based_en.md | 49 ++++++++++++++++++++++++------------ installation/pleroma.service | 3 ++- 4 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 .tool-versions diff --git a/.gitignore b/.gitignore index da73b6f36..32b44e4ff 100644 --- a/.gitignore +++ b/.gitignore @@ -52,9 +52,6 @@ docs/generated_config.md .idea pleroma.iml -# asdf -.tool-versions - # Editor temp files /*~ /*# diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 000000000..3a4b4de4c --- /dev/null +++ b/.tool-versions @@ -0,0 +1,2 @@ +elixir 1.11 +erlang 23.3.4 diff --git a/docs/installation/debian_based_en.md b/docs/installation/debian_based_en.md index a9cf86ab3..614315591 100644 --- a/docs/installation/debian_based_en.md +++ b/docs/installation/debian_based_en.md @@ -38,22 +38,6 @@ sudo apt full-upgrade sudo apt install git build-essential postgresql postgresql-contrib cmake libmagic-dev ``` -### Install Elixir and Erlang - -* Download and add the Erlang repository: - -```shell -wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb -sudo dpkg -i /tmp/erlang-solutions_2.0_all.deb -``` - -* Install Elixir and Erlang: - -```shell -sudo apt update -sudo apt install elixir erlang-dev erlang-nox -``` - ### Optional packages: [`docs/installation/optional/media_graphics_packages.md`](../installation/optional/media_graphics_packages.md) ```shell @@ -84,6 +68,39 @@ sudo -Hu pleroma git clone -b stable https://git.pleroma.social/pleroma/pleroma cd /opt/pleroma ``` +#### Install Elixir and Erlang + +* Become the Pleroma user: + +```shell +sudo -Hu pleroma bash +``` + +* Install [asdf](https://asdf-vm.com/): + +```shell +git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.0 +echo ". $HOME/.asdf/asdf.sh" >> ~/.bashrc +echo ". $HOME/.asdf/completions/asdf.bash" >> ~/.bashrc +exec bash +asdf plugin-add erlang +asdf plugin-add elixir +``` + +* Install Elixir and Erlang: + +```shell +asdf install +``` + +* Return to the root user: + +```shell +exit +``` + +#### Install Pleroma dependencies + * Install the dependencies for Pleroma and answer with `yes` if it asks you to install `Hex`: ```shell diff --git a/installation/pleroma.service b/installation/pleroma.service index 8338228d8..811f1e129 100644 --- a/installation/pleroma.service +++ b/installation/pleroma.service @@ -18,7 +18,8 @@ Environment="HOME=/var/lib/pleroma" ; Path to the folder containing the Pleroma installation. WorkingDirectory=/opt/pleroma ; Path to the Mix binary. -ExecStart=/usr/bin/mix phx.server +Environment="PATH=/var/lib/pleroma/.asdf/shims:/var/lib/pleroma/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +ExecStart=/var/lib/pleroma/.asdf/shims/mix phx.server ; Some security directives. ; Use private /tmp and /var/tmp folders inside a new file system namespace, which are discarded after the process stops. -- cgit v1.2.3