Giter VIP home page Giter VIP logo

nexusdashboard's Introduction

Nexus Dashboard

DLU logo

Features

  • Account Management:
    • Ban, Lock, and Mute accounts (This Mute affects all Characters)
    • Account Deletion
    • Email ( all optional ):
      • Require email verification
      • Reset Password via Email
      • Edit Email ( by Admin only )
      • 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

Deployment

NOTE: This tutorial assumes you have a working DLU server instance and some knowledge of command line interfaces on your chosen platform

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

Docker

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/logs:/logs:rw /
    -v /path/to/unpacked/client:/app/luclient:ro \
    -v /path/to/cachedir:/app/cache:rw \
    ghcr.io/darkflameuniverse/nexusdashboard: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 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

Environmental Variables

Please Reference app/settings_example.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 Linux Installation

Thanks to HailStorm32 for this manual install guide!

Setting Up The Environment

First you will want to install the following packages by executing the following commands presuming you are on a Debian based system.

sudo apt-get update

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


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.'

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 git clone https://github.com/DarkflameUniverse/NexusDashboard.git

You should now have a directory called NexusDashboard present in your home directory

Setting up

Rename the example settings file cp ~/NexusDashboard/app/settings_example.py ~/NexusDashboard/app/settings.py

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


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.

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

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
└───locale.xml

res
├───BrickModels
├───brickprimitives
├───textures
├───ui
├───brickdb.zip

Put the two folders in ~/NexusDashboard/app/luclient

Unzip the brickdb.zip in place unzip brickdb.zip

Remove the .zip file after you have unzipped it, you can do that with rm brickdb.zip

In the luclient directory you should now have a file structure that looks like this

locale
└───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

Once the file is moved over, you will need to rename it to cdclient.sqlite, this can be done with the following command

mv ~/NexusDashboard/app/luclient/res/CDServer.sqlite ~/NexusDashboard/app/luclient/res/cdclient.sqlite
Remaining Setup

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

cd ~/NexusDashboard
pip install -r requirements.txt
pip install gunicorn
flask db upgrade
Running the site

Once all of the above is complete, you can run the site with the command gunicorn -b :8000 -w 4 wsgi:app

Manual Windows Setup

While a lot of the setup on Windows is the same a lot of it can be completed with GUI interfaces and requires installing things from websites instead of the command line.

Setting Up The Environment

You need to install the following prerequisites:

Next you will need to clone the repository. You can clone it anywhere, but for the purpose of this tutorial, you will want to clone it to your desktop just for simplicity, it can be moved after.

Open a command prompt and run cd Desktop (The command line should place you in your Home directory be default) to ensure that you are currently in the desktop directory then run the following command to clone the repository into our desktop directory

Run the following command to clone the repository git clone https://github.com/DarkflameUniverse/NexusDashboard.git

You should now have a directory called NexusDashboard present on your desktop.

Setting up

Now that we have the repository cloned you need to rename the example settings file, you can perform this manually in the GUI or you can use the command line, to do the latter run the following commands

  • cd NexusDashboard\app
  • copy settings_example.py settings.py

Now let's open the settings file we just created and configure some of the settings with the Windows default notepad.

  • notepad settings.py

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.

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

The two important settings to configure are APP_SECRET_KEY and APP_DATABASE_URI

For APP_SECRET_KEY you can just fill in any random 32 character string and for APP_DATABASE_URI you will need to fill in a connection string to your database. The connection string will look similar to this. You will need to fill in your own information for the username, password, host, port and database name.

APP_DATABASE_URI = "mysql+pymysql://<username>:<password>@<host>:<port>/<database>"

and the rest of the file can be left at the default values other than the APP_SECRET_KEY which you will need to fill in with random characters.

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
└───locale.xml

res
├───BrickModels
├───brickprimitives
├───textures
├───ui
└───brickdb.zip

Put the two folders in Desktop/NexusDashboard/app/luclient

Unzip the brickdb.zip in place using 7-Zip, you can do this by right clicking the file and selecting 7-Zip > Extract Here.

After doing this you can remove the .zip, simply delete the file.

In the luclient directory you should now have a file structure that looks like this

