GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Expose UNIX socket in entrypoint.sh for Docker implementation · Issue #7221 · pgadmin-org/pgadmin4

Expose UNIX socket in entrypoint.sh for Docker implementation #7221

New issue
Copy link
New issue
Copy link
Closed
Closed
Expose UNIX socket in entrypoint.sh for Docker implementation#7221
Copy link
Assignees
khushboovashi
Labels
Feature
Milestone
8.5

Description

@LantosIstvan
LantosIstvan
opened on Feb 17, 2024
Issue body actions

Describe the solution you'd like

Can you implement in entrypoint.sh to expose UNIX socket for a reverse proxy like Nginx, maybe defined with an environment variable like PGADMIN_SOCK or your liking? It will automatically take presence over listen address and port. In a Docker Compose stack, where most of the communication managed with UNIX sockets between containers, current pgAdmin container not supporting such deployment.

The official server deployment docs giving examples such Gunicorn setup: https://www.pgadmin.org/docs/pgadmin4/latest/server_deployment.html

Activity

  1. LantosIstvan
    added
    Feature
    on Feb 17, 2024
  2. LantosIstvan commented on Feb 17, 2024

    @LantosIstvan
    LantosIstvan
    on Feb 17, 2024
    ContributorAuthor
    More actions

    I use this possible implementation at the end of my monkey patched entrypoint.sh:

    if [ -n "${PGADMIN_SOCK}" ]; then
    	BIND_ADDRESS="unix:${PGADMIN_SOCK}"
    else
    	if [ -n "${PGADMIN_ENABLE_TLS}" ]; then
    		BIND_ADDRESS="${PGADMIN_LISTEN_ADDRESS:-[::]}:${PGADMIN_LISTEN_PORT:-443}"
    	else
    		BIND_ADDRESS="${PGADMIN_LISTEN_ADDRESS:-[::]}:${PGADMIN_LISTEN_PORT:-80}"
    	fi
    fi
    
    if [ -n "${PGADMIN_ENABLE_TLS}" ]; then
    	exec /venv/bin/gunicorn --limit-request-line "${GUNICORN_LIMIT_REQUEST_LINE:-8190}" --timeout "${TIMEOUT}" --bind "${BIND_ADDRESS}" -w 1 --threads "${GUNICORN_THREADS:-25}" --access-logfile "${GUNICORN_ACCESS_LOGFILE:--}" --keyfile /certs/server.key --certfile /certs/server.cert -c gunicorn_config.py run_pgadmin:app
    else
    	exec /venv/bin/gunicorn --limit-request-line "${GUNICORN_LIMIT_REQUEST_LINE:-8190}" --timeout "${TIMEOUT}" --bind "${BIND_ADDRESS}" -w 1 --threads "${GUNICORN_THREADS:-25}" --access-logfile "${GUNICORN_ACCESS_LOGFILE:--}" -c gunicorn_config.py run_pgadmin:app
    fi

    Where PGADMIN_SOCK is /run/pgadmin/pgadmin.sock. I use separate folders for sockets in Docker Compose for convenience with volumes.

    Of course, the folder also has to exist with needed rights:

    mkdir -p /run/pgadmin
    chown pgadmin:root /run/pgadmin
  3. khushboovashi commented on Feb 19, 2024

    @khushboovashi
    khushboovashi
    on Feb 19, 2024
    Contributor
    More actions

    @DJviolin, Please raise a PR @ https://github.com/pgadmin-org/pgadmin4/pulls for the same.

  4. akshay-joshi
    added this to Not Refinedon Feb 19, 2024
  5. LantosIstvan commented on Feb 19, 2024

    @LantosIstvan
    LantosIstvan
    on Feb 19, 2024
    ContributorAuthor
    More actions

    PR opened.

  6. yogeshmahajan-1903
    assigned
    khushboovashi
    on Feb 23, 2024
  7. akshay-joshi
    added this to Current Sprint (213) and removed this from Not Refinedon Feb 23, 2024
  8. akshay-joshi
    moved this to In Review in Current Sprint (213)on Feb 23, 2024
  9. akshay-joshi
    added
    EDB Sprint 162
    EDB Sprint 163
    and removed
    EDB Sprint 162
    on Feb 23, 2024
  10. akshay-joshi
    added
    EDB Sprint 164
    and removed
    EDB Sprint 163
    on Mar 13, 2024
  11. khushboovashi
    added a commit that references this issue on Mar 26, 2024

    Expose UNIX socket in entrypoint.sh for Docker implementation. #7221

    715839d
  12. khushboovashi
    moved this from In Review to In Testing in Current Sprint (213)on Mar 26, 2024
  13. akshay-joshi
    added
    EDB Sprint 165
    and removed
    EDB Sprint 164
    on Mar 27, 2024
  14. akshay-joshi
    added this to the 8.5 milestone on Mar 27, 2024
  15. khushboovashi
    moved this from In Testing to ✅ Done in Current Sprint (213)on Apr 4, 2024
  16. akshay-joshi
    closed this as completedon Apr 4, 2024
  17. akshay-joshi
    removed this from Current Sprint (213)on Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @khushboovashi
    khushboovashi

Labels

Feature

Type

No type

Projects

No projects

    Milestone

    • 8.5

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.