Skip to content

Instantly share code, notes, and snippets.

@Sieboldianus
Last active January 26, 2024 14:49
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save Sieboldianus/280afdb2f994fae6e5f6b183888f659d to your computer and use it in GitHub Desktop.
Save Sieboldianus/280afdb2f994fae6e5f6b183888f659d to your computer and use it in GitHub Desktop.
An opinionated nextcloud ignore list for developers (sync-exclude.lst)

An opinionated nextcloud ignore list for developers (sync-exclude.lst)

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 dependencies
  • cython_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:

  • .env files, 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/).

Note: The file list is not exhaustive, please comment or update.

Setup

Clone this gist:

git clone git@gist.github.com:280afdb2f994fae6e5f6b183888f659d.git
mv 280afdb2f994fae6e5f6b183888f659d nextcloud_ignore_gist
cd nextcloud_ignore_gist

Copy sync-exclude.lst file to:

%AppData%/Nextcloud/sync-exclude.lst
*~
~$*
.~lock.*
~*.tmp
]*.~*
]Icon\r*
].DS_Store
].ds_store
*.textClipping
._*
]Thumbs.db
]photothumb.db
System Volume Information
.*.sw?
.*.*sw?
].TemporaryItems
].Trashes
].DocumentRevisions-V100
].Trash-*
.fseventd
.apdisk
.Spotlight-V100
.directory
*.part
*.filepart
*.crdownload
*.kate-swp
*.gnucash.tmp-*
.synkron.*
.sync.ffs_db
.symform
.symform-store
.fuse_hidden*
*.unison
.nfs*
My Saved Places.
\#*#
*.sb-*
*.dll
*.exe
.git/
.lock
*.bin
.bin
bin/
*.lock
node_modules/
.cache/
.vscode/
.pytest_cache/
.github/
.ipynb_checkpoints/
*.exe
*.dll
*.class
*.com
*.so
*.o
@*/
__pycache__/
.Python/
build/
dist/
eggs/
.eggs/
wheels/
sdist/
var/
*.egg/
*.egg-info/
lib64/
lib/
.tox/
.nox/
env/
venv/
ENV/
env.bak/
venv.bak/
site/
cython_debug/
vendor/
tmp/
.libs/
.debs/
src/
Debug/
debug/
*.pdb
*.enc
.enc
.sass-cache/
_site/
.info
*.info
.jekyll-cache/
@joennlae
Copy link

Thank you this is perfect 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment