root: make database port configurable

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-10 19:25:09 +02:00
parent cd629dfbaa
commit c7d4e69669
3 changed files with 15 additions and 11 deletions

View File

@ -3,6 +3,7 @@ postgresql:
host: localhost
name: authentik
user: authentik
port: 5432
password: 'env://POSTGRES_PASSWORD'
web:

View File

@ -29,17 +29,19 @@ class TestOutpostServiceConnectionsAPI(APITestCase):
def test_outpost_config(self):
"""Test Outpost's config field"""
provider = ProxyProvider.objects.create(name="test", authorization_flow=Flow.objects.first())
invalid = OutpostSerializer(data={
"name": "foo",
"providers": [provider.pk],
"config": {}
})
provider = ProxyProvider.objects.create(
name="test", authorization_flow=Flow.objects.first()
)
invalid = OutpostSerializer(
data={"name": "foo", "providers": [provider.pk], "config": {}}
)
self.assertFalse(invalid.is_valid())
self.assertIn("config", invalid.errors)
valid = OutpostSerializer(data={
"name": "foo",
"providers": [provider.pk],
"config": default_outpost_config("foo")
})
valid = OutpostSerializer(
data={
"name": "foo",
"providers": [provider.pk],
"config": default_outpost_config("foo"),
}
)
self.assertTrue(valid.is_valid())

View File

@ -248,6 +248,7 @@ DATABASES = {
"NAME": CONFIG.y("postgresql.name"),
"USER": CONFIG.y("postgresql.user"),
"PASSWORD": CONFIG.y("postgresql.password"),
"PORT": int(CONFIG.y("postgresql.port")),
}
}