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

Merge pull request #40 from YunoHost-Apps/testing

Testing
This commit is contained in:
Josue-T 2024-06-03 17:51:27 +02:00 committed by GitHub
commit aa9fed3ce1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 138 additions and 126 deletions

View file

@ -19,7 +19,7 @@ It shall NOT be edited by hand.
pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL.
**Shipped version:** 8.5~ynh2 **Shipped version:** 8.7~ynh1
## Screenshots ## Screenshots

View file

@ -19,7 +19,7 @@ No se debe editar a mano.
pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. 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 ## Capturas

View file

@ -19,7 +19,7 @@ EZ editatu eskuz.
pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. 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 ## Pantaila-argazkiak

View file

@ -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. 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 ## Captures décran

View file

@ -19,7 +19,7 @@ NON debe editarse manualmente.
pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. 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 ## Capturas de pantalla

View file

@ -19,7 +19,7 @@
pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL.
**分发版本:** 8.5~ynh2 **分发版本:** 8.7~ynh1
## 截图 ## 截图

View file

@ -1,5 +1,5 @@
alembic==1.13.1 alembic==1.13.1
Authlib==1.2.1 Authlib==1.3.0
azure-common==1.1.28 azure-common==1.1.28
azure-core==1.30.1 azure-core==1.30.1
azure-identity==1.15.0 azure-identity==1.15.0
@ -7,10 +7,10 @@ azure-mgmt-core==1.4.0
azure-mgmt-rdbms==10.1.0 azure-mgmt-rdbms==10.1.0
azure-mgmt-resource==23.0.1 azure-mgmt-resource==23.0.1
azure-mgmt-subscription==3.1.1 azure-mgmt-subscription==3.1.1
Babel==2.14.0 Babel==2.15.0
bcrypt==4.0.1 bcrypt==4.0.1
bidict==0.23.1 bidict==0.23.1
blinker==1.7.0 blinker==1.8.2
boto3==1.33.13 boto3==1.33.13
botocore==1.33.13 botocore==1.33.13
Brotli==1.1.0 Brotli==1.1.0
@ -19,48 +19,47 @@ certifi==2024.2.2
cffi==1.16.0 cffi==1.16.0
charset-normalizer==3.3.2 charset-normalizer==3.3.2
click==8.1.7 click==8.1.7
colorama==0.4.6 cryptography==42.0.7
cryptography==42.0.5
dnspython==2.6.1 dnspython==2.6.1
email_validator==2.1.1 email_validator==2.1.1
eventlet==0.34.2 eventlet==0.34.2
Flask==2.3.3 Flask==3.0.3
flask-babel==4.0.0 flask-babel==4.0.0
Flask-Compress==1.14 Flask-Compress==1.15
Flask-Gravatar==0.5.0
Flask-Login==0.6.3 Flask-Login==0.6.3
Flask-Mail==0.9.1 Flask-Mail==0.10.0
Flask-Migrate==4.0.7 Flask-Migrate==4.0.7
Flask-Paranoid==0.3.0 Flask-Paranoid==0.3.0
Flask-Principal==0.4.0 Flask-Principal==0.4.0
Flask-Security-Too==5.3.3 Flask-Security-Too==5.4.3
Flask-SocketIO==5.3.6 Flask-SocketIO==5.3.6
Flask-SQLAlchemy==3.1.1 Flask-SQLAlchemy==3.1.1
Flask-WTF==1.2.1 Flask-WTF==1.2.1
google-api-core==2.18.0 google-api-core==2.19.0
google-api-python-client==2.125.0 google-api-python-client==2.131.0
google-auth==2.29.0 google-auth==2.29.0
google-auth-httplib2==0.2.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 googleapis-common-protos==1.63.0
greenlet==3.0.3 greenlet==3.0.3
gunicorn==21.2.0 gunicorn==22.0.0
h11==0.14.0 h11==0.14.0
httpagentparser==1.9.5 httpagentparser==1.9.5
httplib2==0.22.0 httplib2==0.22.0
idna==3.6 idna==3.7
importlib_metadata==7.1.0 importlib_metadata==7.1.0
importlib_resources==6.4.0 importlib_resources==6.4.0
isodate==0.6.1 isodate==0.6.1
itsdangerous==2.1.2 itsdangerous==2.2.0
jaraco.classes==3.4.0 jaraco.classes==3.4.0
jeepney==0.8.0 jeepney==0.8.0
Jinja2==3.1.3 Jinja2==3.1.4
jmespath==1.0.1 jmespath==1.0.1
jsonformatter==0.3.2 jsonformatter==0.3.2
keyring==24.3.1 keyring==24.3.1
ldap3==2.9.1 ldap3==2.9.1
Mako==1.3.2 libgravatar==1.0.4
Mako==1.3.5
markdown-it-py==3.0.0 markdown-it-py==3.0.0
MarkupSafe==2.1.5 MarkupSafe==2.1.5
mdurl==0.1.2 mdurl==0.1.2
@ -72,7 +71,7 @@ oauthlib==3.2.2
packaging==24.0 packaging==24.0
paramiko==3.4.0 paramiko==3.4.0
passlib==1.7.4 passlib==1.7.4
pgadmin4==8.5 pgadmin4==8.7
portalocker==2.8.2 portalocker==2.8.2
proto-plus==1.23.0 proto-plus==1.23.0
protobuf==4.25.3 protobuf==4.25.3
@ -82,18 +81,18 @@ psycopg-c==3.1.12
pyasn1==0.6.0 pyasn1==0.6.0
pyasn1_modules==0.4.0 pyasn1_modules==0.4.0
pycparser==2.22 pycparser==2.22
Pygments==2.17.2 Pygments==2.18.0
PyJWT==2.8.0 PyJWT==2.8.0
PyNaCl==1.5.0 PyNaCl==1.5.0
pyotp==2.9.0 pyotp==2.9.0
pyparsing==3.1.2 pyparsing==3.1.2
pypng==0.20220715.0 pypng==0.20220715.0
python-dateutil==2.9.0.post0 python-dateutil==2.9.0.post0
python-engineio==4.9.0 python-engineio==4.9.1
python-socketio==5.11.2 python-socketio==5.11.2
pytz==2023.4 pytz==2024.1
qrcode==7.4.2 qrcode==7.4.2
requests==2.31.0 requests==2.32.3
requests-oauthlib==2.0.0 requests-oauthlib==2.0.0
rich==13.7.1 rich==13.7.1
rsa==4.9 rsa==4.9
@ -103,16 +102,17 @@ shellingham==1.5.4
simple-websocket==1.0.0 simple-websocket==1.0.0
six==1.16.0 six==1.16.0
speaklater3==1.4 speaklater3==1.4
SQLAlchemy==2.0.29 SQLAlchemy==2.0.30
sqlparse==0.4.4 sqlparse==0.5.0
sshtunnel==0.4.0 sshtunnel==0.4.0
typer==0.9.4 typer==0.12.3
typing_extensions==4.10.0 typing_extensions==4.12.0
ua-parser==0.18.0 ua-parser==0.18.0
uritemplate==4.1.1 uritemplate==4.1.1
urllib3==1.26.18 urllib3==1.26.18
user-agents==2.2.0 user-agents==2.2.0
Werkzeug==2.3.8 Werkzeug==3.0.3
wsproto==1.2.0 wsproto==1.2.0
WTForms==3.1.2 WTForms==3.1.2
zipp==3.18.1 zipp==3.19.0
zstandard==0.22.0

