feat: replace Syncthing with Resilio Sync service deployment and configuration
Some checks failed
Ansible Lint Check / check-ansible (push) Failing after 16s
Nix Format Check / check-format (push) Successful in 58s
Python Lint Check / check-python (push) Failing after 14s

This commit is contained in:
2025-03-17 11:57:32 +01:00
parent b5447dc0ec
commit b63506f809
5 changed files with 44 additions and 57 deletions

View File

@@ -33,5 +33,5 @@
enabled: true enabled: true
- name: uptime-kuma - name: uptime-kuma
enabled: true enabled: true
- name: syncthing - name: resilio-sync
enabled: true enabled: true

View File

@@ -0,0 +1,15 @@
services:
resilio-sync:
image: lscr.io/linuxserver/resilio-sync:latest
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Amsterdam
volumes:
- {{ resilio_sync_data_dir }}/config:/config
- {{ resilio_sync_data_dir }}/downloads:/downloads
- {{ resilio_sync_data_dir }}/data:/sync
ports:
- 8888:8888
- 55555:55555
restart: unless-stopped

View File

@@ -0,0 +1,28 @@
---
- name: Deploy Resilio Sync service
block:
- name: Set Resilio Sync directories
ansible.builtin.set_fact:
resilio_sync_service_dir: "{{ ansible_env.HOME }}/services/resilio_sync"
resilio_sync_data_dir: "/mnt/object_storage/services/resilio_sync"
- name: Create Resilio Sync directory
ansible.builtin.file:
path: "{{ resilio_sync_service_dir }}"
state: directory
mode: "0755"
- name: Deploy Resilio Sync docker-compose.yml
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ resilio_sync_service_dir }}/docker-compose.yml"
mode: "0644"
register: resilio_sync_compose
- name: Stop Resilio Sync service
ansible.builtin.command: docker compose -f "{{ resilio_sync_service_dir }}/docker-compose.yml" down --remove-orphans
when: resilio_sync_compose.changed
- name: Start Resilio Sync service
ansible.builtin.command: docker compose -f "{{ resilio_sync_service_dir }}/docker-compose.yml" up -d
when: resilio_sync_compose.changed

View File

@@ -1,28 +0,0 @@
services:
syncthing:
image: syncthing/syncthing
environment:
- PUID=1000
- PGID=100
- TZ=Europe/Amsterdam
# Disable local discovery since server is not on local network
- STTRACE=
- STNODEFAULTFOLDER=true
- STNODEFAULTFOLDERROOT=true
- STNOUPGRADE=true
# Disable local discovery
- STGUIADDRESS=0.0.0.0:8384not on local network
- STLOCALANNOUNCEENABLED=false
- STGLOBALDISCOVERYENABLED=true
volumes:
- {{ syncthing_data_dir }}:/var/syncthing
ports:
- 8384:8384 # Web UI
- 22000:22000/tcp # TCP file transfers
- 22000:22000/udp # QUIC file transfers
restart: unless-stopped
healthcheck:
test: curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o --color=never OK || exit 1
interval: 1m
timeout: 10s
retries: 3

View File

@@ -1,28 +0,0 @@
---
- name: Deploy Syncthing service
block:
- name: Set Syncthing directories
ansible.builtin.set_fact:
syncthing_service_dir: "{{ ansible_env.HOME }}/services/syncthing"
syncthing_data_dir: "/mnt/object_storage/services/syncthing"
- name: Create Syncthing directory
ansible.builtin.file:
path: "{{ syncthing_service_dir }}"
state: directory
mode: "0755"
- name: Deploy Syncthing docker-compose.yml
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ syncthing_service_dir }}/docker-compose.yml"
mode: "0644"
register: syncthing_compose
- name: Stop Syncthing service
ansible.builtin.command: docker compose -f "{{ syncthing_service_dir }}/docker-compose.yml" down --remove-orphans
when: syncthing_compose.changed
- name: Start Syncthing service
ansible.builtin.command: docker compose -f "{{ syncthing_service_dir }}/docker-compose.yml" up -d
when: syncthing_compose.changed