mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-08 02:24:08 +00:00
DEV: Use docker links to set password environment variable in the hub.
Also, yell at people if they use the default password.
This commit is contained in:
@@ -7,9 +7,6 @@ RUN apt-get install -y libpq-dev \
|
||||
&& apt-get clean -y \
|
||||
&& pip3 install psycopg2
|
||||
|
||||
# Replace this with your own password.
|
||||
ENV JPY_PSQL_PASSWORD arglebargle
|
||||
|
||||
RUN useradd -m -G shadow -p $(openssl passwd -1 rhea) rhea
|
||||
RUN chown rhea .
|
||||
|
||||
|
@@ -6,9 +6,10 @@ c = get_config()
|
||||
c.JupyterHubApp.admin_users = {'rhea'}
|
||||
c.Authenticator.whitelist = {'ganymede', 'io', 'rhea'}
|
||||
|
||||
# Set up the database url.
|
||||
# These environment variables are automatically supplied by the linked postgres
|
||||
# container.
|
||||
import os;
|
||||
pg_pass = os.getenv('JPY_PSQL_PASSWORD')
|
||||
pg_pass = os.getenv('POSTGRES_ENV_JPY_PSQL_PASSWORD')
|
||||
pg_host = os.getenv('POSTGRES_PORT_5432_TCP_ADDR')
|
||||
c.JupyterHubApp.db_url = 'postgresql://jupyterhub:{}@{}:5432/jupyterhub'.format(
|
||||
pg_pass,
|
||||
|
Reference in New Issue
Block a user