-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
It seems that processes like upgrades that "re-render" config.php
make it less readable.
Config variable constants (like PDO::MYSQL_ATTR_SSL_CA
becomes 1009
) get rendered into their actual values which is both less human readable and can also break a configuration in the far-fetched case that they change the numbering of these attributes upstream.
In addition to the above comments are also removed which may not be ideal.
Steps to reproduce
- On a not fully up to date installation of nextcloud configure SSL for the database connection by adding the following as per the documentation
'dbdriveroptions' => [
// \PDO::MYSQL_ATTR_SSL_KEY => '/../ssl-key.pem',
// \PDO::MYSQL_ATTR_SSL_CERT => '/../ssl-cert.pem',
\PDO::MYSQL_ATTR_SSL_CA => '/etc/ssl/certs/ca-certificates.crt',
\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => true,
],
(in my case I used LE so I only needed to set the CA and VERIFY_SERVER_CERT)
2. Run a nextcloud update
3. Look at the contents of config.php
it is now and any comments that were in it are gone:
'dbdriveroptions' =>
array (
1009 => '/etc/ssl/certs/ca-certificates.crt',
1014 => true,
),
Expected behavior
At least constant names (\PDO::....
) should have been preserved and ideally comments should too.
Nextcloud Server version
31
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.3
Web server
Apache (supported)
Database engine version
MariaDB
Additional info
Discovered with 31.0.7 -> 31.0.9.1 upgrade, verified by rolling the vm back and doing it again.
While I understand the process that most likely causes this (config.php
is re-rendered from the state of nextcloud during the update, thus we only have the actual data structure), it seems to me that if this is something that can't be changed a comment header needs to be added that warns that documentation in the form of comments will not be preserved in upgrades or alternatively that only comments outside of the $CONFIG array can be preserved.
I do think that preserving constant names is critical.