Skip to content

Commit 5be3edb

Browse files
committed
Address pgweb feedback
1 parent 2c8a708 commit 5be3edb

5 files changed

Lines changed: 21 additions & 12 deletions

File tree

src/pgweb/.devcontainer.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,10 @@
1313
],
1414
"postStartCommand": "/workspace/start-bookmark-refresh.sh",
1515
"features": {
16-
"ghcr.io/devcontainers/features/common-utils:2": {
17-
"installZsh": false,
18-
"installOhMyZsh": false,
19-
"upgradePackages": false
20-
},
21-
"ghcr.io/devcontainers/features/java:1": {
16+
"ghcr.io/devcontainers/features/java@sha256:e75d274ac969b29a59ba6f34c2d098f6a52144d0ec027ef326b724ea4b8b7b4e": {
2217
"version": "17"
2318
},
24-
"ghcr.io/devcontainers/features/aws-cli:1": {}
19+
"ghcr.io/devcontainers/features/aws-cli@sha256:bbc9fd513c22e331953126c75ad7b2ed1f9044f1cd5890b7073b634810459b18": {}
2520
},
2621
"remoteUser": "root"
2722
}

src/pgweb/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM sosedoff/pgweb
2+
3+
USER root
4+
5+
RUN apt-get update && \
6+
apt-get -y install sudo && \
7+
apt-get -y clean && \
8+
rm -rf /var/lib/apt/lists/*
9+
10+
USER pgweb

src/pgweb/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Once deployed in Workbench, access the pgweb UI at the app URL (port 8081).
1818

1919
The app automatically discovers all Aurora databases in your Workbench workspace and creates pre-configured connection bookmarks with fresh IAM authentication tokens.
2020

21+
For more information on how pgweb bookmarks work, see [Server Connection
22+
Bookmarks](https://github.com/sosedoff/pgweb/wiki/Server-Connection-Bookmarks).
23+
2124
### How It Works
2225

2326
1. **Auto-Discovery**: Every 10 minutes, the app queries `wb resource list` to find all Aurora databases

src/pgweb/docker-compose.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ services:
33
# The container name must be "application-server"
44
container_name: "application-server"
55
# This can be either a pre-existing image or built from a Dockerfile
6-
image: "sosedoff/pgweb"
7-
# build:
8-
# context: .
6+
build:
7+
context: .
98
# Override the default entrypoint to use our custom script
109
entrypoint: []
1110
command: ["pgweb", "--sessions", "--bind=0.0.0.0", "--listen=8081", "--bookmarks-dir=/root/.pgweb/bookmarks"]

src/pgweb/start-bookmark-refresh.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ set -o errexit
33
set -o pipefail
44
set -o nounset
55

6+
readonly PGWEB_BASE="${PGWEB_BASE:-/root/.pgweb}"
7+
68
echo "Starting bookmark refresh for pgweb..."
79

810
# Create base directory (but not bookmarks subdirectory - that will be a symlink)
9-
mkdir -p /root/.pgweb
11+
mkdir -p "${PGWEB_BASE}"
1012

1113
# Make sure refresh script is executable
1214
chmod +x /workspace/refresh-bookmarks.sh
@@ -24,7 +26,7 @@ nohup bash -c '
2426
sleep 600 # 10 minutes
2527
/workspace/refresh-bookmarks.sh || echo "$(date): WARNING: Bookmark refresh failed"
2628
done
27-
' >> /root/.pgweb/refresh.log 2>&1 &
29+
' >> "${PGWEB_BASE}/refresh.log" 2>&1 &
2830

2931
REFRESH_PID=$!
3032
echo "Bookmark refresh service configured (background PID: ${REFRESH_PID})"

0 commit comments

Comments
 (0)