Administer pgAdmin Users and Preferences Using the Command Line Interface (CLI). #2483

This commit is contained in:
Khushboo Vashi
2023-12-21 12:07:26 +05:30
committed by GitHub
parent a973c9c62c
commit 0d287df6dd
23 changed files with 749 additions and 165 deletions

View File

@@ -70,9 +70,9 @@ if [ ! -f /var/lib/pgadmin/pgadmin4.db ]; then
# When running in Desktop mode, no user is created
# so we have to import servers anonymously
if [ "${PGADMIN_CONFIG_SERVER_MODE}" = "False" ]; then
/venv/bin/python3 /pgadmin4/setup.py --load-servers "${PGADMIN_SERVER_JSON_FILE}"
/venv/bin/python3 /pgadmin4/setup.py load-servers "${PGADMIN_SERVER_JSON_FILE}"
else
/venv/bin/python3 /pgadmin4/setup.py --load-servers "${PGADMIN_SERVER_JSON_FILE}" --user "${PGADMIN_DEFAULT_EMAIL}"
/venv/bin/python3 /pgadmin4/setup.py load-servers "${PGADMIN_SERVER_JSON_FILE}" --user "${PGADMIN_DEFAULT_EMAIL}"
fi
fi
fi

View File

@@ -72,7 +72,7 @@ fi
# Run setup script first:
echo "Creating configuration database..."
if ! /usr/pgadmin4/venv/bin/python3 /usr/pgadmin4/web/setup.py;
if ! /usr/pgadmin4/venv/bin/python3 /usr/pgadmin4/web/setup.py setup-db;
then
echo "Error setting up server mode. Please examine the output above."
exit 1

View File

@@ -100,7 +100,8 @@ setup(
},
entry_points={
'console_scripts': ['pgadmin4=pgadmin4.pgAdmin4:main'],
'console_scripts': ['pgadmin4=pgadmin4.pgAdmin4:main',
'pgadmin4-cli=pgadmin4.setup:main'],
},
)