Add syncthing service

This commit is contained in:
Thomas Dehaeze 2022-02-06 21:48:51 +01:00
parent a73e30d9cd
commit d27cb83bb3

View File

@ -347,3 +347,54 @@ Unit=trash-empty
[Install] [Install]
WantedBy=timers.target WantedBy=timers.target
#+end_src #+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