|
|
Line 6: |
Line 6: |
| services.syncthing = { | | services.syncthing = { |
| enable = true; | | enable = true; |
| | openDefaultPorts = true; |
| settings.gui = { | | settings.gui = { |
| user = "myuser"; | | user = "myuser"; |
Line 66: |
Line 67: |
|
| |
|
| </syntaxhighlight> | | </syntaxhighlight> |
|
| |
| === Firewall ===
| |
| You will probably have to open a few ports in the firewall:
| |
| <syntaxHighlight lang="nix">
| |
| # 22000 TCP and/or UDP for sync traffic
| |
| # 21027/UDP for discovery
| |
| # source: https://docs.syncthing.net/users/firewall.html
| |
| networking.firewall.allowedTCPPorts = [ 22000 ];
| |
| networking.firewall.allowedUDPPorts = [ 22000 21027 ];
| |
| </syntaxHighlight>
| |
|
| |
| Syncthing uses port 22000 to facilitate discovery of nodes on the local area network. If this port is blocked by the firewall, nodes will have to go all the way to the announce servers, then use a bridge to tunnel through NAT. This is much slower than just sending data in a "node1 -> router -> node2" path.
| |
|
| |
|
| === Declarative node IDs === | | === Declarative node IDs === |