How can I edit the default ignored files list?

Hi all,
I installed Nextcloud on an x64 server running Arch Linux with nginx, mariadb and php 7.
After trying it out a little I installed the Desktop client on my Mac.
I put some folders in the nextcloud sync folder and then noticed that several files were not synced, like .htaccess files.
I need those files synced, so I tried to edit the list of excluded files but I found a long list of patterns that I can not edit or delete.
Looking in the github repo of the client I found the ā€œsync-exclude.lstā€ file and I edited it, but I know it will be overwritten with the next update of the client app. Now most of my files get synced.
Why are all those files excluded?
Why are ā€œ.htaccessā€ not synced with an error related to not available space on my server? (other new files get synced regularly)
Thanks,
Matteo

You can locally edit the .snyc-exclude.lst, I’m not really sure that this file is overwritten during an update. So keep a copy and verify the settings after an update.
Most excluded files are temporary files of operating systems or of a specific client software where it makes no sense to sync them over devices.

.htaccess is blacklisted for security reasons:

Sorry for the late reply and thank you very much for your answer :slight_smile:
Anyway, IMHO the user should be able to take decisions over his files.
After all, this is the whole point of this private cloud project, right?
Obviously any technical reason are accepted.
But since I am also the maintainer of my personal cloud server, I’m ok with dealing with the extra work to support some extra file synchronization.
I edited that file a month ago now, and my server and my client seem to work as expected, including the syncing of .htaccess files.
I have peace of mind about this edit because the only issue brought to my attention about this .htaccess files (and all other excluded) is about security when running an apache webserver that would interpret thos htaccess files. Since I use nginx I feel safe.
Am I wrong with this last assumption?

Yes, but to protect data many settings are done in a way that it is secure by default. You can also set apache to ignore .htaccess files, so you could do that for everything within the data-folder. But you need to be able to change the apache-configuration (not possible for users on shared hosting, in some administration tools access to apache-configuration is limited or needs advanced knowledge).

If you want to manage websites via external storages, I would rather try to put this in via feature request, that for such storage types, .htaccess is not ignored.

On nginx, these .htaccess-files are just files and do not alter the configuration.

Hi, where do I find the snyc-exclude.lst ?

Greetings from Germany
JK

Found it in C:\Users\kubik\AppData\Local\Nextcloud but it was empty!?

Where do I find the list where the excluded files are listed?

Greetings

Hi,

In C:\Users%username%\AppData\Local\Nextcloud adds a file named sync-exclude.lst if you add other extensions that not the default ones.

In NextCloud client, in the tab ā€œGeneralā€ you have ā€œAdvancedā€ - Edit Ignored Files, there are the default ones, if you add anything to there, it will create the sync-exclude.lst file.

Is it possible to edit the default not synced files?
I want to delete .~lock.* from this list because I think it is very useful to sync it.

As I understand I can only add things to the sync-exclude.lst but I cant take stuff away cause it is empty.

I’m on Kubuntu by the way.

Hello

I’ve a simillar issue: I’m using encfs to encrypt files for a specific folder AND their filename. A lot of files are excluded from sync due to a too large default exception rule.

I checked the content of the exlude file ā€œ.snyc-exclude.lstā€ and it’s empty.

How can I change a default exception or remove ALL exceptions for a specific folder ?

Thanks

Hello,
I am experiencing the same issue. And the suggestions didn’t fix it.

I have a lot of unsynced files due to ignored file rules. When I open ā€œedit ignored file listā€ section it is all grayed out so that I cannot edit. It seems that the sync-exclude.lst file is located in /tmp/.mount_Nextcls92Dx1/usr/bin/ folder, which I don’t have permission to edit and is an odd location to edit anyway.

I am using Nextcloud Desktop Client Version 2.3.3 on Ubuntu 16.04.

Anybody have an idea on how can I change file-name rules for syncing? Editing the rules on the server side also works for me. Thanks.

/etc/Nextcloud/sync-exclude.lst
was the file I needed to edit

Same problem for me; I need htaccess :((((((

the file on mac
/Applications/nextcloud.app/Contents/Resources/sync-exclude.lst

but did not work in my case, blocked server side too

how to change default ignore list, i want to sync .lock file which is from eclips but somehow this is being ignored.

Thanks

In case anyone needs it, I found the file is now in the folder C:\Users%username%\AppData\Roaming\Nextcloud

This still persists.
I have deleted .~lock.* from the list in client’s window, but to no effect.
Can’t sync this type of files, which are very useful.

So this has not been solved yet.

It should be possible to get full control over the synchronization of files in a dedicated NextCloud instance.
I am a developer working with a development environment on a MacBook and I synchronize my projects with a NAS for backup purposes. This backup should contain all files, also the .htaccess files are very important for my work.

What makes you say that you can’t? Did you actually test it?

I’m asking because the previous post in this eight-year-old thread was made three years ago, and if I had to guess, I’d say the previous poster either edited the wrong file or ran into a bug that was most likely fixed long ago.

I assume as a developer you know the difference between backups and synchronization, and therefore understand what you are doing and why you are doing it, so I won’t go into whether I think this is a good idea or not :wink:

What makes you say that you can’t? Did you actually test it?

Yes, I did. And unfortunately this behaviour isn’t fixed in NC 29.0, that’s why I searched for a solution and found this thread.

I assume as a developer you know the difference between backups and synchronization, and therefore understand what you are doing and why you are doing it

Yes, I’m not stupid.

EDIT, a possible solution:

I have helped myself by changing line no. 469 in the file lib/private/Files/Filesystem.php:

# self::$blacklist = \OC::$server->getConfig()->getSystemValue('blacklisted_files', ['.htaccess']);
self::$blacklist = \OC::$server->getConfig()->getSystemValue('blacklisted_files', []);

But this will not survive updates.

A better solution:
It would be smarter to include the parameter ā€˜blacklisted_files’ => [ā€˜.htaccess’] by default in the config.php, then every operator of a Nextcloud instance can decide for themselves what is blocked and what is not. That is the difference between freedom and nannyism. Since my instance runs with nginx, no .htaccess files need to be blocked. That’s easy …

The code you quoted is using getSystemValue and means this information is taken from the configuration file. blacklisted_files is documented here server/config/config.sample.php at 54afea4b01385106a241a5161b3894e669716107 Ā· nextcloud/server Ā· GitHub.

This thread is also about our desktop clients and their local exclude configuration (e.g. to ignore those ~lock files on windows). The default, to block .htaccess files, is done on the server side, as you already figured out.

And there is a good reason for it. If you are using apache, this file allows you to change settings in the configuration, so you must be really careful and explicitely disable .htaccess interpretation for the data folder (AllowOverride None: https://httpd.apache.org/docs/current/howto/htaccess.html=.