mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 19:08:58 +00:00
a2b8f2361e
### Purpose Avoid the issue where the folder marker is deleted by overzealous cleanup tools because it's just a useless, empty directory. We create a small file containing a an admonishment to not delete the directory, and some metadata that is just for human consumption at the moment. (But it would parse as a valid yaml file if we wanted to read this, at some point.) This will only apply when _creating_ a folder marker, that is, existing setups will not gain the file automatically. Obviously, when using a custom folder marker none of this applies. Also, slightly adjust the permission bits for the folder marker directory and file on Unixes, making sure the group & write bits are unset. ### Testing I've created and deleted a few folders and it appears to behave as I expect. ### Screenshots ``` jb@ok:~/somefolder % ls -la total 0 drwxr-xr-x 3 jb staff 96 May 1 08:52 ./ drwx------ 12 jb staff 384 May 1 08:52 ../ drwxr-xr-x 3 jb staff 96 May 1 08:52 .stfolder/ jb@ok:~/somefolder % ls -l .stfolder total 8 -rw-r--r-- 1 jb staff 122 May 1 08:52 syncthing-folder-39a4b0.txt jb@ok:~/somefolder % cat .stfolder/syncthing-folder-39a4b0.txt # This directory is a Syncthing folder marker. # Do not delete. folderID: xtdca-cudyf created: 2024-05-01T08:52:49+02:00 ``` |
||
---|---|---|
.. | ||
mocks | ||
testdata | ||
authmode.go | ||
authmode.pb.go | ||
blockpullorder.go | ||
blockpullorder.pb.go | ||
commit_test.go | ||
config_test.go | ||
config.go | ||
config.pb.go | ||
debug.go | ||
deviceconfiguration.go | ||
deviceconfiguration.pb.go | ||
folderconfiguration.go | ||
folderconfiguration.pb.go | ||
foldertype.go | ||
foldertype.pb.go | ||
guiconfiguration.go | ||
guiconfiguration.pb.go | ||
ldapconfiguration.go | ||
ldapconfiguration.pb.go | ||
ldaptransport.go | ||
ldaptransport.pb.go | ||
migrations_test.go | ||
migrations.go | ||
observed.pb.go | ||
optionsconfiguration.go | ||
optionsconfiguration.pb.go | ||
pullorder.go | ||
pullorder.pb.go | ||
size_test.go | ||
size.go | ||
size.pb.go | ||
tuning_test.go | ||
tuning.go | ||
tuning.pb.go | ||
versioningconfiguration.go | ||
versioningconfiguration.pb.go | ||
wrapper.go |