1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/petrolette_ynh.git synced 2024-09-03 19:56:26 +02:00

Merge pull request #17 from YunoHost-Apps/fix

Upgrade to 1.4.9~ynh1
This commit is contained in:
yalh76 2022-02-07 22:13:52 +01:00 committed by GitHub
commit 28489d39bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 39 additions and 44 deletions

View file

@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
The news reader that doesn't know you The news reader that doesn't know you
**Shipped version:** 1.4.3~ynh2 **Shipped version:** 1.4.9~ynh1
**Demo:** https://petrolette.space **Demo:** https://petrolette.space

View file

@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
La page d'actu qui ne sait rien de toi La page d'actu qui ne sait rien de toi
**Version incluse :** 1.4.3~ynh2 **Version incluse :** 1.4.9~ynh1
**Démo :** https://petrolette.space **Démo :** https://petrolette.space

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://framagit.org/yphil/petrolette/-/archive/v1.4.3/petrolette-v1.4.3.tar.gz SOURCE_URL=https://framagit.org/yphil/petrolette/-/archive/v1.4.9/petrolette-v1.4.9.tar.gz
SOURCE_SUM=3a9d48a0e613cfe93def93dbf18a9d8a122245635b3b45dbd7d146c271af67f0 SOURCE_SUM=d738bdbd50748c4658cfb1a1fe36c12b58c75d96b2d29accc386a49b44f7178c
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -6,7 +6,7 @@
"en": "The news reader that doesn't know you", "en": "The news reader that doesn't know you",
"fr": "La page d'actu qui ne sait rien de toi" "fr": "La page d'actu qui ne sait rien de toi"
}, },
"version": "1.4.3~ynh2", "version": "1.4.9~ynh1",
"url": "https://framagit.org/yphil/petrolette", "url": "https://framagit.org/yphil/petrolette",
"upstream": { "upstream": {
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",

View file

@ -40,7 +40,7 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_backup --src_path="$final_path" --is_big ynh_backup --src_path="$final_path"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION

View file

@ -13,6 +13,9 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
@ -72,7 +75,7 @@ ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
ynh_script_progression --message="Configuring system user..." ynh_script_progression --message="Configuring system user..."
# Create a system user # Create a system user
ynh_system_user_create --username=$app --home_dir=$final_path ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -110,8 +113,9 @@ pushd $final_path
[[ -v TMP_HOME ]] && HOME=$TMP_HOME || unset HOME [[ -v TMP_HOME ]] && HOME=$TMP_HOME || unset HOME
popd popd
chown -R $app:$app $final_path chmod 750 "$final_path"
chmod -R o-rwx $final_path chmod -R o-rwx "$final_path"
chown -R $app:$app "$final_path"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
@ -128,7 +132,7 @@ ynh_add_systemd_config
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description="The news reader that doesn't know you" --log="/home/yunohost.app/${app}/storage/logs/petrolette.log" yunohost service add $app --description="The news reader that doesn't know you"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -136,7 +140,7 @@ yunohost service add $app --description="The news reader that doesn't know you"
ynh_script_progression --message="Starting a systemd service..." ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app --action=start --log_path=systemd ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Directory created"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT

View file

@ -59,6 +59,7 @@ ynh_remove_nginx_config
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Removing dependencies..."
ynh_remove_nodejs ynh_remove_nodejs

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_clean_setup () { ynh_clean_setup () {
true ynh_clean_check_starting
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
@ -56,7 +56,18 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing) # Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:$app "$final_path"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
@ -67,28 +78,6 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
#=================================================
# REINSTALL PETROLLETTE
#=================================================
ynh_script_progression --message="Reinstalling the app ..." --weight=5
ynh_setup_source --dest_dir="$final_path"
pushd $final_path
# set port in configuration file
sed -i "/HTTP_PORT/s/[0-9]*[0-9]/$port/" package.json
sed -i "/HTTPS_PORT/s/[0-9]*[0-9]/$https_port/" package.json
[[ -v TMP_HOME ]] && TMP_HOME=$HOME
HOME=$(pwd)
ynh_use_nodejs
ynh_npm install
[[ -v TMP_HOME ]] && HOME=$TMP_HOME || unset HOME
popd
# Restore permissions on app files
chown -R $app:$app $final_path
chmod -R o-rwx $final_path
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
#================================================= #=================================================
@ -102,14 +91,14 @@ systemctl enable $app.service --quiet
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="The news reader that doesn't know you" --log="/home/yunohost.app/${app}/storage/logs/petrolette.log" yunohost service add $app --description="The news reader that doesn't know you"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_script_progression --message="Starting a systemd service..." --weight=3
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Directory created"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -37,6 +37,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
ynh_clean_setup () { ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails # Restore it if the upgrade fails
ynh_restore_upgradebackup ynh_restore_upgradebackup
} }
@ -50,7 +51,7 @@ ynh_abort_if_errors
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action=stop --log_path=systemd --line_match="Stopped"
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -58,7 +59,7 @@ ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=8 ynh_script_progression --message="Making sure dedicated system user exists..." --weight=8
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -106,9 +107,9 @@ pushd $final_path
[[ -v TMP_HOME ]] && HOME=$TMP_HOME || unset HOME [[ -v TMP_HOME ]] && HOME=$TMP_HOME || unset HOME
popd popd
# Set permissions on app files chmod 750 "$final_path"
chown -R $app:$app $final_path chmod -R o-rwx "$final_path"
chmod -R o-rwx $final_path chown -R $app:$app "$final_path"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
@ -125,14 +126,14 @@ ynh_add_systemd_config
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="The news reader that doesn't know you" --log="/home/yunohost.app/${app}/storage/logs/petrolette.log" yunohost service add $app --description="The news reader that doesn't know you"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_script_progression --message="Starting a systemd service..." --weight=3
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Directory created"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX