Commit graph

12 commits

Author SHA1 Message Date
GenX FX Trading System
6d74ed9563
Bolt: Optimize Markdown rendering in dashboard (#459) 2026-02-27 02:35:29 +07:00
GenX FX Trading System
ae56694f13
🛡️ Sentinel: [MEDIUM] Fix information leakage in web dashboard (#460) 2026-02-27 02:35:27 +07:00
google-labs-jules[bot]
12d17ab97e 🎨 Palette: Add copy-to-clipboard for system status
- Adds a "Copy" button to "Fly.io App" and "Telegram Bot" status items in `index.html` and `dashboard/index.html`.
- Updates `scripts/web_dashboard.py` to include these status rows with the same copy functionality, ensuring consistency across all dashboard views.
- Implements visual feedback (icon changes to checkmark) and accessibility support (aria-labels) for the copy action.
- Uses inline SVG icons to avoid external dependencies.
- Verified with Playwright and existing tests.
2026-02-26 11:56:51 +00:00
google-labs-jules[bot]
f59010950f Fix information leakage in web dashboard error handling 2026-02-26 11:16:47 +00:00
google-labs-jules[bot]
b22e7a6fac Bolt: Optimize Markdown rendering in dashboard
- Replaced `markdown.markdown()` shortcut with reused `markdown.Markdown` instance via `threading.local`.
- Reduced parsing overhead by eliminating re-initialization on every call.
- Verified with unit tests and benchmark (~10% speedup).

Related to performance improvements for dashboard responsiveness.
2026-02-26 05:26:33 +00:00
google-labs-jules[bot]
5a00caed73 feat(perf): Pre-compile Jinja2 template in web dashboard
Extracts the dashboard HTML string into a global constant and compiles it
using Jinja2 only once (lazily) instead of re-parsing the string on every
request. This improves response latency for the dashboard.

- Extracted `DASHBOARD_HTML` constant
- Implemented `DASHBOARD_TEMPLATE` lazy compilation
- Replaced `render_template_string` with `DASHBOARD_TEMPLATE.render()`
- Verified with `scripts/test_web_dashboard.py`
2026-02-12 05:13:07 +00:00
google-labs-jules[bot]
0b8a09a572 Add security headers to web dashboard (CSP, HSTS, X-Frame-Options)
- Implemented `@app.after_request` in `scripts/web_dashboard.py` to inject security headers.
- Added `Content-Security-Policy` with `default-src 'self'`, blocking inline scripts.
- Added `X-Content-Type-Options: nosniff`.
- Added `X-Frame-Options: SAMEORIGIN`.
- Added `Referrer-Policy: strict-origin-when-cross-origin`.
- Added unit test `test_security_headers` to `scripts/test_web_dashboard.py` to verify header presence.
- Mitigates Stored XSS, Clickjacking, and MIME sniffing risks.
2026-02-09 11:27:48 +00:00
google-labs-jules[bot]
644c00e696 🎨 Palette: Add skip-to-content link for accessibility 2026-02-08 11:20:56 +00:00
google-labs-jules[bot]
0c59ee6ed8 Bolt: Reduce syscalls in web dashboard
Replaced `os.path.exists()` + `os.path.getmtime()` with a single `os.stat()` call in `scripts/web_dashboard.py` to reduce syscalls by 50% for cache checks. Also pre-calculated static file paths at module level to avoid redundant `abspath` and `join` calls on every request.

Impact:
- Reduces filesystem operations per request.
- Improves code cleanliness by centralizing path constants.
- Verified with existing tests and manual curl check.
2026-01-23 05:19:37 +00:00
google-labs-jules[bot]
9d93a21039 Bolt: Optimize health check endpoint
💡 What: Separated the /health endpoint from the main dashboard rendering logic. It now returns a lightweight JSON response.
🎯 Why: The previous implementation rendered the full Markdown dashboard for every health check, consuming unnecessary CPU and I/O resources during frequent polling.
📊 Impact: Reduces health check processing time from file reading + markdown parsing (~milliseconds) to a simple JSON return (~microseconds).
🔬 Measurement: Verified with new test script scripts/test_web_dashboard.py and updated render.yaml/app.yaml to use the new endpoint.
2026-01-21 05:17:23 +00:00
google-labs-jules[bot]
5fba7c9c32 Merge web dashboard cache and update EA defaults
Merged `bolt-web-dashboard-cache` optimization into `scripts/web_dashboard.py` to improve documentation rendering performance.
Updated `mt5/MQL5/Experts/SMC_TrendBreakout_MTF_EA.mq5` defaults:
- EnableTrading: true
- RiskPercent: 1.0

Verified frontend functionality and passed all repo validation checks.
2026-01-20 08:52:52 +00:00
google-labs-jules[bot]
6b0f95b374 feat: add web dashboard for cloud deployment
- Implemented a Flask-based web dashboard in `scripts/web_dashboard.py` to serve project status and documentation.
- Integrated the web dashboard into `config/startup_config.json` as a managed component.
- Updated `requirements.txt` with `flask` and `markdown` dependencies.
- Added `/health` endpoint for cloud platform health checks.
- Verified system integrity with existing validation and testing scripts.
2026-01-18 22:52:05 +00:00