{"id":22712058,"url":"https://github.com/buildit/slackbot","last_synced_at":"2025-03-29T22:21:29.028Z","repository":{"id":78235762,"uuid":"168602402","full_name":"buildit/slackbot","owner":"buildit","description":"Slackbot used within Buildit slack channels","archived":false,"fork":false,"pushed_at":"2019-06-26T16:54:04.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-02-04T23:31:09.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buildit.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,"publiccode":null,"codemeta":null}},"created_at":"2019-01-31T21:49:40.000Z","updated_at":"2019-06-25T18:51:09.000Z","dependencies_parsed_at":"2023-03-20T10:03:28.524Z","dependency_job_id":null,"html_url":"https://github.com/buildit/slackbot","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/buildit%2Fslackbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildit%2Fslackbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildit%2Fslackbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildit%2Fslackbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buildit","download_url":"https://codeload.github.com/buildit/slackbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246250085,"owners_count":20747293,"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":[],"created_at":"2024-12-10T13:09:15.838Z","updated_at":"2025-03-29T22:21:29.006Z","avatar_url":"https://github.com/buildit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n## Dockerfiles Explained\n \nThere are three Dockerfiles represented in the Repo. If a change is being made to one Dockerfile, the other Dockerfiles should also be updated accordingly.\n\n- Dockerfile \n\n    This Dockerfile is used by the Azure Pipeline to Build and Deploy the application\n\n- Dockerfile_e2e_test:  \n    \n    This Dockerfile is used by the Azure Pipeline to run Integration level tests against the deployed application\n    \n- Dockerfile_local\n\n    This Dockerfile is used to build a run a docker container on your local machine.  It does not contain the stage for uploacing test results to Azure\n   \n## Develop and Run Slackbot\n\nTo begin developing against this repository, the following steps should be followed.\n\n1) Setup environment variables    \n\n        export GOPATH=\u003cPath on your machine where go modules will be stored\u003e\n        \n        Obtain the two tokens that are passed into the app are used to verify API requests.  Both tokens are registered with Slack for the app and will be sent with API requests. However, each serve a different purpose. The Verification token is used to validate Domain changes in slack. When the event url is changed [here](https://api.slack.com/apps/AG29FUH1U/event-subscriptions?), the bot will handle the request and echo the token back to validate communication.  The Oauth token is used by the app to validate all other API requests coming from Slack. \n            export APPSETTING_SLACKBOT_OAUTHTOKEN: \u003cvalue below\u003e\n            export APPSETTING_SLACKBOT_VERIFICATIONTOKEN: \u003cvalue below\u003e\n    \n            APSETTING_SLACKBOT_VERIFICATIONTOKEN: https://api.slack.com/apps/AG29FUH1U/general?  \n            APPSETTING_SLACKBOT_OAUTHTOKEN: https://api.slack.com/apps/AG29FUH1U/oauth?\n    \n2) Clone to Repo\n \n        git clone https://github.com/buildit/slackbot.git\n\n3) Build the Container    \n\n        cd \u003cworkspace\u003e/slackbot  \n        \n        docker build --build-arg APPSETTING_SLACKBOT_OAUTHTOKEN=${APPSETTING_SLACKBOT_OAUTHTOKEN} --build-arg APPSETTING_SLACKBOT_VERIFICATIONTOKEN=${APPSETTING_SLACKBOT_VERIFICATIONTOKEN} --target=final -f Dockerfile_local -t slackbot:latest .\n        \n        \n4) Run the Container\n\n        docker run -d -p 4390:4390 -e APPSETTING_SLACKBOT_OAUTHTOKEN=${APPSETTING_SLACKBOT_OAUTHTOKEN} -e APPSETTING_SLACKBOT_VERIFICATIONTOKEN=${APPSETTING_SLACKBOT_VERIFICATIONTOKEN} slackbot:latest  \n        \n5) Configure slack to communicate with your slackbot container that is now running on localhost\n\n        Once the app is running, Slack needs to be pointed at the running container. For running the app locally on your machine you can establish a tunnel to a port on your machine using NGROK. However, when you point slack at this local domain (step 4 below), the hosted app will no longer be receiving API events.  Note: This works for the time being, but if the bot/app gets higher usage, this local development and repointing of slack will not suffice.\n        1) Download NGROK to enable local development: https://ngrok.com/download  \n        2) Install it to /usr/local/bin or somewhere on your path  \n        3) Slackbot runs on port 4390, so you'd run ngrok in a terminal to expose that port on your machine ex. ngrok http 4390  \n        4) Grab the forwarding domain (ex. http://933d7ddb.ngrok.io) and use that as the domain name for the three different configurations in slack for events, interactions, and slash commands:\n         - events:  https://api.slack.com/apps/AG29FUH1U/event-subscriptions?  \n         - interactions:  https://api.slack.com/apps/AG29FUH1U/interactive-messages?  \n         - slash commands:  https://api.slack.com/apps/AG29FUH1U/slash-commands?  \n         \n 6) Invite @miles to a slack channel.  Type \"@miles hi\" and the bot should respond \"Hello\" in your channel.\n \nNote:  If you would rather run main.go in your IDE instead of continuing to Build and Run the container, you just need to ensure that your Run Configuration sets the environmnet variables:\n        \n        APPSETTING_SLACKBOT_OAUTHTOKEN\n        APPSETTING_SLACKBOT_VERFICATIONTOKEN\n        \nTODO: \n\n1)Add a help menu as we expand bot functionality and event processing. Currently if you mention the app (ex. @miles), the bot will just respond with \"Hello\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildit%2Fslackbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuildit%2Fslackbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildit%2Fslackbot/lists"}