Giter Club home page Giter Club logo

docker-syncthing-relay's Introduction

Syncthing Relay Docker Image

Build Status Docker Stars Docker Pulls ImageLayers

Overview

Syncthing Relay to help Syncthing clients relay data when they can't communicate directly due to things like NAT routers and firewalls blocking inbound TCP connections.

More detailed description on my blog.

Extensively tested on Digital Ocean $5/mo node

Upstream Links

Quick Start

Just run:

docker run --rm -p 22067:22067 -p 22070:22070 kylemanna/syncthing-relay

Verify your server shows up at http://relays.syncthing.net/

Or private relay:

docker run --rm -p 22067:22067 -p 22070:22070 kylemanna/syncthing-relay -pools=""

Private relays and persistent keys

When using the commands above, docker will remove the old container once it's no longer running. This is fine for public relays where the key does not matter, but becomes impractical for private relays where the URL must contain the key signature.

For those using private relays, it may be a good idea to use persistent storage for the certificate. To that effect, the first step is to create a volume with the command below (only needs to be done once):

docker volume create syncthing-relay

Then run the container mapping the /relaysrv directory into the volume:

docker run -p 22067:22067 -p 22070:22070 --mount source=syncthing-relay,target=/relaysrv -d kylemanna/syncthing-relay -pools=""

Automatically restarting the container on reboot

To automatically restart the container after a host reboot, replace the --rm option in any of the docker invocations above with --restart=always. This is a simple solution for those who want to have a relay server that survives host restarts but prefer not to deal with systemd.

Using Systemd to Auto Start the Docker Container

Here's the quick start guide for setting up a systemd service that will listen on the defualt ports and start at boot time. It will also attempt to pull down image updates each time the service starts and automatically restart after 10 seconds if the process exits. This Docker container preserves no state across starts.

cd /etc/systemd/system
sudo curl -O https://raw.githubusercontent.com/kylemanna/docker-syncthing-relay/master/init/docker-syncthing-relay.service
sudo systemctl daemon-reload
sudo systemctl enable --now docker-syncthing-relay.service
sudo systemctl status docker-syncthing-relay.service

docker-syncthing-relay's People

Contributors

askielboe avatar devplayer0 avatar kylemanna avatar logocomune avatar marcopaganini avatar svandragt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-syncthing-relay's Issues

ENTRYPOINT vs CMD

(not entirely sure about the equivalence, hence an issue instead of a PR)

I'm using your container from docker compose, where it is convenient to be able to pass additional arguments using the command option. If the container would specify /usr/bin/strelaysrv as the ENTRYPOINT, instead of the CMD, we wouldn't need to repeat the path to the binary in the command option.

For example, https://github.com/v2tec/watchtower, where you can just have command: --interval 30 because the path to the binary is configured in the Dockerfile as ENTRYPOINT ["/watchtower"].

Automated PRs?

Would it be a good idea to automate the SyncThing Relay Server version once a week or something?

It should be possible to write a script that:

  • Retrieves the RSS feed at https://build.syncthing.net/job/strelaysrv/rssAll
  • Extract the build number from the entry title and somehow check the build was successful (?)
  • Scrape the Jenkins build page for the full version number
  • Create a PR with the updated Dockerfile

This docker container is the only auto updating SyncThing Relay Server solution I'm aware of, and that worries me in case there ever are security fixes that need to be rolled out.

Global Rate Limit

Hello is there a way to set the global rate limit (strelaysrv 's [-global-rate=<bytes/s>]) when setting up the systemd server?

I am happy to contribute a relay but I received note from my host I went through 1600GB of traffic in the span of a few weeks, which means I had to stop the service until my next billing period :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.