From d27cb83bb30da2f4fceddffe3f4ffcb93cf5f812 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Sun, 6 Feb 2022 21:48:51 +0100 Subject: [PATCH] Add syncthing service --- systemd.org | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/systemd.org b/systemd.org index 9005e09..c0853c0 100644 --- a/systemd.org +++ b/systemd.org @@ -347,3 +347,54 @@ Unit=trash-empty [Install] WantedBy=timers.target #+end_src +* =syncthing= +** Service +:PROPERTIES: +:header-args: :tangle ~/.config/systemd/user/syncthing.service +:header-args+: :comments both :mkdirp yes +:END: +#+begin_src conf +[Unit] +Description=Syncthing - Open Source Continuous File Synchronization for %I +Documentation=man:syncthing(1) +After=network.target + +[Service] +Environment="all_proxy=socks5://localhost:8080" +ExecStart=/usr/bin/syncthing -no-browser -gui-address="0.0.0.0:8384" -no-restart -logflags=0 +Restart=on-failure +SuccessExitStatus=3 4 +RestartForceExitStatus=3 4 + +[Install] +WantedBy=default.target +#+end_src + +* =homelab-tunnel= - SSH Tunnel +Useful to bypass firewalls. +This can we used on the browser: +- for =qutebrowser=, use =:set content.proxy socks5://localhost:8080= (can setup a shortcut for that) + +This is also used for Syncthing. + +** Service +:PROPERTIES: +:header-args: :tangle ~/.config/systemd/user/homelab-tunnel.service +:header-args+: :comments both :mkdirp yes +:END: + +#+begin_src conf +[Unit] +Description=Setup a secure tunnel with homelab +After=network.target + +[Service] +ExecStart=/usr/bin/ssh -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -D 8080 -q -N -T homelab + +# Restart every >2 seconds to avoid StartLimitInterval failure +RestartSec=5 +Restart=always + +[Install] +WantedBy=default.target +#+end_src