Hub 9 (30.0.4) - .htaccess files cannot be synchronized

Hello

I have created a fresh installation of Nextcloud Hub 9 (30.0.4). I would like to synchronize data from various web projects via Nextcloud.
These web projects have various .htaccess files.

Nextcloud can no longer synchronize these files.
I have found the following page:
https://docs.nextcloud.com/server/latest/admin_manual/release_notes/upgrade_to_30.html

According to this page, I can use the value ‘forbidden_filename_basenames’ in config.php to define which files can be excluded without a value before the dot.

Can I also use a
[

‘forbidden_filename_basenames’ => ,

]
so that .htaccess files are allowed again? After my test, this did nothing. How do I allow the synchronization / uploading of .htaccess files again?

The log says
Error no app in context Invalid path: files/path/to/.htaccess 28.12.2024, 19:17:28

The Basics

  • Nextcloud Server version:
    • 30.0.4
  • Operating system and version:
    • Debian 12.8
  • Web server and version :
    • Apache/2.4.62 (Debian)
  • Reverse proxy and version
    • Ngnix (on other Server)
  • PHP version:
    • 8.2
  • Is this the first time you’ve seen this error? (Yes / No):
    • see below - after first install
  • When did this problem seem to first start?
    • after sync folder with .htaccess files
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Manual with Archive
  • Are you using CloudfIare, mod_security, or similar?
    • No
1 Like

forbidden_filenames

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#forbidden-filenames

Ok, but I already have this option in my config.php:

$CONFIG = array (
  'instanceid' => 'xxxx',
  'passwordsalt' => 'xxxx',
  'secret' => 'xxxx',
  'trusted_domains' => 
  array (
    0 => 'cloud.domain.ch',
  ),
  'datadirectory' => '/data/nextcloud',
  'dbtype' => 'mysql',
  'version' => '30.0.4.1',
  'overwrite.cli.url' => 'https://cloud.domain.ch',
  'dbname' => 'dbname',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'username',
  'dbpassword' => 'password',
  'installed' => true,
  'default_phone_region' => 'CH',
  'maintenance' => false,
  'loglevel' => 2,
  'skeletondirectory' => '',
  'defaultapp' => 'files,keeweb,activity,mail,photos',
  'forbidden_filenames' => [],
  'forbidden_filename_basenames' => [],
);

and it doesn’t work. .htaccess files can’t be synchronized with it.

I can’t sync .htaccess either after updating to this new version of nextcloud even with

‘blacklisted_files’ =>
array (
),
which is what previously worked for me.

I get it’s for security reasons but I really need to be able to do this and have other measures in place to make sure the server doesn’t read them.

So I just added the lines from your post

‘forbidden_filenames’ => ,
‘forbidden_filename_basenames’ => ,

in addition to the one from my post

‘blacklisted_files’ =>
array (
),

and it appears to be working again after a reboot :smiley:

Thanks, works for me too.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.