mirror of
https://github.com/YunoHost-Apps/pgadmin_ynh.git
synced 2024-09-03 19:56:38 +02:00
Merge branch 'testing'
This commit is contained in:
commit
8a0e17ca7d
10 changed files with 49 additions and 19 deletions
|
@ -1,7 +1,7 @@
|
|||
pgAdmin for yunohost
|
||||
====================
|
||||
|
||||
[![Integration level](https://dash.yunohost.org/integration/pgadmin.svg)](https://ci-apps.yunohost.org/ci/apps/pgadmin%20%28Community%29/lastBuild/consoleFull)
|
||||
[![Integration level](https://dash.yunohost.org/integration/pgadmin.svg)](https://dash.yunohost.org/appci/app/pgadmin) ![](https://ci-apps.yunohost.org/ci/badges/pgadmin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pgadmin.maintain.svg)
|
||||
[![Install pgadmin with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=pgadmin)
|
||||
|
||||
> *This package allow you to install pgadmin quickly and simply on a YunoHost server.
|
||||
|
@ -12,7 +12,7 @@ Overview
|
|||
|
||||
pgAdmin is a feature rich Open Source administration and development platform for PostgreSQL.
|
||||
|
||||
**Shipped version:** 4-4.21
|
||||
**Shipped version:** 4-4.24
|
||||
|
||||
Screenshots
|
||||
-----------
|
||||
|
@ -34,11 +34,9 @@ This app actually don't support the SSO and don't support LDAP. After the instal
|
|||
|
||||
### Supported architectures
|
||||
|
||||
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/pgadmin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/pgadmin/)
|
||||
|
||||
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/pgadmin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/pgadmin/)
|
||||
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/pgadmin%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/pgadmin/)
|
||||
|
||||
|
||||
<!--Limitations
|
||||
-----------
|
||||
|
||||
|
|
11
conf/armv7_buster.src
Normal file
11
conf/armv7_buster.src
Normal file
|
@ -0,0 +1,11 @@
|
|||
SOURCE_URL=https://github.com/Josue-T/pgadmin_python_build/releases/download/v4-4.24/pgadmin_4-4.24-buster-bin1_armv7l.tar.gz
|
||||
SOURCE_SUM=bbd7046e7c061e3e724fe2bbb018e186301c44149fdc962703412c2ad58b1643
|
||||
# (Optional) Program to check the integrity (sha256sum, md5sum...)
|
||||
# default: sha256
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
# (Optional) Archive format
|
||||
# default: tar.gz
|
||||
SOURCE_FORMAT=tar.gz
|
||||
# (Optional) Put false if sources are directly in the archive root
|
||||
# default: true
|
||||
SOURCE_IN_SUBDIR=true
|
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=https://github.com/Josue-T/pgadmin_python_build/releases/download/v4-4.21/pgadmin_4-4.21-stretch-bin1_armv7l.tar.gz
|
||||
SOURCE_SUM=1d77507fdb4ec18472d8691700a9fc5a88dadc327ca6ce232c42ac70a4e76694
|
||||
SOURCE_URL=https://github.com/Josue-T/pgadmin_python_build/releases/download/v4-4.24/pgadmin_4-4.24-stretch-bin1_armv7l.tar.gz
|
||||
SOURCE_SUM=856aa46f065a5e5163ea8cf62e874b6920de25b460ea8037b3c29f75e22f9e6f
|
||||
# (Optional) Program to check the integrity (sha256sum, md5sum...)
|
||||
# default: sha256
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Manage PostgreSQL databases over the web",
|
||||
"fr": "Application web de gestion des bases de données PostgreSQL"
|
||||
},
|
||||
"version": "4-4.21~ynh1",
|
||||
"version": "4-4.24~ynh1",
|
||||
"url": "https://www.pgadmin.org",
|
||||
"license": "PostgreSQL",
|
||||
"maintainer": {
|
||||
|
@ -14,7 +14,7 @@
|
|||
"email": "josue@tille.ch"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 3.7.0.6"
|
||||
"yunohost": ">= 3.8.0.0"
|
||||
},
|
||||
"multi_instance": false,
|
||||
"services": [
|
||||
|
|
|
@ -26,6 +26,13 @@ setup_dir() {
|
|||
}
|
||||
|
||||
install_source() {
|
||||
# Clean venv is it was on python with an old version in case major upgrade of debian
|
||||
if [ ! -e $final_path/lib/python$python_version ]; then
|
||||
ynh_secure_remove --file=$final_path
|
||||
fi
|
||||
|
||||
mkdir -p $final_path
|
||||
|
||||
if [ -n "$(uname -m | grep arm)" ]
|
||||
then
|
||||
# Clean old file, sometime it could make some big issues if we don't do this !!
|
||||
|
@ -33,19 +40,21 @@ install_source() {
|
|||
ynh_secure_remove --file=$final_path/lib
|
||||
ynh_secure_remove --file=$final_path/include
|
||||
ynh_secure_remove --file=$final_path/share
|
||||
ynh_setup_source --dest_dir $final_path/ --source_id "armv7_stretch"
|
||||
ynh_setup_source --dest_dir $final_path/ --source_id "armv7_$(lsb_release --codename --short)"
|
||||
else
|
||||
# Install virtualenv if it don't exist
|
||||
test -e $final_path/bin/python3 || python3 -m venv $final_path
|
||||
|
||||
# Install pgadmin in virtualenv
|
||||
PS1=""
|
||||
cp ../conf/virtualenv_activate $final_path/bin/activate
|
||||
set +u;
|
||||
source $final_path/bin/activate
|
||||
set -u;
|
||||
pip3 install --upgrade pip
|
||||
pip3 install --upgrade 'Werkzeug<1.0'
|
||||
pip3 install --upgrade https://ftp.postgresql.org/pub/pgadmin/pgadmin$app_main_version/v$app_sub_version/pip/pgadmin${APP_VERSION}-py2.py3-none-any.whl
|
||||
pip3 install --upgrade pgadmin$app_main_version==$app_sub_version
|
||||
set +u;
|
||||
deactivate
|
||||
set -u;
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ ynh_add_uwsgi_service 'pgadmin_user python_version'
|
|||
ynh_script_progression --message="Reloading services..."
|
||||
sudo systemctl reload nginx.service
|
||||
ynh_systemd_action --service_name "uwsgi-app@$app.service" --action restart \
|
||||
--line_match "WSGI app 0 (mountpoint='$path_url') ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/pgadmin.log"
|
||||
--line_match "WSGI app 0 \(mountpoint='$path_url'\) ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/pgadmin.log"
|
||||
sleep 10
|
||||
|
||||
ynh_script_progression --message="Change of URL completed for $app" --last
|
||||
|
|
|
@ -21,7 +21,8 @@ ExecStart=/usr/bin/uwsgi \
|
|||
--logto /var/log/uwsgi/%i/%i.log
|
||||
User=%i
|
||||
Group=www-data
|
||||
Restart=on-failure
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
KillSignal=SIGQUIT
|
||||
Type=notify
|
||||
StandardError=syslog
|
||||
|
|
|
@ -82,8 +82,9 @@ ynh_script_progression --message="Configuring sqlite database..."
|
|||
|
||||
# initialisation sqlite database for pgadmin
|
||||
chmod +x ../conf/setup.exp
|
||||
PS1=""
|
||||
set +u;
|
||||
source $final_path/bin/activate
|
||||
set -u;
|
||||
ynh_replace_special_string --match_string "__ADMIN_PASSWORD__" --replace_string "$admin_pwd" --target_file "../conf/setup.exp"
|
||||
../conf/setup.exp "$final_path/bin/python3" "$final_path/lib/python$python_version/site-packages/pgadmin4/setup.py" "$email"
|
||||
|
||||
|
@ -96,7 +97,9 @@ ynh_psql_execute_as_root \
|
|||
# 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
|
||||
set -u;
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
@ -117,6 +120,7 @@ ynh_use_logrotate --logfile /var/log/pgadmin
|
|||
# reload uwsgi
|
||||
ynh_script_progression --message="Starting pgadmin services..." --weight=3
|
||||
ynh_systemd_action --service_name "uwsgi-app@$app.service" \
|
||||
--line_match "WSGI app 0 (mountpoint='$path_url') ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/pgadmin.log"
|
||||
--line_match "WSGI app 0 \(mountpoint='$path_url'\) ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/pgadmin.log"
|
||||
sleep 10
|
||||
|
||||
ynh_script_progression --message="Installation of $app completed" --last
|
||||
|
|
|
@ -40,6 +40,10 @@ ynh_system_user_create --username $pgadmin_user --home_dir /var/lib/$app
|
|||
ynh_script_progression --message="Restoring files..." --weight=5
|
||||
ynh_restore
|
||||
|
||||
# Check that the good python version is installed
|
||||
# If not upgrade the source
|
||||
install_source
|
||||
|
||||
# POPULATE THE DATABASE
|
||||
ynh_script_progression --message="Reconfiguring Postgresql database..."
|
||||
ynh_psql_test_if_first_run
|
||||
|
@ -70,7 +74,8 @@ ynh_use_logrotate --logfile /var/log/pgadmin
|
|||
# reload uwsgi and nginx
|
||||
ynh_script_progression --message="Starting pgadmin services..." --weight=3
|
||||
ynh_systemd_action --service_name "uwsgi-app@$app.service" \
|
||||
--line_match "WSGI app 0 (mountpoint='$path_url') ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/pgadmin.log"
|
||||
--line_match "WSGI app 0 \(mountpoint='$path_url'\) ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/pgadmin.log"
|
||||
systemctl reload nginx
|
||||
sleep 10
|
||||
|
||||
ynh_script_progression --message="Restoration completed for $app" --last
|
||||
|
|
|
@ -70,6 +70,7 @@ ynh_use_logrotate --logfile /var/log/pgadmin --nonappend
|
|||
# reload uwsgi
|
||||
ynh_script_progression --message="Restarting pgadmin services..." --weight=3
|
||||
ynh_systemd_action --service_name "uwsgi-app@$app.service" \
|
||||
--line_match "WSGI app 0 (mountpoint='$path_url') ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/pgadmin.log"
|
||||
--line_match "WSGI app 0 \(mountpoint='$path_url'\) ready in [[:digit:]]* seconds on interpreter" --log_path "/var/log/uwsgi/$app/pgadmin.log"
|
||||
sleep 10
|
||||
|
||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
||||
|
|
Loading…
Reference in a new issue