Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Syncthing Relay Server widget #230

Merged
merged 4 commits into from Sep 21, 2022

Conversation

DevPGSV
Copy link
Contributor

@DevPGSV DevPGSV commented Sep 20, 2022

  • Added Syncthing Relay Server widget

Screenshot_20220920_044309

@JazzFisch
Copy link
Collaborator

Is genericProxyHandler the correct proxy to use? According to https://docs.syncthing.net/dev/rest.html, this API is secured via the X-API-Key header. Would credentialedProxyHandler not be a better choice?

@DevPGSV
Copy link
Contributor Author

DevPGSV commented Sep 20, 2022

That link points to the Syncthing client documentation.
The service used here is the Syncthing Relay Server:

https://docs.syncthing.net/users/strelaysrv.html

The request is done to the address defined in:
--status-srv
That address only offers one endpoint: /status
That endpoint is public,it doesn't require authorization.
That endpoint is the one used by the following service:
https://relays.syncthing.net/

@benphelps
Copy link
Member

I need an example widget entry, along with any details a user might need to know to get the widget hooked up, for the Wiki.

After that, I'll merge this in.

@benphelps
Copy link
Member

I would suggest changing the last two stats to be just "Relayed" and "Rate", but I can do that after the merge, either way.

We try to keep them single words, since the translation is often much longer, but still needs to fit.

@DevPGSV
Copy link
Contributor Author

DevPGSV commented Sep 21, 2022

The service configuration I am using:

    - Syncthing Relay Server:
        description: Syncthing Relay Server
        icon: syncthing
        server: [redacted]
        container: [redacted]
        widget:
            type: strelaysrv
            url: http://syncthing.librelabucm.org:22070

The command documentation is here: https://docs.syncthing.net/users/strelaysrv.html

We are currently running that Syncthing Relay Server by using: https://hub.docker.com/r/syncthing/relaysrv

Docker or not, the the flag "-status-srv=" defines the address for status endpoint with statistics. By default its value is :22070.
When run on a docker-compose, the flag can be set by using a custom entrypoint:

services:
  strelaysrv:
    image: syncthing/relaysrv:latest
    network_mode: "host"
    entrypoint: ["/bin/entrypoint.sh", "/bin/strelaysrv", "-listen=0.0.0.0:22067", "-ext-address=syncthing.librelabucm.org:22067", "-status-srv=syncthing.librelabucm.org:22070"]
   volumes:
      - ./volumes/strelaysrv:/var/strelaysrv
   ports:
      - 22067:22067
      - 22070:22070

The site https://relays.syncthing.net/ periodically queries the endpoint of known Syncthing Relay Servers to display the statistics.
To test the widget with other servers, choose any other server in the list of https://relays.syncthing.net/ , and set widget.url to the Address of the service. The port (usually :22067) displayed there is the port where the service runs. It has to be changed to :22070, the port where the statistics are available. In that port the statistics are shown at the endpoint /status.

For example, choosing from the list: 195.201.44.21:22067, we would have to set widget.url to http://195.201.44.21:22070.
With that, the widget will query: http://195.201.44.21:22070/status

@benphelps benphelps merged commit 1dff880 into gethomepage:main Sep 21, 2022
Copy link
Contributor

github-actions bot commented Feb 6, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants