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
|
DB_NAME: main
|
||||||
DNS_SERVER: 10.1.1.2
|
DNS_SERVER: 10.1.1.2
|
||||||
DNS_SERVER_PORT: 5350
|
DNS_SERVER_PORT: 5350
|
||||||
|
ADMIN_DOMAIN: nathan.woodburn
|
||||||
WORKERS: 2 # number of workers to run (should be 2 * number of cores)
|
WORKERS: 2 # number of workers to run (should be 2 * number of cores)
|
||||||
|
|
||||||
db:
|
db:
|
||||||
|
7
main.py
7
main.py
@ -19,6 +19,9 @@ dbargs = {
|
|||||||
'password':os.getenv('DB_PASSWORD'),
|
'password':os.getenv('DB_PASSWORD'),
|
||||||
'database':os.getenv('DB_NAME')
|
'database':os.getenv('DB_NAME')
|
||||||
}
|
}
|
||||||
|
ADMIN_DOMAIN = os.getenv('ADMIN_DOMAIN')
|
||||||
|
if ADMIN_DOMAIN == None:
|
||||||
|
ADMIN_DOMAIN = "nathan.woodburn"
|
||||||
|
|
||||||
#Assets routes
|
#Assets routes
|
||||||
@app.route('/assets/<path:path>')
|
@app.route('/assets/<path:path>')
|
||||||
@ -78,6 +81,10 @@ def edit():
|
|||||||
|
|
||||||
avatar=account.get_avatar(domain)
|
avatar=account.get_avatar(domain)
|
||||||
host = request.host
|
host = request.host
|
||||||
|
|
||||||
|
if domain.lower() == ADMIN_DOMAIN:
|
||||||
|
links = db.get_all_links()
|
||||||
|
else:
|
||||||
links = db.get_users_links(domain)
|
links = db.get_users_links(domain)
|
||||||
link_count = len(links)
|
link_count = len(links)
|
||||||
if links == False:
|
if links == False:
|
||||||
|
Loading…
Reference in New Issue
Block a user