Thread: Pgadmin configuration issues
Hello,
Following up from https://github.com/pgadmin-org/pgadmin4/issues/7074,
I am trying to run pgadmin in a docker container. My intention is for the users to see all the servers and not to enter password. However I keep on getting error where its not able to find the password.
My docker config:
db-rl:
image: dpage/pgadmin4:latest
entrypoint: >
/bin/sh -c "
mkdir -p /var/lib/pgadmin/storage/admin_abc.com/;
echo '*:*:*:postgres:pass' >> /var/lib/pgadmin/storage/admin_abc.com/.pgpass;
echo '' >> /var/lib/pgadmin/storage/admin_abc.com/.pgpass;
chown pgadmin:root /var/lib/pgadmin/storage/admin_abc.com/.pgpass;
chmod 600 /var/lib/pgadmin/storage/admin_abc.com/.pgpass;
/entrypoint.sh
"
environment:
- PGADMIN_DEFAULT_EMAIL=admin@abc.com
- PGADMIN_DEFAULT_PASSWORD=password
networks:
rdcnet: {}
#volumes:
#- /srv/pgadmin4:/var/lib/pgadmin
secrets:
- source: pgadmin_config_20240223_4
target: /pgadmin4/config_local.py
- source: pgadmin_servers_20240228_1
target: /pgadmin4/servers.json
--
image: dpage/pgadmin4:latest
entrypoint: >
/bin/sh -c "
mkdir -p /var/lib/pgadmin/storage/admin_abc.com/;
echo '*:*:*:postgres:pass' >> /var/lib/pgadmin/storage/admin_abc.com/.pgpass;
echo '' >> /var/lib/pgadmin/storage/admin_abc.com/.pgpass;
chown pgadmin:root /var/lib/pgadmin/storage/admin_abc.com/.pgpass;
chmod 600 /var/lib/pgadmin/storage/admin_abc.com/.pgpass;
/entrypoint.sh
"
environment:
- PGADMIN_DEFAULT_EMAIL=admin@abc.com
- PGADMIN_DEFAULT_PASSWORD=password
networks:
rdcnet: {}
#volumes:
#- /srv/pgadmin4:/var/lib/pgadmin
secrets:
- source: pgadmin_config_20240223_4
target: /pgadmin4/config_local.py
- source: pgadmin_servers_20240228_1
target: /pgadmin4/servers.json
secrets:
pgadmin_config_20240223_4:
file: ./config/pgadmin.py
pgadmin_servers_20240228_1:
file: ./config/pgadmin_servers.json
file: ./config/pgadmin.py
pgadmin_servers_20240228_1:
file: ./config/pgadmin_servers.json
config_local.py
AUTHENTICATION_SOURCES = ['oauth2']
OAUTH2_CONFIG = [
{
'OAUTH2_NAME': 'Google',
'OAUTH2_DISPLAY_NAME': 'Google',
'OAUTH2_CLIENT_ID': '69794626965-fiq1hjp6udv48ghvjrq0iaulfonsa4fs.apps.googleusercontent.com',
'OAUTH2_CLIENT_SECRET': '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',
'OAUTH2_TOKEN_URL': 'https://oauth2.googleapis.com/token',
'OAUTH2_AUTHORIZATION_URL': 'https://accounts.google.com/o/oauth2/v2/auth',
'OAUTH2_SERVER_METADATA_URL': 'https://accounts.google.com/.well-known/openid-configuration',
'OAUTH2_API_BASE_URL': 'https://openidconnect.googleapis.com/v1/',
'OAUTH2_USERINFO_ENDPOINT': 'userinfo',
'OAUTH2_SCOPE': 'openid email profile',
'OAUTH2_ICON': 'fa-google',
'OAUTH2_BUTTON_COLOR': '#3253a8',
}
]
PGADMIN_CONFIG_CONSOLE_LOG_LEVEL = 10
MASTER_PASSWORD_REQUIRED= False
OAUTH2_CONFIG = [
{
'OAUTH2_NAME': 'Google',
'OAUTH2_DISPLAY_NAME': 'Google',
'OAUTH2_CLIENT_ID': '69794626965-fiq1hjp6udv48ghvjrq0iaulfonsa4fs.apps.googleusercontent.com',
'OAUTH2_CLIENT_SECRET': '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',
'OAUTH2_TOKEN_URL': 'https://oauth2.googleapis.com/token',
'OAUTH2_AUTHORIZATION_URL': 'https://accounts.google.com/o/oauth2/v2/auth',
'OAUTH2_SERVER_METADATA_URL': 'https://accounts.google.com/.well-known/openid-configuration',
'OAUTH2_API_BASE_URL': 'https://openidconnect.googleapis.com/v1/',
'OAUTH2_USERINFO_ENDPOINT': 'userinfo',
'OAUTH2_SCOPE': 'openid email profile',
'OAUTH2_ICON': 'fa-google',
'OAUTH2_BUTTON_COLOR': '#3253a8',
}
]
PGADMIN_CONFIG_CONSOLE_LOG_LEVEL = 10
MASTER_PASSWORD_REQUIRED= False
servers.json
{
"Servers": {
"1": {
"Name": "Staging (16.169)",
"Group": "Servers",
"Host": "192.168.16.169",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "postgres",
"SharedUsername": "postgres",
"Shared": true,
"PassFile": ".pgpass",
"ConnectionParameters": {
"passfile": ".pgpass"
}
},
"Servers": {
"1": {
"Name": "Staging (16.169)",
"Group": "Servers",
"Host": "192.168.16.169",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "postgres",
"SharedUsername": "postgres",
"Shared": true,
"PassFile": ".pgpass",
"ConnectionParameters": {
"passfile": ".pgpass"
}
},
}
I would really appreciate some help
Thanks,
Hardik Sanghavi
Hardik Sanghavi