feat: Add admin domain
All checks were successful
Build Docker / Build Main Image (push) Successful in 19s

This commit is contained in:
Nathan Woodburn 2023-11-17 11:05:06 +11:00
parent a1122419e9
commit 2bf56fed8d
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 9 additions and 1 deletions

View File

@ -18,6 +18,7 @@ services:
DB_NAME: main
DNS_SERVER: 10.1.1.2
DNS_SERVER_PORT: 5350
ADMIN_DOMAIN: nathan.woodburn
WORKERS: 2 # number of workers to run (should be 2 * number of cores)
db:

View File

@ -19,6 +19,9 @@ dbargs = {
'password':os.getenv('DB_PASSWORD'),
'database':os.getenv('DB_NAME')
}
ADMIN_DOMAIN = os.getenv('ADMIN_DOMAIN')
if ADMIN_DOMAIN == None:
ADMIN_DOMAIN = "nathan.woodburn"
#Assets routes
@app.route('/assets/<path:path>')
@ -78,6 +81,10 @@ def edit():
avatar=account.get_avatar(domain)
host = request.host
if domain.lower() == ADMIN_DOMAIN:
links = db.get_all_links()
else:
links = db.get_users_links(domain)
link_count = len(links)
if links == False: