Prepare upgrade to LibreQR 1.2.0

This commit is contained in:
Miraty 2020-03-22 19:02:01 +01:00
parent e8fffd38fb
commit e2f94584c8
Signed by: miraty
GPG Key ID: B82D15F03E67B2B5
13 changed files with 28 additions and 243 deletions

0
LICENSE Normal file → Executable file
View File

8
README.md Normal file → Executable file
View File

@ -27,11 +27,11 @@ Modifiez le fichier /var/www/qr/options.inc.php à votre guise
## Caractéristiques spécifiques YunoHost
#### Support multi-utilisateurs
### Support multi-utilisateurs
Il n'y a aucune forme d'authentification dans l'application.
#### Supported architectures
### Supported architectures
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/qr%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/qr/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/qr%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/qr/)
@ -48,8 +48,8 @@ Il n'y a aucune forme d'authentification dans l'application.
## Liens
* Signaler un bug dans le paquet YunoHost : https://code.antopie.org/miraty/qr_ynh/issues
* Signaler un bug dans le logiciel source : https://code.antopie.org/miraty/qr/issues
* Dépôt de l'application principale : https://code.antopie.org/miraty/qr/
* Signaler un bug dans le logiciel source : https://code.antopie.org/miraty/libreqr/issues
* Dépôt de l'application principale : https://code.antopie.org/miraty/libreqr/
* Site web de YunoHost : https://yunohost.org/
---

4
conf/app.src Normal file → Executable file
View File

@ -1,5 +1,5 @@
SOURCE_URL=https://code.antopie.org/miraty/qr/archive/1.1.0.zip
SOURCE_SUM=b409c5ec4cc98968bbe46152fd33b83aca7337205c81c1b0cf73c4203ecb9a9f
SOURCE_URL=https://code.antopie.org/miraty/libreqr/archive/master.zip
SOURCE_SUM=b8ef7510344b74881ba719a2290c089246439c48bb2f1dac757d213d173f016e
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true

0
conf/nginx.conf Normal file → Executable file
View File

24
manifest.json Normal file → Executable file
View File

@ -1,18 +1,18 @@
{
"name": "Generateur de codes QR",
"name": "LibreQR",
"id": "qr",
"packaging_format": 1,
"description": {
"en": "A QR codes generator",
"fr": "Un générateur de codes QR"
},
"version": "1.0~ynh1",
"url": "https://code.antopie.org/miraty/qr/",
"license": "Apache-2.0",
"version": "1.2.0~ynh2",
"url": "https://code.antopie.org/miraty/libreqr/",
"license": "AGPL-3.0-or-later",
"maintainer": {
"name": "Miraty",
"email": "miraty@antopie.org",
"url": "https://www.antopie.org"
"email": "miraty+ynh@antopie.org",
"url": "https://miraty.antopie.org"
},
"requirements": {
"yunohost": ">= 3.6"
@ -28,8 +28,8 @@
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain for QR code generator",
"fr": "Choisissez un domaine pour le Générateur de codes QR"
"en": "Choose a domain for LibreQR",
"fr": "Choisissez un domaine pour LibreQR"
},
"example": "michu.home"
},
@ -37,8 +37,8 @@
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for QR code generator",
"fr": "Choisissez un chemin pour le Générateur de codes QR"
"en": "Choose a path for LibreQR",
"fr": "Choisissez un chemin pour LibreQR"
},
"example": "/qr",
"default": "/qr"
@ -51,8 +51,8 @@
"fr": "Est-ce une application publique ?"
},
"help": {
"en": "Can the QR code generator be used by everyone?",
"fr": "Le générateur de codes QR peut-il être utilisé par tout le monde ?"
"en": "Can LibreQR be used by everyone?",
"fr": "LibreQR peut-elle être utilisée par tout le monde ?"
},
"default": true
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
scripts/_common.sh Normal file → Executable file
View File

View File

@ -30,7 +30,7 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#=================================================
# STANDARD BACKUP STEPS
@ -55,36 +55,6 @@ ynh_script_progression --message="Backing up php-fpm configuration..." --time --
ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf"
#=================================================
# BACKUP THE MYSQL DATABASE
#=================================================
#ynh_script_progression --message="Backing up the MySQL database..." --time --weight=1
#ynh_mysql_dump_db --database="$db_name" > db.sql
#=================================================
# BACKUP FAIL2BAN CONFIGURATION
#=================================================
#ynh_script_progression --message="Backing up fail2ban configuration..." --time --weight=1
#ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
#ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
#=================================================
#ynh_script_progression --message="Backing up logrotate configuration..." --time --weight=1
#ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP A CRON FILE
#=================================================
#ynh_backup --src_path="/etc/cron.d/$app"
#=================================================
# END OF SCRIPT
#=================================================

27
scripts/change_url Normal file → Executable file
View File

@ -53,12 +53,6 @@ fi
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
#ynh_script_progression --message="Stopping a systemd service..." --time --weight=1
#ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
@ -88,27 +82,6 @@ then
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
fi
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# Mofifie la nouvelle URL dans le fichier de conf options.inc.php
ynh_replace_string --match_string="\$cheminInstall = \"https://$old_domain/$old_path\";" --replace_string="\$cheminInstall = \"https://$new_domain/$new_path\";" --target_file=$final_path/options.inc.php
#=================================================
# END SPECIFIC MODIFICATIONS
#=================================================
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
#ynh_script_progression --message="Starting a systemd service..." --time --weight=1
#ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
#=================================================
# RELOAD NGINX
#=================================================

View File

