Skip to content

Commit 58b98f9

Browse files
authored
Merge pull request #15 from guydou/allow_setting_username_and_password_from_env
Allow setting username and password from env
2 parents cc875bd + 0cfde95 commit 58b98f9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ services:
2323
# Database URL. Use `sqlite3:///` or `mysql://` when needed
2424
DB: "postgres://pypi-server:pypi-server@db/pypi-server"
2525

26+
## if you want to set PGUSER and PGPASSWORD in env
27+
28+
#PGUSER: pypi-server
29+
#PGPASSWORD: pypi-server
2630
## By default random
2731
#SECRET: changeme
2832

pypi_server/db/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def init_postgres(url):
6060

6161
DB.initialize(PostgresqlDatabase(
6262
database=db_name,
63-
user=url.user or '',
64-
password=url.password or '',
63+
user=url.user or None,
64+
password=url.password or None,
6565
host=url.host,
6666
autocommit=bool(url.get('autocommit', True)),
6767
autorollback=bool(url.get('autorollback', True))

0 commit comments

Comments
 (0)