Skip to content

Server list from remote self hosted frontend #110

@mateuszdrab

Description

@mateuszdrab

Hi guys

I've setup a Librespeed frontend with a few backends, configured in the /servers.json file on the frontend server

The frontend is accessed via it's fqdn and works fine, tests are successful against the backend.

When attempting to run librespeed-cli --server-json http://speedtest.redacted/, the command fails with

Retrieving server list from http://speedtest.redacted/
Retry with /.well-known/librespeed
Error when fetching server list: invalid character '<' looking for beginning of value
Terminated due to error

I can see in the reverse proxy logs that both requests to / and /.well-known/librespeed are made, first one returns the frontend html, second one fails as the frontend is not configured to serve this path.

It looks like I am expected to host a copy of the servers.json file somewhere for the CLI to use - this is very illogical as the frontend accesses this same list as well; however, it seems to be rendered in the backend in php and provided in the HTML as a variable.

It would have been more practical to serve the list of servers at /.well-known/librespeed, which would be then accessed by both frontend via an ajax call and cli.

Am I misunderstanding/missing something?

I was experimenting with the idea of copying the servers.json from /servers.json to /var/www/html/servers.json by executing the command upon startup of the frontend pod before executing the /entrypoint.sh but it seems that the entrypoint wipes /var/www/html/ during start-up, rendering this workaround a no-go.

The CLI requests the list from https://librespeed.org/backend-servers/servers.php if not provided, the same file servers.php does not exist in librespeed, if it did, it could provide the JSON list; however, the CLI code would still have to be updated to look up /servers.php followed by /.well-known/librespeed if server-json is specified and does not contain a forward slash, if it does, the entire user provided value should be used to allow users to provide a full path to the file.

If those changes were made to librespeed source and propagated to librespeed.org, the default value for serverListUrl in the CLI could be set to simply https://librespeed.org, and the probing would automatically query https://librespeed.org/servers.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions