YunoHost-Apps / roundcube_ynh

Roundcube package for YunoHost
https://roundcube.net/
GNU Affero General Public License v3.0
11 stars 19 forks source link

Bug: Added plugins in config/local.inc.php are not considered #177

Open CodeShakingSheep opened 11 months ago

CodeShakingSheep commented 11 months ago

Describe the bug

The readme states

You can extend - or even override - the Roundcube configuration which is coming with this package in the file conf/local.inc.php. Do not edit the file conf/config.inc.php as future upgrades will overwrite it.

And it gives this example for adding a plugin:

<?php
$config['plugins'][] = 'html5_notifier';

However, this doesn't seem to work in my case. I installed this plugin twofactor_gauthenticator with composer. Then I created config/local.inc.php and put in the following:

<?php
$config['plugins'][] = 'twofactor_gauthenticator';

However, the plugin didn't appear in the settings. When I added it to the plugin section in config/conf.inc.php it showed up and worked.

Can anybody reproduce this? Could it be related to the renaming of the folder? The readme states conf/local.inc.php while the folder seems to have been renamed to config. I wanted to create a PR updating the readme with the correct folder name but doesn't make sense if it's not working. Any suggestions?

Context

Steps to reproduce

  1. Install plugin
    Inside roundcube directory run ./composer.phar require alexandregz/twofactor_gauthenticator as roundcube user.
  2. Adopt permissions for folder Form /plugins folder run chown -R roundcube:www-data twofactor_gauthenticator/ and chmod o-rx twofactor_gauthenticator/
  3. Apply this comment for plugin https://github.com/alexandregz/twofactor_gauthenticator/issues/170#issuecomment-1519126894
  4. Create / edit config/local.inc.php with this:
    <?php
    $config['plugins'][] = 'twofactor_gauthenticator';
  5. Open settings in Roundcube and see that the expected entry isn't present
  6. Add plugin in config/conf.inc.php instead of config/local.inc.php
  7. Open settings again and see that the expected entry is present now

Expected behavior

The plugin should be activated in Roundcube when adding it inside /config/local.inc.php.

nicofrand commented 9 months ago

I don't think config/local.inc.php is read at all.

To confirm it I put (and then removed ofc) file_put_contents("/tmp/test-roundcube-config.txt", "config file read"); at the beginning of config/config.inc.php and file_put_contents("/tmp/test-roundcube-local.txt", "local config file read"); in config/local.inc.php (with the same rights) and only /tmp/test-roundcube-config.txt was created.

Also the configuration directory is now config and not conf like stated in the disclaimer.