View file

@ -1,5 +1,5 @@
alembic==1.13.1 alembic==1.13.1
Authlib==1.2.1 Authlib==1.3.0
azure-common==1.1.28 azure-common==1.1.28
azure-core==1.30.1 azure-core==1.30.1
azure-identity==1.15.0 azure-identity==1.15.0
@ -7,10 +7,10 @@ azure-mgmt-core==1.4.0
azure-mgmt-rdbms==10.1.0 azure-mgmt-rdbms==10.1.0
azure-mgmt-resource==23.0.1 azure-mgmt-resource==23.0.1
azure-mgmt-subscription==3.1.1 azure-mgmt-subscription==3.1.1
Babel==2.14.0 Babel==2.15.0
bcrypt==4.0.1 bcrypt==4.0.1
bidict==0.23.1 bidict==0.23.1
blinker==1.7.0 blinker==1.8.2
boto3==1.33.13 boto3==1.33.13
botocore==1.33.13 botocore==1.33.13
Brotli==1.1.0 Brotli==1.1.0
@ -19,48 +19,47 @@ certifi==2024.2.2
cffi==1.16.0 cffi==1.16.0
charset-normalizer==3.3.2 charset-normalizer==3.3.2
click==8.1.7 click==8.1.7
colorama==0.4.6 cryptography==42.0.7
cryptography==42.0.5
dnspython==2.6.1 dnspython==2.6.1
email_validator==2.1.1 email_validator==2.1.1
eventlet==0.34.2 eventlet==0.34.2
Flask==2.3.3 Flask==3.0.3
flask-babel==4.0.0 flask-babel==4.0.0
Flask-Compress==1.14 Flask-Compress==1.15
Flask-Gravatar==0.5.0
Flask-Login==0.6.3 Flask-Login==0.6.3
Flask-Mail==0.9.1 Flask-Mail==0.10.0
Flask-Migrate==4.0.7 Flask-Migrate==4.0.7
Flask-Paranoid==0.3.0 Flask-Paranoid==0.3.0
Flask-Principal==0.4.0 Flask-Principal==0.4.0
Flask-Security-Too==5.3.3 Flask-Security-Too==5.4.3
Flask-SocketIO==5.3.6 Flask-SocketIO==5.3.6
Flask-SQLAlchemy==3.1.1 Flask-SQLAlchemy==3.1.1
Flask-WTF==1.2.1 Flask-WTF==1.2.1
google-api-core==2.18.0 google-api-core==2.19.0
google-api-python-client==2.125.0 google-api-python-client==2.131.0
google-auth==2.29.0 google-auth==2.29.0
google-auth-httplib2==0.2.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 googleapis-common-protos==1.63.0
greenlet==1.1.2 greenlet==1.1.2
gunicorn==21.2.0 gunicorn==22.0.0
h11==0.14.0 h11==0.14.0
httpagentparser==1.9.5 httpagentparser==1.9.5
httplib2==0.22.0 httplib2==0.22.0
idna==3.6 idna==3.7
importlib_metadata==7.1.0 importlib_metadata==7.1.0
importlib_resources==6.4.0 importlib_resources==6.4.0
isodate==0.6.1 isodate==0.6.1
itsdangerous==2.1.2 itsdangerous==2.2.0
jaraco.classes==3.4.0 jaraco.classes==3.4.0
jeepney==0.8.0 jeepney==0.8.0
Jinja2==3.1.3 Jinja2==3.1.4
jmespath==1.0.1 jmespath==1.0.1
jsonformatter==0.3.2 jsonformatter==0.3.2
keyring==24.3.1 keyring==24.3.1
ldap3==2.9.1 ldap3==2.9.1
Mako==1.3.2 libgravatar==1.0.4
Mako==1.3.5
markdown-it-py==3.0.0 markdown-it-py==3.0.0
MarkupSafe==2.1.5 MarkupSafe==2.1.5
mdurl==0.1.2 mdurl==0.1.2
@ -72,7 +71,7 @@ oauthlib==3.2.2
packaging==24.0 packaging==24.0
paramiko==3.4.0 paramiko==3.4.0
passlib==1.7.4 passlib==1.7.4
pgadmin4==8.5 pgadmin4==8.7
portalocker==2.8.2 portalocker==2.8.2
proto-plus==1.23.0 proto-plus==1.23.0
protobuf==4.25.3 protobuf==4.25.3
@ -82,18 +81,18 @@ psycopg-c==3.1.12
pyasn1==0.6.0 pyasn1==0.6.0
pyasn1_modules==0.4.0 pyasn1_modules==0.4.0
pycparser==2.22 pycparser==2.22
Pygments==2.17.2 Pygments==2.18.0
PyJWT==2.8.0 PyJWT==2.8.0
PyNaCl==1.5.0 PyNaCl==1.5.0
pyotp==2.9.0 pyotp==2.9.0
pyparsing==3.1.2 pyparsing==3.1.2
pypng==0.20220715.0 pypng==0.20220715.0
python-dateutil==2.9.0.post0 python-dateutil==2.9.0.post0
python-engineio==4.9.0 python-engineio==4.9.1
python-socketio==5.11.2 python-socketio==5.11.2
pytz==2023.4 pytz==2024.1
qrcode==7.4.2 qrcode==7.4.2
requests==2.31.0 requests==2.32.3
requests-oauthlib==2.0.0 requests-oauthlib==2.0.0
rich==13.7.1 rich==13.7.1
rsa==4.9 rsa==4.9
@ -103,16 +102,17 @@ shellingham==1.5.4
simple-websocket==1.0.0 simple-websocket==1.0.0
six==1.16.0 six==1.16.0
speaklater3==1.4 speaklater3==1.4
SQLAlchemy==2.0.29 SQLAlchemy==2.0.30
sqlparse==0.4.4 sqlparse==0.5.0
sshtunnel==0.4.0 sshtunnel==0.4.0
typer==0.9.4 typer==0.12.3
typing_extensions==4.10.0 typing_extensions==4.12.0
ua-parser==0.18.0 ua-parser==0.18.0
uritemplate==4.1.1 uritemplate==4.1.1
urllib3==1.26.18 urllib3==1.26.18
user-agents==2.2.0 user-agents==2.2.0
Werkzeug==2.3.8 Werkzeug==3.0.3
wsproto==1.2.0 wsproto==1.2.0
WTForms==3.1.2 WTForms==3.1.2
zipp==3.18.1 zipp==3.19.0
zstandard==0.22.0

