cog icon indicating copy to clipboard operation
cog copied to clipboard

Allow bootstrapping entirely from chat

Open vanstee opened this issue 9 years ago • 0 comments

Most users will probably get the bot working and will want to immediately talk to it. Instead of telling them to go download, build, and run a series of commands just to interact with the bot, let's do some clever things to allow setting things up within chat itself.

  1. Bootstrapping via chat

    If the bot has just been setup and no other users exist yet (it hasn't yet been bootstrapped) we should allow a user to bootstrap the bot via chat. Here's the scenario I'd like to ideally support:

    @vanstee: @bot help
    @bot: Hey @vanstee. I haven't been setup yet. Setup an admin account by running `@bot bootstrap` or install `[cogctl](https://github.com/operable/cogctl)` and run `cogctl bootstrap`.
    @vanstee: @bot bootstrap
    @bot: Yay! I'm bootstrapped and ready to be configured.
    

    As a bonus it would be nice if the bot DM'd the bootstrapper the credentials of the admin account so they could use cogctl to continue the process.

  2. Importing users via Slack

    When you're running through and creating all your users I think most folks will realize that Slack already has all the info we're typing into cogctl commands, so why not add a command to import users to chat?

    @vanstee: @bot bootstrap
    @bot: Yay! I'm bootstrapped and ready to be configured. Run `@bot users import --username vanstee --password <password>` to create a user with all your information from Slack or run `cogctl users create` and `cogctl chat-handles create` from the command line. You may want to send me this command in a DM to keep your password private.
    (in DM) @vanstee: @bot users import --username vanstee --password ilikecats
    (in DM) @bot: Howdy @vanstee. Nice to meet you.
    

I haven't figured out all the authorization issues here but the following should work as a first pass.

  • If no users other than the admin user are present, any user can import themselves. That user is given all the permissions the admin user has. So they can import other users and pass down those permissions as well.
  • Once more than the admin and another user have been created, only users with the manage_users permission can import other users.

Bonus: It'd be great if during import we could ask the user being imported via a DM what their password should be. Might be a good time to confirm other details as well. (Similar to how the Slack bot sets up your account).

vanstee avatar Feb 02 '16 22:02 vanstee