@ -123,17 +123,6 @@ ynh_print_info "Configuring php-fpm..."
# Create a dedicated php-fpm config
ynh_add_fpm_config
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="MODIFY A CONFIG FILE" --time --weight=1
### `ynh_replace_string` is used to replace a string in a file.
### (It's compatible with sed regular expressions syntax)
ynh_replace_string --match_string="\$cheminInstall = \"https://example.org/\";" --replace_string="\$cheminInstall = \"https://$domain/$path_url\";" --target_file=$final_path/options.inc.php
#=================================================
# GENERIC FINALIZATION
#=================================================
@ -145,17 +134,8 @@ ynh_replace_string --match_string="\$cheminInstall = \"https://example.org/\";"
### that really need such authorization.
# Set permissions to app files
chown -R root: $final_path
chown -R root:$app $final_path/temp
chmod -R g+w $final_path/temp
#=================================================
# SETUP FAIL2BAN
#=================================================
#ynh_script_progression --message="Configuring fail2ban..." --time --weight=1
# Create a dedicated fail2ban config
#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
chown -R root:$app $final_path
chmod -R g+w $final_path
#=================================================
# SETUP SSOWAT

View File

@ -17,46 +17,12 @@ ynh_script_progression --message="Loading installation settings..." --time --wei
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port)
#port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE SERVICE FROM ADMIN PANEL
#=================================================
# Remove a service from the admin panel, added by `yunohost service add`
#if ynh_exec_warn_less yunohost service status $app >/dev/null
#then
# ynh_script_progression --message="Removing $app service..." --time --weight=1
# yunohost service remove $app
#fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
#ynh_script_progression --message="Stopping and removing the systemd service..." --time --weight=1
# Remove the dedicated systemd config
#ynh_remove_systemd_config
#=================================================
# REMOVE THE MYSQL DATABASE
#=================================================
#ynh_script_progression --message="Removing the MySQL database..." --time --weight=1
# Remove a database if it exists, along with the associated user
#ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
#=================================================
# REMOVE DEPENDENCIES
#=================================================
#ynh_script_progression --message="Removing dependencies..." --time --weight=1
# Remove metapackage and its dependencies
#ynh_remove_app_dependencies
#=================================================
# REMOVE APP MAIN DIR
#=================================================
@ -81,47 +47,6 @@ ynh_script_progression --message="Removing php-fpm configuration..." --time --we
# Remove the dedicated php-fpm config
ynh_remove_fpm_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
#ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1
# Remove the app-specific logrotate config
#ynh_remove_logrotate
#=================================================
# CLOSE A PORT
#=================================================
if yunohost firewall list | grep -q "\- $port$"
then
ynh_script_progression --message="Closing port $port..."
ynh_exec_warn_less yunohost firewall disallow TCP $port
fi
#=================================================
# REMOVE FAIL2BAN CONFIGURATION
#=================================================
#ynh_script_progression --message="Removing fail2ban configuration..." --time --weight=1
# Remove the dedicated fail2ban config
#ynh_remove_fail2ban_config
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE THE CRON FILE
#=================================================
# Remove a cron file
#ynh_secure_remove --file="/etc/cron.d/$app"
# Remove a directory securely
#ynh_secure_remove --file="/etc/$app/"
# Remove the log files
#ynh_secure_remove --file="/var/log/$app/"
#=================================================
# GENERIC FINALIZATION
#=================================================

View File

@ -69,10 +69,9 @@ ynh_system_user_create --username=$app
# RESTORE USER RIGHTS
#=================================================
# Restore permissions on app files
chown -R root: $final_path
chown -R root:$app $final_path/temp
chmod -R g+w $final_path/temp
# Set permissions to app files
chown -R root:$app $final_path
chmod -R g+w $final_path
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
@ -80,52 +79,6 @@ chmod -R g+w $final_path/temp
ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf"
#=================================================
# RESTORE FAIL2BAN CONFIGURATION
#=================================================
#ynh_script_progression --message="Restoring the fail2ban configuration..." --time --weight=1
#ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
#ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
#ynh_systemd_action --action=restart --service_name=fail2ban
#=================================================
# SPECIFIC RESTORATION
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
#ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1
# Define and install dependencies
#ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================
#ynh_script_progression --message="Restoring the MySQL database..." --time --weight=1
#db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
#ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
#ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#=================================================
# ADVERTISE SERVICE IN ADMIN PANEL
#=================================================
#yunohost service add $app --log "/var/log/$app/$app.log"
#=================================================
# RESTORE THE CRON FILE
#=================================================
#ynh_restore_file --origin_path="/etc/cron.d/$app"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
#ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================

View File

@ -126,12 +126,6 @@ ynh_script_progression --message="Upgrading php-fpm configuration..." --time --w
# Create a dedicated php-fpm config
ynh_add_fpm_config
#=================================================
# SPECIFIC UPGRADE
#=================================================
# ...
#=================================================
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
@ -142,25 +136,15 @@ ynh_backup_if_checksum_is_different --file="$final_path/options.inc.php"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$final_path/options.inc.php"
#=================================================
# GENERIC FINALIZATION
#=================================================
# UPGRADE FAIL2BAN
#=================================================
#ynh_script_progression --message="Reconfiguring fail2ban..." --time --weight=1
# Create a dedicated fail2ban config
#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions on app files
chown -R root: $final_path
chown -R root:$app $final_path/temp
chmod -R g+w $final_path/temp
# Set permissions to app files
chown -R root:$app $final_path
chmod -R g+w $final_path
#=================================================
# SETUP SSOWAT