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

148
README.md
View File

@ -1,16 +1,71 @@
# Nexus Dashboard
**This is a WIP: For Advanced Users**
<p align="center">
<img src="app/static/logo/logo.png" alt="Sublime's custom image"/>
<img src="app/static/logo/logo.png" alt="DLU logo"/>
</p>
## Features
* Analytics
* Provide reporting to Developers to help better solve issues
* Disabled by default. Set `ALLOW_ANALYTICS` to true to enable
* Account Management:
* Ban, Lock, and Mute accounts (This Mute affects all Characters)
* Email (all optional):
* Require email verification
* Reset Password via Email
* User Registration
* Invitations ( TODO: Implement this )
* Invitation Only Registration ( TODO: Implement this )
* Play Key Management:
* Create, Edit, and Add notes to play keys
* View accounts Tied to a play key
* Character Management:
* Rescue: Pull character to a previously visited world
* Restrict Trade: Toggle the character's ability to trade
* Restrict Mail: Toggle the character's ability to send mail
* Restrict Chat: Toggle the character's ability to send chat messages
* Inventory viewer
* View backpack contents, vault, models, and more!
* Stats Viewer
* Moderation:
* Character Names:
* Approve and mark as needs rename
* Pet Names:
* Auto-moderation of Pet names based on already moderated names
* This is a scheduled tack that runs in the background every hour
* Character Association, to see who has requested what name
* Name cleanup: remove names of deleted pets/characters
* Properties:
* Approve and Un-approve Properties
* Property/Model viewer
* Pre-built and UGC model rendering
* View Properties in full 360 in the browser!
* View in LOD0 (High), LOD1(Medium), or LOD2(Low) quality
* Download models
* Bug Reports:
* View and Resolve bug reports
* Logs:
* Command: View commands that have been run
* Activity: View character activity of entering and exiting worlds
* Audit:
* View moderation activity (characters, pets, properties)
* View GM Level changes
* View Send Mail usage
* System: View Extra logging of background activities of Nexus Dashboard
* Send Mail:
* Send Mail to characters
* Attach items to Mail
* Economy Reports:
* Reports are generated as a scheduled background task run every day at 2300 UTC
* Accounts with GM Level 3 and above are ignored
* Item reports:
* Reports numbers of items in existence
* Includes backpack and Vault items
* Currency:
* Reports how much currency that characters posses
* U-Score:
* Reports how much U-Score that characters posses
* Analytics:
* Provide reporting to Developers to help better solve issues
* Disabled by default. Set `ALLOW_ANALYTICS` to true to enable.
# Deployment
@ -19,59 +74,54 @@
```bash
docker run -d \
-e APP_SECRET_KEY='<secret_key>' \
-e APP_DATABASE_URI='mysql+pymysql://<username>:<password>@<host>:<port>/<database>' \
# you can include other optional Environment Variables from below like this
-e REQUIRE_PLAY_KEY=True
-p 8000:8000/tcp
-v /path/to/unpacked/client:/app/luclient:rw \
-v /path/to/cachedir:/app/cache:rw \ # optional for persistent cache for conversions
aronwk/nexus-dashboard:latest
-e APP_SECRET_KEY='<secret_key>' \
-e APP_DATABASE_URI='mysql+pymysql://<username>:<password>@<host>:<port>/<database>' \
# you can include other optional Environment Variables from below like this
-e REQUIRE_PLAY_KEY=True
-p 8000:8000/tcp
-v /path/to/unpacked/client:/app/luclient:rw \
-v /path/to/cachedir:/app/cache:rw \
aronwk/nexus-dashboard:latest
```
* /app/luclient must be mapped to the location of an unpacked client
* you only need `res/` and `locale/` from the client, but dropping the whole cleint in there won't hurt
* `/app/luclient` must be mapped to the location of an unpacked client
* you only need `res/` and `locale/` from the client, but dropping the whole client in there won't hurt
* Use `fdb_to_sqlite.py` in lcdr's utilities on `res/cdclient.fdb` in the unpacked client to convert the client database to `cdclient.sqlite`
* Put the resulting `cdclient.sqlite` in the res folder: `res/cdclient.sqlite`
* unzip `res/brickdb.zip` in-place
* **Docker will do this for you**
* you should have new folders and files in the following places:
* Put the resulting `cdclient.sqlite` in the res folder: `res/cdclient.sqlite`
### Environmental Variables
Please Reference `app/settings.exmaple.py` to see all the variables
* Required:
* APP_SECRET_KEY (Must be provided)
* APP_DATABASE_URI (Must be provided)
* Everything else is optional and has defaults
## Manual
* Copy `app/settings.exmaple.py` to `app/settings.py` and adjust the settings you would like.
* Provide `APP_SECRET_KEY` and `APP_DATABASE_URI` in `app/settings.py`
* app/luclient must contian a copy of an unpacked client
* you only need `res/` and `locale/` from the client, but dropping the whole client in there won't hurt
* Use `fdb_to_sqlite.py` in lcdr's utilities on `res/cdclient.fdb` in the unpacked client to convert the client database to `cdclient.sqlite`
* Put the resulting `cdclient.sqlite` in the res folder: `res/cdclient.sqlite`
* unzip `res/brickdb.zip` in-place
* you should have new folders and files in the following places:
* `res/Assemblies/../..` with a bunch of sub folders
* `res/Primitives/../..` with a bunch of sub folders
* `res/info.xml`
* `res/Materials.xml`
### Environmental Variables
* Required:
* APP_SECRET_KEY (Must be provided)
* APP_DATABASE_URI (Must be provided)
* Optional
* USER_ENABLE_REGISTER (Default: True)
* USER_ENABLE_EMAIL (Default: True, Needs Mail to be configured)
* USER_ENABLE_CONFIRM_EMAIL (Default: True)
* USER_ENABLE_INVITE_USER (Default: False)
* USER_REQUIRE_INVITATION (Default: False)
* ALLOW_ANALYTICS (Default: False)
* REQUIRE_PLAY_KEY (Default: True)
* MAIL_SERVER (Default: smtp.gmail.com)
* MAIL_PORT (Default: 587)
* MAIL_USE_SSL (Default: False)
* MAIL_USE_TLS (Default: True)
* MAIL_USERNAME (Default: None)
* MAIL_PASSWORD (Default: None)
* USER_EMAIL_SENDER_NAME (Default: None)
* USER_EMAIL_SENDER_EMAIL (Default: None)
## Manual
Don't, use Docker /s
TODO: Make manual deployment easier to configure
* Run:
* `pip install -r requirements.txt`
* `pip install gunicorn`
* `flask db upgrade`
* `gunicorn -b :8000 -w 4 wsgi:app`
* Preferably, you want to setup a systemd service or something to keey this running
# Development
Please use [Editor Config](https://editorconfig.org/)
* `flask run` to run local dev server
* `flask run` to run local dev server

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