mirror of
https://github.com/YunoHost-Apps/pleroma_ynh.git
synced 2024-09-03 20:15:59 +02:00
commit
1aee688936
12 changed files with 56 additions and 31 deletions
|
@ -25,7 +25,7 @@ For user friendly details about Pleroma: [see here](https://blog.soykaf.com/post
|
|||
- Tootdon (Android + iOS)
|
||||
- Tootle (iOS)
|
||||
|
||||
**Shipped version:** 1.1.7
|
||||
**Shipped version:** 2.0.0
|
||||
|
||||
## Important points to read before installing
|
||||
|
||||
|
|
|
@ -21,7 +21,14 @@
|
|||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
upgrade=1 from_commit=edf199768f57000f4df6e2c704483e1036a78203
|
||||
# 0.9.99999
|
||||
upgrade=1 from_commit=9ec87c36793780f74365d3059d7b9d12885fbfcb
|
||||
# 1.1.7
|
||||
upgrade=1 from_commit=3e88dd59d8e5593fb60a86ab955aafde76abdf2e
|
||||
# 1.1.8
|
||||
upgrade=1 from_commit=0a839da33898b7a58f12a27b5b51799694021353
|
||||
# 1.1.9
|
||||
upgrade=1 from_commit=eedad6977760c31d7fb94ced247b9136824da580
|
||||
backup_restore=1
|
||||
multi_instance=0
|
||||
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/84826/artifacts/download
|
||||
SOURCE_SUM=aeb527340dbecc5056cd3aca459ed0a0f3b41808afc492e61f998032e5c3d874
|
||||
SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/100179/artifacts/download
|
||||
SOURCE_SUM=ed4256dd42f6dcabbf61f92e8238a20c83802356f7da44ff80b5d1cf209d3292
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=zip
|
||||
SOURCE_IN_SUBDIR=true
|
||||
SOURCE_FILENAME=pleroma-v1.1.7-arm.zip
|
||||
SOURCE_FILENAME=pleroma-v2.0.0-arm.zip
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/84828/artifacts/download
|
||||
SOURCE_SUM=74032e08b6f89321eb5545ff77fb0b1f142cba49c691d69316963d296d16b727
|
||||
SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/100181/artifacts/download
|
||||
SOURCE_SUM=aa0cfdc2634eb8f9e8ef26bcf01ba8280f41373138b8f14fd5129815cbf76c02
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=zip
|
||||
SOURCE_IN_SUBDIR=true
|
||||
SOURCE_FILENAME=pleroma-v1.1.7-arm64.zip
|
||||
SOURCE_FILENAME=pleroma-v2.0.0-arm64.zip
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/84824/artifacts/download
|
||||
SOURCE_SUM=6cd69e80894af966bb88505dae572e197c96da02ba980357a606bcc948a78e36
|
||||
SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/100177/artifacts/download
|
||||
SOURCE_SUM=daada8893d8afa515c4c50967d411d39186632d540851ff9e8581ffef02b417c
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=zip
|
||||
SOURCE_IN_SUBDIR=true
|
||||
SOURCE_FILENAME=pleroma-v1.1.7-x86-64.zip
|
||||
SOURCE_FILENAME=pleroma-v2.0.0-x86-64.zip
|
||||
|
|
|
@ -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": "1.1.7~ynh1",
|
||||
"version": "2.0.0~ynh1",
|
||||
"url": "https://git.pleroma.social/pleroma/pleroma",
|
||||
"license": "AGPL-3.0-only",
|
||||
"maintainer": [
|
||||
|
|
|
@ -43,6 +43,8 @@ ynh_print_info --message="Stopping a systemd service..."
|
|||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped $app"
|
||||
|
||||
pkill -u $app
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
|
|
@ -76,6 +76,8 @@ ynh_print_info --message="Stopping a systemd service..."
|
|||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped $app"
|
||||
|
||||
pkill -u $app
|
||||
|
||||
#=================================================
|
||||
# MODIFY URL IN NGINX CONF
|
||||
#=================================================
|
||||
|
@ -110,16 +112,19 @@ fi
|
|||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_print_info --message="Modifying a config file..."
|
||||
|
||||
ynh_replace_string --match_string="$old_domain" --replace_string="$new_domain" --target_file="$final_path/$app/config/prod.secret.exs"
|
||||
config="/etc/$app/config.exs"
|
||||
ynh_backup_if_checksum_is_different --file="$config"
|
||||
ynh_replace_string --match_string="$old_domain" --replace_string="$new_domain" --target_file="$config"
|
||||
|
||||
#=================================================
|
||||
# STORE THE CONFIG FILE CHECKSUM
|
||||
#=================================================
|
||||
ynh_print_info --message="Storing the config file checksum..."
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$final_path/$app/config/prod.secret.exs"
|
||||
# Recalculate and store the checksum of the file for the next upgrade.
|
||||
ynh_store_file_checksum --file="$final_path/$app/config/prod.secret.exs"
|
||||
ynh_store_file_checksum --file="$config"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALISATION
|
||||
|
|
|
@ -126,6 +126,7 @@ ynh_print_info --message="Configuring nginx web server..."
|
|||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
if [ $cache -eq 1 ]
|
||||
then
|
||||
cp -rf "../conf/cache.conf" "/etc/nginx/conf.d/$app-cache.conf"
|
||||
|
@ -151,7 +152,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
#=================================================
|
||||
# CREATE THE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_print_info --message="Create the data directory..."
|
||||
ynh_print_info --message="Creating the data directory..."
|
||||
|
||||
# Define app's data directory
|
||||
datadir="/home/yunohost.app/${app}"
|
||||
|
@ -168,8 +169,9 @@ chown -R "$app":"$app" "$datadir"
|
|||
ynh_app_setting_set --app=$app --key=datadir --value="$datadir"
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
# CREATE THE CONFIG DIRECTORY
|
||||
#=================================================
|
||||
ynh_print_info --message="Creating the config directory..."
|
||||
|
||||
mkdir -p /etc/$app
|
||||
chown -R $app /etc/$app
|
||||
|
@ -187,14 +189,12 @@ ynh_add_systemd_config
|
|||
#=================================================
|
||||
# MAKE SETUP
|
||||
#=================================================
|
||||
ynh_print_info --message="Making setup..."
|
||||
|
||||
# Give permission to the final_path
|
||||
chown -R "$app":"$app" "$final_path"
|
||||
|
||||
pushd $final_path/$app
|
||||
#Workaround for static-dir error
|
||||
ynh_replace_string --match_string="_dir" --replace_string="" --target_file="/var/www/pleroma/pleroma/releases/1.1.7/releases.exs"
|
||||
|
||||
#Generate instance
|
||||
su "$app" -s $SHELL -lc "$final_path/$app/bin/pleroma_ctl instance gen --force \
|
||||
--output $config \
|
||||
|
@ -212,7 +212,8 @@ pushd $final_path/$app
|
|||
--uploads-dir $datadir/uploads \
|
||||
--static-dir $datadir/static \
|
||||
--listen-ip 127.0.0.1 \
|
||||
--listen-port $port"
|
||||
--listen-port $port \
|
||||
--db-configurable Y"
|
||||
|
||||
cat "../conf/ldap.exs" "$config"
|
||||
|
||||
|
@ -228,6 +229,7 @@ popd
|
|||
#=================================================
|
||||
# STORE THE CONFIG FILE CHECKSUM
|
||||
#=================================================
|
||||
ynh_print_info --message="Storing the config file checksum..."
|
||||
|
||||
# Calculate and store the config file checksum into the app settings
|
||||
ynh_store_file_checksum --file="$config"
|
||||
|
|
|
@ -42,6 +42,8 @@ fi
|
|||
#=================================================
|
||||
ynh_print_info --message="Stopping all pleroma services..."
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped $app"
|
||||
|
||||
pkill -u $app
|
||||
|
||||
#=================================================
|
||||
|
@ -88,7 +90,7 @@ ynh_secure_remove --file="/etc/nginx/conf.d/$app-cache.conf"
|
|||
#=================================================
|
||||
# CLOSE A PORT
|
||||
#=================================================
|
||||
ynh_print_info --message="Closing a port"
|
||||
ynh_print_info --message="Closing a port..."
|
||||
|
||||
if yunohost firewall list | grep -q "\- $port$"
|
||||
then
|
||||
|
@ -101,12 +103,13 @@ fi
|
|||
#=================================================
|
||||
# REMOVE DIRECTORIES
|
||||
#=================================================
|
||||
ynh_print_info --message="Removing directories..."
|
||||
|
||||
# Remove the config directory securely
|
||||
ynh_secure_remove "/etc/$app/"
|
||||
ynh_secure_remove --file="/etc/$app"
|
||||
|
||||
# Remove the data directory securely
|
||||
ynh_secure_remove "$datadir/"
|
||||
ynh_secure_remove --file="$datadir"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
|
@ -53,8 +53,10 @@ test ! -d $final_path \
|
|||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_print_info --message="Restoring the nginx configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
if [ $cache -eq 1 ]
|
||||
then
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$app-cache.conf"
|
||||
|
@ -88,7 +90,7 @@ chown -R "$app":"$app" "$final_path"
|
|||
#=================================================
|
||||
# RECREATE THE DATA DIRECTORY
|
||||
#=================================================
|
||||
ynh_print_info --message="Recreate the data directory..."
|
||||
ynh_print_info --message="Recreating the data directory..."
|
||||
|
||||
# Create app folders
|
||||
mkdir -p "$datadir/"
|
||||
|
|
|
@ -37,6 +37,7 @@ registration=$(ynh_app_setting_get --app=$app --key=registration)
|
|||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
ynh_print_info --message="Checking version..."
|
||||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
|
@ -94,6 +95,7 @@ apt-key del A14F4FCA
|
|||
#=================================================
|
||||
# CHECK VERSION NUMBER
|
||||
#=================================================
|
||||
ynh_print_info --message="Checking version number..."
|
||||
|
||||
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
|
||||
sleep 60
|
||||
|
@ -110,10 +112,9 @@ ynh_print_info --message="Backing up the app before upgrading (may take a while)
|
|||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
read -p "key"
|
||||
ynh_clean_check_starting
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
ynh_clean_check_starting
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
@ -127,12 +128,17 @@ ynh_print_info --message="Stopping a systemd service..."
|
|||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped $app"
|
||||
|
||||
if ynh_version_gt "${previous_version}" "1.1.1~ynh1" ; then
|
||||
pkill -u $app
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# UPGRADE TO OTP RELEASE
|
||||
#=================================================
|
||||
ynh_print_info --message="Upgrading to OTP release..."
|
||||
|
||||
if ynh_version_gt "1.1.1~ynh1" "${previous_version}" ; then
|
||||
ynh_print_info --message="Upgrading to OTP release..."
|
||||
|
||||
# Define app's data directory
|
||||
datadir="/home/yunohost.app/${app}"
|
||||
ynh_app_setting_set --app=$app --key=datadir --value="$datadir"
|
||||
|
@ -162,7 +168,7 @@ if ynh_version_gt "1.1.1~ynh1" "${previous_version}" ; then
|
|||
|
||||
ynh_backup_if_checksum_is_different --file="$config"
|
||||
|
||||
rm -r $final_path/$app/*
|
||||
ynh_secure_remove --file="$final_path/$app"
|
||||
fi
|
||||
|
||||
if ynh_version_gt "1.1.7~ynh1" "${previous_version}" ; then
|
||||
|
@ -173,7 +179,6 @@ fi
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_print_info --message="Upgrading source files..."
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
|
@ -240,7 +245,6 @@ ynh_print_info --message="Making upgrade..."
|
|||
chown -R "$app":"$app" "$final_path"
|
||||
|
||||
pushd $final_path/$app
|
||||
su "$app" -s $SHELL -lc "$final_path/$app/bin/pleroma_ctl update"
|
||||
su "$app" -s $SHELL -lc "$final_path/$app/bin/pleroma_ctl migrate"
|
||||
popd
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue