Build an image and add it to compose
This commit is contained in:
parent
56641f66d5
commit
a9d7f142e7
3 changed files with 30 additions and 2 deletions
|
|
@ -20,8 +20,14 @@ class Config:
|
|||
"""
|
||||
Get config from environment variables
|
||||
"""
|
||||
self.postgres_hostname = getenv('POSTGRES_HOSTNAME', 'localhost')
|
||||
self.postgres_username = getenv('POSTGRES_USERNAME', 'hedgedoc')
|
||||
self.postgres_password = getenv('POSTGRES_PASSWORD', 'geheim')
|
||||
self.postgres_database = getenv('POSTGRES_DATABASE', 'hedgedoc')
|
||||
self.postgres_port = int(getenv('POSTGRES_PORT', '5432'))
|
||||
|
||||
self.smtp_hostname = getenv('SMTP_HOSTNAME', 'localhost')
|
||||
self.smtp_port = getenv('SMTP_PORT', '587')
|
||||
self.smtp_port = int(getenv('SMTP_PORT', '587'))
|
||||
self.smtp_username = getenv('SMTP_USERNAME', '')
|
||||
self.smtp_password = getenv('SMTP_PASSWORD', '')
|
||||
self.smtp_from = getenv('SMTP_FROM', '')
|
||||
|
|
@ -191,7 +197,7 @@ if __name__ == '__main__':
|
|||
config = Config()
|
||||
mail = EmailSender(config.smtp_hostname, config.smtp_port, config.smtp_username, config.smtp_password, config.smtp_from)
|
||||
|
||||
with pgsql.Connection(("localhost", 5432), "hedgedoc", "geheim") as db:
|
||||
with pgsql.Connection((config.postgres_hostname, config.postgres_port), config.postgres_username, config.postgres_password) as db:
|
||||
if args.check:
|
||||
check_revisions_to_be_expired(revisions_delta)
|
||||
check_notes_to_be_expired(notes_delta, config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue