Every time I update Nextcloud the theme entry in the config.php get cleared.
I use
'theme' => $_SERVER['HTTP_HOST'],
after an update the entry is
'theme' => '',
GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/11038 (Updating App will enable maintenance in config.php ...), https://github.com/nextcloud/server/pull/11240 (Consider openssl settings from config.php), https://github.com/nextcloud/server/pull/11047 (Fix typo in config.sample.php), https://github.com/nextcloud/server/issues/1358 (config.php - Disable Remember Login), and https://github.com/nextcloud/server/pull/10744 (Update help.php).
I don't think you're "allowed" to use vars in config.php because that file is re-written by Nextcloud when system config changes. cc @MorrisJobke
You could create a new file theme.config.php in the same folder like config.php and use
return [
'theme' => $_SERVER['HTTP_HOST']
];
this should be update save.
With the solution of @danielkesselberg the theme is always also fetched from this additional file and will not be vanished on update.
Most helpful comment
You could create a new file
theme.config.phpin the same folder likeconfig.phpand usethis should be update save.