Syncthing: Установка и настройка

Syncthing: Установка и настройка

Инструкция по установке и первичной настройке #Syncthing.

Репозиторий

  • Скачать и установить ключ репозитория:
1
 curl -fsSLo '/etc/apt/keyrings/syncthing.gpg' 'https://syncthing.net/release-key.gpg'
  • Создать файл репозитория /etc/apt/sources.list.d/syncthing.sources:
1
 echo -e "X-Repolib-Name: Syncthing\nEnabled: yes\nTypes: deb\nURIs: https://apt.syncthing.net\nSuites: syncthing\nComponents: stable\nArchitectures: $( dpkg --print-architecture )\nSigned-By: /etc/apt/keyrings/syncthing.gpg\n" | tee '/etc/apt/sources.list.d/syncthing.sources' > '/dev/null'
  • Скачать файл предпочтений syncthing.pref:
1
 f=('syncthing'); d='/etc/apt/preferences.d'; p='https://lib.onl/ru/2025/02/261ad6ab-a4a5-57f9-aae2-da4d1095e6fc'; for i in "${f[@]}"; do curl -fsSLo "${d}/${i}.pref" "${p}/${i}.pref"; done

Установка

  • Установить пакеты:
1
 apt update && apt install --yes syncthing

Настройка

  • Скачать юнит для запуска #Syncthing под обычным пользователем:
1
 f=('syncthing@'); d='/etc/systemd/system'; p='https://lib.onl/ru/2025/02/261ad6ab-a4a5-57f9-aae2-da4d1095e6fc'; for i in "${f[@]}"; do curl -fsSLo "${d}/${i}.service" "${p}/${i}.service"; done
  • Запустить сервис #Syncthing под пользователем USER:
1
systemctl enable --now syncthing@USER.service