run syncthing web UI on port 444

This commit is contained in:
Pim Kunis 2023-05-04 13:04:57 +02:00
parent ed6723e1da
commit da6a26d4fd
3 changed files with 25 additions and 4 deletions

View file

@ -231,6 +231,8 @@
<address>0.0.0.0:8384</address> <address>0.0.0.0:8384</address>
<apikey>{{ api_key }}</apikey> <apikey>{{ api_key }}</apikey>
<theme>light</theme> <theme>light</theme>
<user>pim</user>
<password>$2a$10$m3yFFV47/kiCTz0SILEZHOTTLGKX3rkh0Ig4ciqqMPWNPj4gI6gT2</password>
</gui> </gui>
<ldap></ldap> <ldap></ldap>
<options> <options>

View file

@ -1,6 +1,10 @@
# vi: ft=yaml # vi: ft=yaml
version: "3" version: "3"
networks:
traefik:
external: true
configs: configs:
config: config:
file: /srv/syncthing/config.xml file: /srv/syncthing/config.xml
@ -12,13 +16,21 @@ configs:
services: services:
syncthing: syncthing:
image: lscr.io/linuxserver/syncthing:latest image: lscr.io/linuxserver/syncthing:latest
networks:
- traefik
deploy: deploy:
placement: placement:
constraints: constraints:
- "node.labels.syncthing == true" - "node.labels.syncthing == true"
labels: labels:
- traefik.enable=false - traefik.enable=true
- com.centurylinklabs.watchtower.enable=false - traefik.http.routers.syncthing.entrypoints=localsecure
- traefik.http.routers.syncthing.rule=Host(`syncthing.pim.kunis.nl`)
- traefik.http.routers.syncthing.service=syncthing
- traefik.http.routers.syncthing.tls=true
- traefik.http.routers.syncthing.tls.certresolver=letsencrypt
- traefik.docker.network=treafik
- traefik.http.services.syncthing.loadbalancer.server.port=8384
environment: environment:
- PUID=1000 - PUID=1000
- PGID=1000 - PGID=1000
@ -27,8 +39,6 @@ services:
- type: bind - type: bind
source: /mnt/data/syncthing source: /mnt/data/syncthing
target: /data target: /data
ports:
- 8384:8384
configs: configs:
- source: config - source: config
target: /config/config.xml target: /config/config.xml

View file

@ -7,22 +7,31 @@
template: template:
src: "{{ role_path }}/config.xml.j2" src: "{{ role_path }}/config.xml.j2"
dest: /srv/syncthing/config.xml dest: /srv/syncthing/config.xml
register: config
- name: Copy private key - name: Copy private key
copy: copy:
src: "{{ role_path }}/key.pem" src: "{{ role_path }}/key.pem"
dest: /srv/syncthing/key.pem dest: /srv/syncthing/key.pem
register: privkey
- name: Copy certificate - name: Copy certificate
copy: copy:
src: "{{ role_path }}/cert.pem" src: "{{ role_path }}/cert.pem"
dest: /srv/syncthing/cert.pem dest: /srv/syncthing/cert.pem
register: cert
- name: Copy Docker stack file - name: Copy Docker stack file
template: template:
src: "{{ role_path }}/docker-stack.yml.j2" src: "{{ role_path }}/docker-stack.yml.j2"
dest: /srv/syncthing/docker-stack.yml dest: /srv/syncthing/docker-stack.yml
- name: Remove docker stack
docker_stack:
name: syncthing
state: absent
when: config.changed or privkey.changed or cert.changed
- name: Deploy Docker stack - name: Deploy Docker stack
docker_stack: docker_stack:
name: syncthing name: syncthing