1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pleroma_ynh.git synced 2024-09-03 20:15:59 +02:00

Merge pull request #43 from YunoHost-Apps/testing

Testing
This commit is contained in:
yalh76 2019-02-24 22:13:25 +01:00 committed by GitHub
commit e7628a209c
8 changed files with 81 additions and 59 deletions

View file

@ -25,7 +25,7 @@ For user friendly details about Pleroma: [see here](https://blog.soykaf.com/post
- Tootdon (Android + iOS)
- Tootle (iOS)
**Shipped version:** 0.9.0
**Shipped version:** 0.9.9
## Important points to read before installing

View file

@ -1,5 +1,5 @@
SOURCE_URL=url of app's source
SOURCE_SUM=sha256 checksum
SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/archive/v0.9.9/pleroma-v0.9.9.tar.gz
SOURCE_SUM=21a25c34cfd9399e6b2feed570ea67f1f61a14304fadabb0283a03724b076a5f
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

View file

@ -3,15 +3,23 @@ Description=__APP__ social network
After=network.target postgresql.service
[Service]
Environment="MIX_ENV=prod"
User=__APP__
Group=__APP__
WorkingDirectory=__FINALPATH__/__APP__
Environment="HOME=__FINALPATH__"
ExecStart=/usr/bin/mix phx.server
ExecReload=/bin/kill $MAINPID
KillMode=process
Restart=on-failure
; Name of the user that runs the Pleroma service.
User=__APP__
Group=__APP__
; Declares that Pleroma runs in production mode.
Environment="MIX_ENV=prod"
; Make sure that all paths fit your installation.
; Path to the home directory of the user running the Pleroma service.
Environment="HOME=__FINALPATH__"
; Path to the folder containing the Pleroma installation.
WorkingDirectory=__FINALPATH__/__APP__
; Path to the Mix binary.
ExecStart=/usr/bin/mix phx.server
StandardOutput=syslog
StandardError=syslog

View file

@ -6,7 +6,7 @@
"en": "Pleroma is an OStatus-compatible social networking server written in Elixir, compatible with GNU Social and Mastodon",
"fr": "Pleroma est un réseau social écrit en Elixir, compatible avec OStatus, GNU Social et Mastodon"
},
"version": "0.9.0~ynh4",
"version": "0.9.9~ynh1",
"url": "https://git.pleroma.social/pleroma/pleroma",
"license": "AGPL-3.0-only",
"maintainer": {

View file

@ -106,6 +106,20 @@ port=$(ynh_find_port 8095)
#ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
ynh_app_setting_set $app port $port
#=================================================
# INSTALL ERLANG and ELIXIR
#=================================================
ynh_print_info "Installing erlang and elixir ..."
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
sudo apt install -y ../conf/esl-erlang_21.2.6-1~debian~jessie_amd64.deb
sudo apt install -y ../conf/elixir_1.8.1-2~debian~jessie_amd64.deb
elif
[ "$(lsb_release --codename --short)" == "stretch" ]; then
sudo apt install -y ../conf/esl-erlang_21.2.6-1~debian~stretch_amd64.deb
sudo apt install -y ../conf/elixir_1.8.1-2~debian~stretch_amd64.deb
fi
#=================================================
# INSTALL DEPENDENCIES
#=================================================
@ -118,19 +132,6 @@ ynh_print_info "Installing dependencies ..."
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
# Add erlang for Debian Jessie
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
echo "deb http://packages.erlang-solutions.com/debian jessie contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list
elif
[ "$(lsb_release --codename --short)" == "stretch" ]; then
echo "deb http://packages.erlang-solutions.com/debian stretch contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list
fi
sudo wget https://packages.erlang-solutions.com/debian/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc
sudo rm erlang_solutions.asc
# install dependencies
ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools
#=================================================
@ -154,9 +155,11 @@ ynh_psql_create_user "$app" "$db_pwd"
ynh_psql_execute_as_root \
"CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $db_name;"
ynh_psql_execute_as_root "\connect $db_name
CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS pg_trgm;"
CREATE EXTENSION IF NOT EXISTS unaccent;"
ynh_psql_execute_as_root "\connect $db_name
CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS citext;"
CREATE EXTENSION IF NOT EXISTS pg_trgm;"
ynh_psql_execute_as_root "\connect $db_name
CREATE EXTENSION IF NOT EXISTS citext;"
ynh_psql_execute_as_root "\connect $db_name
CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";"
@ -171,8 +174,7 @@ ynh_print_info "Setting up source files ..."
ynh_app_setting_set $app final_path $final_path
# Download, check integrity, uncompress and patch the source from app.src
#ynh_setup_source "$final_path/$app"
git clone https://git.pleroma.social/pleroma/pleroma "$final_path/$app"
ynh_setup_source "$final_path/$app"
#=================================================
# NGINX CONFIGURATION

View file

@ -68,7 +68,14 @@ ynh_print_info "Removing dependencies"
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
ynh_secure_remove "/etc/apt/sources.list.d/erlang-solutions.list"
#=================================================
# REMOVE ERLANG AND ELIXIR
#=================================================
ynh_print_info "Removing erlang and elixir..."
sudo apt remove -y esl-erlang
sudo apt remove -y elixir
#=================================================
# REMOVE APP MAIN DIR

View file

@ -89,23 +89,25 @@ chown -R "$app":"$app" "$final_path"
#=================================================
# SPECIFIC RESTORATION
#=================================================
# INSTALL ERLANG and ELIXIR
#=================================================
ynh_print_info "Installing erlang and elixir ..."
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
sudo apt install -y ../settings/conf/esl-erlang_21.2.6-1~debian~jessie_amd64.deb
sudo apt install -y ../settings/conf/elixir_1.8.1-2~debian~jessie_amd64.deb
elif
[ "$(lsb_release --codename --short)" == "stretch" ]; then
sudo apt install -y ../settings/conf/esl-erlang_21.2.6-1~debian~stretch_amd64.deb
sudo apt install -y ../settings/conf/elixir_1.8.1-2~debian~stretch_amd64.deb
fi
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_print_info "Reinstalling dependencies..."
# Add erlang for Debian Jessie
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
echo "deb http://packages.erlang-solutions.com/debian jessie contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list
elif
[ "$(lsb_release --codename --short)" == "stretch" ]; then
echo "deb http://packages.erlang-solutions.com/debian stretch contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list
fi
sudo wget https://packages.erlang-solutions.com/debian/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc
sudo rm erlang_solutions.asc
# Define and install dependencies
ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools
@ -119,9 +121,11 @@ ynh_psql_create_user "$app" "$db_pwd"
ynh_psql_execute_as_root \
"CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;"
ynh_psql_execute_as_root "\connect $db_name
CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS pg_trgm;"
CREATE EXTENSION IF NOT EXISTS unaccent;"
ynh_psql_execute_as_root "\connect $db_name
CREATE EXTENSION IF NOT EXISTS unaccent;CREATE EXTENSION IF NOT EXISTS citext;"
CREATE EXTENSION IF NOT EXISTS pg_trgm;"
ynh_psql_execute_as_root "\connect $db_name
CREATE EXTENSION IF NOT EXISTS citext;"
ynh_psql_execute_file_as_root ./db.sql "$db_name"
#=================================================

View file

@ -70,6 +70,9 @@ if [ -z $final_path ]; then
ynh_app_setting_set $app final_path $final_path
fi
# Remove repository
ynh_secure_remove "/etc/apt/sources.list.d/erlang-solutions.list"
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -106,11 +109,7 @@ path_url=$(ynh_normalize_url_path $path_url)
ynh_print_info "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
#ynh_setup_source "$final_path/$app"
pushd $final_path/$app
git reset --hard
git pull --quiet
popd
ynh_setup_source "$final_path/$app"
#=================================================
# NGINX CONFIGURATION
@ -133,23 +132,25 @@ then
ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf"
fi
#=================================================
# INSTALL ERLANG and ELIXIR
#=================================================
ynh_print_info "Installing erlang and elixir ..."
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
sudo apt install -y ../conf/esl-erlang_21.2.6-1~debian~jessie_amd64.deb
sudo apt install -y ../conf/elixir_1.8.1-2~debian~jessie_amd64.deb
elif
[ "$(lsb_release --codename --short)" == "stretch" ]; then
sudo apt install -y ../conf/esl-erlang_21.2.6-1~debian~stretch_amd64.deb
sudo apt install -y ../conf/elixir_1.8.1-2~debian~stretch_amd64.deb
fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_print_info "Upgrading dependencies..."
# Add erlang for Debian Jessie
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
echo "deb http://packages.erlang-solutions.com/debian jessie contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list
elif
[ "$(lsb_release --codename --short)" == "stretch" ]; then
echo "deb http://packages.erlang-solutions.com/debian stretch contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list
fi
sudo wget https://packages.erlang-solutions.com/debian/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc
sudo rm erlang_solutions.asc
# install dependencies
ynh_install_app_dependencies git build-essential openssl ssh sudo postgresql postgresql-contrib elixir erlang-dev erlang-parsetools erlang-xmerl erlang-tools