2022-01-16 18:22:00 +00:00
# Nexus Dashboard
< p align = "center" >
2022-03-13 20:09:34 +00:00
< img src = "app/static/logo/logo.png" alt = "DLU logo" / >
2022-01-16 18:22:00 +00:00
< / p >
2022-01-18 04:30:39 +00:00
## Features
2022-03-13 20:09:34 +00:00
* Account Management:
* Ban, Lock, and Mute accounts (This Mute affects all Characters)
2022-05-14 14:04:47 +00:00
* Account Deletion
* Email ( all optional ):
2022-03-13 20:09:34 +00:00
* Require email verification
* Reset Password via Email
2022-05-14 14:04:47 +00:00
* Edit Email ( by Admin only )
2022-03-13 20:09:34 +00:00
* 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
2022-01-18 04:30:39 +00:00
2022-01-16 18:22:00 +00:00
# Deployment
2022-05-11 18:28:55 +00:00
> **NOTE: This tutorial assumes you have a working DLU server instance and**
2022-12-31 04:14:08 +00:00
> **some knowledge of command line interfaces on your chosen platform**
2022-12-29 21:10:36 +00:00
2022-12-31 04:14:08 +00:00
**It is highly recommended to setup a reverse proxy via Nginx or some other tool and use SSL to secure your Nexus Dashboard instance if you are going to be opening it up to any non-LANs**
* [How to setup Nginx ](https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-reverse-proxy-on-ubuntu-22-04 )
* [How to use certbot for SSL ](https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-22-04 )
2022-12-29 21:10:36 +00:00
2022-01-16 18:22:00 +00:00
## Docker
```bash
docker run -d \
2022-03-13 20:09:34 +00:00
-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
2022-01-16 18:22:00 +00:00
```
2022-03-13 20:09:34 +00:00
* `/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
2022-01-16 18:22:00 +00:00
* 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`
2022-03-13 20:09:34 +00:00
* Put the resulting `cdclient.sqlite` in the res folder: `res/cdclient.sqlite`
2022-01-16 18:22:00 +00:00
### Environmental Variables
2022-03-13 20:09:34 +00:00
2022-03-14 00:28:24 +00:00
Please Reference `app/settings_exmaple.py` to see all the variables
2022-03-13 20:09:34 +00:00
* Required:
2022-01-16 18:22:00 +00:00
* APP_SECRET_KEY (Must be provided)
* APP_DATABASE_URI (Must be provided)
2022-03-13 20:09:34 +00:00
* Everything else is optional and has defaults
2022-01-16 18:22:00 +00:00
2022-12-31 04:14:08 +00:00
## Manual Linux Installation
2022-05-11 18:28:55 +00:00
Thanks to [HailStorm32 ](https://github.com/HailStorm32 ) for this manual install guide!
2022-12-31 04:14:08 +00:00
2022-05-11 18:28:55 +00:00
### Setting Up The Environment
2022-12-31 04:14:08 +00:00
First you will want to install the following packages by executing the following commands presuming you are on a Debian based system.
2022-05-11 18:28:55 +00:00
`sudo apt-get update`
2022-12-31 04:14:08 +00:00
2022-05-11 18:28:55 +00:00
`sudo apt-get install -y python3 python3-pip sqlite3 git unzip libmagickwand-dev`
> *Note: If you are having issues with installing `sqlite3`, change it to `sqlite`*
< br >
2022-12-31 04:14:08 +00:00
Next you will want to clone the repository. You can clone it anywhere, but for the purpose of this tutorial, we will be cloning it to the home directory.'
< br > < / br >
2022-05-11 18:28:55 +00:00
2022-12-31 04:14:08 +00:00
Run `cd ~` to ensure that you are currently in the home directory then run the following command to clone the repository into our home directory
2022-05-11 18:28:55 +00:00
`git clone https://github.com/DarkflameUniverse/NexusDashboard.git`
2022-12-31 04:14:08 +00:00
You should now have a directory called `NexusDashboard` present in your home directory
2022-05-11 18:28:55 +00:00
### Setting up
Rename the example settings file
`cp ~/NexusDashboard/app/settings_example.py ~/NexusDashboard/app/settings.py`
2022-12-31 04:14:08 +00:00
Now let's open the settings file we just created and configure some of the settings with nano as it is a simple text editor that is easy to use
`nano ~/NexusDashboard/app/settings.py`
>*Obviously you can replace this with a text editor of your choice, nano is just the most simple to use out of the ones available by default on most Linux distros*
2022-05-11 18:28:55 +00:00
< br >
2022-12-31 04:14:08 +00:00
Inside this file is where you can change certain settings like user registration, email support and other things. In this tutorial we will only be focusing on the bare minimum to get up and running, but feel free to adjust what you would like to fit your needs.
2022-05-20 20:23:34 +00:00
2022-12-31 04:14:08 +00:00
>*Note: There are options in here that are related to email registration and password recovery among other features however those require extra setup not covered by this tutorial*
2022-05-11 18:28:55 +00:00
The two important settings to configure are `APP_SECRET_KEY` and `APP_DATABASE_URI`
For `APP_SECRET_KEY` , fill in any random 32 character string
For `APP_DATABASE_URI` , fill in the respective fields
```
< username > --> database username
< password > --> database password
< host > --> database address
(this will most likely be localhost if you are running the database on the same machine
< port > --> port number of the database
(this can most likely be left out if you are running the database on the same machine)
< database > --> database name
```
>*If you are omitting `<port>` , make sure to also omit the `:` *
For a configuration where the database is running on the same machine, it would similar to this
```
APP_SECRET_KEY = "abcdefghijklmnopqrstuvwxyz123456"
APP_DATABASE_URI = "mysql+pymysql://DBusername:DBpassword@localhost/DBname"
```
The rest of the file is left at the default values
Once you are done making the changes, save and close the file
##### Client related files
We will need the following folders from the client
```
locale (all of the files inside)
res
|_BrickModels
|_brickprimitives
|_textures
|_ui
|_brickdb.zip
```
Put the two folders in `~/NexusDashboard/app/luclient`
Unzip the `brickdb.zip` in place
`unzip brickdb.zip`
2022-12-31 04:14:08 +00:00
Remove the `.zip` file after you have unzipped it, you can do that with
2022-05-11 18:28:55 +00:00
`rm brickdb.zip`
In the `luclient` directory you should now have a file structure that looks like this
```
local
|_locale.xml
res
|_BrickModels
|_...
|_brickprimitives
|_...
|_textures
|_...
|_ui
|_...
|_Assemblies
|_...
|_Primitives
|_...
|_Materials.xml
|_info.xml
```
We will also need to copy the `CDServer.sqlite` database file from the server to the `~/NexusDashboard/app/luclient/res` folder
2022-12-31 04:14:08 +00:00
Once the file is moved over, you will need to rename it to `cdclient.sqlite` , this can be done with the following command
2022-05-20 20:47:14 +00:00
```bash
mv ~/NexusDashboard/app/luclient/res/CDServer.sqlite ~/NexusDashboard/app/luclient/res/cdclient.sqlite
```
2022-05-11 18:28:55 +00:00
##### Remaining Setup
2022-12-31 04:14:08 +00:00
To finish this, we will need to install the python dependencies and run the database migrations, simply run the following commands one at a time
2022-05-20 20:47:14 +00:00
```bash
cd ~/NexusDashboard
pip install -r requirements.txt
pip install gunicorn
flask db upgrade
```
2022-05-11 18:28:55 +00:00
##### Running the site
2022-12-31 04:14:08 +00:00
Once all of the above is complete, you can run the site with the command
2022-05-11 18:28:55 +00:00
`gunicorn -b :8000 -w 4 wsgi:app`
2022-01-18 04:30:39 +00:00
2022-01-16 18:22:00 +00:00
# Development
2022-12-31 04:14:08 +00:00
Please use [Editor Config ](https://editorconfig.org/ ) to maintain a consistent coding style between different editors and different contributors.
2022-01-16 18:22:00 +00:00
2022-12-31 04:14:08 +00:00
* `python3 -m flask run` to run a local dev server