View file

@ -7,7 +7,7 @@ name = "pgAdmin4"
description.en = "Manage PostgreSQL databases over the web" description.en = "Manage PostgreSQL databases over the web"
description.fr = "Application web de gestion des bases de données PostgreSQL" description.fr = "Application web de gestion des bases de données PostgreSQL"
version = "8.5~ynh2" version = "8.7~ynh1"
maintainers = ["Josué Tille"] maintainers = ["Josué Tille"]
@ -42,13 +42,13 @@ ram.runtime = "200M"
[resources] [resources]
[resources.sources.pgadmin_prebuilt_armv7_bookworm] [resources.sources.pgadmin_prebuilt_armv7_bookworm]
prefetch = false 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.url = "https://github.com/YunoHost-Apps/pgadmin_python_build/releases/download/v8.7/pgadmin_8.7-bookworm-bin1_armv7l.tar.gz"
armhf.sha256 = "55bce68b2dca172311acc9f9d1c8837d53af72b69a2e37dc9da9c374129b2fe8" armhf.sha256 = "5aedef91672fd30022ba410cda919138ff18703b9839bbfc3bca4ea421102591"
[resources.sources.pgadmin_prebuilt_armv7_bullseye] [resources.sources.pgadmin_prebuilt_armv7_bullseye]
prefetch = false 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.url = "https://github.com/YunoHost-Apps/pgadmin_python_build/releases/download/v8.7/pgadmin_8.7-bullseye-bin1_armv7l.tar.gz"
armhf.sha256 = "4f67b54a306220621f76a488e18b5c1a04379ee3914fbd91830378bcf8896363" armhf.sha256 = "9603492ca0fb2b258425b298705f0b2fa24e54d34182160d1854ce68c21f04a9"
[resources.system_user] [resources.system_user]
allow_email = true allow_email = true

