Manual/ ansible install of syncthing that’s defintely running as I can acess the gui from an ssh tunnel, but not externally on a headless server.
Interestingly the GUI Actions>Settings>GUI shows the IP as 127.0.0.1:8384
Not sure if this should be 0.0.0.0:8384 as per the service.
Also:
The GUI address is overridden by startup options. Changes here will not take effect while the override is in place.
I’ve disabled ufw but no dice.
nmap is showing the port as open, netstat from the server is showing 8384 as listening
Side question: I’m tying ufw to IPs but please shout if there’s any other hardening suggestions other than https if it’s to be publically exposed without that.
Any suggestions on next steps in troubleshooting please?
systemctl status syncthing@name
● syncthing@name.service - Syncthing - Open Source Continuous File Synchronization for andy
Loaded: loaded (/etc/systemd/system/syncthing@.service; indirect; vendor preset: enabled)
Active: active (running) since Wed 2021-06-09 17:44:11 BST; 59min ago
Docs: man:syncthing(1)
Main PID: 46219 (syncthing)
Tasks: 21 (limit: 9830)
CGroup: /system.slice/system-syncthing.slice/syncthing@name.service
├─46219 /usr/bin/syncthing -no-browser -gui-address=0.0.0.0:8384 -no-restart -logflags=0
└─46228 /usr/bin/syncthing -no-browser -gui-address=0.0.0.0:8384 -no-restart -logflags=0
cat /etc/systemd/system/multi-user.target.wants/syncthing@name.service
# BEGIN ANSIBLE MANAGED BLOCK
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization for %I
Documentation=man:syncthing(1)
After=network.target
You don’t need to whitelist IPs if you enable HTTPS and pick a strong password.
0.0.0.0:8384 is the correct value if you want it publicly accessible. 127.0.01 would only allow access from the device itself e.g via a local browser or ssh port forwarding.
As your service starts syncthing with --gui-address="0.0.0.0:8384" this should work.
Is there any significance of the gui showing 127.0.0.1, rather than 0.0.0.0, or does it always show that?
I did follow those ufw steps but, possible more importantly (?) I’ve disabled it entirely for testing and here’s it then
$ sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N ufw-after-forward
-N ufw-after-input
-N ufw-after-logging-forward
-N ufw-after-logging-input
-N ufw-after-logging-output
-N ufw-after-output
-N ufw-before-forward
-N ufw-before-input
-N ufw-before-logging-forward
-N ufw-before-logging-input
-N ufw-before-logging-output
-N ufw-before-output
-N ufw-reject-forward
-N ufw-reject-input
-N ufw-reject-output
-N ufw-track-forward
-N ufw-track-input
-N ufw-track-output
-A INPUT -j ufw-before-logging-input
-A INPUT -j ufw-before-input
-A INPUT -j ufw-after-input
-A INPUT -j ufw-after-logging-input
-A INPUT -j ufw-reject-input
-A INPUT -j ufw-track-input
-A FORWARD -j ufw-before-logging-forward
-A FORWARD -j ufw-before-forward
-A FORWARD -j ufw-after-forward
-A FORWARD -j ufw-after-logging-forward
-A FORWARD -j ufw-reject-forward
-A FORWARD -j ufw-track-forward
-A OUTPUT -j ufw-before-logging-output
-A OUTPUT -j ufw-before-output
-A OUTPUT -j ufw-after-output
-A OUTPUT -j ufw-after-logging-output
-A OUTPUT -j ufw-reject-output
-A OUTPUT -j ufw-track-output
with it enabled again - I’m not posting the full tables here if that’s ok but shout if something is obviously missing and I’ll check but think this is what you’re looking for
Thanks, you may have missed this line in my original post?
I’ve disabled ufw but no dice. nmap is showing the port as open, netstat from the server is showing 8384 as listening
EDIT
Ah, sorry, I see what you’re saying now. Whether it’s on 0.0.0.0
Seems it’s not working on IPV4??
I think the ssh tunnels are confusing the below but maybe you’ll see something I can’t. Just about to head home and I’ll reboot it and see what it’s saying without those.
*Changing port
*Changing 0.0.0.0 to external IP
*running as root
*runnning manually from commmand line, rather than through systemd
*accessing by IP, rather than dns
and variations of all
The GUI address is overridden by startup options. Changes here will not take effect while the override is in place.
but it does seem to stay in the settings once I change it!
I feel I’m getting at least closer to that “Sorry, I’ve been an idiot message”, but I’m not quite there yet
I’ve found something else interesting, that in ~/.config/syncthing/config.xml…
It’s created with 127.0.0.1:8384 despite the service file asking for 0.0.0.0:8384
The change in gui IP you asked for also changes that config
That if I change the config.xml to 0.0.0.0:8384 before I start the service it starts on 0.0.0.0:8384. i.e. the config fiie is overriding the service file
That noone of those changes make it work
I’m 99% sure I am NOT templating that config out in my install ansible script but I’ll double check that