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

fix permission, continue

This commit is contained in:
Salamandar 2024-01-30 16:48:42 +01:00
parent 701094e25b
commit 463bea48fd
3 changed files with 17 additions and 30 deletions

View file

@ -22,16 +22,24 @@ set_permission() {
chown $app:root -R /var/lib/pgadmin chown $app:root -R /var/lib/pgadmin
mkdir -p /var/log/pgadmin mkdir -p /var/log/pgadmin
chown $app:root -R /var/log/pgadmin chown $app:root -R /var/log/pgadmin
chown $app:root /var/log/uwsgi/$app
chown $app:root /etc/uwsgi/apps-available/$app.ini
chmod u=rwX,g=rX,o= -R /var/lib/pgadmin chmod u=rwX,g=rX,o= -R /var/lib/pgadmin
} }
_install_pgadmin_venv() { ynh_install_venv() {
ynh_exec_as "$app" python3 -m venv --upgrade "$install_dir/venv" if [ -f "$install_dir/venv/bin/python" ]; then
venvpy="$install_dir/venv/bin/python3" ynh_exec_as "$app" python3 -m venv "$install_dir/venv" --upgrade
else
ynh_exec_as "$app" python3 -m venv "$install_dir/venv"
fi
ynh_use_venv
ynh_exec_as "$app" "$venvpy" -m pip install --upgrade --no-cache-dir pip wheel ynh_exec_as "$app" "$venvpy" -m pip install --upgrade --no-cache-dir pip wheel
}
ynh_use_venv() {
venvpy="$install_dir/venv/bin/python3"
}
_install_pgadmin_pip() {
ynh_exec_as "$app" "$venvpy" -m pip install --upgrade --no-cache-dir --ignore-installed "psycopg[c]" ynh_exec_as "$app" "$venvpy" -m pip install --upgrade --no-cache-dir --ignore-installed "psycopg[c]"
cp "$YNH_APP_BASEDIR/conf/requirement_$(lsb_release --codename --short).txt" "$install_dir/requirements.txt" cp "$YNH_APP_BASEDIR/conf/requirement_$(lsb_release --codename --short).txt" "$install_dir/requirements.txt"

View file

@ -20,8 +20,9 @@ email=$(ynh_user_get_info --username $admin --key 'mail')
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." ynh_script_progression --message="Setting up source files..."
ynh_install_venv
_install_pgadmin_venv _install_pgadmin_pip
setup_dir setup_dir

View file

@ -23,15 +23,6 @@ ynh_restore_file --origin_path="$install_dir"
### ownership to all files such as after the ynh_setup_source step ### ownership to all files such as after the ynh_setup_source step
chown -R "$app:www-data" "$install_dir" chown -R "$app:www-data" "$install_dir"
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
#================================================= #=================================================
# RESTORE THE POSTGRESQL SUPERUSER # RESTORE THE POSTGRESQL SUPERUSER
#================================================= #=================================================
@ -39,19 +30,12 @@ ynh_script_progression --message="Restoring the Postgresql superuser..." --weigh
ynh_psql_execute_as_root --sql "CREATE USER ${db_user} WITH PASSWORD '${db_pwd}' SUPERUSER CREATEDB CREATEROLE REPLICATION" ynh_psql_execute_as_root --sql "CREATE USER ${db_user} WITH PASSWORD '${db_pwd}' SUPERUSER CREATEDB CREATEROLE REPLICATION"
#=================================================
# SPECIFIC RESTORATION
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=5 ynh_script_progression --message="Updating python virtualenv..." --weight=5
# Define and install dependencies ynh_install_venv
#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
# Check that the good python version is installed
# If not upgrade the source
install_source
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS
@ -79,12 +63,6 @@ ynh_restore_uwsgi_service
ynh_script_progression --message="Protecting directory..." ynh_script_progression --message="Protecting directory..."
set_permission set_permission
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..."
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================