docker-apps/syncthing/syncthing_jm.txt
2025-04-03 22:57:52 +02:00

82 lines
2.9 KiB
Plaintext

Create user and group
---------------------
Credentials -> Local Users -> Add
Full Name: syncthing
Username: syncthin
Disable Password: <select>
Email: stuurmcp@telkomsa.net
UID: (note)
Create New Primary Group: <unselect>
Primary Group: syncthin
Create Home Directory: <uncheck>
Samba Authentication: <uncheck>
Save
syncthin UID: 3054
syncthin GID: 3053
Add mapping for synched folder in docker config
-----------------------------------------------
In this example: the folder where synched data are stored is /mnt/stpool1/synched
On Truenas shell:
jlmkr edit docker
Add the following args to "systemd_nspawn_user_args":
--bind='/mnt/stpool1/synched:/mnt/synched'
set ACL permissions for media to be accessible by syncthing
-----------------------------------------------------------
As photos will be synched from home computer, we will provide permissions for synchting
On Truenas shell:
# read and note acl entries
getfacl /mnt/stpool1/NData1/Media
getfacl /mnt/stpool1/NData1/Media/Pictures
# set read and execute permissions for syncthin user on parent folder
setfacl -m u:syncthin:5 /mnt/stpool1/NData1/Media
# set full permissions for syncthin user on Pictures folder recursively
setfacl -R -m u:syncthin:7 /mnt/stpool1/NData1/Media/Pictures
# modify defaults recursively
setfacl -R -d -m u:syncthin:7 /mnt/stpool1/NData1/Media/Pictures
# NB! if you want to remove all acl entries from a folder recursively, use setfacl -b -R <foldername>
Change ownership of synched folder
----------------------------------
On Truenas shell:
Stop old/source syncthing
heavyscript app --stop syncthing
chown -R syncthin:syncthin /mnt/stpool1/synched
Create datasets
---------------
/mnt/SSD1/docker/data/syncthing
/mnt/SSD1/docker/data/syncthing/config
Set Owner:Group to syncthin:syncthin
Copy folder to docker stacks
----------------------------
In Windows cmd shell in syncthing folder, enter:
pscp -P 22 -r stacks/*.* root@192.168.2.2:/mnt/SSD1/docker/stacks/syncthing/
This should copy compose.yaml, .env and secrets to /mnt/SSD1/docker/stacks/syncthing
Migrating data from old syncthing (source) to newly installed one (target)
--------------------------------------------------------------------------
It is recommedend to start the new synchting from scratch, however if you absolutely must migrate, only copying the config file should be sufficient.
If still running, stop old/source syncthing
heavyscript app --stop syncthing
Stop new/target syncthing media server
On Dockge, select syncthing and click stop
Copy the source config to target folder:
cp -vp /mnt/stpool1/apps/syncthing/config/config.xml /mnt/SSD1/docker/data/syncthing/config
chown -R syncthin:syncthin /mnt/SSD1/docker/data/syncthing/config
If the mounts for the synched folders are he same as that of the old media server then we're done, if not:
Edit destination config.yml to update to the new paths of synched folders:
nano /mnt/SSD1/docker/data/syncthing/config/config.yml
Change the paths to folder mounts in new syncthing