Skip to content

Commit

Permalink
Merge fa7fe78 into 38e6e21
Browse files Browse the repository at this point in the history
  • Loading branch information
jawadqur committed Nov 29, 2022
2 parents 38e6e21 + fa7fe78 commit 68cae37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"filename": "fence/config-default.yaml",
"hashed_secret": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
"is_verified": false,
"line_number": 31
"line_number": 32
}
],
"fence/local_settings.example.py": [
Expand Down Expand Up @@ -334,5 +334,5 @@
}
]
},
"generated_at": "2022-08-12T15:25:33Z"
"generated_at": "2022-11-08T16:17:42Z"
}
1 change: 1 addition & 0 deletions fence/config-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ BASE_URL: 'http://localhost/user'
# postgres db to connect to
# connection url format:
# postgresql://[user[:password]@][netloc][:port][/dbname]
# can also be set via env var DB
DB: 'postgresql://test:test@localhost:5432/fence'

# A URL-safe base64-encoded 32-byte key for encrypting keys in db
Expand Down
3 changes: 3 additions & 0 deletions fence/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ def post_process(self):
for default in defaults:
self.force_default_if_none(default, default_cfg=default_config)

# allow setting DB connection string via env var
self["DB"] = os.environ.get("DB", self["DB"])

if "ROOT_URL" not in self._configs and "BASE_URL" in self._configs:
url = urllib.parse.urlparse(self._configs["BASE_URL"])
self._configs["ROOT_URL"] = "{}://{}".format(url.scheme, url.netloc)
Expand Down

0 comments on commit 68cae37

Please sign in to comment.