locale
└───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 Desktop/NexusDashboard/app/luclient/res folder

Once the file is moved over, you will need to rename it to cdclient.sqlite, this can be done by right clicking the file and selecting Rename and then changing the name to cdclient.sqlite

Remaining Setup

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 in the root directory of the site, if you are not in the root directory you can run cd Desktop/NexusDashboard to get there (assuming you have opened a new terminal window)

pip install -r requirements.txt
flask db upgrade
Running the site

Once all of the above is complete, you can run the site with the command flask run however bare in mind that this is a development version of the site, at the moment running a production version of the site on Windows is not supported.

Development

Please use Editor Config to maintain a consistent coding style between different editors and different contributors.

  • python3 -m flask run to run a local dev server

nexusdashboard's People

Contributors

aronwk-aaron avatar darwinanim8or avatar dependabot[bot] avatar flareco avatar hailstorm32 avatar jettford avatar moliata avatar ramen2x avatar xiphoseer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nexusdashboard's Issues

`get`call exception

I integrated the NexusDashboard into the docker-compose.yml from the DarkflameServer.
Because I didn't manage to make the composition work with a remote repository, I cloned this repo and built the docker image from the source with the docker composition.

I get no errors on startup and everything seems to be fine but when I try to access the web page, I get an internal server error and I get an error stack trace from a get request via flask.
I am not very experienced with python so any help that could cause this error would be appreciated.

docker-compose.yml
docker log

Problem showing inventory items

There is a problem displaying inventory items
LUServer-2022-06-21-22-46-16

As I can understand there is a problem converting dds files to png. All caches files (/app/cache) although that are named .png after viewing as hex the header is DDS.

I had no problem/error while installing imagemagic.

I use linux Mint on Windows VM.

game broke

Hi,

Username - AlexPep

I am having an issue within the server where I am being told I'm smashed after going through one of the earth transporters in Ninjago and the game is freezing me and not respawning. What can I do without creating a new character?

Thanks

ENH: Configurable Strike/Ban system

When moderation properties, pet names, and char names and resolving bug/abuse reports have the ability to put a strike on the offending account.
After a configurable amount of strikes, mute account, and after more, ban account.
(or have it not do anything)

And potentially a configurable strike roll-off, where strikes become "inactive" after an amount of time, but are still viewable for the account.

mesh subdir of BrickModels does not exist in unpacked client

properties.py looks for models in the mesh subdir of BrickModels. However the BrickModels dir from the unpacked client does not contain these sub directories.

[2022-03-31 04:32:11 +0000] [11009] [ERROR] ERROR on app/cache/BrickModels/mesh/reward/rew_ninjagomonastery_screen.lod1.mtl:
 [Errno 2] No such file or directory: 'app/luclient/res/BrickModels/mesh/reward/rew_ninjagomonastery_screen.lxfml'
[2022-03-31 04:32:11 +0000] [11011] [ERROR] ERROR on app/cache/BrickModels/mesh/reward/rew_ninjagomonastery_walloutsidecorner1.lod1.mtl:
 [Errno 2] No such file or directory: 'app/luclient/res/BrickModels/mesh/reward/rew_ninjagomonastery_walloutsidecorner1.lxfml'
