slackbridge icon indicating copy to clipboard operation
slackbridge copied to clipboard

Simplify setup (configuration and token generation)

Open patcon opened this issue 8 years ago • 1 comments

Reticketed from https://github.com/ossobv/slackbridge/issues/10#issuecomment-317416030 (I had related questions)

Curious your thoughts on this!

Do you think that goal (simpler config) might involve web api anyhow? the thinking being that config could then just be "register a new app", and then it's simple in-browser oauth for two teams stored in some backend.

or we're you more thinking along the lines of a CLI wizard and envvars?

patcon avatar Aug 01 '17 21:08 patcon

Well, for starters, begin removal of the horrendous CONFIG dict and replace with ini-file loading like this:

[DEFAULT]
WEBHOOK_IN_URL = https://hooks.slack.com/services
WEBHOOK_IN_URL_OSSO = ${WEBHOOK_IN_URL}/X/Y/Z
WEBAPI_TOKEN_OSSO = xoxp-token-token-token

[company1-osso]
A.webhook_in_url =
    ${WEBHOOK_IN_URL}/AAAAAAAAA/BBBBBBBBB/cccccccccccccccccccccccc
A.webhook_out_token = dddddddddddddddddddddddd
A.channel = CXXXXXXXX
A.peername = osso
A.webapi_token =
 
B.webhook_in_url = ${WEBHOOK_IN_URL_OSSO}
B.webhook_out_token = eeeeeeeeeeeeeeeeeeeeeeee
B.channel = #shared-company1
B.peername = company1
B.webapi_token = ${WEBAPI_TOKEN_OSSO}

Splitting it up into several files will add the need for a setup.py, but also make refactoring/testing easier.

wdoekes avatar Aug 28 '17 11:08 wdoekes