mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-08 02:24:08 +00:00
DOC: Tweaks to comments in initdb.sh.
This commit is contained in:
@@ -1,16 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Start a postgres daemon, ignoring log output.
|
# Start a postgres daemon, ignoring log output.
|
||||||
|
|
||||||
gosu postgres pg_ctl start -w -l /dev/null
|
gosu postgres pg_ctl start -w -l /dev/null
|
||||||
|
|
||||||
|
# Create a Jupyterhub user and database.
|
||||||
gosu postgres psql -c "CREATE DATABASE jupyterhub;"
|
gosu postgres psql -c "CREATE DATABASE jupyterhub;"
|
||||||
gosu postgres psql -c "CREATE USER jupyterhub WITH ENCRYPTED PASSWORD '$JPY_PSQL_PASSWORD';"
|
gosu postgres psql -c "CREATE USER jupyterhub WITH ENCRYPTED PASSWORD '$JPY_PSQL_PASSWORD';"
|
||||||
gosu postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE jupyterhub TO jupyterhub;"
|
gosu postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE jupyterhub TO jupyterhub;"
|
||||||
|
|
||||||
# Alter pg_hba.conf to actually require passwords.
|
# Alter pg_hba.conf to actually require passwords. The default image exposes
|
||||||
# The default image exposes allows any user to connect without requiring a
|
# allows any user to connect without requiring a password, which is a liability
|
||||||
# password.
|
# if this is run forwarding ports from the host machine.
|
||||||
sed -ri -e 's/(host all all 0.0.0.0\/0 )(trust)/\1md5/' "$PGDATA"/pg_hba.conf
|
sed -ri -e 's/(host all all 0.0.0.0\/0 )(trust)/\1md5/' "$PGDATA"/pg_hba.conf
|
||||||
|
|
||||||
|
# Stop the daemon. The root Dockerfile will restart the server for us.
|
||||||
gosu postgres pg_ctl stop -w
|
gosu postgres pg_ctl stop -w
|
||||||
|
Reference in New Issue
Block a user