make active useful

Readme update
parity between setting and env settings
This commit is contained in:
Aaron Kimbre
2022-03-13 15:09:34 -05:00
parent 8285f02ed8
commit 418c81944b
4 changed files with 144 additions and 61 deletions

View File

@@ -230,14 +230,38 @@ def register_settings(app):
"pool_pre_ping": True,
"pool_use_lifo": True
}
app.config['MAIL_SERVER'] = os.getenv('MAIL_SERVER', 'smtp.gmail.com')
app.config['MAIL_PORT'] = os.getenv('MAIL_USE_SSL', 587)
app.config['MAIL_USE_SSL'] = os.getenv('MAIL_USE_SSL', False)
app.config['MAIL_USE_TLS'] = os.getenv('MAIL_USE_TLS', True)
app.config['MAIL_USERNAME'] = os.getenv('MAIL_USERNAME', None)
app.config['MAIL_PASSWORD'] = os.getenv('MAIL_PASSWORD', None)
app.config['USER_EMAIL_SENDER_NAME'] = os.getenv('USER_EMAIL_SENDER_NAME', None)
app.config['USER_EMAIL_SENDER_EMAIL'] = os.getenv('USER_EMAIL_SENDER_EMAIL', None)
app.config['MAIL_SERVER'] = os.getenv(
'MAIL_SERVER',
app.config['MAIL_SERVER']
)
app.config['MAIL_PORT'] = os.getenv(
'MAIL_USE_SSL',
app.config['MAIL_PORT']
)
app.config['MAIL_USE_SSL'] = os.getenv(
'MAIL_USE_SSL',
app.config['MAIL_USE_SSL']
)
app.config['MAIL_USE_TLS'] = os.getenv(
'MAIL_USE_TLS',
app.config['MAIL_USE_TLS']
)
app.config['MAIL_USERNAME'] = os.getenv(
'MAIL_USERNAME',
app.config['MAIL_USERNAME']
)
app.config['MAIL_PASSWORD'] = os.getenv(
'MAIL_PASSWORD',
app.config['MAIL_PASSWORD']
)
app.config['USER_EMAIL_SENDER_NAME'] = os.getenv(
'USER_EMAIL_SENDER_NAME',
app.config['USER_EMAIL_SENDER_NAME']
)
app.config['USER_EMAIL_SENDER_EMAIL'] = os.getenv(
'USER_EMAIL_SENDER_EMAIL',
app.config['USER_EMAIL_SENDER_EMAIL']
)
def gm_level(gm_level):

View File

@@ -61,7 +61,7 @@ def edit_gm_level(id):
@gm_level(3)
def lock(id):
account = Account.query.filter(Account.id == id).first()
account.locked = not account.locked
account.active = account.locked = not account.locked
account.save()
if account.locked:
log_audit(f"Locked ({account.id}){account.username}")
@@ -77,7 +77,7 @@ def lock(id):
@gm_level(3)
def ban(id):
account = Account.query.filter(Account.id == id).first()
account.banned = not account.banned
account.active = account.banned = not account.banned
account.save()
if account.banned:
log_audit(f"Banned ({account.id}){account.username}")

View File

@@ -5,7 +5,7 @@ APP_NAME = "Nexus Dashboard"
APP_SYSTEM_ERROR_SUBJECT_LINE = APP_NAME + " system error"
APP_SECRET_KEY = ""
APP_DATABASE_URI = ""
APP_DATABASE_URI = "mysql+pymysql://<username>:<password>@<host>:<port>/<database>"
# Send Analytics for Developers to better fix issues
ALLOW_ANALYTICS = False
@@ -20,7 +20,7 @@ WTF_CSRF_TIME_LIMIT = 86400
# Flask-User settings
USER_APP_NAME = APP_NAME
USER_ENABLE_CHANGE_PASSWORD = True # Allow users to change their password
USER_ENABLE_CHANGE_USERNAME = True # Allow users to change their username
USER_ENABLE_CHANGE_USERNAME = False # Allow users to change their username
USER_ENABLE_REGISTER = False # Allow new users to register
# Should alwyas be set to true
@@ -34,6 +34,15 @@ USER_ENABLE_INVITE_USER = False # Allow users to be invited
USER_REQUIRE_INVITATION = False # Only invited users may - WILL DISABLE REGISTRATION
USER_ENABLE_FORGOT_PASSWORD = True # Allow users to reset their passwords
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 587
MAIL_USE_SSL = False
MAIL_USE_TLS = True
MAIL_USERNAME = None
MAIL_PASSWORD = None
USER_EMAIL_SENDER_NAME = None
USER_EMAIL_SENDER_EMAIL = None
# Require Play Key
REQUIRE_PLAY_KEY = True