Skip to content

LNVPS/speedtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

LNVPS Speedtest

Custom, LNVPS-themed front-end and deployment config for the LibreSpeed Rust backend (librespeed-rs), running at https://speedtest.lnvps.net.

This repo exists so the themed index.html and server changes aren't lost.

What's here

assets/index.html        LNVPS-themed speedtest page (drop-in for LibreSpeed)
deploy/
  configs.toml.example   librespeed-rs config (native TLS on :443)
  systemd/…/override.conf systemd socket drop-in — listen on 443 instead of 8080
  letsencrypt/…/restart-speedtest.sh  certbot deploy hook (reload after renewal)

The front-end (assets/index.html)

A single self-contained page styled to match lnvps.net:

  • Pure-black background, Source Code Pro monospace, LNVPS green (oklch(0.8 0.3 142)) + cyan (#00fff2) accents, thin green rules.
  • Redrawn gauges (green download / cyan upload) and a live throughput sparkline plotting both series over the duration of the test.
  • Full SEO/social tagging: title, description, canonical, robots, Open Graph, Twitter Card, and JSON-LD (WebApplication) structured data.
  • Accessibility floor: responsive to mobile, visible keyboard focus, prefers-reduced-motion respected.

It relies on the LibreSpeed assets shipped with librespeed-rs (speedtest.js, servers_list.js, favicon.ico) being present in the same directory — only index.html is customised.

Deployment (Debian)

The server runs the official librespeed-rs .deb. Assets live in /var/lib/librespeed-rs/.

1. Install the backend

wget https://github.com/librespeed/speedtest-rust/releases/download/v1.4.0/librespeed-rs-x86_64-unknown-linux-gnu.deb
sudo dpkg -i librespeed-rs-x86_64-unknown-linux-gnu.deb

2. Deploy the themed page

sudo cp assets/index.html /var/lib/librespeed-rs/assets/index.html

3. HTTPS via Let's Encrypt (native TLS, no reverse proxy)

librespeed-rs terminates TLS itself, so there's no proxy hop to skew measurements. It uses systemd socket activation, so the listening port is set on the socket, not just in the config.

# certificate (port 80 free for the HTTP-01 challenge)
sudo certbot certonly --standalone -d speedtest.lnvps.net \
  --agree-tos --register-unsafely-without-email

# config: enable TLS + point at the cert (see deploy/configs.toml.example)
sudo cp deploy/configs.toml.example /var/lib/librespeed-rs/configs.toml

# make the socket listen on 443 instead of 8080
sudo mkdir -p /etc/systemd/system/speedtest_rs.socket.d
sudo cp deploy/systemd/speedtest_rs.socket.d/override.conf \
        /etc/systemd/system/speedtest_rs.socket.d/override.conf

# reload cert automatically on renewal
sudo cp deploy/letsencrypt/renewal-hooks/deploy/restart-speedtest.sh \
        /etc/letsencrypt/renewal-hooks/deploy/restart-speedtest.sh
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/restart-speedtest.sh

sudo systemctl daemon-reload
sudo systemctl enable --now speedtest_rs.socket
sudo systemctl restart speedtest_rs.service

Verify:

curl -sI https://speedtest.lnvps.net/ | head -1     # HTTP/1.1 200 OK

Notes

  • Static file serving is limited. librespeed-rs only serves files with .js, .html, .ico, .css extensions (res_200_fs in its source); any other path 404s. That's why robots.txt / sitemap.xml can't be hosted here — the in-page <meta name="robots"> covers indexing instead.
  • The service unit is named speedtest_rs (not librespeed-rs) since v1.4.0. Manage with systemctl {status,restart,stop} speedtest_rs.
  • Certbot's timer auto-renews; the deploy hook restarts the service so it picks up the new certificate.

License

Front-end derived from LibreSpeed (LGPL-3.0). Theming and deployment config © LNVPS.

About

LNVPS-themed LibreSpeed speedtest front-end + deployment config for speedtest.lnvps.net

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors