feat: Add admin domain
All checks were successful
Build Docker / Build Main Image (push) Successful in 19s
All checks were successful
Build Docker / Build Main Image (push) Successful in 19s
This commit is contained in:
parent
a1122419e9
commit
2bf56fed8d
@ -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:
|
||||
|
7
main.py
7
main.py
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user