St+Tailscale+Tasker(Android)?

The run conditions look useful, but a bit crude. While I appreciate the ability to run ST (Android) when logged into a given Wifi network, I would also like to be able to sync in certain other conditions.

WOuld it be possible to maybe

  • detect when tailscale is connected (and then run syncthing)
  • detect when a TS is connected and a connected device is reachable via it?

COuld this be done vis Tasked (with a set of intents that Tasker csna use to start,enable,pause, stop ST fully or enable/disable certain devices etc?)

Alterntively, is there maybe a widget or easy/simple way to toggle ST when one needs it (and then to ignore the run conditions)?

Is the end goal to try to conserve battery power and/or to ensure that Syncthing uses only the tailnet?

The goal is to sync on the local LAN if I’m at home, but to also be able to use the Tailnet if I’, outside and my Android is connected to the Tailnet, but not to bother (and thus save battery) when it is not

Also: does ST handle clients having mode than one address (one LAN IP, and one for the Tailnet)?

s/mode/more/. sigh.

It would be nice to determine a sequence of addresses to check in order (and which to check und er which conditions) so, if I am home (a=nd connected to one of my Wifi networks, and Tailscale is still ‘on’):

  • if connected to Wifi Home 12: use addresses n 192.168.0.0/24, 172.16.0.0/12
  • if connected to Home-Wifi-2 : use addresses 192.168.0.0/24 only
  • if connected to Tailscale (ie Tailscale is ON): use addresses in xxx.xxx…0.0/16. or such?

While on your home LAN, Syncthing’s local discovery broadcasts will find and connect using your private IP addresses (assuming your host and/or router firewalls allow it).

While away from home, if you aren’t port forwarding your home device(s) for direct connections from the internet, and your tailnet is configured to allow access on port 22000, your Android phone should automatically find your home device at its static CGNAT address (100.x.x.x) assigned by Tailscale because local discovery won’t result in a connection via a private IP address (e.g. 192.168.x.x) and your home device(s) will have provided their tailnet addresses to the Syncthing discovery servers.

When your Android device is disconnected from your tailnet, Syncthing might end up using a Syncthing relay server. If you only want it to use the tailnet or home LAN, easiest solution is to disable relaying. Then Syncthing will just periodically check for a link similar to how the Wi-Fi run conditions work.

Yes, by default Syncthing dynamically binds to all available network interfaces.

For more details: https://docs.syncthing.net/users/config#listen-addresses

The allowedNetworks setting provides additional granularity.

As far as I’m aware of neither the official Syncthing Android app (which is no longer receiving any feature upgrades) or Syncthing-Fork specifically offer that level of granularity in their respective UIs, but the default Syncthing settings, disabling relaying, and perhaps combining it with the allowedNetworks and listenAddress settings results in the connection behavior you described.