Hacker News new | ask | show | jobs
by creativeembassy 1794 days ago
I love Syncthing. I've found some unconventional uses for it in syncing program settings. My fonts folder is now synced between my Mac, Windows and Linux computers and that works surprisingly well. My projects folder does a one-way archive (like rsync) for backup to my home NAS and an offsite VPS. I have a Streamdeck that I use between my Mac and Windows work machines, and I sync the settings on that so it operates the same way regardless of which machine I plug it into. I love it.
2 comments

One of my unconventional uses is to sync my HomeAssistant configuration to my desktop, where I have it in a git repository. I can edit manually from my desktop, and/or manage from the HomeAssistant UI, and either way, commit discrete, working changes to git once I'm ready.
Interesting.

I’ve gone through so many iterations of trying to work out how to do something like this for Home Assistant config.

Do you set it up as realtime 2-way sync? And do you just exclude the .git folder from the sync to HA?

Yes exactly that, plus it ignores .log, .db and core.restore_state.

I should note I specifically use this for doing source control of configuration and making it easy to manually edit -- I have an entirely separate process for backups of the server itself.

Like you, I've also gone through several iterations but this has been working for me for almost a year now.

Cool, thanks for elaborating. I may give this approach another try.

That said, I’m making far fewer YAML changes these days than I used to. I’m doing almost everything via their UI so maybe I need to consider how much I actually need source control now vs just having solid backups.

Originally I was against their move from YAML config to the more user friendly GUI approach but I have to admit it’s a lot easier to make quick on-the-fly changes to my automations these days. I’m begrudgingly coming around to the idea of not firing up VS Code every time I want to tweak something!

This. I'd like to sync my ~/development directory, including all the git directories, so I don't need to push and pull branches between machines. Is this at all feasible?
It works fine. I've been doing it for ages with no problems. Note that I added node_modules, etc. to the ignore file so that it's not always syncing thousands of tiny files, which always tend to take a long time for some reason.
Out of interest, what OS are you using? I'm wondering if some of the issues I've had in the past may have been macOS specific.

That said, I can't recall if I tried excluding node_modules when I last gave this a go. Maybe I'll try it again.

Yeah been trying to work that one out for years.

I've read of other HN'ers doing this successfully (syncing git repos between machines) but I just seem to get a lot of issues - git repos often broken temporarily, conflicts etc.

Don't know how Syncthing works, of it it would even work, but what if Syncthing would detect that it recurses into a .git folder, and then use git push to push all refs to the remote .git repo? That should give a transparent "sync" of the entire git repo and workdir for the user, but via the safety of git's own sync mechanism.
My NAS does btrfs snapshotting of the Synchthing folder. So I have an up-to-date backup of my phone pictures, laptop files and can go back in time if I accidentally delete something.