Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install plugins (carddav) #249

Closed
foorschtbar opened this issue May 21, 2024 · 9 comments
Closed

Unable to install plugins (carddav) #249

foorschtbar opened this issue May 21, 2024 · 9 comments

Comments

@foorschtbar
Copy link

Hi,

my goal was to upgrade my carddav plugin inside the container with composer, but composer says it missing git:

roundcube-app  | /usr/bin/composer
roundcube-app  | Executing /usr/bin/composer to update dependencies...
roundcube-app  | Composer could not detect the root package (roundcube/roundcubemail) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
roundcube-app  | Loading composer repositories with package information
roundcube-app  | Updating dependencies
roundcube-app  | Nothing to modify in lock file
roundcube-app  | Installing dependencies from lock file
roundcube-app  | Package operations: 0 installs, 20 updates, 0 removals
roundcube-app  | 
roundcube-app  | In GitDownloader.php line 82:
roundcube-app  |                                                             
roundcube-app  |   git was not found in your PATH, skipping source download 

After some different tries, i setup a new container, but still had problems installing ANY pugins from repo. My minimal (NOT) working example is here:

image: roundcube/roundcubemail:latest
environment:
[...]
  - ROUNDCUBEMAIL_SKIN=elastic
  - ROUNDCUBEMAIL_PLUGINS=carddav
  - ROUNDCUBEMAIL_INSTALL_PLUGINS=true
volumes:
  - ./data/roundcube/html:/var/www/html
[...]

I got

roundcube-app  | Installing plugins from the list
roundcube-app  | Plugins: carddav
roundcube-app  | Composer could not detect the root package (roundcube/roundcubemail) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
roundcube-app  | 
roundcube-app  | In PackageDiscoveryTrait.php line 369:
roundcube-app  |                                    
roundcube-app  |   Could not find package carddav.  
roundcube-app  |                                    
roundcube-app  |   Did you mean one of these?       
roundcube-app  |       sabre/dav                    
roundcube-app  |       horde/dav                    
roundcube-app  |       sabre/katana                 
roundcube-app  |       syncgw/sabredav              
roundcube-app  |       roundcube/carddav   

then i tried ROUNDCUBEMAIL_PLUGINS=roundcube/carddav and after (two) restarts i got:

roundcube-app  | wait-for-it.sh: roundcube-db:3306 is available after 0 seconds
roundcube-app  | Installing plugins from the list
roundcube-app  | Plugins: roundcube/carddav
roundcube-app  | Composer could not detect the root package (roundcube/roundcubemail) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
roundcube-app  | Could not scan for classes inside "/usr/src/roundcubemail/vendor/roundcube/carddav/carddav.php" which does not appear to be a file nor a folder
roundcube-app  | Could not scan for classes inside "/usr/src/roundcubemail/vendor/roundcube/carddav/dbmigrations/" which does not appear to be a file nor a folder
[...]
roundcube-app  | errors: PHP Error: Invalid plugin name: roundcube/carddav in /var/www/html/program/lib/Roundcube/rcube_plugin_api.php on line 177 (POST /?_task=mail&_action=refresh)

What i'm doing wrong? Same problems with 3rd party addons link html5_notifier or twofactor_gauthenticator.

@thomascube
Copy link
Member

@williamdes Maybe the boolean approach for ROUNDCUBEMAIL_INSTALL_PLUGINS is not sufficient. Composer package names do not always match the plugin names in Roundcube. While ROUNDCUBEMAIL_PLUGINS will enable the given (pre-installed) plugins, we might need to extend ROUNDCUBEMAIL_INSTALL_PLUGINS to become a list of composer packages to be installed (and activated upon installation). Those installed plugins wouldn't need to be listed in ROUNDCUBEMAIL_PLUGINS.

@williamdes
Copy link
Contributor

I did conclude to the same, a new env name should be given for the composer plugins. I have two PRs to create soon. Sorry for the delay, still testing my changes.

