add internet stability test#805
Conversation
Add a prolonged ping-based stability test with real-time canvas chart, stats (avg/min/max/jitter/packet loss), stability rating, external ping targets, CSV export, and Docker support. Link from main page to stability test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Load server list dynamically from servers.json for Docker frontend/dual modes - Copy servers.json to web root in entrypoint.sh for frontend/dual modes - Change back link from href="/" to href="./" for subdirectory installs - Use binary search for visible chart data range (O(log n) vs O(n)) - Add 200ms minimum interval between pings to limit sample rate Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The current Dockerfile.alpine pulls FROM php:8-alpine and then `apk add php-apache2`. The result is two PHP installs side by side: the docker-library PHP at /usr/local/bin/php (~30 MB, never used by Apache) and the apk-installed PHP at /usr/bin/php (which mod_php actually loads). Pinning a fresh Alpine release and installing the apk packages directly drops the dead /usr/local/bin/php install entirely. Expected wins: - Smaller image (~30 MB less; 2024 baseline was ~120 MB) - One PHP binary, no $PATH ambiguity - Cleaner story for any follow-up that touches PHP config
ca-certificates-bundle (which provides /etc/ssl/certs/ca-certificates.crt) is already pulled in transitively by apache2 / php-apache2 on alpine:3.23, so live HTTPS calls from PHP work today (verified with file_get_contents against ipinfo.io). But the master image (FROM php:8-alpine) installs the full ca-certificates package explicitly, and operators with IPINFO_APIKEY configured rely on outbound HTTPS. Make the dependency explicit to: * Match master's package set rather than relying on a transitive pull that some future apk dep change could drop. * Document the runtime TLS requirement at the Dockerfile level instead of leaving it implicit. ~50 KB image-size cost; the umbrella ca-certificates package adds the update-ca-certificates CLI on top of the bundle. Per Qodo's review on PR #800.
Review Summary by QodoAdd internet stability test with real-time charting and metrics
WalkthroughsDescription• Add comprehensive internet stability test feature with real-time ping monitoring • Implement canvas-based chart visualization with configurable alert thresholds • Support local server and external ping targets (Google, Cloudflare, Apple) • Include stability metrics: current/average/min/max ping, jitter, packet loss, and rating • Add CSV export functionality and Docker integration for stability test page Diagramflowchart LR
A["User Interface<br/>stability.html"] -->|"Worker Messages"| B["Web Worker<br/>stability_worker.js"]
B -->|"Ping Requests"| C["Local Server<br/>or External Target"]
C -->|"Response Times"| B
B -->|"Status Updates"| A
A -->|"Render Chart"| D["Canvas Chart<br/>Real-time Visualization"]
A -->|"Export"| E["CSV Download"]
F["Navigation Links<br/>index-classic.html<br/>index-modern.html"] -->|"Link to"| A
File Changes1. stability_worker.js
|
Code Review by Qodo
1.
|
|
#766 was the base for this |
Drop FROM php:8-alpine in favor of FROM alpine:3.23 (~55% smaller image)
Sort the server dropdown by country first, then by city within the same country. This makes it easier to find servers in a specific country when the list is long. Applies to both modern and classic UIs.
Address code review findings: - Sort a shallow copy instead of mutating the caller's array - Add null guard on server.name to handle malformed entries - Use original SPEEDTEST_SERVERS index for classic UI option values
Parse server names more robustly for sorting: - "City, Country, Provider" → use second part as country - "City, Country (1) (Hetzner)" → strip parentheticals from country - "Frankfurt, Germany (FRA01)" → country is "Germany" not "Germany (FRA01)"
Build an array of {idx, server} pairs before sorting so the original
SPEEDTEST_SERVERS index is carried through, eliminating the per-option
indexOf call.
Add a prolonged ping-based stability test with real-time canvas chart, stats (avg/min/max/jitter/packet loss), stability rating, external ping targets, CSV export, and Docker support. Link from main page to stability test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Load server list dynamically from servers.json for Docker frontend/dual modes - Copy servers.json to web root in entrypoint.sh for frontend/dual modes - Change back link from href="/" to href="./" for subdirectory installs - Use binary search for visible chart data range (O(log n) vs O(n)) - Add 200ms minimum interval between pings to limit sample rate Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eedtest into internet-stability
add internet stability test