Rename peo4c to peo
Renames the Python package, environment variables (PEO4C_* to PEO_*), the SQL helper schema, image paths and the entrypoint script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7bd044ddb9
commit
fd0dda6470
17 files changed
+124
-124
No files matched your search
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-FileCopyrightText: 2026 Bart Broere
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Prepares a freshly initialised cluster for peo4c.
|
||||
# Prepares a freshly initialised cluster for peo.
|
||||
set -euo pipefail
|
||||
|
||||
# The bridge connects over 127.0.0.1 with the credentials users log in with, so
|
||||
@@ -12,7 +12,7 @@ sed -i -E 's/^(host[[:space:]]+[^[:space:]]+[[:space:]]+[^[:space:]]+[[:space:]]
|
||||
|
||||
# Create the default AGE graph that neo4j-browser opens on first connect.
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "${POSTGRES_DB:-$POSTGRES_USER}" \
|
||||
-v graph="${PEO4C_DEFAULT_GRAPH:-neo4j}" <<'EOSQL'
|
||||
-v graph="${PEO_DEFAULT_GRAPH:-neo4j}" <<'EOSQL'
|
||||
LOAD 'age';
|
||||
SET search_path = ag_catalog, "$user", public;
|
||||
SELECT ag_catalog.create_graph(:'graph')
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-FileCopyrightText: 2026 Bart Broere
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Runs PostgreSQL (through the stock postgres entrypoint), the peo4c bridge and
|
||||
# Runs PostgreSQL (through the stock postgres entrypoint), the peo bridge and
|
||||
# pgAdmin side by side. The container stops when PostgreSQL or the bridge exits;
|
||||
# pgAdmin is optional and its failure does not take the others down.
|
||||
set -euo pipefail
|
||||
@@ -10,7 +10,7 @@ if [ "${1:-}" != "postgres" ]; then
|
||||
exec docker-entrypoint.sh "$@"
|
||||
fi
|
||||
|
||||
export PEO4C_PG_DATABASE="${PEO4C_PG_DATABASE:-${POSTGRES_DB:-${POSTGRES_USER:-postgres}}}"
|
||||
export PEO_PG_DATABASE="${PEO_PG_DATABASE:-${POSTGRES_DB:-${POSTGRES_USER:-postgres}}}"
|
||||
|
||||
start_pgadmin() {
|
||||
local app=/opt/pgadmin/app
|
||||
@@ -19,8 +19,8 @@ start_pgadmin() {
|
||||
if [ ! -f /var/lib/pgadmin/pgadmin4.db ]; then
|
||||
# First start: create the login user and register the bundled PostgreSQL.
|
||||
cat > /var/lib/pgadmin/servers.json <<EOF
|
||||
{"Servers": {"1": {"Name": "peo4c", "Group": "Servers", "Host": "127.0.0.1", "Port": 5432,
|
||||
"MaintenanceDB": "${PEO4C_PG_DATABASE}", "Username": "${POSTGRES_USER:-postgres}", "SSLMode": "prefer"}}}
|
||||
{"Servers": {"1": {"Name": "peo", "Group": "Servers", "Host": "127.0.0.1", "Port": 5432,
|
||||
"MaintenanceDB": "${PEO_PG_DATABASE}", "Username": "${POSTGRES_USER:-postgres}", "SSLMode": "prefer"}}}
|
||||
EOF
|
||||
chown postgres:postgres /var/lib/pgadmin/servers.json
|
||||
PGADMIN_SETUP_EMAIL="$email" \
|
||||
@@ -31,22 +31,22 @@ EOF
|
||||
|| { rm -f /var/lib/pgadmin/pgadmin4.db; return 1; }
|
||||
fi
|
||||
|
||||
gosu postgres /opt/pgadmin/bin/gunicorn --bind "0.0.0.0:${PEO4C_PGADMIN_PORT}" \
|
||||
gosu postgres /opt/pgadmin/bin/gunicorn --bind "0.0.0.0:${PEO_PGADMIN_PORT}" \
|
||||
--workers 1 --threads 25 --timeout 0 --chdir "$app" --log-level warning pgAdmin4:app &
|
||||
pgadmin_pid=$!
|
||||
echo "peo4c: pgAdmin on http://localhost:${PEO4C_PGADMIN_PORT}/ (login: $email)"
|
||||
echo "peo: pgAdmin on http://localhost:${PEO_PGADMIN_PORT}/ (login: $email)"
|
||||
}
|
||||
|
||||
docker-entrypoint.sh "$@" &
|
||||
pg_pid=$!
|
||||
|
||||
cd /opt/peo4c/bridge
|
||||
gosu postgres python3 -m peo4c &
|
||||
cd /opt/peo/bridge
|
||||
gosu postgres python3 -m peo &
|
||||
bridge_pid=$!
|
||||
|
||||
pgadmin_pid=
|
||||
if [ "${PEO4C_PGADMIN}" = "true" ]; then
|
||||
start_pgadmin || echo "peo4c: WARNING: pgAdmin setup failed, continuing without it" >&2
|
||||
if [ "${PEO_PGADMIN}" = "true" ]; then
|
||||
start_pgadmin || echo "peo: WARNING: pgAdmin setup failed, continuing without it" >&2
|
||||
fi
|
||||
|
||||
shutdown() {
|
||||
@@ -1,6 +1,6 @@
|
||||
# SPDX-FileCopyrightText: 2026 Bart Broere
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# pgAdmin settings for the peo4c image, loaded via CONFIG_DISTRO_FILE_PATH.
|
||||
# pgAdmin settings for the peo image, loaded via CONFIG_DISTRO_FILE_PATH.
|
||||
# Paths derived from DATA_DIR in pgAdmin's config.py are computed before this
|
||||
# file is applied, so they are all set explicitly here.
|
||||
|
||||
|
||||
Reference in new issue
Block a user