diff --git a/README.md b/README.md index 9d56b2c..26efdae 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It shall NOT be edited by hand. pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. -**Shipped version:** 8.5~ynh2 +**Shipped version:** 8.7~ynh1 ## Screenshots diff --git a/README_es.md b/README_es.md index fa8c245..00b925f 100644 --- a/README_es.md +++ b/README_es.md @@ -19,7 +19,7 @@ No se debe editar a mano. pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. -**Versión actual:** 8.5~ynh2 +**Versión actual:** 8.7~ynh1 ## Capturas diff --git a/README_eu.md b/README_eu.md index a6a66cd..2805a77 100644 --- a/README_eu.md +++ b/README_eu.md @@ -19,7 +19,7 @@ EZ editatu eskuz. pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. -**Paketatutako bertsioa:** 8.5~ynh2 +**Paketatutako bertsioa:** 8.7~ynh1 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index 43232e6..083c727 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Il NE doit PAS être modifié à la main. pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. -**Version incluse :** 8.5~ynh2 +**Version incluse :** 8.7~ynh1 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index 6b860c7..3e1b721 100644 --- a/README_gl.md +++ b/README_gl.md @@ -19,7 +19,7 @@ NON debe editarse manualmente. pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. -**Versión proporcionada:** 8.5~ynh2 +**Versión proporcionada:** 8.7~ynh1 ## Capturas de pantalla diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 22508e9..c5a3b17 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -19,7 +19,7 @@ pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. -**分发版本:** 8.5~ynh2 +**分发版本:** 8.7~ynh1 ## 截图 diff --git a/conf/requirement_bookworm.txt b/conf/requirement_bookworm.txt index f422fdb..3ab9db9 100644 --- a/conf/requirement_bookworm.txt +++ b/conf/requirement_bookworm.txt @@ -1,5 +1,5 @@ alembic==1.13.1 -Authlib==1.2.1 +Authlib==1.3.0 azure-common==1.1.28 azure-core==1.30.1 azure-identity==1.15.0 @@ -7,10 +7,10 @@ azure-mgmt-core==1.4.0 azure-mgmt-rdbms==10.1.0 azure-mgmt-resource==23.0.1 azure-mgmt-subscription==3.1.1 -Babel==2.14.0 +Babel==2.15.0 bcrypt==4.0.1 bidict==0.23.1 -blinker==1.7.0 +blinker==1.8.2 boto3==1.33.13 botocore==1.33.13 Brotli==1.1.0 @@ -19,48 +19,47 @@ certifi==2024.2.2 cffi==1.16.0 charset-normalizer==3.3.2 click==8.1.7 -colorama==0.4.6 -cryptography==42.0.5 +cryptography==42.0.7 dnspython==2.6.1 email_validator==2.1.1 eventlet==0.34.2 -Flask==2.3.3 +Flask==3.0.3 flask-babel==4.0.0 -Flask-Compress==1.14 -Flask-Gravatar==0.5.0 +Flask-Compress==1.15 Flask-Login==0.6.3 -Flask-Mail==0.9.1 +Flask-Mail==0.10.0 Flask-Migrate==4.0.7 Flask-Paranoid==0.3.0 Flask-Principal==0.4.0 -Flask-Security-Too==5.3.3 +Flask-Security-Too==5.4.3 Flask-SocketIO==5.3.6 Flask-SQLAlchemy==3.1.1 Flask-WTF==1.2.1 -google-api-core==2.18.0 -google-api-python-client==2.125.0 +google-api-core==2.19.0 +google-api-python-client==2.131.0 google-auth==2.29.0 google-auth-httplib2==0.2.0 -google-auth-oauthlib==1.1.0 +google-auth-oauthlib==1.2.0 googleapis-common-protos==1.63.0 greenlet==3.0.3 -gunicorn==21.2.0 +gunicorn==22.0.0 h11==0.14.0 httpagentparser==1.9.5 httplib2==0.22.0 -idna==3.6 +idna==3.7 importlib_metadata==7.1.0 importlib_resources==6.4.0 isodate==0.6.1 -itsdangerous==2.1.2 +itsdangerous==2.2.0 jaraco.classes==3.4.0 jeepney==0.8.0 -Jinja2==3.1.3 +Jinja2==3.1.4 jmespath==1.0.1 jsonformatter==0.3.2 keyring==24.3.1 ldap3==2.9.1 -Mako==1.3.2 +libgravatar==1.0.4 +Mako==1.3.5 markdown-it-py==3.0.0 MarkupSafe==2.1.5 mdurl==0.1.2 @@ -72,7 +71,7 @@ oauthlib==3.2.2 packaging==24.0 paramiko==3.4.0 passlib==1.7.4 -pgadmin4==8.5 +pgadmin4==8.7 portalocker==2.8.2 proto-plus==1.23.0 protobuf==4.25.3 @@ -82,18 +81,18 @@ psycopg-c==3.1.12 pyasn1==0.6.0 pyasn1_modules==0.4.0 pycparser==2.22 -Pygments==2.17.2 +Pygments==2.18.0 PyJWT==2.8.0 PyNaCl==1.5.0 pyotp==2.9.0 pyparsing==3.1.2 pypng==0.20220715.0 python-dateutil==2.9.0.post0 -python-engineio==4.9.0 +python-engineio==4.9.1 python-socketio==5.11.2 -pytz==2023.4 +pytz==2024.1 qrcode==7.4.2 -requests==2.31.0 +requests==2.32.3 requests-oauthlib==2.0.0 rich==13.7.1 rsa==4.9 @@ -103,16 +102,17 @@ shellingham==1.5.4 simple-websocket==1.0.0 six==1.16.0 speaklater3==1.4 -SQLAlchemy==2.0.29 -sqlparse==0.4.4 +SQLAlchemy==2.0.30 +sqlparse==0.5.0 sshtunnel==0.4.0 -typer==0.9.4 -typing_extensions==4.10.0 +typer==0.12.3 +typing_extensions==4.12.0 ua-parser==0.18.0 uritemplate==4.1.1 urllib3==1.26.18 user-agents==2.2.0 -Werkzeug==2.3.8 +Werkzeug==3.0.3 wsproto==1.2.0 WTForms==3.1.2 -zipp==3.18.1 +zipp==3.19.0 +zstandard==0.22.0 diff --git a/conf/requirement_bullseye.txt b/conf/requirement_bullseye.txt index 8622b1a..a492e80 100644 --- a/conf/requirement_bullseye.txt +++ b/conf/requirement_bullseye.txt @@ -1,5 +1,5 @@ alembic==1.13.1 -Authlib==1.2.1 +Authlib==1.3.0 azure-common==1.1.28 azure-core==1.30.1 azure-identity==1.15.0 @@ -7,10 +7,10 @@ azure-mgmt-core==1.4.0 azure-mgmt-rdbms==10.1.0 azure-mgmt-resource==23.0.1 azure-mgmt-subscription==3.1.1 -Babel==2.14.0 +Babel==2.15.0 bcrypt==4.0.1 bidict==0.23.1 -blinker==1.7.0 +blinker==1.8.2 boto3==1.33.13 botocore==1.33.13 Brotli==1.1.0 @@ -19,48 +19,47 @@ certifi==2024.2.2 cffi==1.16.0 charset-normalizer==3.3.2 click==8.1.7 -colorama==0.4.6 -cryptography==42.0.5 +cryptography==42.0.7 dnspython==2.6.1 email_validator==2.1.1 eventlet==0.34.2 -Flask==2.3.3 +Flask==3.0.3 flask-babel==4.0.0 -Flask-Compress==1.14 -Flask-Gravatar==0.5.0 +Flask-Compress==1.15 Flask-Login==0.6.3 -Flask-Mail==0.9.1 +Flask-Mail==0.10.0 Flask-Migrate==4.0.7 Flask-Paranoid==0.3.0 Flask-Principal==0.4.0 -Flask-Security-Too==5.3.3 +Flask-Security-Too==5.4.3 Flask-SocketIO==5.3.6 Flask-SQLAlchemy==3.1.1 Flask-WTF==1.2.1 -google-api-core==2.18.0 -google-api-python-client==2.125.0 +google-api-core==2.19.0 +google-api-python-client==2.131.0 google-auth==2.29.0 google-auth-httplib2==0.2.0 -google-auth-oauthlib==1.1.0 +google-auth-oauthlib==1.2.0 googleapis-common-protos==1.63.0 greenlet==1.1.2 -gunicorn==21.2.0 +gunicorn==22.0.0 h11==0.14.0 httpagentparser==1.9.5 httplib2==0.22.0 -idna==3.6 +idna==3.7 importlib_metadata==7.1.0 importlib_resources==6.4.0 isodate==0.6.1 -itsdangerous==2.1.2 +itsdangerous==2.2.0 jaraco.classes==3.4.0 jeepney==0.8.0 -Jinja2==3.1.3 +Jinja2==3.1.4 jmespath==1.0.1 jsonformatter==0.3.2 keyring==24.3.1 ldap3==2.9.1 -Mako==1.3.2 +libgravatar==1.0.4 +Mako==1.3.5 markdown-it-py==3.0.0 MarkupSafe==2.1.5 mdurl==0.1.2 @@ -72,7 +71,7 @@ oauthlib==3.2.2 packaging==24.0 paramiko==3.4.0 passlib==1.7.4 -pgadmin4==8.5 +pgadmin4==8.7 portalocker==2.8.2 proto-plus==1.23.0 protobuf==4.25.3 @@ -82,18 +81,18 @@ psycopg-c==3.1.12 pyasn1==0.6.0 pyasn1_modules==0.4.0 pycparser==2.22 -Pygments==2.17.2 +Pygments==2.18.0 PyJWT==2.8.0 PyNaCl==1.5.0 pyotp==2.9.0 pyparsing==3.1.2 pypng==0.20220715.0 python-dateutil==2.9.0.post0 -python-engineio==4.9.0 +python-engineio==4.9.1 python-socketio==5.11.2 -pytz==2023.4 +pytz==2024.1 qrcode==7.4.2 -requests==2.31.0 +requests==2.32.3 requests-oauthlib==2.0.0 rich==13.7.1 rsa==4.9 @@ -103,16 +102,17 @@ shellingham==1.5.4 simple-websocket==1.0.0 six==1.16.0 speaklater3==1.4 -SQLAlchemy==2.0.29 -sqlparse==0.4.4 +SQLAlchemy==2.0.30 +sqlparse==0.5.0 sshtunnel==0.4.0 -typer==0.9.4 -typing_extensions==4.10.0 +typer==0.12.3 +typing_extensions==4.12.0 ua-parser==0.18.0 uritemplate==4.1.1 urllib3==1.26.18 user-agents==2.2.0 -Werkzeug==2.3.8 +Werkzeug==3.0.3 wsproto==1.2.0 WTForms==3.1.2 -zipp==3.18.1 +zipp==3.19.0 +zstandard==0.22.0 diff --git a/manifest.toml b/manifest.toml index 3124c56..67a1f57 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "pgAdmin4" description.en = "Manage PostgreSQL databases over the web" description.fr = "Application web de gestion des bases de données PostgreSQL" -version = "8.5~ynh2" +version = "8.7~ynh1" maintainers = ["Josué Tille"] @@ -42,13 +42,13 @@ ram.runtime = "200M" [resources] [resources.sources.pgadmin_prebuilt_armv7_bookworm] prefetch = false - armhf.url = "https://github.com/YunoHost-Apps/pgadmin_python_build/releases/download/v8.5/pgadmin_8.5-bookworm-bin1_armv7l.tar.gz" - armhf.sha256 = "55bce68b2dca172311acc9f9d1c8837d53af72b69a2e37dc9da9c374129b2fe8" + armhf.url = "https://github.com/YunoHost-Apps/pgadmin_python_build/releases/download/v8.7/pgadmin_8.7-bookworm-bin1_armv7l.tar.gz" + armhf.sha256 = "5aedef91672fd30022ba410cda919138ff18703b9839bbfc3bca4ea421102591" [resources.sources.pgadmin_prebuilt_armv7_bullseye] prefetch = false - armhf.url = "https://github.com/YunoHost-Apps/pgadmin_python_build/releases/download/v8.5/pgadmin_8.5-bullseye-bin1_armv7l.tar.gz" - armhf.sha256 = "4f67b54a306220621f76a488e18b5c1a04379ee3914fbd91830378bcf8896363" + armhf.url = "https://github.com/YunoHost-Apps/pgadmin_python_build/releases/download/v8.7/pgadmin_8.7-bullseye-bin1_armv7l.tar.gz" + armhf.sha256 = "9603492ca0fb2b258425b298705f0b2fa24e54d34182160d1854ce68c21f04a9" [resources.system_user] allow_email = true diff --git a/scripts/_common.sh b/scripts/_common.sh index bec851d..aaeac80 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -12,48 +12,58 @@ postgresql_version="$(psql -V | cut -d' ' -f3 | cut -d. -f1)" #================================================= install_source() { + # Cleanup old venv files + ynh_secure_remove --file="$install_dir"/bin + ynh_secure_remove --file="$install_dir"/lib + ynh_secure_remove --file="$install_dir"/lib64 + ynh_secure_remove --file="$install_dir"/include + ynh_secure_remove --file="$install_dir"/share + ynh_secure_remove --file="$install_dir"/pyvenv.cfg + # Clean venv is it was on python with an old version in case major upgrade of debian - if [ ! -e $install_dir/venv/lib/python$python_version ] || ! grep -qF "$install_dir/venv/bin/python" "$install_dir"/venv/bin/pip; then - ynh_secure_remove --file=$install_dir/venv/bin - ynh_secure_remove --file=$install_dir/venv/lib - ynh_secure_remove --file=$install_dir/venv/lib64 - ynh_secure_remove --file=$install_dir/venv/include - ynh_secure_remove --file=$install_dir/venv/share - ynh_secure_remove --file=$install_dir/venv/pyvenv.cfg + if [ ! -e "$install_dir/venv/lib/python$python_version" ] || ! grep -qF "$install_dir/venv/bin/python" "$install_dir"/venv/bin/pip; then + ynh_secure_remove --file="$install_dir"/venv/bin + ynh_secure_remove --file="$install_dir"/venv/lib + ynh_secure_remove --file="$install_dir"/venv/lib64 + ynh_secure_remove --file="$install_dir"/venv/include + ynh_secure_remove --file="$install_dir"/venv/share + ynh_secure_remove --file="$install_dir"/venv/pyvenv.cfg fi if uname -m | grep -q arm then - # Clean old file, sometime it could make some big issues if we don't do this !! - ynh_secure_remove --file=$install_dir/venv/bin - ynh_secure_remove --file=$install_dir/venv/lib - ynh_secure_remove --file=$install_dir/venv/include - ynh_secure_remove --file=$install_dir/venv/share - ynh_setup_source --dest_dir $install_dir/venv/ --source_id "pgadmin_prebuilt_armv7_$(lsb_release --codename --short)" + ynh_setup_source --dest_dir "$install_dir"/venv/ --source_id "pgadmin_prebuilt_armv7_$(lsb_release --codename --short)" --full_replace + + # Fix multi-instance support + for f in "$install_dir"/venv/bin/*; do + if ! [[ $f =~ "__" ]]; then + ynh_replace_special_string --match_string='#!'/opt/yunohost/pgadmin/venv --replace_string='#!'"$install_dir"/venv --target_file="$f" + fi + done else # Install virtualenv if it don't exist - test -e $install_dir/venv/bin/python3 || python3 -m venv $install_dir/venv + test -e "$install_dir"/venv/bin/python3 || python3 -m venv "$install_dir"/venv # Install pgadmin in virtualenv - pip=$install_dir/venv/bin/pip + pip="$install_dir"/venv/bin/pip $pip install --upgrade pip wheel - $pip install --upgrade -r "$YNH_APP_BASEDIR"/conf/requirement_$(lsb_release --codename --short).txt + $pip install --upgrade -r "$YNH_APP_BASEDIR/conf/requirement_$(lsb_release --codename --short).txt" fi # Apply patchs if needed # Note that we put patch into scripts dir because /source are not stored and can't be used on restore - if ! grep -F -q '# BEGIN Yunohost Patch' $install_dir/venv/lib/python$python_version/site-packages/pgadmin4/migrations/versions/fdc58d9bd449_.py; then - pushd $install_dir/venv/lib/python$python_version/site-packages/pgadmin4 + if ! grep -F -q '# BEGIN Yunohost Patch' "$install_dir/venv/lib/python$python_version/site-packages/pgadmin4/migrations/versions/fdc58d9bd449_.py"; then + pushd "$install_dir/venv/lib/python$python_version/site-packages/pgadmin4" patch -p1 < "$YNH_APP_BASEDIR"/scripts/patch/avoid_create_user_on_setup_db.patch popd fi - if ! grep -F -q '# BEGIN Yunohost Patch' $install_dir/venv/lib/python$python_version/site-packages/pgadmin4/pgadmin/__init__.py; then - pushd $install_dir/venv/lib/python$python_version/site-packages/pgadmin4 + if ! grep -F -q '# BEGIN Yunohost Patch' "$install_dir/venv/lib/python$python_version/site-packages/pgadmin4/pgadmin/__init__.py"; then + pushd "$install_dir/venv/lib/python$python_version/site-packages/pgadmin4" patch -p1 < "$YNH_APP_BASEDIR"/scripts/patch/fix_add_local_db.patch popd fi - if ! grep -F -q '# BEGIN Yunohost Patch' $install_dir/venv/lib/python$python_version/site-packages/pgadmin4/pgadmin/authenticate/webserver.py; then - pushd $install_dir/venv/lib/python$python_version/site-packages/pgadmin4 + if ! grep -F -q '# BEGIN Yunohost Patch' "$install_dir/venv/lib/python$python_version/site-packages/pgadmin4/pgadmin/authenticate/webserver.py"; then + pushd "$install_dir/venv/lib/python$python_version/site-packages/pgadmin4" patch -p1 < "$YNH_APP_BASEDIR"/scripts/patch/change_default_webserver_new_user_role_to_admin.patch popd fi @@ -61,16 +71,16 @@ install_source() { set_permission() { # Set permission - chown $app:$app -R $install_dir - chmod u+rw,o= -R $install_dir - chown $app:$app -R $data_dir - chmod u+rw,o= -R $data_dir - chown $app:$app -R /var/log/$app - chmod u=rwX,g=rX,o= -R /var/log/$app + chown "$app:$app" -R "$install_dir" + chmod u+rw,o= -R "$install_dir" + chown "$app:$app" -R "$data_dir" + chmod u+rw,o= -R "$data_dir" + chown "$app:$app" -R /var/log/"$app" + chmod u=rwX,g=rX,o= -R /var/log/"$app" # Criticals files - chown $app:root $data_dir/master_pwd - chmod u=r,g=,o= $data_dir/master_pwd - chown $app:root $install_dir/postgres-reg.ini - chmod u=r,g=,o= $install_dir/postgres-reg.ini + chown "$app":root "$data_dir"/master_pwd + chmod u=r,g=,o= "$data_dir"/master_pwd + chown "$app":root "$install_dir"/postgres-reg.ini + chmod u=r,g=,o= "$install_dir"/postgres-reg.ini } diff --git a/scripts/change_url b/scripts/change_url index c46db0e..3940ef6 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -41,7 +41,7 @@ set_permission ynh_script_progression --message="Starting a systemd service..." --weight=3 # Start a systemd service -ynh_systemd_action --service_name="$app.service" --action="restart" --line_match "Listening at: unix:/run/$app/app.socket" --log_path systemd +ynh_systemd_action --service_name="$app.service" --action="restart" --line_match="Listening at: unix:/run/$app/app.socket" --log_path=systemd #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 5827001..5ab0f21 100644 --- a/scripts/install +++ b/scripts/install @@ -13,20 +13,20 @@ source /usr/share/yunohost/helpers #================================================= # Postgresql superuser #================================================= -ynh_script_progression --message="Configuring Postgresql superuser..." --weight 1 +ynh_script_progression --message="Configuring Postgresql superuser..." --weight=1 -ynh_psql_execute_as_root --sql "ALTER USER $db_user WITH SUPERUSER CREATEDB CREATEROLE REPLICATION" +ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH SUPERUSER CREATEDB CREATEROLE REPLICATION" ynh_script_progression --message='Creating base directory...' -if [ -n "$(ls -A $data_dir)" ]; then +if [ -n "$(ls -A "$data_dir")" ]; then old_data_dir_path="${data_dir}_$(date '+%Y%m%d.%H%M%S')" ynh_print_warn "Data directory was not empty. Data was moved to $old_data_dir_path" - mkdir -p $old_data_dir_path + mkdir -p "$old_data_dir_path" mv -t "$old_data_dir_path" "$data_dir"/* fi -mkdir -p /var/log/$app +mkdir -p /var/log/"$app" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -69,7 +69,7 @@ set_permission #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=3 -ynh_systemd_action --service_name "$app.service" --action="restart" --line_match "Listening at: unix:/run/$app/app.socket" --log_path systemd +ynh_systemd_action --service_name="$app.service" --action="restart" --line_match="Listening at: unix:/run/$app/app.socket" --log_path=systemd #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 5752a1e..63ead8c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -16,9 +16,9 @@ source /usr/share/yunohost/helpers ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Stop service -ynh_systemd_action --service_name "$app.service" --action stop -ynh_remove_systemd_config --service=$app -yunohost service remove $app +ynh_systemd_action --service_name="$app.service" --action=stop +ynh_remove_systemd_config --service="$app" +yunohost service remove "$app" # Remove the app-specific logrotate config ynh_remove_logrotate @@ -33,8 +33,10 @@ ynh_remove_nginx_config #================================================= ynh_script_progression --message="Removing various files..." --weight=1 -# Remove the log files -ynh_secure_remove --file="/var/log/$app" +if [ "$YNH_APP_PURGE" -eq 1 ]; then + ynh_script_progression --message="Removing logs..." + ynh_secure_remove --file=/var/log/"$app" +fi #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index eb87410..fa7e905 100644 --- a/scripts/restore +++ b/scripts/restore @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Restoring the Postgresql superuser..." --weight=1 -ynh_psql_execute_as_root --sql "ALTER USER $app WITH SUPERUSER CREATEDB CREATEROLE REPLICATION" +ynh_psql_execute_as_root --sql="ALTER USER $app WITH SUPERUSER CREATEDB CREATEROLE REPLICATION" #================================================= # RESTORE ALL CONFIG AND DATA @@ -38,8 +38,8 @@ install_source ynh_script_progression --message="Enable systemd services" --weight=2 # systemctl daemon-reload -systemctl enable $app.service --quiet -yunohost service add $app --log "/var/log/$app/$app.log" --description 'PgAdmin application' +systemctl enable "$app".service --quiet +yunohost service add "$app" --log "/var/log/$app/$app.log" --description 'PgAdmin application' set_permission @@ -50,7 +50,7 @@ set_permission #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name "$app.service" --action="restart" --line_match "Listening at: unix:/run/$app/app.socket" --log_path systemd +ynh_systemd_action --service_name="$app.service" --action="restart" --line_match="Listening at: unix:/run/$app/app.socket" --log_path=systemd ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index b47c095..2bb0f87 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,14 +18,14 @@ source /usr/share/yunohost/helpers ynh_script_progression --message="Stopping a systemd service..." --weight=1 if [ -f "/etc/uwsgi/apps-available/$app.ini" ]; then - ynh_systemd_action --service_name "uwsgi-app@$app.service" --action stop + ynh_systemd_action --service_name="uwsgi-app@$app.service" --action=stop systemctl disable "uwsgi-app@$app.service" --quiet yunohost service remove "uwsgi-app@$app" || true ynh_secure_remove --file="/etc/uwsgi/apps-available/$app.ini" ynh_secure_remove --file="/etc/systemd/system/uwsgi-app@$app.service.d" else - ynh_systemd_action --service_name "$app.service" --action stop + ynh_systemd_action --service_name="$app.service" --action=stop fi #================================================= @@ -49,8 +49,8 @@ if [ -d "$install_dir/data" ]; then fi ynh_secure_remove "$install_dir/data" fi -if [ ! -e $data_dir/master_pwd ]; then - ynh_string_random --length=60 > $data_dir/master_pwd +if [ ! -e "$data_dir"/master_pwd ]; then + ynh_string_random --length=60 > "$data_dir"/master_pwd fi #================================================= @@ -59,7 +59,7 @@ fi ynh_script_progression --message="Configuring Postgresql superuser..." --weight=1 # Re-set the db_pwd just in case… -ynh_psql_execute_as_root --sql "ALTER USER $app WITH PASSWORD '$db_pwd' SUPERUSER CREATEDB CREATEROLE REPLICATION" +ynh_psql_execute_as_root --sql="ALTER USER $app WITH PASSWORD '$db_pwd' SUPERUSER CREATEDB CREATEROLE REPLICATION" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -85,12 +85,12 @@ ynh_script_progression --message="Upgrading system configurations related to $ap ynh_add_nginx_config # Add systemd config -ynh_add_systemd_config --service=$app --template=pgadmin.service +ynh_add_systemd_config --service="$app" --template=pgadmin.service -yunohost service add $app --log "/var/log/$app/$app.log" --description 'PgAdmin application' +yunohost service add "$app" --log "/var/log/$app/$app.log" --description 'PgAdmin application' # Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --logfile /var/log/$app --nonappend +ynh_use_logrotate --logfile=/var/log/"$app" --nonappend set_permission @@ -99,7 +99,7 @@ set_permission #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=3 -ynh_systemd_action --service_name "$app.service" --action="restart" --line_match "Listening at: unix:/run/$app/app.socket" --log_path systemd +ynh_systemd_action --service_name="$app.service" --action="restart" --line_match="Listening at: unix:/run/$app/app.socket" --log_path=systemd #================================================= # END OF SCRIPT