cozy-labs / cozy-light

Personal Server Made Easy
http://cozy-labs.github.io/cozy-light/
GNU Affero General Public License v3.0
104 stars 13 forks source link

PLugins specific commands not available throuh cozy-light #75

Closed nicodel closed 9 years ago

nicodel commented 9 years ago

Hi, I have been trying to reinstall cozy-light-basic-auth, after having erase everything (but that is another subject..). From what I remenber, and the README still mention it. I need to do cozy-light set-pasword to set password for me account. But after installing the plugin, this command seems to still be unknown to cozy-light. As I know that cozy-light-githooks got the same set of additional commands to cozy-light, I install it. Result is the same. Available commands to cozy-light stay the same :

 $ cozy-light *

  Usage: cozy-light [options] [command]

  Commands:

    start [options] 
       start Cozy Light server

    install [options] <app>
       Add app to current Cozy Light

    uninstall [options] <app>
       Remove app from current Cozy Light

    add-plugin [options] <plugin>
       Add plugin to current Cozy Light

    remove-plugin [options] <plugin>
       Remove plugin from current Cozy Light

    display-config [options] 
       Display current config of Cozy Light

    enable [options] <apporplugin>
       Enable given disabled app or plugin

    disable [options] <apporplugin>
       Disable given app or plugin

    install-distro [options] [distro]
       Install given distro. If none is give, it displays the distro list

    * 
       display help

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

Any ideas ?

frankrousseau commented 9 years ago

It's a bug I fixed normally. I hope to be able to work on it tomorrow.

nicodel commented 9 years ago

I would like to work on it. I try, tonigh, to understand where it could be blocking, but I can't get my hand on it.

Do you know what piece of code could be involved ?

frankrousseau commented 9 years ago

Ok I studied the problem. It looks hard to solve. I think we need a two step initialization.

Currently, the plugins are loaded after the user command is analyzed (it requires all the parameters given by the user to init properly, like the port or the home directory). But the lib that manages the mapping between the command line requires plugin intialization before the user command is analyzed to know which command to map on which function.

nicodel commented 9 years ago

Sure it does. I'll look more in depth, but it is maybe a bit over my skils.

maboiteaspam commented 9 years ago

Currently, the plugins are loaded after the user command is analyzed (it requires all the parameters given by the user to init properly, like the port or the home directory).

y 2 cents, see my last pr you refused.

runvnc commented 9 years ago

I think the main problem with your PR @maboiteaspam is you deleted his buildAction code which is necessary for some of the other commands to work, like the ones that take params (start -p). If I am understanding correctly, with your PR you solved the problems of plugins not being able to have commands, but at the same time made it so that commands can't have parameters.

frankrousseau commented 9 years ago

@runvnc You're right. That part didn't look good. But the main problem was the lack of explanation and the mix of several concepts in one PR that made it hardly reviewable.

nicodel commented 9 years ago

cozy-light updated on my RPI to the 0.4.8 Issue solved ! Thank you

frankrousseau commented 9 years ago

You're welcome!