{"id":20066298,"url":"https://github.com/ossobv/slackbridge","last_synced_at":"2025-05-05T18:32:35.664Z","repository":{"id":28251592,"uuid":"31759917","full_name":"ossobv/slackbridge","owner":"ossobv","description":"Bridging Slack.com #channels between companies","archived":false,"fork":false,"pushed_at":"2024-04-16T06:58:27.000Z","size":68,"stargazers_count":28,"open_issues_count":9,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-09T02:41:32.623Z","etag":null,"topics":["inter-company","slack","slack-webhook"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Blacksilver42/ciscord","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ossobv.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-06T08:32:13.000Z","updated_at":"2024-04-16T06:58:30.000Z","dependencies_parsed_at":"2022-09-15T11:05:07.781Z","dependency_job_id":null,"html_url":"https://github.com/ossobv/slackbridge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossobv%2Fslackbridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossobv%2Fslackbridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossobv%2Fslackbridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ossobv%2Fslackbridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ossobv","download_url":"https://codeload.github.com/ossobv/slackbridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252553165,"owners_count":21766838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["inter-company","slack","slack-webhook"],"created_at":"2024-11-13T13:55:58.473Z","updated_at":"2025-05-05T18:32:35.404Z","avatar_url":"https://github.com/ossobv.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"SlackBridge\n===========\n\nSlackBridge bridges Slack.com #channels between companies.\n\n* *Does your company use Slack?*\n* *Does your customer/subcontractor also use slack?*\n\nThen, no more hard times of having to grant each others' workers access\non both Slack teams: you can now form a union between two of your Slack\n#channels using this bridge.\n\n\nConfiguration and setup\n-----------------------\n\nYou'll need to run this as a daemon on a publicly reachable IP:\n\n* Test it in the foreground from the command line, to get a poor mans\n  builtin http server. You can use the nginx ``proxy_pass`` directive\n  (without path) to reach it.\n* Run it as a WSGI application. Has been tested with uWSGI; you can\n  use the nginx ``uwsgi_pass`` directive to reach it. Multiple workers\n  are allowed, as long as it is single-threaded.\n\nConfiguration in Slack:\n~~~~~~~~~~~~~~~~~~~~~~~\n\n* Create at least one `Incoming WebHook\n  \u003chttps://my.slack.com/services/new/incoming-webhook\u003e`_ per Slack\n  team; record *the URL*.\n  (Tip: set the other relation's brand logo as default icon, or a\n  generic ``:speech_balloon:`` icon if you use it for multiple\n  channels.)\n* For *each* #channel that you want to bridge/share, create an\n  `Outgoing WebHook\n  \u003chttps://my.slack.com/services/new/outgoing-webhook\u003e`_, record the\n  *token*. Set the WebHook POST URL to where this bridge is reachable\n  from the world, and append ``/outgoing`` to the path.\n* And, preferably, you'll also need at least one WebAPI token to\n  supply some info to the other end. You can do this by `creating a\n  bot user \u003chttps://my.slack.com/services/new/bot\u003e`_ (call it\n  *@slackbridge*). Record the *API token*.\n  (Previously, the recommended token was a \"user token\", which is now\n  `legacy \u003chttps://api.slack.com/custom-integrations/legacy-tokens\u003e`_.)\n\nInifile configuration:\n~~~~~~~~~~~~~~~~~~~~~~\n\nConfiguration using an inifile would look like this (skip if you're\nusing Heroku)::\n\n    [yourcompany-othercompany]\n    A.webhook_out_token = \u003cthe-recorded-token\u003e\n    A.webhook_in_url = \u003cthe-recorded-url\u003e\n    A.channel = #\u003cchannel-you-wish-to-share\u003e\n    A.peername = othercompany\n    A.webapi_token = \u003cxoxb-bot-token-goes-here\u003e\n\nThe other side of the SlackBridge has to do the same \"Configuration in\nSlack\" steps as seen above. Those values should go into a second set of\nkey-value pairs, starting with ``B``::\n\n    B.webhook_out_token = \u003cthe-peers-recorded-token\u003e\n    B.webhook_in_url = \u003cthe-peers-recorded-url\u003e\n    B.channel = #\u003cchannel-they-wish-to-share\u003e\n    B.peername = yourcompany\n    B.webapi_token = \u003cxoxb-their-bot-token-goes-here\u003e\n\nThe inifile will be searched as ``./slackbridge.ini`` or in the location\nsupplied by the ``SLACKBRIDGE_INIFILE`` environment variable.\n\nYou can add extra sections for more bridges. See the ``sample.ini``\nexample configuration for more details.\n\nEnvironment variable (Heroku style) configuration:\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nInstead of doing inifile config, you can use environment variables.\n\nIn that case, instead of the ``A`` and ``B`` config as seen above, you'd\nset these for both ``A`` and ``B``::\n\n    PORTAL_1_SIDE_A_WEBHOOK_OUT_TOKEN=\n    PORTAL_1_SIDE_A_WEBHOOK_IN_URL=\n    PORTAL_1_SIDE_A_CHANNEL_NAME=\n    PORTAL_1_SIDE_A_GROUP_NAME=\n    PORTAL_1_SIDE_A_WEB_API_TOKEN=\n\nYou can increment the number ``1`` for more bridges. See the\n``sample.env`` example configuration for more details.\n\n\nInner workings\n--------------\n\nThe SlackBridge works like this:\n\n* The Slack *Outgoing WebHook* -- from both teams -- posts messages to\n  the slackbridge on the supplied ``/outgoing`` URL.\n* The bridge posts the message to a subprocess, so the main process\n  can return immediately.\n* The subprocess translates the values from the *Outgoing WebHook* to\n  values for the *Incoming WebHook*, optionally overwriting the\n  #channel name and some other translations (channel name, avatars,\n  @mentions).\n* The translated values get posted to the *Incoming WebHook URL* so\n  they end up on the other end of the bridge.\n\nSupported commands by the bot -- type it in a bridged channel and get\nthe response there:\n\n* ``!info`` lists the users on both sides of the bridge. Now you know\n  who you can @mention.\n\n\nHeroku\n------\n\nThese instructions require `Heroku Command Line\n\u003chttps://devcenter.heroku.com/articles/heroku-command-line\u003e`_::\n\n    heroku create\n    cp sample.env .env\n    # Properly set all environment variables in file\n    vim .env\n    # Test running the bridge locally\n    heroku local\n    # Push environment variables to Heroku\n    heroku config:push --overwrite\n    # Deploy to Heroku\n    git push heroku \u003cmy-branch\u003e\n\nThings to note:\n\n* Free Heroku dynos can only run 18 hours per day. After that, the\n  slack bridge will simply not work. This can be very confusing. You\n  may wish to consider paying $7/month for a 24h dyno.\n* Please see ``sample.env`` for an example of how to set environment\n  variables.\n\n\nBUGS / CAVEATS\n--------------\n\n* You can skip the WebAPI token, but @mentions will look awkward and\n  ``!info`` won't give you all the info.\n* Message edits and snippet/file/image uploads will not get sent\n  across the bridge.\n\n\nTODO\n----\n\n* Clean up code (ugly globals). Too few subclasses.\n* Make more extensible. You may want to integrate your own\n  slackbot-style responses here.\n* Add default icon to CONFIG, so we can reuse the same incoming\n  webhook for more than one team, even if they don't supply the\n  wa_token.\n* Clean up the config. It's a horrible mess as it is.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fossobv%2Fslackbridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fossobv%2Fslackbridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fossobv%2Fslackbridge/lists"}