mirror of
https://github.com/DarkflameUniverse/NexusDashboard.git
synced 2025-10-19 13:38:03 +00:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a7a68d2fe1 | ||
![]() |
b17928b050 | ||
![]() |
ee65f67fe3 | ||
![]() |
5d1b79334a | ||
![]() |
e726f59114 | ||
![]() |
8826a34ebc | ||
![]() |
a3d492df91 | ||
![]() |
4a58e963a5 | ||
![]() |
8012780eba |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -3,7 +3,7 @@ name: ci
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "**"
|
- "main"
|
||||||
tags:
|
tags:
|
||||||
- "v*.*.*"
|
- "v*.*.*"
|
||||||
pull_request:
|
pull_request:
|
||||||
|
@@ -83,11 +83,12 @@ docker run -d \
|
|||||||
-e APP_SECRET_KEY='<secret_key>' \
|
-e APP_SECRET_KEY='<secret_key>' \
|
||||||
-e APP_DATABASE_URI='mysql+pymysql://<username>:<password>@<host>:<port>/<database>' \
|
-e APP_DATABASE_URI='mysql+pymysql://<username>:<password>@<host>:<port>/<database>' \
|
||||||
# you can include other optional Environment Variables from below like this
|
# you can include other optional Environment Variables from below like this
|
||||||
-e REQUIRE_PLAY_KEY=True
|
-e REQUIRE_PLAY_KEY=True \
|
||||||
-p 8000:8000/tcp
|
-p 8000:8000/tcp \
|
||||||
-v /path/to/unpacked/client:/app/luclient:r \
|
-v /path/to/logs:/logs:rw /
|
||||||
|
-v /path/to/unpacked/client:/app/luclient:ro \
|
||||||
-v /path/to/cachedir:/app/cache:rw \
|
-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
|
* `/app/luclient` must be mapped to the location of an unpacked client
|
||||||
|
@@ -251,9 +251,11 @@ def register_settings(app):
|
|||||||
'MAIL_SERVER',
|
'MAIL_SERVER',
|
||||||
app.config['MAIL_SERVER']
|
app.config['MAIL_SERVER']
|
||||||
)
|
)
|
||||||
app.config['MAIL_PORT'] = os.getenv(
|
app.config['MAIL_PORT'] = int(
|
||||||
'MAIL_USE_SSL',
|
os.getenv(
|
||||||
|
'MAIL_PORT',
|
||||||
app.config['MAIL_PORT']
|
app.config['MAIL_PORT']
|
||||||
|
)
|
||||||
)
|
)
|
||||||
app.config['MAIL_USE_SSL'] = os.getenv(
|
app.config['MAIL_USE_SSL'] = os.getenv(
|
||||||
'MAIL_USE_SSL',
|
'MAIL_USE_SSL',
|
||||||
|
@@ -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='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="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 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 %}
|
{% endblock %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@@ -77,11 +77,11 @@ def upgrade():
|
|||||||
sa.Column('created_at', mysql.TIMESTAMP(), server_default=sa.text('now()'), nullable=False),
|
sa.Column('created_at', mysql.TIMESTAMP(), server_default=sa.text('now()'), nullable=False),
|
||||||
sa.Column('play_key_id', mysql.INTEGER(), nullable=True),
|
sa.Column('play_key_id', mysql.INTEGER(), nullable=True),
|
||||||
sa.Column('mute_expire', mysql.BIGINT(unsigned=True), server_default='0', nullable=False),
|
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.PrimaryKeyConstraint('id'),
|
||||||
sa.UniqueConstraint('name')
|
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('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_confirmed_at', sa.DateTime(), nullable=True))
|
||||||
op.add_column('accounts', sa.Column('email', sa.Unicode(length=255), server_default='', 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
|
from app import create_app
|
||||||
|
|
||||||
app = create_app()
|
app = create_app()
|
||||||
|
|
||||||
|
|
||||||
@app.shell_context_processor
|
@app.shell_context_processor
|
||||||
def make_shell_context():
|
def make_shell_context():
|
||||||
"""Extend the Flask shell context."""
|
"""Extend the Flask shell context."""
|
||||||
return {'app': app}
|
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 __name__ == '__main__':
|
||||||
if running_directly:
|
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
app.run(host='0.0.0.0')
|
app.run(host='0.0.0.0')
|
||||||
|
else:
|
||||||
# Configure production running
|
|
||||||
if running_under_gunicorn:
|
|
||||||
import logging
|
import logging
|
||||||
from logging.handlers import RotatingFileHandler
|
from logging.handlers import RotatingFileHandler
|
||||||
gunicorn_logger = logging.getLogger('gunicorn.error')
|
gunicorn_logger = logging.getLogger('gunicorn.error')
|
||||||
@@ -27,7 +23,3 @@ if running_under_gunicorn:
|
|||||||
file_handler.setFormatter(formatter)
|
file_handler.setFormatter(formatter)
|
||||||
app.logger.addHandler(file_handler)
|
app.logger.addHandler(file_handler)
|
||||||
app.logger.setLevel(gunicorn_logger.level)
|
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