{"id":18916749,"url":"https://github.com/kufu/yokoso","last_synced_at":"2025-04-06T13:11:23.852Z","repository":{"id":35082453,"uuid":"202458666","full_name":"kufu/yokoso","owner":"kufu","description":"🚪 Slack integration for https://srd-gate.com/03/login.cgi","archived":false,"fork":false,"pushed_at":"2025-03-26T06:42:49.000Z","size":6180,"stargazers_count":76,"open_issues_count":2,"forks_count":14,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-03-30T12:07:40.617Z","etag":null,"topics":["slack","slack-api"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kufu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-15T02:21:11.000Z","updated_at":"2025-03-26T06:42:47.000Z","dependencies_parsed_at":"2023-02-19T04:45:57.558Z","dependency_job_id":"664f24d3-965e-4254-beac-acc7d0e75dfb","html_url":"https://github.com/kufu/yokoso","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/kufu%2Fyokoso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kufu%2Fyokoso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kufu%2Fyokoso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kufu%2Fyokoso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kufu","download_url":"https://codeload.github.com/kufu/yokoso/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485287,"owners_count":20946398,"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":["slack","slack-api"],"created_at":"2024-11-08T10:21:41.809Z","updated_at":"2025-04-06T13:11:23.823Z","avatar_url":"https://github.com/kufu.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yokoso\n\n![Tests](https://github.com/kufu/yokoso/actions/workflows/build.yml/badge.svg)\n\n- Slack とビル来客システム https://srd-gate.com/03/login.cgi を連携させるツール\n- 概要は [SmartHR Tech Blog](https://tech.smarthr.jp/entry/2019/06/28/134701)\n\n\u003cimg src=\"https://github.com/kufu/yokoso/blob/images/sample_animation.gif?raw=true\" width=\"480px\"\u003e\n\n# 対応入館証について\n\n`yokoso` はビル来客システムの連携させるツールですが、来客システムには以下の2つの仕様が確認されています。\n\n- 2次元バーコードを発行するタイプ\n- QRコードを発行するタイプ\n\n本repositoryの所有者であるSmartHRがオフィスをお借りしているビルでは、後者のQRコードを発行するタイプが使用されています。\nそれに合わせて、mainブランチの仕様もQRコードを発行するタイプの来客システムに対応したものになっています。\nまた、2次元バーコードを発行するタイプのシステムは利用できなくなったため、そちらの仕様については積極的に保守ができなくなりました。したがって、そちらの仕様については `2D-code` ブランチに切り離しております。\nご利用される環境に合わせてブランチを選定、設定をお願いします。\n\n# 全体像\n\n\u003cimg src=\"https://github.com/kufu/yokoso/blob/images/diagram.png?raw=true\" width=\"640px\"\u003e\n\n# セットアップ\n\n## サーバサイド\n\n### 前提\n\n- 以下を使っています\n  - Heroku\n  - Redis\n- 以下の環境変数は後で設定するので空で大丈夫です\n  - `SLACK_TOKEN`\n  - `MAIL_ADDRESS_WEBHOOK`\n\n### 起動\n\n#### サーバ実行の場合\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\n- 環境変数を設定してデプロイする\n- リソース割り当て\n  - \u003cimg src=\"https://github.com/kufu/yokoso/blob/images/heroku_dynos.png?raw=true\" width=\"480px\"\u003e\n\n#### ローカル実行の場合\n\n- `sample.env` -\u003e `.env` に名前変更して、環境変数を設定する\n- `localhost:5000` で起動するのでグローバルからローカルに通信をフォワーディングする\n  - 参考: [Using ngrok to develop locally for Slack](https://api.slack.com/tutorials/tunneling-with-ngrok)\n  - 参考: [FORWARD](https://forwardhq.com/)\n\n```\nheroku local -e .env\n```\n\n## Slack App 作成\n\n- Slack App を新規作成して各種設定をする\n- https://api.slack.com/apps\n- \u003cimg src=\"https://github.com/kufu/yokoso/blob/images/slack_app_create.png?raw=true\" width=\"480px\"\u003e\n\n### Interactive Components\n\n- 設定をオンにしてサーバのアドレスを入力する\n- `https://{{server_url}}/app/interactive`\n- \u003cimg src=\"https://github.com/kufu/yokoso/blob/images/slack_app_intractive.png?raw=true\" width=\"480px\"\u003e\n\n### Slash Commands\n\n- スラッシュコマンドの設定を追加する\n- `https://{{server_url}}/app/dialog`\n- \u003cimg src=\"https://github.com/kufu/yokoso/blob/images/slack_app_dialog.png?raw=true\" width=\"480px\"\u003e\n\n### OAuth \u0026 Permissions\n\n- 権限を追加する\n    - channels:history\n    - chat:write:bot\n    - users:read\n    - commands\n      - スラッシュコマンドを設定していれば自動で追加されているはず\n    - \u003cimg src=\"https://github.com/kufu/yokoso/blob/images/slakc_app_scope.png?raw=true\" width=\"480px\"\u003e\n- Token は後でサーバサイド環境変数へセットする\n  - \u003cimg src=\"https://github.com/kufu/yokoso/blob/images/slack_app_token.png?raw=true\" width=\"480px\"\u003e\n\n### App Install\n\n- ワークスペースへのインストールを忘れずに実施\n\n## Email Webhook\n\n- メール受信 -\u003e Webhook を作成\n- 受信したメール本文を json 形式の body 要素として post すれば OK\n- webhook アドレスは `https://{{server_url}}/app/notification`\n- サービスは何でも良い\n  - zapier なら [コチラ](https://zapier.com/app/editor/template/9205?selected_apis=ZapierMailAPI%2CWebHookAPI)\n    - 先述のQRコードを用いるタイプの来客システムの場合、2次元バーコードのタイプとは異なり入館IDからコードの生成を行えなくなっています（入館IDとQRコードを複合したデータが異なる）\n    - そのため、添付ファイルをWebhookに含める形でpostするよう設定してください。その時のKeyは `pdf` にしてください\n  - 参考: \u003cimg src=\"https://github.com/kufu/yokoso/blob/images/zapier.png?raw=true\" width=\"480px\"\u003e\n- Webhook 用メールアドレスは後でサーバサイド環境変数へセットする\n\n## サーバーサイド環境変数の再設定\n\n- 以下の環境変数を設定する\n  - `SLACK_TOKEN`\n  - `MAIL_ADDRESS_WEBHOOK`\n\n## Code of Conduct\n\nEveryone interacting in the yokoso project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kufu/yokoso/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [Apache License 2.0](https://github.com/kufu/yokoso/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkufu%2Fyokoso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkufu%2Fyokoso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkufu%2Fyokoso/lists"}