View file

@ -12,48 +12,58 @@ postgresql_version="$(psql -V | cut -d' ' -f3 | cut -d. -f1)"
#================================================= #=================================================
install_source() { 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 # 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 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/bin
ynh_secure_remove --file=$install_dir/venv/lib ynh_secure_remove --file="$install_dir"/venv/lib
ynh_secure_remove --file=$install_dir/venv/lib64 ynh_secure_remove --file="$install_dir"/venv/lib64
ynh_secure_remove --file=$install_dir/venv/include ynh_secure_remove --file="$install_dir"/venv/include
ynh_secure_remove --file=$install_dir/venv/share ynh_secure_remove --file="$install_dir"/venv/share
ynh_secure_remove --file=$install_dir/venv/pyvenv.cfg ynh_secure_remove --file="$install_dir"/venv/pyvenv.cfg
fi fi
if uname -m | grep -q arm if uname -m | grep -q arm
then then
# Clean old file, sometime it could make some big issues if we don't do this !! ynh_setup_source --dest_dir "$install_dir"/venv/ --source_id "pgadmin_prebuilt_armv7_$(lsb_release --codename --short)" --full_replace
ynh_secure_remove --file=$install_dir/venv/bin
ynh_secure_remove --file=$install_dir/venv/lib # Fix multi-instance support
ynh_secure_remove --file=$install_dir/venv/include for f in "$install_dir"/venv/bin/*; do
ynh_secure_remove --file=$install_dir/venv/share if ! [[ $f =~ "__" ]]; then
ynh_setup_source --dest_dir $install_dir/venv/ --source_id "pgadmin_prebuilt_armv7_$(lsb_release --codename --short)" ynh_replace_special_string --match_string='#!'/opt/yunohost/pgadmin/venv --replace_string='#!'"$install_dir"/venv --target_file="$f"
fi
done
else else
# Install virtualenv if it don't exist # 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 # Install pgadmin in virtualenv
pip=$install_dir/venv/bin/pip pip="$install_dir"/venv/bin/pip
$pip install --upgrade pip wheel $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 fi
# Apply patchs if needed # Apply patchs if needed
# Note that we put patch into scripts dir because /source are not stored and can't be used on restore # 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 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 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 patch -p1 < "$YNH_APP_BASEDIR"/scripts/patch/avoid_create_user_on_setup_db.patch
popd popd
fi fi
if ! grep -F -q '# BEGIN Yunohost Patch' $install_dir/venv/lib/python$python_version/site-packages/pgadmin4/pgadmin/__init__.py; then 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 pushd "$install_dir/venv/lib/python$python_version/site-packages/pgadmin4"
patch -p1 < "$YNH_APP_BASEDIR"/scripts/patch/fix_add_local_db.patch patch -p1 < "$YNH_APP_BASEDIR"/scripts/patch/fix_add_local_db.patch
popd popd
fi fi
if ! grep -F -q '# BEGIN Yunohost Patch' $install_dir/venv/lib/python$python_version/site-packages/pgadmin4/pgadmin/authenticate/webserver.py; then 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 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 patch -p1 < "$YNH_APP_BASEDIR"/scripts/patch/change_default_webserver_new_user_role_to_admin.patch
popd popd
fi fi
@ -61,16 +71,16 @@ install_source() {
set_permission() { set_permission() {
# Set permission # Set permission
chown $app:$app -R $install_dir chown "$app:$app" -R "$install_dir"
chmod u+rw,o= -R $install_dir chmod u+rw,o= -R "$install_dir"
chown $app:$app -R $data_dir chown "$app:$app" -R "$data_dir"
chmod u+rw,o= -R $data_dir chmod u+rw,o= -R "$data_dir"
chown $app:$app -R /var/log/$app chown "$app:$app" -R /var/log/"$app"
chmod u=rwX,g=rX,o= -R /var/log/$app chmod u=rwX,g=rX,o= -R /var/log/"$app"
# Criticals files # Criticals files
chown $app:root $data_dir/master_pwd chown "$app":root "$data_dir"/master_pwd
chmod u=r,g=,o= $data_dir/master_pwd chmod u=r,g=,o= "$data_dir"/master_pwd
chown $app:root $install_dir/postgres-reg.ini chown "$app":root "$install_dir"/postgres-reg.ini
chmod u=r,g=,o= $install_dir/postgres-reg.ini chmod u=r,g=,o= "$install_dir"/postgres-reg.ini
} }

View file

@ -41,7 +41,7 @@ set_permission
ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_script_progression --message="Starting a systemd service..." --weight=3
# Start a systemd service # 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 # END OF SCRIPT

View file

@ -13,20 +13,20 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# Postgresql superuser # 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...' 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')" 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" 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"/* mv -t "$old_data_dir_path" "$data_dir"/*
fi fi
mkdir -p /var/log/$app mkdir -p /var/log/"$app"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -69,7 +69,7 @@ set_permission
#================================================= #=================================================
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.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 # END OF SCRIPT

View file

@ -16,9 +16,9 @@ source /usr/share/yunohost/helpers
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# Stop service # Stop service
ynh_systemd_action --service_name "$app.service" --action stop ynh_systemd_action --service_name="$app.service" --action=stop
ynh_remove_systemd_config --service=$app ynh_remove_systemd_config --service="$app"
yunohost service remove $app yunohost service remove "$app"
# Remove the app-specific logrotate config # Remove the app-specific logrotate config
ynh_remove_logrotate ynh_remove_logrotate
@ -33,8 +33,10 @@ ynh_remove_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Removing various files..." --weight=1 ynh_script_progression --message="Removing various files..." --weight=1
# Remove the log files if [ "$YNH_APP_PURGE" -eq 1 ]; then
ynh_secure_remove --file="/var/log/$app" ynh_script_progression --message="Removing logs..."
ynh_secure_remove --file=/var/log/"$app"
fi
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression --message="Restoring the Postgresql superuser..." --weight=1 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 # RESTORE ALL CONFIG AND DATA
@ -38,8 +38,8 @@ install_source
ynh_script_progression --message="Enable systemd services" --weight=2 ynh_script_progression --message="Enable systemd services" --weight=2
# systemctl daemon-reload # systemctl daemon-reload
systemctl enable $app.service --quiet systemctl enable "$app".service --quiet
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'
set_permission set_permission
@ -50,7 +50,7 @@ set_permission
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 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 ynh_systemd_action --service_name=nginx --action=reload

View file

@ -18,14 +18,14 @@ source /usr/share/yunohost/helpers
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
if [ -f "/etc/uwsgi/apps-available/$app.ini" ]; then 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 systemctl disable "uwsgi-app@$app.service" --quiet
yunohost service remove "uwsgi-app@$app" || true yunohost service remove "uwsgi-app@$app" || true
ynh_secure_remove --file="/etc/uwsgi/apps-available/$app.ini" ynh_secure_remove --file="/etc/uwsgi/apps-available/$app.ini"
ynh_secure_remove --file="/etc/systemd/system/uwsgi-app@$app.service.d" ynh_secure_remove --file="/etc/systemd/system/uwsgi-app@$app.service.d"
else else
ynh_systemd_action --service_name "$app.service" --action stop ynh_systemd_action --service_name="$app.service" --action=stop
fi fi
#================================================= #=================================================
@ -49,8 +49,8 @@ if [ -d "$install_dir/data" ]; then
fi fi
ynh_secure_remove "$install_dir/data" ynh_secure_remove "$install_dir/data"
fi fi
if [ ! -e $data_dir/master_pwd ]; then if [ ! -e "$data_dir"/master_pwd ]; then
ynh_string_random --length=60 > $data_dir/master_pwd ynh_string_random --length=60 > "$data_dir"/master_pwd
fi fi
#================================================= #=================================================
@ -59,7 +59,7 @@ fi
ynh_script_progression --message="Configuring Postgresql superuser..." --weight=1 ynh_script_progression --message="Configuring Postgresql superuser..." --weight=1
# Re-set the db_pwd just in case… # 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 # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -85,12 +85,12 @@ ynh_script_progression --message="Upgrading system configurations related to $ap
ynh_add_nginx_config ynh_add_nginx_config
# Add systemd 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) # 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 set_permission
@ -99,7 +99,7 @@ set_permission
#================================================= #=================================================
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.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 # END OF SCRIPT