Giter Club home page Giter Club logo

ts-dakoku's Introduction

TeamSpirit 打刻

screen

Slack のコマンドで TeamSpirit の打刻をします

Docker Automated build CircleCI Coverage Status Codacy Badge

導入手順

詳細は ブログ記事 を参照してください。

Heroku

Deploy

上のボタンをクリック、もしくは、以下のコマンドを実行

mkdir -p ~/.go/src/github.com/ngs
cd ~/.go/src/github.com/ngs

git clone [email protected]:ngs/ts-dakoku.git
cd ts-dakoku

heroku create
heroku addons:create heroku-redis:hobby-dev

heroku config:set \
  SALESFORCE_CLIENT_ID=${SALESFORCE_CLIENT_ID} \
  SALESFORCE_CLIENT_SECRET=${SALESFORCE_CLIENT_SECRET} \
  SLACK_CLIENT_ID=${SLACK_CLIENT_ID} \
  SLACK_CLIENT_SECRET=${SLACK_CLIENT_SECRET} \
  SLACK_VERIFICATION_TOKEN=${SLACK_VERIFICATION_TOKEN} \
  TEAMSPIRIT_HOST=${TEAMSPIRIT_HOST}

git push heroku master

Docker

docker pull redis
docker pull atsnngs/ts-dakoku

docker run --name ts-dakoku-redis -d redis
docker run --name ts-dakoku -p 8000:8000 -d --rm \
  --link ts-dakoku-redis:redis \
  -e SALESFORCE_CLIENT_ID=${SALESFORCE_CLIENT_ID} \
  -e SALESFORCE_CLIENT_SECRET=${SALESFORCE_CLIENT_SECRET} \
  -e SLACK_VERIFICATION_TOKEN=${SLACK_VERIFICATION_TOKEN} \
  -e SLACK_CLIENT_ID=${SLACK_CLIENT_ID} \
  -e SLACK_CLIENT_SECRET=${SLACK_CLIENT_SECRET} \
  -e TEAMSPIRIT_HOST=${TEAMSPIRIT_HOST} \
  -e REDIS_URL="redis://redis:6379" \
  atsnngs/ts-dakoku

環境変数

Name Description Default
SALESFORCE_CLIENT_ID 接続アプリケーションのコンシューマ鍵
SALESFORCE_CLIENT_SECRET 接続アプリケーションのコンシューマ秘密鍵
SLACK_CLIENT_ID Slack のコンシューマ鍵
SLACK_CLIENT_SECRET Slack のコンシューマ秘密鍵
SLACK_VERIFICATION_TOKEN Slack アプリケーション の Verification Token
TEAMSPIRIT_HOST TeamSpirit のホスト名
STATE_STORE_KEY Redis に保存する認証ステートのキー tsdakoku:states
OAUTH_TOKEN_STORE_KEY Redis に保存する OAuth2 トークンのキー tsdakoku:oauth_tokens
SALESFORCE_TIMEOUT_MINUTES アクセストークンの有効期限 (分) 60

Author

Atushi Nagase

License

Copyright © 2018 Atushi Nagase. All rights reserved.

ts-dakoku's People

Contributors

ngs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ts-dakoku's Issues

slack appの追加設定

マニュアルの設定だけでは、slackの認証の段階で「redirect_uri did not match any configured URIs」というエラーが表示され、打刻はできますが、チャンネルに投稿されませんでした。
slack apiの仕様変更に伴う、追加設定かもしれませんので報告させていただきます。

追加の設定項目について

slack api設定画面の OAuth & Permissions > Redirect URLs に
{herokuのURL}/oauth/slack/callbackを追加することで解決できました。
スクリーンショット 2021-04-16 11 04 55

発生環境

  • 日時: 2021年4月
  • heroku: freeプラン、RegionはUnited States
  • 使用ブラウザ: chrome

休憩時間の打刻が日本時間にならない

slackから休憩打刻をしたときに、日本時間ではなく標準時で登録されてしまいます。
別途herokuの設定が必要であれば教えていただきたいです。

発生環境

  • 日時: 2021年4月
  • heroku: freeプラン、RegionはUnited States
  • 使用ブラウザ: chrome

暫定対応

以下のようにslack.goを変更して対応しました。

	const location = "Asia/Tokyo"
	loc, err := time.LoadLocation(location)
	if err != nil {
			loc = time.FixedZone(location, 9*60*60)
	}
	now := time.Now().In(loc)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.