Install syncthing
- Reference
- For windows, just extract directly into the
Program Files folder
Arch
tar -xzf syncthing-linux-amd64-v2.0.13.tar.gz
Ubuntu
Reference
Windows
Fully Managed Window Install
Remote Access
-
Local host
http://127.0.0.1:8384
-
Access UI over ssh
ssh -L 9999:localhost:8384 staging
ssh -L 9998:localhost:8384 production
ssh -L 9997:localhost:8384 framework
ssh -L 9996:localhost:8484 work_tower_ubuntu
ssh -L 9995:localhost:8484 work_laptop_ubuntu
Add token from 1password to env file
ssh production
sudo mkdir -p /etc/strelaysrv
sudo tee /etc/strelaysrv/strelaysrv.env > /dev/null <<'EOF'
TOKEN=<token here>
EOF
Forward this port to production pi on router:
Unify
Site Manager -> Dream Machine Pro Max -> Network Tab -> Settings (bottom left) -> Overview -> Port Forwarding
# Relay Port
22067
Relay Server Reference
Run this from a DEV machine
./deploy.sh && ./deploy.sh -t production
Record the produced relay id
ssh production
journalctl --user -u strelaysrv
Manually Configure
- DO FOR EACH CLIENT (they must know about each other)
- Manually register each client to the private relay so they all can sync even if outside the home network
- Actions -> Settings -> Connections -> Sync Protocal Listening Address
quic://0.0.0.0:22000,tcp://0.0.0.0:22000,relay://frii.day:22067?id=<recorded id here>&token=<get token from 1password>
- Manually disable:
- Enable NAT traversal # Magic hard to troubleshoot, Grug do not like, host relay instead
- Global Discovery Servers # Why discover when you can just tell stuff where it lives, Public access? Relay, Private access? NAT discover. Done
- Manually set folder defaults to
~/deploy. actions -> settings -> general -> edit folder defaults. This ensures when you share wiki-data it ends up in the ~/deploy folder instead of being dropped in the home dir
- Manually setup GUI auth (creds are in 1password)
- Manually go into each UI and connect to one DEV MACHINE (should not automate, this is a security thing)
- Manually create folders on one DEV MACHINE (should not automate, this is a security thing)
- Use sharing tab in settings to allow other device to use folder
- FOR EACH CONNECTION SETTING ON EACH CLIENT
- FOR PIs Turn on introducer for ALL DEV MACHINE connections (add a device once and all nodes learn about the node and accept)
- FOR PIs Turn off auto-accept for ALL DEV MACHINE connections (if you have this on then you don't get to pick the folder location, which matters if the folder is not on default path)
- FOR FRAMEWORK Turn on introducer for GLASS BOX
- FOR FRAMEWORK Turn on auto-accept for GLASS BOX
- Run this from a DEV machine one more time to ensure any changes to ignore file propagate
./deploy.sh && ./deploy.sh -t production
- For wiki share both folders:
# wiki data
~/deploy/<environment>/wiki-data
# wiki attachments
/srv/www/<environment>/wiki/a
sudo chown -R piegarden:piegarden srv
- For NODES (you can set this on all nodes for all connections to keep things simple) that can leave the home lan (aka, framework, Gaming Laptop) you will need to explicitly set the device connection for each remote device:
Edit Remote Device -> Advanced -> Addresses:
dynamic, relay://frii.day:22067
- For wow folders make sure you add
Config.wtf to ignore patterns for all shared WTF folders. This file is per device since it changes graphics settings
- Set both the existing WTF and AddOns folders to WTF_bak and AddOns_bak in case you make a mistake
- Ensure files that have never been synced before get copied from WTF_bak and AddOns_bak. This will always include the
Config.wtf file since we exclude it from the sync.
Folders:
Label:
wiki
Id:
uqcfn-ywpmk
Path:
~/deploy/wiki-data
Networking Mental Model For syncthing
Remote Device → Addresses
-> How do I try to reach them?
Sync Protocol Listen Addresses
-> How can they try to reach me?
Put a Relay in the middle add to both fields and you have:
Sync Protocol Listen Addresses -> syncthing connects to the relay and waits for pairing
Remote Device → Addresses -> tell the relay you would like to use it as a connection (thus lets pair)
Troubleshooting
Unable to connect to relay
Restarting syncthing on Windows appears to fix this issue