diff --git a/__pycache__/config.cpython-313.pyc b/__pycache__/config.cpython-313.pyc new file mode 100644 index 0000000..ad7ce61 Binary files /dev/null and b/__pycache__/config.cpython-313.pyc differ diff --git a/app/__init__.py b/app/__init__.py index 9c3210c..4ce705f 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -108,6 +108,17 @@ def create_app(config_name='development'): except ImportError as e: print(f"Could not import API blueprint: {e}") + # Register template filters - IMPORTANT FOR MARKDOWN FILTER + from app.core.template_filters import bp as filters_bp + app.register_blueprint(filters_bp) + + # Register template filters directly if the blueprint method doesn't work + from app.core.template_filters import markdown_filter, ip_network_filter, ip_address_filter, get_ip_network + app.jinja_env.filters['markdown'] = markdown_filter + app.jinja_env.filters['ip_network'] = ip_network_filter + app.jinja_env.filters['ip_address'] = ip_address_filter + app.jinja_env.globals['get_ip_network'] = get_ip_network + # Create database tables with app.app_context(): try: diff --git a/app/__pycache__/__init__.cpython-313.pyc b/app/__pycache__/__init__.cpython-313.pyc index 0ea6980..25aafc2 100644 Binary files a/app/__pycache__/__init__.cpython-313.pyc and b/app/__pycache__/__init__.cpython-313.pyc differ diff --git a/app/core/__pycache__/template_filters.cpython-313.pyc b/app/core/__pycache__/template_filters.cpython-313.pyc new file mode 100644 index 0000000..f27479d Binary files /dev/null and b/app/core/__pycache__/template_filters.cpython-313.pyc differ diff --git a/app/scripts/__pycache__/db_seed.cpython-313.pyc b/app/scripts/__pycache__/db_seed.cpython-313.pyc index 9f31c6d..02a29fe 100644 Binary files a/app/scripts/__pycache__/db_seed.cpython-313.pyc and b/app/scripts/__pycache__/db_seed.cpython-313.pyc differ diff --git a/app/templates/dashboard/server_view.html b/app/templates/dashboard/server_view.html index b6a8ae4..5629817 100644 --- a/app/templates/dashboard/server_view.html +++ b/app/templates/dashboard/server_view.html @@ -103,79 +103,37 @@
-
+

Applications

-
{% if server.apps %} -
+
{% for app in server.apps %} -
-

- -

-
-
-
- - Edit - - -
- - - {% if app.ports %} -
-
Ports
-
- - - - - - - - - - {% for port in app.ports %} - - - - - - {% endfor %} - -
PortProtocolDescription
{{ port.port_number }}{{ port.protocol }}{{ port.description }}
-
-
- {% endif %} - - {% if app.documentation %}
Documentation
- {{ app.documentation|markdown }} + {{ app.documentation|markdown|safe }}
{% else %} diff --git a/config.py b/config.py new file mode 100644 index 0000000..7f66bca --- /dev/null +++ b/config.py @@ -0,0 +1,28 @@ +import os + +class Config: + """Base config.""" + SECRET_KEY = os.environ.get('SECRET_KEY', 'dev-key-placeholder') + SQLALCHEMY_TRACK_MODIFICATIONS = False + WTF_CSRF_ENABLED = True + SESSION_COOKIE_SECURE = False # Set to True in production with HTTPS + +class DevelopmentConfig(Config): + """Development config.""" + DEBUG = True + SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite:///app.db') + SQLALCHEMY_ECHO = True + +class ProductionConfig(Config): + """Production config.""" + DEBUG = False + TESTING = False + SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite:///app.db') + SESSION_COOKIE_SECURE = True + REMEMBER_COOKIE_SECURE = True + +class TestingConfig(Config): + """Testing config.""" + TESTING = True + SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:' + WTF_CSRF_ENABLED = False \ No newline at end of file diff --git a/instance/app.db b/instance/app.db new file mode 100644 index 0000000..43782aa Binary files /dev/null and b/instance/app.db differ diff --git a/wsgi.py b/wsgi.py index 0895bb8..a5de29a 100644 --- a/wsgi.py +++ b/wsgi.py @@ -1,7 +1,13 @@ +import os from app import create_app -# Create application instance - production +# Set the environment variable for database URL if needed +# os.environ['DATABASE_URL'] = 'your_production_database_url' + +# Create a production application app = create_app('production') if __name__ == '__main__': - app.run() \ No newline at end of file + # This is only used for development + # In production, a WSGI server would import this file + app.run(host='0.0.0.0', port=5000) \ No newline at end of file