librespeed / speedtest

Self-hosted Speed Test for HTML5 and more. Easy setup, examples, configurable, mobile friendly. Supports PHP, Node, Multiple servers, and more
https://librespeed.org
GNU Lesser General Public License v3.0
12.29k stars 2.21k forks source link

Standalone mode does not support multiple servers #567

Closed erlisdhima closed 9 months ago

erlisdhima commented 1 year ago

Hi,

It seems like servers.json is not being used by index.php in standalone mode. Was this done on purpose? Based on the documentation standalone includes both frontend and backend (files are included both in the server).

I'm trying to specify two servers, one remote and one local (the speedtest instance itself).

Ideally we would have a check if servers.json exists and if so, use that file, otherwise fallback to local testing.

Let me know if this makes sense.

Thanks in advance!

adolfintel commented 1 year ago

Yeah, standalone mode is made for ease of installation so it doesn't support multiple servers, but there's nothing stopping you from creating 2 docker containers on the same machine, a backend and a frontend.

erlisdhima commented 1 year ago

I was trying to not create extra containers. Is it possible you may consider doing this change in the future?

adolfintel commented 1 year ago

It's unlikely to happen in the near future, I started working full time a couple years ago and all my projects have been pretty much on hold since because I'm too busy.

erlisdhima commented 1 year ago

Are you still accepting PRs? I can try to work on it.

adolfintel commented 1 year ago

Sure, go ahead, I'd put it behind an environment variable that's disabled by default, that way it doesn't impact existing users.

erlisdhima commented 1 year ago

Great! I'll try your suggestion. Will update this issue when I have something ready.

Thanks for coming back so quickly! :)

sstidl commented 1 year ago

I think #540 contains what @erlisdhima wants