mirror of
https://github.com/DarkflameUniverse/NexusDashboard.git
synced 2025-10-17 20:48:01 +00:00
Compare commits
17 Commits
configurat
...
v1.1.1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a7a68d2fe1 | ||
![]() |
b17928b050 | ||
![]() |
ee65f67fe3 | ||
![]() |
5d1b79334a | ||
![]() |
e726f59114 | ||
![]() |
8826a34ebc | ||
![]() |
a3d492df91 | ||
![]() |
4a58e963a5 | ||
![]() |
8012780eba | ||
![]() |
f403d7dcb0 | ||
![]() |
ceed592342 | ||
![]() |
bf7fb3d159 | ||
![]() |
ef55b8f9f2 | ||
![]() |
3d47b265c9 | ||
![]() |
3f7a382dbc | ||
![]() |
760936a01f | ||
![]() |
c96174fcbe |
54
.github/workflows/ci.yml
vendored
Normal file
54
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
pull_request:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
# generate Docker tags based on the following events/attributes
|
||||
tags: |
|
||||
type=ref,event=pr
|
||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
13
README.md
13
README.md
@@ -83,11 +83,12 @@ 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 \
|
||||
-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 \
|
||||
aronwk/nexus-dashboard:latest
|
||||
ghcr.io/darkflameuniverse/nexusdashboard:latest
|
||||
```
|
||||
|
||||
* `/app/luclient` must be mapped to the location of an unpacked client
|
||||
@@ -248,12 +249,12 @@ Run the following command to clone the repository `git clone https://github.com/
|
||||
|
||||
You should now have a directory called `NexusDashboard` present on your desktop.
|
||||
|
||||
### Setting up
|
||||
### 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.
|
||||
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.
|
||||
|
@@ -251,9 +251,11 @@ def register_settings(app):
|
||||
'MAIL_SERVER',
|
||||
app.config['MAIL_SERVER']
|
||||
)
|
||||
app.config['MAIL_PORT'] = os.getenv(
|
||||
'MAIL_USE_SSL',
|
||||
app.config['MAIL_PORT'] = int(
|
||||
os.getenv(
|
||||
'MAIL_PORT',
|
||||
app.config['MAIL_PORT']
|
||||
)
|
||||
)
|
||||
app.config['MAIL_USE_SSL'] = os.getenv(
|
||||
'MAIL_USE_SSL',
|
||||
|
@@ -138,14 +138,14 @@ def brick_list():
|
||||
brick_list = []
|
||||
if len(brick_list) == 0:
|
||||
suffixes = [".g", ".g1", ".g2", ".g3", ".xml"]
|
||||
res = pathlib.Path(f"{current_app.config['CLIENT_LOCATION']}res/")
|
||||
cache = pathlib.Path(f"{current_app.config['CACHE_LOCATION']}")
|
||||
# Load g files
|
||||
for path in res.rglob("*.*"):
|
||||
for path in cache.rglob("*.*"):
|
||||
if str(path.suffix) in suffixes:
|
||||
brick_list.append(
|
||||
{
|
||||
"type": "file",
|
||||
"name": str(path.as_posix()).replace("{current_app.config['CLIENT_LOCATION']}res/", "")
|
||||
"name": str(path.as_posix()).replace(f"{current_app.config['CACHE_LOCATION']}", "")
|
||||
}
|
||||
)
|
||||
response = make_response(json.dumps(brick_list))
|
||||
@@ -157,7 +157,7 @@ def brick_list():
|
||||
@luclient_blueprint.route('/ldddb/<path:req_path>')
|
||||
def dir_listing(req_path):
|
||||
# Joining the base and the requested path
|
||||
rel_path = pathlib.Path(str(pathlib.Path(f"{current_app.config['CLIENT_LOCATION']}res/{req_path}").resolve()))
|
||||
rel_path = pathlib.Path(str(pathlib.Path(f"{current_app.config['CACHE_LOCATION']}/{req_path}").resolve()))
|
||||
# Return 404 if path doesn't exist
|
||||
if not rel_path.exists():
|
||||
return abort(404)
|
||||
|
@@ -84,6 +84,17 @@
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='bootstrap-4.2.1/js/bootstrap.bundle.min.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ url_for('static', filename='datatables/datatables.min.js') }}"></script>
|
||||
<script type="sytylesheet" src="{{ url_for('static', filename='datatables/datatables.min.css') }}"></script>
|
||||
<script>
|
||||
// set the active nav-link item
|
||||
$(function () {
|
||||
let target_nav = '#{{request.endpoint}}'.replace('\.', '-');
|
||||
$(target_nav).addClass('active');
|
||||
});
|
||||
// make tooltips with data work
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
|
@@ -77,11 +77,11 @@ def upgrade():
|
||||
sa.Column('created_at', mysql.TIMESTAMP(), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('play_key_id', mysql.INTEGER(), nullable=True),
|
||||
sa.Column('mute_expire', mysql.BIGINT(unsigned=True), server_default='0', nullable=False),
|
||||
sa.ForeignKeyConstraint(['play_key_id'], ['play_keys.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('name')
|
||||
)
|
||||
|
||||
op.create_foreign_key(None, 'accounts', 'play_keys', ['play_key_id'], ['id'], ondelete='CASCADE')
|
||||
op.add_column('accounts', sa.Column('active', sa.BOOLEAN(), server_default='1', nullable=False))
|
||||
op.add_column('accounts', sa.Column('email_confirmed_at', sa.DateTime(), nullable=True))
|
||||
op.add_column('accounts', sa.Column('email', sa.Unicode(length=255), server_default='', nullable=True))
|
||||
|
16
wsgi.py
16
wsgi.py
@@ -1,23 +1,19 @@
|
||||
from sys import platform
|
||||
|
||||
from app import create_app
|
||||
|
||||
app = create_app()
|
||||
|
||||
|
||||
@app.shell_context_processor
|
||||
def make_shell_context():
|
||||
"""Extend the Flask shell context."""
|
||||
return {'app': app}
|
||||
|
||||
running_directly = __name__ == "wsgi" or __name__ == "__main__"
|
||||
running_under_gunicorn = not running_directly and 'gunicorn' in __name__ and 'linux' in platform
|
||||
|
||||
# Configure development running
|
||||
if running_directly:
|
||||
if __name__ == '__main__':
|
||||
with app.app_context():
|
||||
app.run(host='0.0.0.0')
|
||||
|
||||
# Configure production running
|
||||
if running_under_gunicorn:
|
||||
else:
|
||||
import logging
|
||||
from logging.handlers import RotatingFileHandler
|
||||
gunicorn_logger = logging.getLogger('gunicorn.error')
|
||||
@@ -27,7 +23,3 @@ if running_under_gunicorn:
|
||||
file_handler.setFormatter(formatter)
|
||||
app.logger.addHandler(file_handler)
|
||||
app.logger.setLevel(gunicorn_logger.level)
|
||||
|
||||
# Error out if nothing has been setup
|
||||
if not running_directly and not running_under_gunicorn:
|
||||
raise RuntimeError('Unsupported WSGI server')
|
||||
|
Reference in New Issue
Block a user