The latest nextcloud server versions will have ransomware detection automatically
enabled, meaning that syncing common developer file types (e.g. .lock) will return errors.
Fatal webdav OCA\DAV\Connector\Sabre\Exception\Forbidden: Ransomware file detected. Prevented upload of ..py/bokeh/secrets.tar.enc because it matches extension pattern ".enc"
If you are syncing complex, nested work directories as a developer, the following list can be used, as a starting point, to exclude certain common file types and folders.
Examples:
.git/: folder will not be synced (but the latest files checked out, will)node_modules/: (JS) will not be synced, preventing syncing of a massive quantity of unnecessary dependenciescython_debug/: C-Extensions for Python debug directories_site/: Commonly used for building static sites and serving temporary files (mkdocs serve,hugo serve)
Some files indeed are synced:
.envfiles, since I do not version these in git
The motivation behind this approach is that Nextcloud should not be used as a backup
solution, but for syncing working files. For instance, if you want to continue
working at home on selected files (*.md, *.odt), this will be possible. For checking
out the latest git repositories, or dependencies,
use the native approach (e.g. git pull for repositories, npm install for node_modules/).
If you then want to re-initiatlize your git folder in your existing Nextcloud sync, on another computer, you need to be aware that some files not excluded in your Nextcloud will indeed be synced. Use this command to re-init a git folder where files already exist:
git clone https://myrepo.com/git.git temp" \
&& echo "mv temp/.git code/.git" \
&& echo "rm -rf temp"
&& echo "cd code"
&& echo "git restore .Note: The file list is not exhaustive, please comment or update.
Clone this gist:
git clone [email protected]:280afdb2f994fae6e5f6b183888f659d.git
mv 280afdb2f994fae6e5f6b183888f659d nextcloud_ignore_gist
cd nextcloud_ignore_gist
Copy sync-exclude.lst file to:
%AppData%/Nextcloud/sync-exclude.lst
Thank you this is perfect 💯