Integrity check .htaccess

Nextcloud version : 23.0.3
Operating system and version: TrueNAS-12.0-U8
nginx version: 1.20.2
PHP version: 7.4.28

I updated Nexcloud Plugin on TrueNAS (jail), from version 23.0.0 to 23.0.3.
after update i received this message on “Security & setup warnings”:

“Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the documentation. (List of invalid files… / Rescan…)”

so I listed the invalid files, founding an issue on .htaccess:

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- core
	- INVALID_HASH
		- .htaccess

Raw output
==========
Array
(
    [core] => Array
        (
            [INVALID_HASH] => Array
                (
                    [.htaccess] => Array
                        (
                            [expected] => aab002636038627a549cdc33b749fe7ef74fcbb2a52decf1af0b4c90394d869d982dd7a2d3ce72d1d5114b21aa73cb35ddb6c8b54760ca0e7347e7b26760d6ab
                            [current] => 54cf22f44b5e273d6ca00a13843a803df163891451a2289ca91d088aa9d8230175791937c69ab8728d89206008adeaf2fd836dc47d5543494ac04bb4c318ccde
                        )

                )

        )

)

why I receive this, and how to solve?
thanks, regards.

Andrea Bianchini

Same Issue, Did you find a solution?

I searched

aab002636038627a549cdc33b749fe7ef74fcbb2a52decf1af0b4c90394d869d982dd7a2d3ce72d1d5114b21aa73cb35ddb6c8b54760ca0e7347e7b26760d6ab

for you and found:

Nextcloud: core/signature.json | Fossies

nextcloud 23.0.3 - Download, Browsing & More | Fossies Archive

Here the correct file from the above zip archive (version 23.0.3). Rename it to .htaccess
Download dot-htaccess

(use e.g. https://emn178.github.io/online-tools/sha512_file_hash.html to check integrity after download)

Unfortunately I do not know if this will solve the problem. I think it is more likely a bug with Nextcloud.

1 Like

Hi devnull, thanks a lot for your answer!!
it seem to solve the issue. berfore copying the file you suggest i had a litte compare of the two files: the one from my installation and the one from correct source.
in the second I found 4 line added in " # Add cache control for static resources " section.
so my bad CRC file:

  # Add cache control for static resources

  <FilesMatch "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite)$">
    Header set Cache-Control "max-age=15778463"
  </FilesMatch>

and correct CRC source file:

  # Add cache control for static resources

  <FilesMatch "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite)$">
    Header set Cache-Control "max-age=15778463"
  </FilesMatch>

  <FilesMatch "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite)(\?v=.*)?$">
    Header set Cache-Control "max-age=15778463, immutable"
  </FilesMatch>

I really don’t know what is this, in term of functionality, but adding theese lines i get a correct CRC (and then NO errors)

please note in the bad CRC file there was also some lines at the end of the file I removed:

#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####

ErrorDocument 403 //
ErrorDocument 404 //

that’s all.
thank you again!!

Andrea Bianchini

1 Like

Dear [andrebia1984]

I have the same issue after update to 23.0.3.
Nextcloud version : 23.0.3
Operating system and version: TrueNAS-12.0-U8
But I don’t know where the .htaccess is located. I edited a .htaccess /usr/local/www/nextcloud as you mentioned above. reboot truenas. The issue is same.
Please help me out. thank you.

Updated to 24.0.1 Issue is back with different hash

Results

  • core
    • INVALID_HASH
      • .htaccess

Raw output

Array
(
[core] => Array
(
[INVALID_HASH] => Array
(
[.htaccess] => Array
(
[expected] => d9cab0f077161bf043d6d85f5bcacbdfaf82913968b7706df9cf7e6f98b11af363f3843b455175ae775567916822fec8f6ab95000ba064c71e05c86a02196d95
[current] => aab002636038627a549cdc33b749fe7ef74fcbb2a52decf1af0b4c90394d869d982dd7a2d3ce72d1d5114b21aa73cb35ddb6c8b54760ca0e7347e7b26760d6ab
)

            )

    )

)

Any Thoughts on how to fix this one?