3.8.0 • Published 4 years ago

hubot-kredits v3.8.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

npm

Hubot Kredits

This repository provides scripts for integrating Kosmos Kredits in Hubot chatbots. The bot will watch for project-related things happening on the Internet and automatically create ERC721 tokens for issuing kredits for project contributions.

Setup

Ethereum wallet

You will need an Ethereum wallet for your bot, so it can interact with the Ethereum smart contracts. npm run create-wallet will do the job for you.

The wallet must be funded with enough ETH to interact with the contracts.

Contract permissions

The bot wallet needs the following Aragon contract permissions to interact with kredits-contracts:

  1. ADD_CONTRIBUTION_ROLE on the Contribution contract
  2. MANAGE_CONTRIBUTORS_ROLE on the Contributor contract

These permissions can be configured using the Aragon CLI (see kredits-contracts.

aragon dao acl grant [DAO address] [contribution app address] ADD_CONTRIBUTION_ROLE [bot wallet address]
aragon dao acl grant [DAO address] [contributor app address] MANAGE_CONTRIBUTORS_ROLE [bot wallet address]

To get the Contribution and Contributor app addresses use aragon dao apps.

Configuration

As usual in Hubot, you can add all config as environment variables.

KeyDescription
KREDITS_WEBHOOK_TOKENA string for building your secret webhook URLs
KREDITS_ROOMThe bot will talk to you in this room
KREDITS_WALLET_PATHPath to an Etherum wallet JSON file (default: ./wallet.json)
KREDITS_WALLET_PASSWORDWallet password
KREDITS_PROVIDER_URLEthereum JSON-RPC URL (default: http://localhost:7545)
KREDITS_WEB_URLURL of the Kredits Web app (default: https://kredits.kosmos.org)
KREDITS_DAO_ADDRESSDAO Kernel address
KREDITS_SESSION_SECRETSecret used by grant to sign the session ID
KREDITS_GRANT_HOSTHost used by grant to generate OAuth redirect URLs (default: localhost:8888)
KREDITS_GRANT_PROTOCOLProtocol (http or https) used by grant to generate the OAuth redirect URLs (default: "http")

Integrations

GitHub

The GitHub integration will watch for closed issues and merged pull requests, which carry a kredits label: kredits-1, kredits-2, kredits-3 for small, medium and large contributions. If there are multiple people assigned, it will issue contribution tokens for all of them.

If KREDITS_GITHUB_KEY and KREDITS_GITHUB_SECRET are set, the bot will also expose OAuth endpoints to authenticate new contributors and register new contributor profiles on the smart contract. For this feature, a GitHub OAuth app is required and the OAuth grant config variables must be set.

Setup

Point a GitHub organization webhook to the following URL:

https://your-hubot.example.com/incoming/kredits/github/{webhook_token}

Config

KeyDescription
KREDITS_GITHUB_REPO_BLACKLISTRepos which you do not want to issue kredits for. Format: orgname/reponame, e.g. 67P/test-one-two
KREDITS_GITHUB_KEYKey of the GitHub OAuth app used to authenticate contributors
KREDITS_GITHUB_SECRETSecret of the GitHub OAuth app used to authenticate contributors

Gitea

The Gitea integration will watch for closed issues and merged pull requests, which carry a kredits label: kredits-1, kredits-2, kredits-3 for small, medium and large contributions. If there are multiple people assigned, it will issue contribution tokens for all of them.

Setup

Point a Gitea organization webhook to the following URL:

https://your-hubot.example.com/incoming/kredits/gitea/{webhook_token}

Config

KeyDescription
KREDITS_GITEA_REPO_BLACKLISTRepos which you do not want to issue kredits for. Format: orgname/reponame, e.g. kosmos/test-one-two

MediaWiki

The MediaWiki integration will periodically check for wiki page creations and edits. It will create kredits contribution tokens based on amount of text added.

Setup

No setup needed, except for configuring the wiki URL. The bot will poll your wiki's API on its own.

Config

KeyDescription
KREDITS_MEDIAWIKI_URLYour wiki URL, e.g. https://wiki.kosmos.org/

Zoom

The Zoom integration creates contributions for meeting participations.

Every meeting that is longer than 15 minutes and with more than 2 participants will be registered. An optional meeting whitelist can be configured to create contributions only for specific meetings.

Setup

A Zoom JWT app has to be set up and an event webhook subscription on meeting.ended has to be configured to the following URL:

https://your-hubot.example.com/incoming/kredits/zoom/{webhook_token}

Config

KeyDescription
KREDITS_ZOOM_JWTThe JWT for the Zoom application (required)
KREDITS_ZOOM_MEETING_WHITELISTComma separated list of meeting names for which kredits should be tracked (optional)
KREDITS_ZOOM_CONTRIBUTION_AMOUNTThe amount of kredits issued for each meeting. (default: 500)

Zoom apps

3.8.0

4 years ago

3.7.0

4 years ago

3.6.0

4 years ago

3.5.1

4 years ago

3.5.0

4 years ago

3.4.1

5 years ago

3.4.0

5 years ago

3.3.1

5 years ago

3.3.0

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.7.0

7 years ago

1.6.0

7 years ago

1.5.0

7 years ago

1.4.6

7 years ago

1.4.5

7 years ago

1.4.4

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.1.0

7 years ago