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

feature request: Change default host for streaming services and torrent client #132

Open
3 tasks done
sin3point14 opened this issue Sep 17, 2024 · 0 comments
Open
3 tasks done
Labels
Milestone

Comments

@sin3point14
Copy link
Sponsor

Checklist

  • I checked that this feature has not been requested before
  • I checked that this feature is not in the "Not planned" list
  • This feature will benefit the majority of users

Problem Description / Use Case

I run seanime on a NAS. On this machine I lock the network down by binding services to vpn ip and use ufw to limit communication(as a secondary measure). In the code I observed

sin3point14@devm-manas-wsl:~/github/seanime/internal$ rgrep --exclude-dir=extension_repo -w 0.0.0.0
torrentstream/server.go:        // Default address is "0.0.0.0:43214"
torrentstream/repository_test.go:               StreamingServerHost: "0.0.0.0",
torrentstream/repository_test.go:       }, "0.0.0.0")
torrentstream/client.go:        if settings.StreamingServerHost == "0.0.0.0" {
torrentstream/repository.go:            s.StreamingServerHost = "0.0.0.0"
core/modules.go:                        StreamingServerHost:            "0.0.0.0",
core/config.go: if cfg.Server.Host == "" || cfg.Server.Host == "0.0.0.0" {

Also while running seanime i observed:

root@the-beast:/data/seanime# netstat -ntulp | grep seanime
tcp        0      0 0.0.0.0:43213           0.0.0.0:*               LISTEN      1584086/seanime
tcp        0      0 100.106.233.76:43211    0.0.0.0:*               LISTEN      1584086/seanime
udp        0      0 0.0.0.0:43213           0.0.0.0:*                           1584086/seanime

it binds a service to 0.0.0.0:43213, which by grepping the code I find is the TorrentClientPort.

Proposed Solution

My thoughts:

The services are probably unauthenticated so by default they should bind to 127.0.0.1 like the main web server.

I don't know enough about torrent protocols and eyeballing the code in internal/torrentstream/repository.go felt maybe there's some need to bind to 0.0.0.0. However, I'm running qbittorrent in docker as an unpriviliged user and it still works so maybe there is no need to bind to 0.0.0.0 here after all?

  • Maybe we can allow the user to change the host for the torrent client? An option can be provided in the Torrent client section like Streaming server section's Host field.
  • Or maybe we can bind the torrent client and streaming server to same host as server.host? It would be weird if the user wants to use use it on a different host as the main server's host, and if they want to change, they can do that in the settings page.
@sin3point14 sin3point14 added the feature request New feature or request label Sep 17, 2024
@5rahim 5rahim added this to the v2.2.0 milestone Sep 25, 2024
5rahim added a commit that referenced this issue Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Review
Development

No branches or pull requests

2 participants