diff options
author | GuDzpoz | 2021-08-16 13:55:00 +0800 |
---|---|---|
committer | GuDzpoz | 2021-08-16 13:55:00 +0800 |
commit | 317498f63b83014e73ad7bfe430d93db4083c4ab (patch) | |
tree | 88ad2cfc860d712da74eb07ea7b945b8e7d74123 /pleroma.install | |
download | aur-317498f63b83014e73ad7bfe430d93db4083c4ab.tar.gz |
Pleroma 2.4.0 stable OTP build
Diffstat (limited to 'pleroma.install')
-rw-r--r-- | pleroma.install | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/pleroma.install b/pleroma.install new file mode 100644 index 000000000000..80ec165dbaed --- /dev/null +++ b/pleroma.install @@ -0,0 +1,39 @@ +post_install() { + username="pleroma" + home_dir="/opt/${username}" + uploads_dir="/var/lib/${username}/uploads" + static_dir="/var/lib/${username}/static" + config_dir="/etc/${username}" + tmp_psql="/tmp/setup_otp_db.psql" + + instance_gen_params="instance gen\ + --output \"${config_dir}/config.exs\"\ + --output-psql \"$tmp_psql\"\ + --uploads-dir \"$uploads_dir\"\ + --static-dir \"$static_dir\"\ + --dbname \"$username\"\ + --dbuser \"$username\"\ +" + + printf "\n" + printf "A local installation of postgresql is strongly recommended unless you know what you are doing. Use:\n $ sudo pacman -S postgresql\nto install postgresql locally.\n\n" + printf "If postgresql is installed locally, the user should run the following commands to initialize pleroma:\n" + + printf ">>> sudo -Hu $username ${home_dir}/bin/pleroma_ctl ${instance_gen_params}\n" + printf ">>> sudo -Hu postgres psql -f \"${tmp_psql}\"\n" + printf ">>> sudo -Hu $username ${home_dir}/bin/pleroma_ctl migrate\n\n" + + printf "If the user is using a remote postgresql instance, they should ensure \"${tmp_psql}\" be executed remotely after the first command:\n" + printf ">>> sudo -Hu $username -s /bin/bash ${home_dir}/bin/pleroma_ctl ${instance_gen_params}\n" + printf ">>> # Now execute \"$tmp_psql\" remotely.\n" + printf ">>> sudo -Hu $username -s /bin/bash ${home_dir}/bin/pleroma_ctl migrate\n\n" + + printf "After initializing pleroma, you may start it with:\n" + printf ">>> sudo systemctl start pleroma\n\n" + + printf "Check https://docs-develop.pleroma.social/backend/installation/otp_en/#post-installation for post-installation steps.\n" +} + +post_upgrade() { + post_install $1 +} |