Skip to content

Commit 0bcb23a

Browse files
committed
bugfix
1 parent 34ecd76 commit 0bcb23a

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ __pycache__/
2020
*$py.class
2121
*.so
2222
.Python
23+
.venv
2324

2425
# IDE
2526
.vscode/

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ FROM python:3.9-slim
33
# Set working directory
44
WORKDIR /app
55

6+
# Copy requirements first for better caching
7+
COPY requirements.txt .
8+
69
# Install Python dependencies
7-
RUN pip install --no-cache-dir flask requests urllib3
10+
RUN pip install --no-cache-dir -r requirements.txt
811

912
# Copy application files
1013
COPY index.html .

server.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,7 @@ def load_config():
5050
def index():
5151
return send_from_directory('.', 'index.html')
5252

53-
# Serve static files
54-
@app.route('/<path:path>')
55-
def serve_static(path):
56-
# Special handling for config.json
57-
if path == 'config.json':
58-
return send_from_directory('config', 'config.json')
59-
return send_from_directory('.', path)
60-
61-
# Proxy API requests to KaraKeep
53+
# Proxy API requests to KaraKeep - MUST come before catch-all route
6254
@app.route('/api/karakeep/<path:path>')
6355
def proxy_karakeep(path):
6456
config = load_config()
@@ -121,6 +113,14 @@ def save_preferences():
121113
def handle_options(path):
122114
return '', 200
123115

116+
# Serve static files - MUST come last as it's a catch-all
117+
@app.route('/<path:path>')
118+
def serve_static(path):
119+
# Special handling for config.json
120+
if path == 'config.json':
121+
return send_from_directory('config', 'config.json')
122+
return send_from_directory('.', path)
123+
124124
if __name__ == '__main__':
125125
ensure_config_exists()
126126
print("KaraKeep HomeDash Server (Flask) starting...")

0 commit comments

Comments
 (0)