[2022-03-31 04:32:12 +0000] [11011] [ERROR] Exception on /properties/get_model/70368744182634/mtl/1 [GET]
Traceback (most recent call last):
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask_user/decorators.py", line 58, in decorator
    return view_function(*args, **kwargs)
  File "/home/[redacted]/NexusDashboard/app/properties.py", line 315, in get_model
    response = prebuilt(content, file_format, lod)[0]
  File "/home/[redacted]/NexusDashboard/app/properties.py", line 381, in prebuilt
    with open(str(cache.as_posix()), 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'app/cache/BrickModels/mesh/reward/rew_ninjagomonastery_walloutsidecorner1.lod1.mtl'
[2022-03-31 04:32:12 +0000] [11009] [ERROR] Exception on /properties/get_model/70368744182661/mtl/1 [GET]
Traceback (most recent call last):
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask_user/decorators.py", line 58, in decorator
    return view_function(*args, **kwargs)
  File "/home/[redacted]/NexusDashboard/app/properties.py", line 315, in get_model
    response = prebuilt(content, file_format, lod)[0]
  File "/home/[redacted]/NexusDashboard/app/properties.py", line 381, in prebuilt
    with open(str(cache.as_posix()), 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'app/cache/BrickModels/mesh/reward/rew_ninjagomonastery_screen.lod1.mtl'
[2022-03-31 04:32:12 +0000] [11012] [ERROR] ERROR on app/cache/BrickModels/mesh/reward/rew_ninjagomonastery_wall4.lod1.mtl:
 [Errno 2] No such file or directory: 'app/luclient/res/BrickModels/mesh/reward/rew_ninjagomonastery_wall4.lxfml'
[2022-03-31 04:32:12 +0000] [11012] [ERROR] Exception on /properties/get_model/70368744182652/mtl/1 [GET]
Traceback (most recent call last):
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask_user/decorators.py", line 58, in decorator
    return view_function(*args, **kwargs)
  File "/home/[redacted]/NexusDashboard/app/properties.py", line 315, in get_model
    response = prebuilt(content, file_format, lod)[0]
  File "/home/[redacted]/NexusDashboard/app/properties.py", line 381, in prebuilt
    with open(str(cache.as_posix()), 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'app/cache/BrickModels/mesh/reward/rew_ninjagomonastery_wall4.lod1.mtl'
[2022-03-31 04:32:12 +0000] [11010] [ERROR] ERROR on app/cache/BrickModels/mesh/reward/rew_ninjagomonastery_wallinsidecorner1.lod1.mtl:
 [Errno 2] No such file or directory: 'app/luclient/res/BrickModels/mesh/reward/rew_ninjagomonastery_wallinsidecorner1.lxfml'
[2022-03-31 04:32:12 +0000] [11010] [ERROR] Exception on /properties/get_model/70368744182640/mtl/1 [GET]
Traceback (most recent call last):
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/[redacted]/.local/lib/python3.9/site-packages/flask_user/decorators.py", line 58, in decorator
    return view_function(*args, **kwargs)
  File "/home/[redacted]/NexusDashboard/app/properties.py", line 315, in get_model
    response = prebuilt(content, file_format, lod)[0]
  File "/home/[redacted]/NexusDashboard/app/properties.py", line 381, in prebuilt
    with open(str(cache.as_posix()), 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'app/cache/BrickModels/mesh/reward/rew_ninjagomonastery_wallinsidecorner1.lod1.mtl' 

image

Moderation Approval Site "View" Button wont work and trow an Internal Server Error Page

I have the following Error:
NexusDahsboard | [2022-10-11 20:27:05 +0000] [41] [ERROR] Exception on /characters/view/2 [GET]
NexusDahsboard | Traceback (most recent call last):
NexusDahsboard | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2070, in wsgi_app
NexusDahsboard | response = self.full_dispatch_request()
NexusDahsboard | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1515, in full_dispatch_request
NexusDahsboard | rv = self.handle_user_exception(e)
NexusDahsboard | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1513, in full_dispatch_request
NexusDahsboard | rv = self.dispatch_request()
NexusDahsboard | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1499, in dispatch_request
NexusDahsboard | return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
NexusDahsboard | File "/usr/local/lib/python3.8/site-packages/flask_user/decorators.py", line 58, in decorator
NexusDahsboard | return view_function(*args, **kwargs)
NexusDahsboard | File "/app/characters.py", line 95, in view
NexusDahsboard | if "i" in inv.keys() and type(inv["i"]) == list:
NexusDahsboard | AttributeError: 'str' object has no attribute 'keys'

This happens when I want to press the "View" Button on the Moderation Approval site.
I get a Internal Server Error on the Webinterface at the same time.

Anyone know if this is a me problem right now or generaly a problem still?

Error when disabling play keys

When disabling requiring play keys in settings.py, running the dashboard with gunicorn and creating an account as you normally would, a big error comes up, here it is:

File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 808, in _prepare_impl self.session.flush() File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 3298, in flush self._flush(objects) File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 3437, in _flush with util.safe_reraise(): File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 70, in __exit__ compat.raise_( File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 207, in raise_ raise exception File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 3398, in _flush flush_context.execute() File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 456, in execute rec.execute(self) File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 630, in execute util.preloaded.orm_persistence.save_obj( File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py", line 242, in save_obj _emit_insert_statements( File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py", line 1219, in _emit_insert_statements result = connection._execute_20( File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1583, in _execute_20 return meth(self, args_10style, kwargs_10style, execution_options) File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection return connection._execute_clauseelement( File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1452, in _execute_clauseelement ret = self._execute_context( File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1814, in _execute_context self._handle_dbapi_exception( File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1995, in _handle_dbapi_exception util.raise_( File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 207, in raise_ raise exception File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1771, in _execute_context self.dialect.do_execute( File "/home/ubuntu/.local/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute cursor.execute(statement, parameters) File "/home/ubuntu/.local/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute result = self._query(query) File "/home/ubuntu/.local/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query conn.query(q) File "/home/ubuntu/.local/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "/home/ubuntu/.local/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result result.read() File "/home/ubuntu/.local/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read first_packet = self.connection._read_packet() File "/home/ubuntu/.local/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet packet.raise_for_error() File "/home/ubuntu/.local/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error err.raise_mysql_exception(self._data) File "/home/ubuntu/.local/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception raise errorclass(errno, errval) sqlalchemy.exc.IntegrityError: (pymysql.err.IntegrityError) (1048, "Column 'play_key_id' cannot be null") [SQL: INSERT INTO accounts (name, email_confirmed_at, password, active, play_key_id) VALUES (%(name)s, %(email_confirmed_at)s, %(password)s, %(active)s, %(play_key_id)s)] [parameters: {'name': 'test', 'email_confirmed_at': None, 'password': '$2b$12$ZRhSsSbMkvNsqS7RYb/3heubZn.edLFY1FmP6izrxDY0qzNVNWYv.', 'active': 1, 'play_key_id': None}] (Background on this error at: https://sqlalche.me/e/14/gkpj)

The most important part is that, sqlalchemy does not like setting the play_key_id column to None. When enabling play keys, the registration process works flawlessly otherwise. Some other notes:

  • The dashboard is being run on port 5000 instead of port 8000 (AccountManager's default, since I'm lazy to enable the port)
  • I didn't extract the brick models and stuff because I don't care about those features, but I did copy the locale and cdclient.

ENH: Add an option to remove models from properties

When cop fails to process brick models, they can build up in the files without the user knowing, and can cause the property to be unloadable. There should be an option to remove the models individually as well as all models to clean up broken properties and make them usable again.

Sending SMTP via Mail Relay fails

Hello,

I run NexusDashboard in a docker container.
I'm trying to get it to send SMTP on Port 25 to a MailEnable relay I have configured to accept unauthenticated SMTP from a list of IP addresses and send them Authenticated.

Please let me know if you need anything else, I've been scratching my head for a few days.

My research indicates that it's filtering the "mail port" as a string instead of an integer.
https://stackoverflow.com/questions/23079017/servname-not-supported-for-ai-socktype

My email-related enviroment variables are as follows:

  USER_ENABLE_CHANGE_PASSWORD: "True"  # Allow users to change their password
  USER_ENABLE_CHANGE_USERNAME: "False"  # Allow users to change their usernam
  USER_ENABLE_REGISTER: "True"  # Allow new users to register
  USER_ENABLE_EMAIL: "True"  # Register with Email WILL - DISABLE OTHER THINGS TOO
  USER_ENABLE_CONFIRM_EMAIL: "True"  # Force users to confirm their email
  USER_ENABLE_INVITE_USER: "True"  # Allow users to be invited
  USER_REQUIRE_INVITATION: "True"  # Only invited users may - WILL DISABLE REGISTRATION
  USER_ENABLE_FORGOT_PASSWORD: "True"   # Allow users to reset their password
  MAIL_SERVER: "10.1.1.2" - #IP address of mailEnable relay
  MAIL_PORT: 25
  MAIL_USE_SSL: "False"
  MAIL_USE_TLS: "False"
  MAIL_USERNAME: None
  MAIL_PASSWORD: None
  USER_EMAIL_SENDER_NAME: Lego Universe
  USER_EMAIL_SENDER_EMAIL: [email protected]

Here is the log output when trying to invite a user.

raise EmailError('SMTP Connection error: Check your MAIL_SERVER and MAIL_PORT settings.')
socket.gaierror: [Errno -8] Servname not supported for ai_socktype
During handling of the above exception, another exception occurred:
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/flask_user/user_manager.py", line 413, in invite_user_stub
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1499, in dispatch_request
    return self.invite_user_view()
  File "/usr/local/lib/python3.8/site-packages/flask_user/decorators.py", line 58, in decorator
    return view_function(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask_user/user_manager__views.py", line 335, in invite_user_view
    self.email_manager.send_invite_user_email(current_user, user_invitation)
  File "/usr/local/lib/python3.8/site-packages/flask_user/email_manager.py", line 122, in send_invite_user_email
    self._render_and_send_email(
  File "/usr/local/lib/python3.8/site-packages/flask_user/email_manager.py", line 191, in _render_and_send_email
    self.user_manager.email_adapter.send_email_message(
  File "/usr/local/lib/python3.8/site-packages/flask_user/email_adapters/smtp_email_adapter.py", line 68, in send_email_message
Traceback (most recent call last):
flask_user.EmailError: SMTP Connection error: Check your MAIL_SERVER and MAIL_PORT settings.
    self.mail.send(message)
  File "/usr/local/lib/python3.8/site-packages/flask_user/email_adapters/smtp_email_adapter.py", line 64, in send_email_message
  File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 491, in send
    with self.connect() as connection:
    self.host = self.configure_host()
  File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 144, in __enter__
  File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 156, in configure_host
    host = smtplib.SMTP_SSL(self.mail.server, self.mail.port)
  File "/usr/local/lib/python3.8/smtplib.py", line 1048, in __init__
    SMTP.__init__(self, host, port, local_hostname, timeout,
  File "/usr/local/lib/python3.8/smtplib.py", line 255, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/local/lib/python3.8/smtplib.py", line 339, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/local/lib/python3.8/smtplib.py", line 1054, in _get_socket
  File "/usr/local/lib/python3.8/socket.py", line 787, in create_connection
    new_socket = socket.create_connection((host, port), timeout,
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):

BUG: Property rendering can't load the models

When I try to view a propertie over the NexusDashboard, it will show me the Content under: Property Content with the correct items.
As soon as I try to render a singe item or view the XML of the model I will get a 500 error from Nginx, and when I try to render the full propertie, I will just get the green sqare empty.

The Console of the Dashbaord throws this error: [ERROR] Exception on /properties/get_model/70368744177671/mtl/2 [GET] -> FileNotFoundError: [Errno 2] No such file or directory: 'app/cache/BrickModels/mesh\\ftcommunityitems\\rew_modularcastlealtcolor_gate.lod2.mtl'

When I check, all of the folders under app/cache do contain what they should, but the BrickModels folder is empty.

I do not know how to sole this unfortunately, and would appreciate every help.

Trying to Login to Dashboard throws error "Unknown column 'accounts.email' in 'field list'"

Am I dumb? Did I miss a step somewhere?

I went through the whole install process via the "Windows Manual" steps, ran the page with "flask run", I've got it open in my browser. But I need to sign in with a username and password, and I never made one for Nexus. (And there's no register button anywhere, despite me thinking there should be one while looking at the files)

I filled out settings.py with the username/pass for the database, and I tried them on the login page, but it throws an error, simply saying
"Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."

Yet the server itself doesn't show an error in powershell.
The only error I wasn't able to fix was the command "flask db upgrade" not being able to find the brickprimatives folder in \res\ (Which it couldn't find because I couldn't find it to put it in there.)((I assume the same would happen with the models textures and ui folders, as I couldn't find those either.))

Windows 10
With Python 3.8.0, as specified in the setup
ImageMagick-7.1.1-Q16

ENH: Serve brickdb from app

Currently UGC model viewing relies upon on an public endpoint on my server, instead we should rely upon the brick db in LU that pre-built model viewing uses

ENH: Logging

Look into adding logging to a file and to cli

ND looks for cdclient.sqlite when CDServer.sqlite is actually needed

If you provide it a cdclient instead of a CDServer, certain aspects of ND will not work (eg, the send mail page IIRC). ND should prefer opening CDServer.sqlite instead of cdclient.sqlite if present so that luclient can be symlinked to the same client dir as the DLU server

BUG: Fresh Char can't be procesed

this xml from a fresh char breaks stuff

<obj v="1">
<mf hc="96" hs="6" hd="0" t="142" l="12" hdc="0" cd="24" lh="22785040" rh="22337732" es="4" ess="118" ms="23"/>
<char acct="5" cc="0" gm="0" ft="0" llog="1648679357" ls="0" lzx="-626.5847" lzy="613.3515" lzz="-28.6374" lzrx="0.0" lzry="0.7015" lzrz="0.0" lzrw="0.7126" stt="0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;"/>
<dest hm="4" hc="4" im="0" ic="0" am="0" ac="0" d="0"/>
<inv>
<bag>
<b t="0" m="20"/>
<b t="1" m="240"/>
<b t="2" m="240"/>
<b t="3" m="240"/>
</bag>
<items>
<in t="0">
<i l="24263" id="1152921508901814439" s="0" c="1" eq="1" b="1"/>
<i l="23902" id="1152921508901814440" s="1" c="1" eq="1" b="1"/>
</in>
</items>
</inv>
<lvl l="1" cv="1" sb="500"/>
<flag/>
</obj>

ENH: Eco Graphs

Right now, they suck

Make a week by week view where you can page through weeks
and make a date range picker so people can crash their browsers if the so choose

ENH: async ucg model loading instead of sequential loading

Loading large properties has issues.
the first being if the property has many individual files, it takes awhile to load
The second being that the viewer becomes basically unusable, due to all the geometry.

Can't really do anything about the second right now, but the first can be solved by loading them async

ENH: Audit Log

Implement an audit log for all things so there is a paper trail if someone changes someone from the site.

  • Changing GM level
  • Moderating
  • mod mail

Error when opening properties tab

A popup appears whenever I open the properties tab or any page involving properties. A restart will return things to normal, but only temporarily as it just comes back up again not much later.

image

Errors while trying to start.

Hey, I just got to the very end of this manual for setting this dashboard up, and I was going through a trial and error of trying to start than installing packages via pip that weren't installed, and I came across this error when trying to upgrade the db:

Error: While importing 'wsgi', an ImportError was raised:

Traceback (most recent call last):
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask\cli.py", line 214, in locate_app
    __import__(module_name)
  File "C:\DU\NexusDashboard-main\wsgi.py", line 2, in <module>
    from app import create_app
  File "C:\DU\NexusDashboard-main\app\__init__.py", line 7, in <module>
    from app.models import db, migrate, PlayKey
  File "C:\DU\NexusDashboard-main\app\models.py", line 3, in <module>
    from flask_user import UserMixin
ModuleNotFoundError: No module named 'flask_user'


Usage: flask [OPTIONS] COMMAND [ARGS]...
Try 'flask --help' for help.

Error: No such command 'db'.

And it seems from posts online that flask_user is out of date or something, and when I try to install it, it can't install it. Also I did install flask_migrate so idk why the db command isn't working. I already have the server working, I can play on the server, and I even have the account manager working. And if I try to run this: gunicorn -b :8000 -w 4 wsgi:app, I get this:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python311\Scripts\gunicorn.exe\__main__.py", line 4, in <module>
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python311\Lib\site-packages\gunicorn\app\wsgiapp.py", line 9, in <module>
    from gunicorn.app.base import Application
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python311\Lib\site-packages\gunicorn\app\base.py", line 11, in <module>
    from gunicorn import util
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python311\Lib\site-packages\gunicorn\util.py", line 8, in <module>
    import fcntl
ModuleNotFoundError: No module named 'fcntl'

And it seems fcntl isn't installable either. And of course trying to just do flask run results in in the error with flask_user not being installed.

Edit*: On top of this, when I try to do pip install -r requirements.txt, I get a ton of errors relating to greenlet.

Premission denied even when run as sudo

Trying to do the flask db update command to finish up the setup of the dashboard, but every time i try to run it, this pops up. I have followed every step exactly as specified, but for some reason it still always does this. Error thing down below
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1771, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/default.py", line 717, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.10/dist-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "/usr/local/lib/python3.10/dist-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "/usr/local/lib/python3.10/dist-packages/pymysql/connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.10/dist-packages/pymysql/connections.py", line 775, in _read_query_result
result.read()
File "/usr/local/lib/python3.10/dist-packages/pymysql/connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.10/dist-packages/pymysql/connections.py", line 725, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.10/dist-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.10/dist-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1005, 'Can't create table darkflame.alembic_version (errno: 13 "Permission denied")')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/bin/flask", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/dist-packages/flask/cli.py", line 990, in main
cli.main(args=sys.argv[1:])
File "/usr/local/lib/python3.10/dist-packages/flask/cli.py", line 596, in main
return super().main(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1668, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1668, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/flask/cli.py", line 440, in decorator
return __ctx.invoke(f, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/flask_migrate/cli.py", line 149, in upgrade
_upgrade(directory, revision, sql, tag, x_arg)
File "/usr/local/lib/python3.10/dist-packages/flask_migrate/init.py", line 98, in wrapped
f(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/flask_migrate/init.py", line 185, in upgrade
command.upgrade(config, revision, sql=sql, tag=tag)
File "/usr/local/lib/python3.10/dist-packages/alembic/command.py", line 320, in upgrade
script.run_env()
File "/usr/local/lib/python3.10/dist-packages/alembic/script/base.py", line 563, in run_env
util.load_python_file(self.dir, "env.py")
File "/usr/local/lib/python3.10/dist-packages/alembic/util/pyfiles.py", line 92, in load_python_file
module = load_module_py(module_id, path)
File "/usr/local/lib/python3.10/dist-packages/alembic/util/pyfiles.py", line 108, in load_module_py
spec.loader.exec_module(module) # type: ignore
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/brickmaster/NexusDashboard/migrations/env.py", line 91, in
run_migrations_online()
File "/home/brickmaster/NexusDashboard/migrations/env.py", line 85, in run_migrations_online
context.run_migrations()
File "", line 8, in run_migrations
File "/usr/local/lib/python3.10/dist-packages/alembic/runtime/environment.py", line 851, in run_migrations
self.get_context().run_migrations(**kw)
File "/usr/local/lib/python3.10/dist-packages/alembic/runtime/migration.py", line 603, in run_migrations
self._ensure_version_table()
File "/usr/local/lib/python3.10/dist-packages/alembic/runtime/migration.py", line 539, in _ensure_version_table
self._version.create(self.connection, checkfirst=True)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/schema.py", line 944, in create
bind._run_ddl_visitor(ddl.SchemaGenerator, self, checkfirst=checkfirst)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 2082, in _run_ddl_visitor
visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/visitors.py", line 520, in traverse_single
return meth(obj, **kw)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/ddl.py", line 890, in visit_table
self.connection.execute(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1263, in execute
return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/ddl.py", line 77, in _execute_on_connection
return connection._execute_ddl(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1353, in _execute_ddl
ret = self._execute_context(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1814, in _execute_context
self.handle_dbapi_exception(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1995, in handle_dbapi_exception
util.raise
(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/util/compat.py", line 207, in raise

raise exception
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1771, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/default.py", line 717, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.10/dist-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "/usr/local/lib/python3.10/dist-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "/usr/local/lib/python3.10/dist-packages/pymysql/connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.10/dist-packages/pymysql/connections.py", line 775, in _read_query_result
result.read()
File "/usr/local/lib/python3.10/dist-packages/pymysql/connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.10/dist-packages/pymysql/connections.py", line 725, in _read_packet
packet.raise_for_error()
File "/usr/local/lib/python3.10/dist-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.10/dist-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1005, 'Can't create table darkflame.alembic_version (errno: 13 "Permission denied")')
[SQL:
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
)

]
(Background on this error at: https://sqlalche.me/e/14/e3q8)

ENH: Show pet owners

This will be a brute force with a cache way to do it.
basicallyadd a column to the pet_names db table and then when the page loads find the owner and save it so we don't have to look again

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.