{"id":19054468,"url":"https://github.com/datadog/slack-channel-manager","last_synced_at":"2025-04-24T03:15:45.954Z","repository":{"id":33869442,"uuid":"149294871","full_name":"DataDog/slack-channel-manager","owner":"DataDog","description":"Slack Bot for private channel management in a public workspace.","archived":false,"fork":false,"pushed_at":"2024-04-24T20:08:11.000Z","size":1352,"stargazers_count":8,"open_issues_count":15,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T06:24:39.580Z","etag":null,"topics":["nodejs","slack","slackbot"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DataDog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-09-18T13:42:09.000Z","updated_at":"2024-04-24T20:08:15.000Z","dependencies_parsed_at":"2024-04-24T21:27:09.376Z","dependency_job_id":"63492fb1-7f0b-4407-8c6a-9a77f660491b","html_url":"https://github.com/DataDog/slack-channel-manager","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/DataDog%2Fslack-channel-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fslack-channel-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fslack-channel-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fslack-channel-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataDog","download_url":"https://codeload.github.com/DataDog/slack-channel-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249391024,"owners_count":21263205,"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":["nodejs","slack","slackbot"],"created_at":"2024-11-08T23:38:30.189Z","updated_at":"2025-04-17T23:31:45.253Z","avatar_url":"https://github.com/DataDog.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slack-channel-manager\n\nSlack bot for private channel management in a public slack workspace.\n\n## Usage\n\nPlease see the [detailed usage instructions][1] on the project wiki more information.\n\n## Roadmap\n\nCurrently, the following features are supported:\n- Requesting a private channel for a specific user\n- Querying a list of all active channels managed by the bot\n- Joining a private channel created by another authorized user\n- Marking managed channels for automatic expiry\n- Managing channels that were manually created by users (unmanaged)\n\nIf you would like to see any features implemented (or see any problems with the current functionality), please submit an issue or a pull request.\n\n## Setup Instructions\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes. The deployment process will be exactly the same.\n\n### Prerequisites\n\nThese dependencies are required before proceeding with a local installation:\n- NodeJS and NPM\n- MongoDB\n- [ngrok][2] (or some secure localhost tunnelling service)\n\n### Installing locally\n\nClone this repo\n\n```sh\ngit clone git@github.com:DataDog/slack-channel-manager.git\n```\n\nNavigate to the repo and install dependencies\n\n```sh\ncd slack-channel-manager\nnpm install\n```\n\n### Running locally\n\nRun the localhost tunnelling service (instructions here are for ngrok on development port 8080).\nNote down the `\u003cngrok-subdomain\u003e` that appears in the output. Also, note that this subdomain changes everytime you restart the service. So, be sure to update the Slack Command Request URLs in the Slack API Dashboard.\n\n```sh\nngrok http 8080\n## You should see the following output if your ngrok account has been setup correctly\n# ngrok by @inconshreveable\n\n# Session Status                online\n# Account                       \u003cyour name\u003e (Plan: Free)\n# Version                       3.8.0\n# Region                        United States (us)\n# Web Interface                 http://127.0.0.1:4040\n# Forwarding                    https://\u003cngrok-subdomain\u003e.ngrok-free.app -\u003e localhost:8080\n#\n# Connections                   ttl     opn     rt1     rt5     p50     p90\n#                               0       0       0.00    0.00    0.00    0.00\n```\n\nStart up a MongoDB server. Note: create `mongodb-data` directory at root.\n\n```sh\nmongod --dbpath=mongodb-data/\n```\n\nRun the bot\n\n```\nnpm start\n```\n\n### Setting up the Slack App\n\nIMPORTANT: Before proceeding, create a new \"role account\" user and make it an administrator in your Slack workspace. Use this account as the account you use to login to the [Slack Apps Dashboard][3] and perform all the following setup instructions. Otherwise, the bot will perform all actions _on behalf of your personal Slack account_, which is probably not desirable.\n\nGo to your [Slack Apps Dashboard][3] and click on **Create New App**. Make sure not to click on the _Interested in the next generation of apps?_ section. Give the app a name (e.g. `slack-channel-manager`), select a workspace in which you will be testing the bot, and submit the form.\n\nNavigate to the _Bot Users_ section in the sidebar, then\n- Click on **Add a Bot User**\n- Give it a suitable _Display name_ (e.g. \"Channel Manager Bot\") and a _Default username_ (e.g. \"channel-manager-bot\")\n- Toggle **Always Show My Bot as Online** on\n- Submit the form with **Add Bot User**\n\nNavigate to the _Slash Commands_ section in the sidebar, then create the following commands:\n\n| Command | Request URL | Short Description | Usage Hint | Escape |\n| --- | --- | --- | --- | --- |\n| /request-channel | https://\\\u003cngrok-subdomain\u003e.ngrok-free.app/command/request-channel | Requests a private channel | [@user-to-invite] | ✓ |\n| /extend-expiry | https://\\\u003cngrok-subdomain\u003e.ngrok-free.app/command/extend-expiry | Extends a channel's expiry date | [number of days] | |\n| /set-expiry | https://\\\u003cngrok-subdomain\u003e.ngrok-free.app/command/set-expiry | Sets a channel's expiry date | YYYY-MM-DD | |\n| /remove-user | https://\\\u003cngrok-subdomain\u003e.ngrok-free.app/command/remove-user | Remove a user from a private channel | [@user-to-remove] | ✓ |\n\nNavigate to the _Interactive Components_ section in the sidebar, then\n- Toggle **Interactivity** on\n- Set the **Request URL** to `https://\u003cngrok-subdomain\u003e.ngrok-free.app/action`\n- Add an action with the following fields:\n\n| Name | Description | Callback ID |\n| --- | --- | --- |\n| Request Private Channel | Request a private channel with a user. | request_channel_action |\n\nNavigate to the _Event Subscriptions_ section in the sidebar, then\n- Toggle **Enable Events** on\n- Set the **Request URL** to `https://\u003cngrok-subdomain\u003e.ngrok-free.app/event`\n    - Note that the app must be locally running before setting the Request URL. If everything is correctly configured, a \"Verified\" icon should appear.\n- Under the _Subscribe to Workspace Events_ section, add the following events:\n\n```\ngroup_archive\ngroup_deleted\ngroup_rename\ngroup_unarchive\nmember_joined_channel\nmember_left_channel\n```\n\n- Under the _Subscribe to Bot Events_ section, add the following events:\n\n```\nmember_joined_channel\nmessage.im\n```\n\nNavigate to the _OAuth and Permissions_ section in the sidebar, then\n- Add `https://\u003cngrok-subdomain\u003e.ngrok-free.app/oauth` to the _Redirect URLs_ section\n- Click on **Select Permission Scopes** and add the following scopes:\n\n```\nchannels:read\nchat:write:bot\ngroups:read\ngroups:write\nbot\ncommands\nusers:read\n```\n\n- After saving all changes, click on **Install App to Workspace**\n\nInstalling the app to your testing Slack workspace will supply you with all the credentials you need to set up your local environment. The example `.env` file provided in this repository provides instructions on how to set it up.\n\n```\ncp .env.example .env\n# Follow the instructions inside the new .env file and fill it out\n```\n\nFinally, create an \"authorization\" private channel in your Slack workspace. This channel will be used as a home for all users that are allowed to interact with the Channel Manager. In other words, if a user would like to use the bot, they must be a part of this authorization channel. The name of this channel can be any valid channel name, but it must match the value of `AUTH_CHANNEL` as specified in your `.env` file.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n[1]: https://github.com/DataDog/slack-channel-manager/wiki/Usage-Instructions\n[2]: https://ngrok.com/\n[3]: https://api.slack.com/apps/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fslack-channel-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadog%2Fslack-channel-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fslack-channel-manager/lists"}