/delete", methods=["POST"])
diff --git a/app/routes/static.py b/app/routes/static.py
index 02a2a14..21777f7 100644
--- a/app/routes/static.py
+++ b/app/routes/static.py
@@ -4,34 +4,34 @@ import os
bp = Blueprint("static_assets", __name__)
-@bp.route("/static/libs/tabler-icons/tabler-icons.min.css")
-def tabler_icons():
- """Serve tabler-icons CSS from node_modules or download if missing"""
- icons_path = os.path.join(current_app.static_folder, "libs", "tabler-icons")
-
- # Create directory if it doesn't exist
- if not os.path.exists(icons_path):
- os.makedirs(icons_path)
-
- css_file = os.path.join(icons_path, "tabler-icons.min.css")
-
- # If file doesn't exist, download from CDN
- if not os.path.exists(css_file):
- import requests
-
- try:
- cdn_url = "https://cdn.jsdelivr.net/npm/@tabler/icons@latest/iconfont/tabler-icons.min.css"
- response = requests.get(cdn_url)
- if response.status_code == 200:
- with open(css_file, "wb") as f:
- f.write(response.content)
- print(f"Downloaded tabler-icons.min.css from CDN")
- else:
- print(f"Failed to download tabler-icons CSS: {response.status_code}")
- except Exception as e:
- print(f"Error downloading tabler-icons CSS: {e}")
-
- return send_from_directory(icons_path, "tabler-icons.min.css")
+# @bp.route("/static/libs/tabler-icons/tabler-icons.min.css")
+# def tabler_icons():
+# """Serve tabler-icons CSS from node_modules or download if missing"""
+# icons_path = os.path.join(current_app.static_folder, "libs", "tabler-icons")
+#
+# # Create directory if it doesn't exist
+# if not os.path.exists(icons_path):
+# os.makedirs(icons_path)
+#
+# css_file = os.path.join(icons_path, "tabler-icons.min.css")
+#
+# # If file doesn't exist, download from CDN
+# if not os.path.exists(css_file):
+# import requests
+#
+# try:
+# cdn_url = "https://cdn.jsdelivr.net/npm/@tabler/core@1.1.1/dist/css/tabler.min.css"
+# response = requests.get(cdn_url)
+# if response.status_code == 200:
+# with open(css_file, "wb") as f:
+# f.write(response.content)
+# print(f"Downloaded tabler-icons.min.css from CDN")
+# else:
+# print(f"Failed to download tabler-icons CSS: {response.status_code}")
+# except Exception as e:
+# print(f"Error downloading tabler-icons CSS: {e}")
+#
+# return send_from_directory(icons_path, "tabler-icons.min.css")
@bp.route("/static/css/tabler.min.css")
@@ -50,7 +50,7 @@ def tabler_css():
import requests
try:
- cdn_url = "https://cdn.jsdelivr.net/npm/@tabler/core@latest/dist/css/tabler.min.css"
+ cdn_url = "https://cdn.jsdelivr.net/npm/@tabler/core@1.1.1/dist/css/tabler.min.css"
response = requests.get(cdn_url)
if response.status_code == 200:
with open(css_file, "wb") as f:
@@ -82,7 +82,7 @@ def favicon():
try:
# Using a simple placeholder favicon
- cdn_url = "https://www.google.com/favicon.ico"
+ cdn_url = "https://www.svgrepo.com/show/529863/server-minimalistic.svg"
response = requests.get(cdn_url)
if response.status_code == 200:
with open(favicon_file, "wb") as f:
diff --git a/app/templates/dashboard/app_form.html b/app/templates/dashboard/app_form.html
index 343e6d0..d769517 100644
--- a/app/templates/dashboard/app_form.html
+++ b/app/templates/dashboard/app_form.html
@@ -119,8 +119,6 @@
@@ -144,8 +142,6 @@
|
@@ -251,9 +247,48 @@
{% endblock %}
\ No newline at end of file
diff --git a/app/templates/layout.html b/app/templates/layout.html
index 195641a..b0cc5cc 100644
--- a/app/templates/layout.html
+++ b/app/templates/layout.html
@@ -17,8 +17,8 @@
-
+
+
diff --git a/app/utils/app_utils.py b/app/utils/app_utils.py
index 940c345..f911ad9 100644
--- a/app/utils/app_utils.py
+++ b/app/utils/app_utils.py
@@ -105,6 +105,10 @@ def process_app_ports(app_id, port_data, server_id=None):
if app:
server_id = app.server_id
+ # If no port data is provided, that's valid (app with no ports)
+ if not port_data:
+ return True, None
+
# Track the port+protocol combinations we've seen to avoid duplicates
seen_ports = set()
diff --git a/compose.yml b/compose.yml
index 9c125bc..867a191 100644
--- a/compose.yml
+++ b/compose.yml
@@ -7,7 +7,7 @@ services:
dockerfile: Dockerfile
# image: homedocs:latest
ports:
- - "5001:8000"
+ - "5000:8000"
volumes:
- ./instance:/app/instance # Persist SQLite database
# environment:
diff --git a/run.py b/run.py
index 9f6577d..40081e4 100644
--- a/run.py
+++ b/run.py
@@ -10,6 +10,7 @@ from datetime import datetime
import random
import string
import json
+from flask_wtf.csrf import CSRFProtect
# Add the current directory to Python path
current_dir = os.path.abspath(os.path.dirname(__file__))
@@ -79,6 +80,9 @@ def register_routes(app):
print("Starting Flask app with SQLite database...")
app = create_app("development")
+# Set up CSRF protection
+csrf = CSRFProtect(app)
+
@app.shell_context_processor
def make_shell_context():
diff --git a/wsgi.py b/wsgi.py
index 7c48ac6..8dff4aa 100644
--- a/wsgi.py
+++ b/wsgi.py
@@ -1,6 +1,7 @@
import os
import secrets
from app import create_app
+from flask_wtf.csrf import CSRFProtect
# Generate a secret key if not provided
if not os.environ.get("SECRET_KEY"):
|