@sairuk
Copy link

sairuk commented May 25, 2024

i tried to spin this up today and found enabling ROUNDCUBEMAIL_INSTALL_PLUGINS: 1 also seems to break simple activation of packed in plugins as the composer approach will expect a version string

roundcubemail   | Installing plugins from the list
roundcubemail   | Plugins: archive,zipdownload
roundcubemail   | Composer could not detect the root package (roundcube/roundcubemail) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
roundcubemail   | 
roundcubemail   | In VersionParser.php line 521:
roundcubemail   |                                                                                
roundcubemail   |   Could not parse version constraint zipdownload: Invalid version string "zip  
roundcubemail   |   download"                                                                    
roundcubemail   |                                                                                
roundcubemail   | 

installing the mfa plugin is possible however activation is not as per the aforementioned naming issues.
installation

      ROUNDCUBEMAIL_INSTALL_PLUGINS: 1
      ROUNDCUBEMAIL_PLUGINS: alexandregz/twofactor_gauthenticator:dev-master
roundcubemail   | Plugins: alexandregz/twofactor_gauthenticator:dev-master
roundcubemail   | Composer could not detect the root package (roundcube/roundcubemail) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
roundcubemail   | ./composer.json has been updated
roundcubemail   | Composer could not detect the root package (roundcube/roundcubemail) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
roundcubemail   | Running composer update alexandregz/twofactor_gauthenticator
roundcubemail   | Loading composer repositories with package information
roundcubemail   | Updating dependencies
roundcubemail   | Lock file operations: 1 install, 0 updates, 0 removals
roundcubemail   |   - Locking alexandregz/twofactor_gauthenticator (dev-master 77157a4)
roundcubemail   | Writing lock file
roundcubemail   | Installing dependencies from lock file
roundcubemail   | Package operations: 1 install, 0 updates, 0 removals
roundcubemail   |   - Downloading alexandregz/twofactor_gauthenticator (dev-master 77157a4)
roundcubemail   |   - Installing alexandregz/twofactor_gauthenticator (dev-master 77157a4): Extracting archive
roundcubemail   | Creating package config file
roundcubemail   | Generating optimized autoload files

runtime

roundcubemail   | errors: PHP Error: Invalid plugin name: alexandregz/twofactor_gauthenticator:dev-master in /var/www/html/program/lib/Roundcube/rcube_plugin_api.php on line 177 (GET /?_task=settings&_action=responses)

i worked around these issues by mounting in custom plugin volumes inplace in both this container and the nginx one, something like below to both containers then activating with ROUNDCUBEMAIL_PLUGINS: archive,zipdownload,twofactor_gauthenticator

    volumes:
      - ./var/roundcube/plugins/twofactor_gauthenticator:/var/www/html/plugins/twofactor_gauthenticator:

@williamdes
Copy link
Contributor

Please check #250 and let me know

@foorschtbar
Copy link
Author

Please check #250 and let me know

Works now! Thank u.

I still got the Composer could not detect the root package (roundcube/roundcubemail) version, defaulting to '1.0.0'. See https://getcomposer.org/root-versionbut packages got installed. Some need :dev-master tag for working.

@williamdes
Copy link
Contributor

Thank you for testing!

I still got the Composer could not detect the root package (roundcube/roundcubemail) version, defaulting to '1.0.0'. See https://getcomposer.org/root-versionbut packages got installed. Some need :dev-master tag for working.

Mee too, this is related to the source contents of the composer.json
It should maybe be altered in another PR.
But I am not sure this is problematic

@Codelica
Copy link

Codelica commented Jul 2, 2024

@williamdes is this change moving to ROUNDCUBEMAIL_COMPOSER_PLUGINS in any dev image currently or just pending the next release?

@williamdes
Copy link
Contributor

Because of #250 you should consider that it is not in any image for now

@thomascube
Copy link
Member

#250 was merged and is part of the 1.6.8 images. Please re-open if the problem persists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants