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

Simplify setup (configuration and token generation) #12

Open
patcon opened this issue Aug 1, 2017 · 1 comment
Open

Simplify setup (configuration and token generation) #12

patcon opened this issue Aug 1, 2017 · 1 comment

Comments

@patcon
Copy link
Contributor

patcon commented Aug 1, 2017

Reticketed from #10 (comment) (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?

wdoekes added a commit that referenced this issue Aug 28, 2017
If you use the PORTAL_n_SIDE_n env config or the slackbridgeconf.py
style config, you need only replace your reference to slackbridge.py to
wsgi.py.

However, you may now start using an inifile for configuration. See
sample.ini for an example.

Configuration loading is done in the following order:

- environment (PORTAL_n_SIDE_n_...)
- if that was not found, load inifile (./slackbridge.ini or the
  filename found in SLACKBRIDGE_INIFILE env)

If slackbridgeconf.py is found, it is loaded as well. Expect this to
change in future commits.

If you're replacing your CONFIG-style slackbridge conf with either the
INI or ENV style config, you can use testconfig.py to compare the
output. The old CONFIG-style config was write only, so a double-check to
see if you made any mistakes in the new INI or ENV config is highly
recommended.

Touches issue #12.
@wdoekes
Copy link
Member

wdoekes commented Aug 28, 2017

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.

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

2 participants