diff --git a/README.md b/README.md index 1e117f3..4e9df20 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # pgAdmin4 for YunoHost -[![Integration level](https://dash.yunohost.org/integration/pgadmin.svg)](https://dash.yunohost.org/appci/app/pgadmin) ![Working status](https://ci-apps.yunohost.org/ci/badges/pgadmin.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/pgadmin.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/pgadmin.svg)](https://dash.yunohost.org/appci/app/pgadmin) ![Working status](https://ci-apps.yunohost.org/ci/badges/pgadmin.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/pgadmin.maintain.svg) + [![Install pgAdmin4 with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pgadmin) *[Lire ce readme en français.](./README_fr.md)* @@ -18,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. -**Shipped version:** 6.18~ynh1 +**Shipped version:** 7.2~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index c74db5c..99d8b16 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,24 +5,25 @@ It shall NOT be edited by hand. # pgAdmin4 pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/pgadmin.svg)](https://dash.yunohost.org/appci/app/pgadmin) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/pgadmin.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/pgadmin.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/pgadmin.svg)](https://dash.yunohost.org/appci/app/pgadmin) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/pgadmin.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/pgadmin.maintain.svg) + [![Installer pgAdmin4 avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pgadmin) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer pgAdmin4 rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer pgAdmin4 rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL. -**Version incluse :** 6.18~ynh1 +**Version incluse :** 7.2~ynh1 -## Captures d'écran +## Captures d’écran -![Capture d'écran de pgAdmin4](./doc/screenshots/pgadmin4-welcome-light.png) +![Capture d’écran de pgAdmin4](./doc/screenshots/pgadmin4-welcome-light.png) ## Avertissements / informations importantes @@ -32,8 +33,8 @@ This app actually don't support the SSO and don't support LDAP. After the instal ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : +* Site officiel de l’app : +* Documentation officielle de l’admin : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -49,4 +50,4 @@ ou sudo yunohost app upgrade pgadmin -u https://github.com/YunoHost-Apps/pgadmin_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file diff --git a/conf/armv7_buster.src b/conf/armv7_bookworm.src similarity index 71% rename from conf/armv7_buster.src rename to conf/armv7_bookworm.src index 7df687f..102150a 100644 --- a/conf/armv7_buster.src +++ b/conf/armv7_bookworm.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Josue-T/pgadmin_python_build/releases/download/v4-6.18/pgadmin_4-6.18-buster-bin1_armv7l.tar.gz -SOURCE_SUM=a1ed682818fa89789ac374fa233e42b745bc4ab6c1f144ea6b0a5b855c287252 +SOURCE_URL=https://github.com/Josue-T/pgadmin_python_build/releases/download/v4-7.5/pgadmin_4-7.5-bookworm-bin1_armv7l.tar.gz +SOURCE_SUM=2b73060fe05a719f182ed8b14ec5bae9b8993c0e82570c2e14d4ee1b7dc5abfd # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum diff --git a/conf/armv7_bullseye.src b/conf/armv7_bullseye.src index a43d026..e2038e2 100644 --- a/conf/armv7_bullseye.src +++ b/conf/armv7_bullseye.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Josue-T/pgadmin_python_build/releases/download/v4-6.18/pgadmin_4-6.18-bullseye-bin1_armv7l.tar.gz -SOURCE_SUM=982f0b15d3e723a10e2ddbebf0ab02f65b1ff813725c049ce8c6d23fb1049994 +SOURCE_URL=https://github.com/Josue-T/pgadmin_python_build/releases/download/v4-7.5/pgadmin_4-7.5-bullseye-bin1_armv7l.tar.gz +SOURCE_SUM=d1c69acd257ee138615e7258a77ae8f796f9bf62cf20cfa3dcb8762412af1aea # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum diff --git a/conf/requirement_bookworm.txt b/conf/requirement_bookworm.txt new file mode 100644 index 0000000..978447d --- /dev/null +++ b/conf/requirement_bookworm.txt @@ -0,0 +1,104 @@ +alembic==1.11.1 +Authlib==1.2.1 +azure-common==1.1.28 +azure-core==1.28.0 +azure-identity==1.13.0 +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.12.1 +bcrypt==4.0.1 +bidict==0.22.1 +blinker==1.6.2 +boto3==1.28.13 +botocore==1.31.13 +Brotli==1.0.9 +cachetools==5.3.1 +certifi==2023.7.22 +cffi==1.15.1 +charset-normalizer==3.2.0 +click==8.1.6 +cryptography==41.0.2 +dnspython==2.4.1 +email-validator==2.0.0.post2 +eventlet==0.33.3 +Flask==2.2.5 +flask-babel==3.1.0 +Flask-Compress==1.13 +Flask-Gravatar==0.5.0 +Flask-Login==0.6.2 +Flask-Mail==0.9.1 +Flask-Migrate==4.0.4 +Flask-Paranoid==0.3.0 +Flask-Principal==0.4.0 +Flask-Security-Too==5.1.2 +Flask-SocketIO==5.3.5 +Flask-SQLAlchemy==3.0.5 +Flask-WTF==1.1.1 +google-api-core==2.11.1 +google-api-python-client==2.95.0 +google-auth==2.22.0 +google-auth-httplib2==0.1.0 +google-auth-oauthlib==1.0.0 +googleapis-common-protos==1.59.1 +greenlet==2.0.2 +httpagentparser==1.9.5 +httplib2==0.22.0 +idna==3.4 +importlib-metadata==6.8.0 +isodate==0.6.1 +itsdangerous==2.1.2 +jaraco.classes==3.3.0 +jeepney==0.8.0 +Jinja2==3.1.2 +jmespath==1.0.1 +keyring==23.13.1 +ldap3==2.9.1 +Mako==1.2.4 +MarkupSafe==2.1.3 +more-itertools==10.0.0 +msal==1.23.0 +msal-extensions==1.0.0 +msrest==0.7.1 +oauthlib==3.2.2 +paramiko==3.2.0 +passlib==1.7.4 +pgadmin4==7.5 +Pillow==9.5.0 +portalocker==2.7.0 +protobuf==4.23.4 +psutil==5.9.5 +psycopg==3.1.9 +psycopg-c==3.1.9 +pyasn1==0.5.0 +pyasn1-modules==0.3.0 +pycparser==2.21 +PyJWT==2.8.0 +PyNaCl==1.5.0 +pyotp==2.8.0 +pyparsing==3.1.0 +pypng==0.20220715.0 +python-dateutil==2.8.2 +python-engineio==4.5.1 +python-socketio==5.8.0 +pytz==2023.3 +qrcode==7.4.2 +requests==2.31.0 +requests-oauthlib==1.3.1 +rsa==4.9 +s3transfer==0.6.1 +SecretStorage==3.3.3 +six==1.16.0 +speaklater3==1.4 +SQLAlchemy==2.0.19 +sqlparse==0.4.4 +sshtunnel==0.4.0 +typing_extensions==4.7.1 +ua-parser==0.18.0 +uritemplate==4.1.1 +urllib3==1.26.16 +user-agents==2.2.0 +Werkzeug==2.2.3 +WTForms==3.0.1 +zipp==3.16.2 diff --git a/conf/requirement_bullseye.txt b/conf/requirement_bullseye.txt new file mode 100644 index 0000000..acf93c3 --- /dev/null +++ b/conf/requirement_bullseye.txt @@ -0,0 +1,105 @@ +alembic==1.11.1 +Authlib==1.2.1 +azure-common==1.1.28 +azure-core==1.28.0 +azure-identity==1.13.0 +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.12.1 +bcrypt==4.0.1 +bidict==0.22.1 +blinker==1.6.2 +boto3==1.28.13 +botocore==1.31.13 +Brotli==1.0.9 +cachetools==5.3.1 +certifi==2023.7.22 +cffi==1.15.1 +charset-normalizer==3.2.0 +click==8.1.6 +cryptography==41.0.2 +dnspython==2.4.1 +email-validator==2.0.0.post2 +eventlet==0.33.3 +Flask==2.2.5 +flask-babel==3.1.0 +Flask-Compress==1.13 +Flask-Gravatar==0.5.0 +Flask-Login==0.6.2 +Flask-Mail==0.9.1 +Flask-Migrate==4.0.4 +Flask-Paranoid==0.3.0 +Flask-Principal==0.4.0 +Flask-Security-Too==5.1.2 +Flask-SocketIO==5.3.5 +Flask-SQLAlchemy==3.0.5 +Flask-WTF==1.1.1 +google-api-core==2.11.1 +google-api-python-client==2.95.0 +google-auth==2.22.0 +google-auth-httplib2==0.1.0 +google-auth-oauthlib==1.0.0 +googleapis-common-protos==1.59.1 +greenlet==1.1.2 +httpagentparser==1.9.5 +httplib2==0.22.0 +idna==3.4 +importlib-metadata==6.8.0 +isodate==0.6.1 +itsdangerous==2.1.2 +jaraco.classes==3.3.0 +jeepney==0.8.0 +Jinja2==3.1.2 +jmespath==1.0.1 +keyring==23.13.1 +ldap3==2.9.1 +Mako==1.2.4 +MarkupSafe==2.1.3 +more-itertools==10.0.0 +msal==1.23.0 +msal-extensions==1.0.0 +msrest==0.7.1 +oauthlib==3.2.2 +paramiko==3.2.0 +passlib==1.7.4 +pgadmin4==7.5 +Pillow==9.5.0 +pkg_resources==0.0.0 +portalocker==2.7.0 +protobuf==4.23.4 +psutil==5.9.5 +psycopg==3.1.9 +psycopg-c==3.1.9 +pyasn1==0.5.0 +pyasn1-modules==0.3.0 +pycparser==2.21 +PyJWT==2.8.0 +PyNaCl==1.5.0 +pyotp==2.8.0 +pyparsing==3.1.0 +pypng==0.20220715.0 +python-dateutil==2.8.2 +python-engineio==4.5.1 +python-socketio==5.8.0 +pytz==2023.3 +qrcode==7.4.2 +requests==2.31.0 +requests-oauthlib==1.3.1 +rsa==4.9 +s3transfer==0.6.1 +SecretStorage==3.3.3 +six==1.16.0 +speaklater3==1.4 +SQLAlchemy==2.0.19 +sqlparse==0.4.4 +sshtunnel==0.4.0 +typing_extensions==4.7.1 +ua-parser==0.18.0 +uritemplate==4.1.1 +urllib3==1.26.16 +user-agents==2.2.0 +Werkzeug==2.2.3 +WTForms==3.0.1 +zipp==3.16.2 diff --git a/manifest.json b/manifest.json index af55c8c..69263b5 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Manage PostgreSQL databases over the web", "fr": "Application web de gestion des bases de données PostgreSQL" }, - "version": "6.18~ynh1", + "version": "7.2~ynh1", "url": "https://www.pgadmin.org", "upstream": { "license": "PostgreSQL", @@ -19,7 +19,7 @@ "email": "josue@tille.ch" }, "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0.11" }, "multi_instance": false, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index ef18cc0..ea3c266 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -41,15 +41,6 @@ install_source() { ynh_secure_remove --file=$final_path/share ynh_setup_source --dest_dir $final_path/ --source_id "armv7_$(lsb_release --codename --short)" else - # Install rustup is not already installed - # We need this to be able to install cryptgraphy - export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" - if [ -e $final_path/.rustup ]; then - sudo -u "$pgadmin_user" env PATH=$PATH rustup update - else - sudo -u "$pgadmin_user" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=stable --profile=minimal' - fi - # Install virtualenv if it don't exist test -e $final_path/bin/python3 || python3 -m venv $final_path @@ -58,10 +49,9 @@ install_source() { set +$u_arg; source $final_path/bin/activate set -$u_arg; - pip3 install --upgrade pip - pip3 install --upgrade 'Werkzeug<1.0' - pip3 install --upgrade 'markupsafe==2.0.1' - pip3 install --upgrade pgadmin4==$app_sub_version + pip3 install --upgrade pip wheel + pip3 install -I --upgrade "psycopg[c]" + pip3 install --upgrade -r $YNH_APP_BASEDIR/conf/requirement_$(lsb_release --codename --short).txt set +$u_arg; deactivate set -$u_arg; diff --git a/scripts/config_database.py b/scripts/config_database.py index 7b60626..d62f48a 100644 --- a/scripts/config_database.py +++ b/scripts/config_database.py @@ -1,11 +1,13 @@ #!/usr/bin/python -import imp +from importlib.machinery import SourceFileLoader import sqlite3 import sys -# Import crypto from pgadmin project -crypto = imp.load_source('crypt', '/opt/yunohost/pgadmin/lib/python__PYTHON_VERSION__/site-packages/pgadmin4/pgadmin/utils/crypto.py') +# Import crypto from pgadmin project __PYTHON_VERSION__ +python_version = str(sys.version_info[0]) + "." + str(sys.version_info[1]) +crypto = SourceFileLoader('crypto', '/opt/yunohost/pgadmin/lib/python' + + python_version + '/site-packages/pgadmin4/pgadmin/utils/crypto.py').load_module() # Get arguments username = sys.argv[1] @@ -22,19 +24,31 @@ user_encrypted_password = cursor.fetchone()[0] crypted_password = crypto.encrypt(password, user_encrypted_password) # Declare database data to put in database -data = {'id': 1,'user_id': 1, 'servergroup_id' : 1, 'name': 'Yunohost Server', 'host': 'localhost', 'port': 5432,'maintenance_db':'postgres','username':username, - 'ssl_mode':'prefer', 'comment' : '', 'password' :crypted_password,'role':'', 'discovery_id':'', 'hostaddr':'','db_res':'','passfile':'', - 'sslcert' :'','sslkey':'','sslrootcert':'','sslcrl':''} +data = {'id': 1, 'user_id': 1, 'servergroup_id': 1, 'name': 'Yunohost Server', 'host': 'localhost', 'port': 5432, 'maintenance_db': 'postgres', + 'username': username, 'comment': '', 'password': crypted_password, 'role': '', 'discovery_id': '', + 'db_res': '', 'bgcolor': '', 'fgcolor': '', 'service': '', + 'use_ssh_tunnel': '', 'tunnel_host': '', 'tunnel_port': 22, 'tunnel_username': '', 'tunnel_authentication': '', 'tunnel_identity_file': '', 'tunnel_password': '', + 'save_password': 1, 'shared': '', 'kerberos_conn': 0, 'cloud_status': 0, 'passexec_cmd': '', 'passexec_expiration': '', + 'connection_params': '''{"sslmode": "prefer", "connect_timeout": 10, "sslcert": "/.postgresql/postgresql.crt", "sslkey": "/.postgresql/postgresql.key"}'''} # Insert new data in database cursor = conn.cursor() -cursor.execute('''INSERT INTO `server`( - `id`,`user_id`,`servergroup_id`,`name`,`host`,`port`,`maintenance_db`,`username`, - `ssl_mode`,`comment`,`password`,`role`,`discovery_id`,`hostaddr`,`db_res`,`passfile`,`sslcert`,`sslkey`,`sslrootcert`,`sslcrl` - ) VALUES( - :id,:user_id,:servergroup_id,:name,:host,:port,:maintenance_db,:username, - :ssl_mode,:comment,:password,:role,:discovery_id,:hostaddr,:db_res,:passfile,:sslcert,:sslkey,:sslrootcert,:sslcrl - )''', data) +cursor.execute(''' + INSERT INTO `server` ( + `id`,`user_id`,`servergroup_id`,`name`,`host`,`port`,`maintenance_db`, + `username`,`comment`,`password`,`role`,`discovery_id`, + `db_res`,`bgcolor`,`fgcolor`,`service`, + `use_ssh_tunnel`,`tunnel_host`,`tunnel_port`,`tunnel_username`,`tunnel_authentication`,`tunnel_identity_file`,`tunnel_password`, + `save_password`,`shared`,`kerberos_conn`,`cloud_status`,`passexec_cmd`,`passexec_expiration`, + `connection_params` + ) VALUES ( + :id,:user_id,:servergroup_id,:name,:host,:port,:maintenance_db, + :username,:comment,:password,:role,:discovery_id, + :db_res,:bgcolor,:fgcolor,:service, + :use_ssh_tunnel,:tunnel_host,:tunnel_port,:tunnel_username,:tunnel_authentication,:tunnel_identity_file,:tunnel_password, + :save_password,:shared,:kerberos_conn,:cloud_status,:passexec_cmd,:passexec_expiration, + :connection_params + );''', data) conn.commit() # Close connection diff --git a/scripts/install b/scripts/install index aaad63c..ba612ea 100644 --- a/scripts/install +++ b/scripts/install @@ -75,7 +75,7 @@ ynh_app_setting_set --app=$app --key=db_pwd --value="$db_pwd" #================================================= ynh_script_progression --message="Installing dependencies..." --weight=7 -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER @@ -135,7 +135,6 @@ ynh_psql_execute_as_root \ --sql "CREATE USER ${db_user} WITH PASSWORD '${db_pwd}' SUPERUSER CREATEDB CREATEROLE REPLICATION" # Add Server In PGadmin database -ynh_replace_string --match_string "__PYTHON_VERSION__" --replace_string "$python_version" --target_file config_database.py $final_path/bin/python3 config_database.py "$db_user" "$db_pwd" set +u; deactivate diff --git a/scripts/restore b/scripts/restore index 7f494d0..8891245 100644 --- a/scripts/restore +++ b/scripts/restore @@ -72,7 +72,7 @@ ynh_restore_file --origin_path="$final_path" ynh_script_progression --message="Reinstalling dependencies..." --weight=5 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies # Check that the good python version is installed # If not upgrade the source diff --git a/scripts/upgrade b/scripts/upgrade index 7c74faa..01a55da 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,7 +81,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # SPECIFIC UPGRADE