Skip to content

Commit

Permalink
allow disable admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
F-Node-Karlsruhe committed Jun 30, 2021
1 parent f6b1387 commit 7073b9a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import secrets
from utils.hash import hash_user_token
from services.ghost_api import get_post, get_post_payment
from config import SECRET_KEY, DATABASE_LOCATION, SESSION_LIFETIME, URL
from config import SECRET_KEY, DATABASE_LOCATION, SESSION_LIFETIME, URL, ADMIN_PANEL
import os
from services.iota import Listener
from datetime import datetime, timedelta
Expand Down Expand Up @@ -134,7 +134,8 @@ def await_payment(data):
with app.app_context():
db.create_all()

admin.init_app(app)
if ADMIN_PANEL:
admin.init_app(app)

socketio.start_background_task(iota_listener.start, app)
socketio.run(app, host='0.0.0.0')
Expand Down
4 changes: 3 additions & 1 deletion config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@

NODE_URL = getenv('NODE_URL')

GHOST_ADMIN_KEY = getenv('GHOST_ADMIN_KEY')
GHOST_ADMIN_KEY = getenv('GHOST_ADMIN_KEY')

ADMIN_PANEL = getenv('ADMIN_PANEL') == 'true'
3 changes: 3 additions & 0 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ NODE_URL=https://api.hornet-1.testnet.chrysalis2.com

# allow authors to have own addresses in their location field
AUTHOR_ADDRESSES=false

# allow admin access via flask-admin
ADMIN_PANEL=false

0 comments on commit 7073b9a

Please sign in to comment.