1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge branch 'master' into twitter-module

This commit is contained in:
Kenny Wu 2018-07-31 20:08:32 -07:00 committed by GitHub
commit ab4eef5170
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 459 additions and 349 deletions

View File

@ -273,14 +273,20 @@
"name": "Federico Ruggi",
"avatar_url": "https://avatars2.githubusercontent.com/u/1081051?v=4",
"profile": "https://github.com/ruggi",
"contributions": [
]
"contributions": []
},
{
"login": "ctwoodward",
"name": "Craig Woodward",
"avatar_url": "https://avatars2.githubusercontent.com/u/7293328?v=4",
"profile": "https://github.com/ctwoodward",
"contributions": []
},
{
"login": "ReadmeCritic",
"name": "ReadmeCritic",
"avatar_url": "https://avatars3.githubusercontent.com/u/15367484?v=4",
"profile": "https://twitter.com/ReadmeCritic",
"contributions": [
]
},

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
*.exe
*.exe~
*.dll
ftw*
*.so
*.dylib

View File

@ -9,4 +9,4 @@ before_install:
- export TRAVIS_BUILD_DIR=$HOME/gopath/src/github.com/senorprogrammer/wtf
- cd $HOME/gopath/src/github.com/senorprogrammer/wtf
script: go get ./... && go get github.com/go-test/deep && go test -v github.com/senorprogrammer/wtf/wtftests/...
script: go get ./... && go get github.com/go-test/deep && go test -v github.com/senorprogrammer/wtf/wtf_tests/...

View File

@ -60,7 +60,7 @@ Thanks goes to these wonderful people:
| [<img src="https://avatars0.githubusercontent.com/u/5546718?v=4" width="48px;"/><br /><sub><b>flw</b></sub>](http://flw.tools/)<br /> | [<img src="https://avatars0.githubusercontent.com/u/6024927?v=4" width="48px;"/><br /><sub><b>David Barda</b></sub>](https://github.com/davebarda)<br /> | [<img src="https://avatars2.githubusercontent.com/u/4261980?v=4" width="48px;"/><br /><sub><b>Geoff Lee</b></sub>](https://github.com/matrinox)<br /> | [<img src="https://avatars3.githubusercontent.com/u/1022918?v=4" width="48px;"/><br /><sub><b>George Opritescu</b></sub>](http://international.github.io)<br /> | [<img src="https://avatars3.githubusercontent.com/u/497310?v=4" width="48px;"/><br /><sub><b>Grazfather</b></sub>](https://twitter.com/Grazfather)<br /> | [<img src="https://avatars2.githubusercontent.com/u/1691120?v=4" width="48px;"/><br /><sub><b>Michael Cordell</b></sub>](http://www.mikecordell.com/)<br /> | [<img src="https://avatars2.githubusercontent.com/u/1215497?v=4" width="48px;"/><br /><sub><b>Patrick José Pereira</b></sub>](http://patrick.ibexcps.com)<br /> |
| [<img src="https://avatars2.githubusercontent.com/u/1483092?v=4" width="48px;"/><br /><sub><b>sherod taylor</b></sub>](https://github.com/sherodtaylor)<br /> | [<img src="https://avatars2.githubusercontent.com/u/3062663?v=4" width="48px;"/><br /><sub><b>Andrew Scott</b></sub>](http://cogentia.io)<br /> | [<img src="https://avatars2.githubusercontent.com/u/3252403?v=4" width="48px;"/><br /><sub><b>Anand Sudhir Prayaga</b></sub>](https://github.com/anandsudhir)<br /> | [<img src="https://avatars1.githubusercontent.com/u/12018440?v=4" width="48px;"/><br /><sub><b>Lassi Piironen</b></sub>](https://github.com/lsipii)<br /> | [<img src="https://avatars0.githubusercontent.com/u/14799210?v=4" width="48px;"/><br /><sub><b>BlackWebWolf</b></sub>](https://github.com/BlackWebWolf)<br /> | [<img src="https://avatars0.githubusercontent.com/u/1894885?v=4" width="48px;"/><br /><sub><b>andrewzolotukhin</b></sub>](https://github.com/andrewzolotukhin)<br /> | [<img src="https://avatars1.githubusercontent.com/u/8568280?v=4" width="48px;"/><br /><sub><b>Leon Stigter</b></sub>](https://retgits.github.io)<br /> |
| [<img src="https://avatars3.githubusercontent.com/u/21756?v=4" width="48px;"/><br /><sub><b>Amr Tamimi</b></sub>](https://tamimi.se)<br /> | [<img src="https://avatars3.githubusercontent.com/u/3717137?v=4" width="48px;"/><br /><sub><b>Jagdeep Singh</b></sub>](https://jagdeep.me)<br /> | [<img src="https://avatars0.githubusercontent.com/u/889171?v=4" width="48px;"/><br /><sub><b>Lineu Felipe</b></sub>](https://github.com/darkSasori)<br /> | [<img src="https://avatars2.githubusercontent.com/u/159124?v=4" width="48px;"/><br /><sub><b>Konstantin</b></sub>](https://github.com/kvj)<br /> | [<img src="https://avatars2.githubusercontent.com/u/6044920?v=4" width="48px;"/><br /><sub><b>Brendan O'Leary</b></sub>](http://www.brendanoleary.com)<br /> | [<img src="https://avatars2.githubusercontent.com/u/1226441?v=4" width="48px;"/><br /><sub><b>bertl4398</b></sub>](https://github.com/bertl4398)<br /> | [<img src="https://avatars2.githubusercontent.com/u/6553695?v=4" width="48px;"/><br /><sub><b>Ferenc-</b></sub>](https://github.com/Ferenc-)<br /> |
| [<img src="https://avatars1.githubusercontent.com/u/952036?v=4" width="48px;"/><br /><sub><b>Rohan Verma</b></sub>](http://rohanverma.net)<br /> | [<img src="https://avatars1.githubusercontent.com/u/19293566?v=4" width="48px;"/><br /><sub><b>Tim Fitzgerald</b></sub>](https://github.com/fimtitzgerald)<br /> | [<img src="https://avatars2.githubusercontent.com/u/1081051?v=4" width="48px;"/><br /><sub><b>Federico Ruggi</b></sub>](https://github.com/ruggi)<br /> | [<img src="https://avatars2.githubusercontent.com/u/7293328?v=4" width="48px;"/><br /><sub><b>Craig Woodward</b></sub>](https://github.com/ctwoodward)<br /> |
| [<img src="https://avatars1.githubusercontent.com/u/952036?v=4" width="48px;"/><br /><sub><b>Rohan Verma</b></sub>](http://rohanverma.net)<br /> | [<img src="https://avatars1.githubusercontent.com/u/19293566?v=4" width="48px;"/><br /><sub><b>Tim Fitzgerald</b></sub>](https://github.com/fimtitzgerald)<br /> | [<img src="https://avatars2.githubusercontent.com/u/1081051?v=4" width="48px;"/><br /><sub><b>Federico Ruggi</b></sub>](https://github.com/ruggi)<br /> | [<img src="https://avatars2.githubusercontent.com/u/7293328?v=4" width="48px;"/><br /><sub><b>Craig Woodward</b></sub>](https://github.com/ctwoodward)<br /> | [<img src="https://avatars3.githubusercontent.com/u/15367484?v=4" width="48px;"/><br /><sub><b>ReadmeCritic</b></sub>](https://twitter.com/ReadmeCritic)<br /> |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

View File

@ -12,14 +12,6 @@ Connects to the BambooHR API and displays who will be Away today.
wtf/bamboohr/
```
## Required ENV Variables
<span class="caption">Key:</span> `WTF_BAMBOO_HR_TOKEN` <br />
<span class="caption">Value:</span> Your <a href="https://www.bamboohr.com/api/documentation/">BambooHR API</a> token.
<span class="caption">Key:</span> `WTF_BAMBOO_HR_SUBDOMAIN` <br />
<span class="caption">Value:</span> Your <a href="https://www.bamboohr.com/api/documentation/">BambooHR API</a> subdomain name.
## Keyboard Commands
None.
@ -28,6 +20,7 @@ None.
```yaml
bamboohr:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
enabled: true
position:
top: 0
@ -35,12 +28,16 @@ bamboohr:
height: 2
width: 1
refreshInterval: 900
subdomain: "testco"
```
### Attributes
`apiKey` <br />
Value: Your <a href="https://www.bamboohr.com/api/documentation/">BambooHR API</a> token.
`enabled` <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Whether or not this module is executed and if its data displayed onscreen. <br />
Values: `true`, `false`.
`position` <br />
@ -49,3 +46,6 @@ Defines where in the grid this module's widget will be displayed. <br />
`refreshInterval` <br />
How often, in seconds, this module will update its data. <br />
Values: Any positive integer, `0..n`.
`subdomain` <br />
Value: Your <a href="https://www.bamboohr.com/api/documentation/">BambooHR API</a> subdomain name.

View File

@ -16,12 +16,6 @@ Displays build information for your CircleCI account.
wtf/circleci/
```
## Required ENV Variables
<span class="caption">Key:</span> `WTF_CIRCLE_API_KEY` <br />
<span class="caption">Value:</span> Your <a href="https://circleci.com/account/api">CircleCI API</a>
token.
## Keyboard Commands
None.
@ -30,6 +24,7 @@ None.
```yaml
circleci:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
enabled: true
position:
top: 4
@ -41,6 +36,9 @@ circleci:
### Attributes
`apiKey` <br />
Value: Your <a href="https://circleci.com/account/api">CircleCI API</a> token.
`enabled` <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: `true`, `false`.

View File

@ -4,8 +4,6 @@ date: 2018-06-27T15:55:42-07:00
draft: false
---
<img src="/imgs/modules/gerrit.png" width="640" height="384" alt="gerrit screenshot" />
Displays information about your projects hosted on Gerrit:
#### Open Incoming Reviews
@ -16,17 +14,14 @@ All open reviews that are requesting your approval.
All open reviews created by you.
<img src="/imgs/modules/gerrit.png" width="640" height="167" alt="gerrit screenshot" />
## Source Code
```bash
wtf/gerrit/
```
## Required ENV Variables
<span class="caption">Key:</span> `WTF_GERRIT_PASSWORD` <br />
<span class="caption">Action:</span> Your <a href="https://gerrit-review.googlesource.com/Documentation/user-upload.html#http">Gerrit HTTP Password</a>.
## Keyboard Commands
<span class="caption">Key:</span> `/` <br />
@ -59,6 +54,7 @@ gerrit:
projects:
- org/test-project"
- dotfiles
password: "mypassword"
username: "myname"
verifyServerCertificate: false
```
@ -83,8 +79,11 @@ Values: A valid URI.
`projects` <br />
A list of Gerrit project names to fetch data for. <br />
`password` <br />
Value: Your <a href="https://gerrit-review.googlesource.com/Documentation/user-upload.html#http">Gerrit HTTP Password</a>.
`username` <br />
Your Gerrit username. <br />
Your Gerrit username.
`verifyServerCertificate` <br />
_Optional_ <br />

View File

@ -23,22 +23,6 @@ All open pull requests created by you.
wtf/github/
```
## GitHub Required ENV Variables
<span class="caption">Key:</span> `WTF_GITHUB_TOKEN` <br />
<span class="caption">Action:</span> Your <a href="https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization">GitHub API</a> token.
## GitHub Enterprise Required ENV Variables
<span class="caption">Key:</span> `WTF_GITHUB_TOKEN` <br />
<span class="caption">Action:</span> Your <a href="https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization">GitHub API</a> token.
<span class="caption">Key:</span> `WTF_GITHUB_BASE_URL` <br />
<span class="caption">Action:</span> Your <a href="https://developer.github.com/enterprise/2.13/v3/enterprise-admin/">GitHub Enterprise</a> API URL.
<span class="caption">Key:</span> `WTF_GITHUB_UPLOAD_URL` <br />
<span class="caption">Action:</span> Your <a href="https://developer.github.com/enterprise/2.13/v3/enterprise-admin/">GitHub Enterprise</a> upload URL (often the same as API URL).
## Keyboard Commands
<span class="caption">Key:</span> `/` <br />
@ -60,6 +44,8 @@ wtf/github/
```yaml
github:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
baseURL: ""
enabled: true
enableStatus: true
position:
@ -71,13 +57,21 @@ github:
repositories:
wesker-api: "UmbrellaCorp"
wtf: "senorprogrammer"
uploadURL: ""
username: "senorprogrammer"
```
### Attributes
`apiKey` <br />
Value: Your <a href="https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization">GitHub API</a> token.
`baseURL` <br />
_Optional_ <br />
Value: Your <a href="https://developer.github.com/enterprise/2.13/v3/enterprise-admin/">GitHub Enterprise</a> API URL.
`enabled` <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Whether or not this module is executed and if its data displayed onscreen. <br />
Values: `true`, `false`.
`enableStatus` <br />
@ -98,6 +92,10 @@ for. <br />
<span class="caption">Key:</span> The name of the repository. <br />
<span class="caption">Value:</span> The name of the account or organization that owns the repository.
`uploadURL` <br />
_Optional_ <br />
Value: Your <a href="https://developer.github.com/enterprise/2.13/v3/enterprise-admin/">GitHub Enterprise</a> upload URL (often the same as API URL).
`username` <br />
Your GitHub username. Used to figure out which review requests you've
been added to.

View File

@ -24,11 +24,6 @@ All open merge requests created by you.
wtf/gitlab/
```
## Required ENV Variables
<span class="caption">Key:</span> `WTF_GITLAB_TOKEN` <br />
<span class="caption">Action:</span> A <a href="https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html">GitLab personal access token</a>. Requires at least `api` access.
## Keyboard Commands
<span class="caption">Key:</span> `/` <br />
@ -50,6 +45,7 @@ wtf/gitlab/
```yaml
gitlab:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
enabled: true
position:
top: 2
@ -65,6 +61,9 @@ gitlab:
### Attributes
`apiKey` <br />
Value: A <a href="https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html">GitLab personal access token</a>. Requires at least `api` access.
`enabled` <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: `true`, `false`.

View File

@ -17,11 +17,6 @@ width="320" height="68" alt="jenkins screenshot" />
wtf/jenkins/
```
## Required ENV Variables
<span class="caption">Key:</span> `WTF_JENKINS_API_KEY` <br />
<span class="caption">Value:</span> Your <a href="https://wiki.jenkins.io/display/JENKINS/Remote+access+API">Jenkins API</a> key.
## Keyboard Commands
None.
@ -30,6 +25,7 @@ None.
```yaml
jenkins:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
enabled: true
position:
top: 2
@ -44,6 +40,9 @@ jenkins:
### Attributes
`apiKey` <br />
Value: Your <a href="https://wiki.jenkins.io/display/JENKINS/Remote+access+API">Jenkins API</a> key.
`enabled` <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: `true`, `false`.

View File

@ -14,11 +14,6 @@ Displays all Jira issues assigned to you for the specified project.
wtf/jira/
```
## Required ENV Variables
<span class="caption">Key:</span> `WTF_JIRA_API_KEY` <br />
<span class="caption">Value:</span> Your <a href="https://confluence.atlassian.com/cloud/api-tokens-938839638.html">Jira API</a> key.
## Keyboard Commands
<span class="caption">Key:</span> `[return]` <br />
@ -42,6 +37,7 @@ wtf/jira/
```yaml
jira:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
colors:
rows:
even: "lightblue"
@ -68,6 +64,7 @@ configuration (note the difference in `project`):
```yaml
jira:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
colors:
rows:
even: "lightblue"
@ -89,6 +86,9 @@ jira:
### Attributes
`apiKey` <br />
Value: Your <a href="https://confluence.atlassian.com/cloud/api-tokens-938839638.html">Jira API</a> key.
`colors.rows.even` <br />
Define the foreground color for even-numbered rows. <br />
Values: Any <a href="https://en.wikipedia.org/wiki/X11_color_names">X11

View File

@ -15,12 +15,6 @@ monitored application: deploy ID, deploy time, and who deployed it.
wtf/newrelic/
```
## Required ENV Variables
<span class="caption">Key:</span> `WTF_NEW_RELIC_API_KEY` <br />
<span class="caption">Value:</span> Your <a href="">New Relic API</a>
token.
## Keyboard Commands
None.
@ -29,6 +23,7 @@ None.
```yaml
newrelic:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
applicationId: 10549735
deployCount: 6
enabled: true
@ -42,6 +37,9 @@ newrelic:
### Attributes
`apiKey` <br />
Value: Your <a href="https://docs.newrelic.com/docs/apis/getting-started/intro-apis/access-rest-api-keys">New Relic API</a> token.
`applicationId` <br />
The integer ID of the New Relic application you wish to report on. <br
/>

View File

@ -15,12 +15,6 @@ and who's currently on call.
wtf/opsgenie/
```
## Required ENV Variables
<span class="caption">Key:</span> `WTF_OPS_GENIE_API_KEY` <br />
<span class="caption">Value:</span> Your <a href="https://docs.opsgenie.com/docs/api-integration">OpsGenie
API</a> token.
## Keyboard Commands
None.
@ -29,6 +23,7 @@ None.
```yaml
opsgenie:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
displayEmpty: false
enabled: true
position:
@ -41,6 +36,9 @@ opsgenie:
### Attributes
`apiKey` < br />
Value: Your <a href="https://docs.opsgenie.com/docs/api-integration">OpsGenie API</a> token.
`displayEmpty` <br />
Whether schedules with no assigned person on-call should be displayed. <br />
Values: `true`, `false`.

View File

@ -16,13 +16,6 @@ Displays all items on specified project.
wtf/todoist/
```
## Required ENV Variables
<span class="caption">Key:</span> `WTF_TODOIST_TOKEN` <br />
<span class="caption">Value:</span> Your Todoist API Token. <br />
_You can get your API Token at: todoist.com/prefs/integrations._
## Keyboard Commands
<span class="caption">Key:</span> `h` <br />
@ -62,6 +55,7 @@ _You can get your API Token at: todoist.com/prefs/integrations._
```yaml
todoist:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
enabled: true
position:
top: 0
@ -75,6 +69,9 @@ todoist:
### Attributes
`apiKey` <br />
Value: Your <a href="https://developer.todoist.com/sync/v7/">Todoist API</a> token.
`enabled` <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: `true`, `false`.

View File

@ -16,11 +16,6 @@ Displays build information for your Travis CI account.
wtf/travisci/
```
## Required ENV Variables
<span class="caption">Key:</span> `WTF_TRAVIS_API_TOKEN` <br />
<span class="caption">Value:</span> Your <a href="https://developer.travis-ci.org/authentication">Travis CI API</a> access token.
## Keyboard Commands
None.
@ -29,6 +24,7 @@ None.
```yaml
travisci:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
enabled: true
position:
top: 4
@ -41,6 +37,9 @@ travisci:
### Attributes
`apiKey` <br />
Value: Your <a href="https://developer.travis-ci.org/authentication">Travis CI API</a> access token.
`enabled` <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: `true`, `false`.

View File

@ -14,15 +14,6 @@ Displays all Trello cards on specified lists.
wtf/trello/
```
## Required ENV Variables
<span class="caption">Key:</span> `WTF_TRELLO_APP_KEY` <br />
<span class="caption">Value:</span> Your Trello App Key. <br />
<span class="caption">Key:</span> `WTF_TRELLO_ACCESS_TOKEN` <br />
<span class="caption">Value:</span> Your Trello Access Token. <br />
_You can get your API key at: trello.com/app-key._
## Keyboard Commands
None.
@ -33,6 +24,8 @@ None.
```yaml
trello:
accessToken: "7b8b14f8743a408a93276d7155dd9ee2"
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
board: Main
enabled: true
list: "Todo"
@ -52,6 +45,8 @@ configuration (note the difference in `list`):
```yaml
trello:
accessToken: "7b8b14f8743a408a93276d7155dd9ee2"
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
board: Main
enabled: true
list: ["Todo", "Done"]
@ -66,6 +61,12 @@ trello:
### Attributes
`accessToken` <br />
Value: Your Trello access token.
`apiKey` <br />
Value: Your Trello API key.
`board` <br />
The name of the Trello board. <br />

View File

@ -14,14 +14,6 @@ Displays tickets in the "New" status - i.e. have not yet been assigned.
wtf/zendesk/
```
## Required ENV Variables
<span class="caption">Key:</span> `ZENDESK_API` <br />
<span class="caption">Value:</span> Your Zendesk API Token
<span class="caption">Key:</span> `ZENDESK_DOMAIN` <br />
<span class="caption">Value:</span> Your Zendesk subdomain
## Keyboard Commands
<span class="caption">Key:</span> `[return]` <br />
@ -43,6 +35,7 @@ wtf/zendesk/
```yaml
zendesk:
apiKey: "3276d7155dd9ee27b8b14f8743a408a9"
enabled: true
position:
top: 0
@ -50,11 +43,15 @@ zendesk:
height: 1
width: 1
status: "new"
subdomain: "your_domain"
username: "your_email@acme.com"
```
### Attributes
`apiKey` <br />
Value: Your Zendesk API token.
`enabled` <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: `true`, `false`.
@ -66,6 +63,9 @@ Defines where in the grid this module's widget will be displayed. <br />
The status of tickets you want to retrieve.
Values: `new`, `open`, `pending`, `hold`.
`subdomain` <br />
Value: Your Zendesk subdomain.
`username` <br />
Your Zendesk username
Values: A valid Zendesk username (usually an email address).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -4,6 +4,8 @@ import (
"encoding/xml"
"fmt"
"os"
"github.com/senorprogrammer/wtf/wtf"
)
// A Client represents the data required to connect to the BambooHR API
@ -17,10 +19,10 @@ type Client struct {
func NewClient(url string) *Client {
client := Client{
apiBase: url,
apiKey: os.Getenv("WTF_BAMBOO_HR_TOKEN"),
subdomain: os.Getenv("WTF_BAMBOO_HR_SUBDOMAIN"),
}
client.loadAPICredentials()
return &client
}
@ -60,3 +62,15 @@ func (client *Client) away(startDate, endDate string) (cal Calendar, err error)
return
}
func (client *Client) loadAPICredentials() {
client.apiKey = wtf.Config.UString(
"wtf.mods.bamboohr.apiKey",
os.Getenv("WTF_BAMBOO_HR_TOKEN"),
)
client.subdomain = wtf.Config.UString(
"wtf.mods.bamboohr.subdomain",
os.Getenv("WTF_BAMBOO_HR_SUBDOMAIN"),
)
}

View File

@ -9,6 +9,8 @@ import (
"net/http"
"net/url"
"os"
"github.com/senorprogrammer/wtf/wtf"
)
const APIEnvKey = "WTF_CIRCLE_API_KEY"
@ -59,7 +61,10 @@ func circleRequest(path string) (*http.Response, error) {
}
func apiKey() string {
return os.Getenv(APIEnvKey)
return wtf.Config.UString(
"wtf.mods.circleci.apiKey",
os.Getenv(APIEnvKey),
)
}
func parseJson(obj interface{}, text io.Reader) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -19,12 +19,12 @@
<guid>https://wtfutil.com/posts/modules/zendesk/</guid>
<description>Added in v0.1.0.
Displays tickets in the &amp;ldquo;New&amp;rdquo; status - i.e. have not yet been assigned.
Source Code wtf/zendesk/ Required ENV Variables Key: ZENDESK_API Value: Your Zendesk API Token
Key: ZENDESK_DOMAIN Value: Your Zendesk subdomain
Keyboard Commands Key: [return] Action: Open the selected ticket in the browser.
Source Code wtf/zendesk/ Keyboard Commands Key: [return] Action: Open the selected ticket in the browser.
Key: j Action: Select the next item in the list.
Key: k Action: Select the previous item in the list.
Key: ↓ Action: Scroll down the list.</description>
Key: ↓ Action: Scroll down the list.
Key: ↑ Action: Scroll up the list.
Configuration zendesk:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;enabled:trueposition:top:0left:2height:1width:1status:&amp;#34;new&amp;#34;subdomain:&amp;#34;your_domain&amp;#34;username:&amp;#34;your_email@acme.com&amp;#34; Attributes apiKey Value: Your Zendesk API token.</description>
</item>
<item>
@ -35,10 +35,10 @@ Key: ↓ Action: Scroll down the list.</description>
<guid>https://wtfutil.com/posts/modules/travisci/</guid>
<description>Added in v0.0.12.
Displays build information for your Travis CI account.
Source Code wtf/travisci/ Required ENV Variables Key: WTF_TRAVIS_API_TOKEN Value: Your Travis CI API access token.
Keyboard Commands None.
Configuration travisci:enabled:trueposition:top:4left:1height:1width:2pro:falserefreshInterval:900 Attributes enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data.</description>
Source Code wtf/travisci/ Keyboard Commands None.
Configuration travisci:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;enabled:trueposition:top:4left:1height:1width:2pro:falserefreshInterval:900 Attributes apiKey Value: Your Travis CI API access token.
enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data. Values: A positive integer, 0.</description>
</item>
<item>
@ -49,12 +49,13 @@ position Defines where in the grid this module&amp;rsquo;s widget will be displa
<guid>https://wtfutil.com/posts/modules/todoist/</guid>
<description>Added in v0.0.11.
Displays all items on specified project.
Source Code wtf/todoist/ Required ENV Variables Key: WTF_TODOIST_TOKEN Value: Your Todoist API Token. You can get your API Token at: todoist.com/prefs/integrations.
Keyboard Commands Key: h Action: Show the previous project.
Source Code wtf/todoist/ Keyboard Commands Key: h Action: Show the previous project.
Key: ← Action: Show the previous project.
Key: l Action: Show the next project.
Key: → Action: Show the next project.
Key: j Action: Select the next item in the list.</description>
Key: j Action: Select the next item in the list.
Key: ↓ Action: Select the next item in the list.
Key: k Action: Select the previous item in the list.</description>
</item>
<item>
@ -66,11 +67,11 @@ Key: j Action: Select the next item in the list.</description>
<description>Displays information about your projects hosted on Gerrit:
Open Incoming Reviews All open reviews that are requesting your approval.
My Outgoing Reviews All open reviews created by you.
Source Code wtf/gerrit/ Required ENV Variables Key: WTF_GERRIT_PASSWORD Action: Your Gerrit HTTP Password.
Keyboard Commands Key: / Action: Open/close the widget&amp;rsquo;s help window.
Source Code wtf/gerrit/ Keyboard Commands Key: / Action: Open/close the widget&amp;rsquo;s help window.
Key: h Action: Show the previous project.
Key: l Action: Show the next project.
Key: ← Action: Show the previous project.</description>
Key: ← Action: Show the previous project.
Key: → Action: Show the next project.</description>
</item>
<item>
@ -127,10 +128,10 @@ enabled Determines whether or not this module is executed and if its data displa
<guid>https://wtfutil.com/posts/modules/circleci/</guid>
<description>Added in v0.0.7.
Displays build information for your CircleCI account.
Source Code wtf/circleci/ Required ENV Variables Key: WTF_CIRCLE_API_KEY Value: Your CircleCI API token.
Keyboard Commands None.
Configuration circleci:enabled:trueposition:top:4left:1height:1width:2refreshInterval:900 Attributes enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data.</description>
Source Code wtf/circleci/ Keyboard Commands None.
Configuration circleci:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;enabled:trueposition:top:4left:1height:1width:2refreshInterval:900 Attributes apiKey Value: Your CircleCI API token.
enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data. Values: A positive integer, 0.</description>
</item>
<item>
@ -156,9 +157,9 @@ position Where in the grid this module&amp;rsquo;s widget will be displayed.</de
<guid>https://wtfutil.com/posts/modules/jenkins/</guid>
<description>Added in v0.0.8.
Displays jenkins status of given builds in a project or view
Source Code wtf/jenkins/ Required ENV Variables Key: WTF_JENKINS_API_KEY Value: Your Jenkins API key.
Keyboard Commands None.
Configuration jenkins:enabled:trueposition:top:2left:3height:2width:3refreshInterval:300url:&amp;#34;https://jenkins.domain.com/jenkins/view_url&amp;#34;user:&amp;#34;username&amp;#34;verifyServerCertificate:true Attributes enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
Source Code wtf/jenkins/ Keyboard Commands None.
Configuration jenkins:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;enabled:trueposition:top:2left:3height:2width:3refreshInterval:300url:&amp;#34;https://jenkins.domain.com/jenkins/view_url&amp;#34;user:&amp;#34;username&amp;#34;verifyServerCertificate:true Attributes apiKey Value: Your Jenkins API key.
enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed.
refreshInterval How often, in seconds, this module will update its data.</description>
</item>
@ -173,9 +174,11 @@ refreshInterval How often, in seconds, this module will update its data.</descri
Displays information about your projects hosted on GitLab:
Open Approval Requests All open merge requests that are requesting your approval.
Open Merge Requests All open merge requests created by you.
Source Code wtf/gitlab/ Required ENV Variables Key: WTF_GITLAB_TOKEN Action: A GitLab personal access token. Requires at least api access.
Keyboard Commands Key: / Action: Open/close the widget&amp;rsquo;s help window.
Key: h Action: Show the previous project.</description>
Source Code wtf/gitlab/ Keyboard Commands Key: / Action: Open/close the widget&amp;rsquo;s help window.
Key: h Action: Show the previous project.
Key: l Action: Show the next project.
Key: ← Action: Show the previous project.
Key: → Action: Show the next project.</description>
</item>
<item>
@ -339,12 +342,12 @@ Key: j Action: Select the next item in the list.</description>
<guid>https://wtfutil.com/posts/modules/jira/</guid>
<description>Displays all Jira issues assigned to you for the specified project.
Source Code wtf/jira/ Required ENV Variables Key: WTF_JIRA_API_KEY Value: Your Jira API key.
Keyboard Commands Key: [return] Action: Open the selected issue in the browser.
Source Code wtf/jira/ Keyboard Commands Key: [return] Action: Open the selected issue in the browser.
Key: j Action: Select the next item in the list.
Key: k Action: Select the previous item in the list.
Key: ↓ Action: Select the next item in the list.
Key: ↑ Action: Select the previous item in the list.</description>
Key: ↑ Action: Select the previous item in the list.
Configuration Single Jira Project jira:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;colors:rows:even:&amp;#34;lightblue&amp;#34;odd:&amp;#34;white&amp;#34;domain:&amp;#34;https://umbrellacorp.</description>
</item>
<item>
@ -354,10 +357,11 @@ Key: ↑ Action: Select the previous item in the list.</description>
<guid>https://wtfutil.com/posts/modules/trello/</guid>
<description>Displays all Trello cards on specified lists.
Source Code wtf/trello/ Required ENV Variables Key: WTF_TRELLO_APP_KEY Value: Your Trello App Key. Key: WTF_TRELLO_ACCESS_TOKEN Value: Your Trello Access Token. You can get your API key at: trello.com/app-key.
Keyboard Commands None.
Configuration Single Trello List trello:board:Mainenabled:truelist:&amp;#34;Todo&amp;#34;position:height:1left:2top:0width:1refreshInterval:3600username:myname Multiple Trello Lists If you want to monitor multiple Trello lists, use the following configuration (note the difference in list):
trello:board:Mainenabled:truelist:[&amp;#34;Todo&amp;#34;,&amp;#34;Done&amp;#34;]position:height:1left:2top:0width:1refreshInterval:3600username:myname Attributes board The name of the Trello board.</description>
Source Code wtf/trello/ Keyboard Commands None.
Configuration Single Trello List trello:accessToken:&amp;#34;7b8b14f8743a408a93276d7155dd9ee2&amp;#34;apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;board:Mainenabled:truelist:&amp;#34;Todo&amp;#34;position:height:1left:2top:0width:1refreshInterval:3600username:myname Multiple Trello Lists If you want to monitor multiple Trello lists, use the following configuration (note the difference in list):
trello:accessToken:&amp;#34;7b8b14f8743a408a93276d7155dd9ee2&amp;#34;apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;board:Mainenabled:truelist:[&amp;#34;Todo&amp;#34;,&amp;#34;Done&amp;#34;]position:height:1left:2top:0width:1refreshInterval:3600username:myname Attributes accessToken Value: Your Trello access token.
apiKey Value: Your Trello API key.
board The name of the Trello board. enabled Determines whether or not this module is executed and if its data displayed onscreen.</description>
</item>
<item>
@ -382,10 +386,11 @@ Configuration gcal:colors:title:&amp;#34;red&amp;#34;description:&amp;#34;lightb
<description>Displays information about your git repositories hosted on GitHub:
Open Review Requests All open code review requests assigned to you.
Open Pull Requests All open pull requests created by you.
Source Code wtf/github/ GitHub Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your GitHub API token.
GitHub Enterprise Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your GitHub API token.
Key: WTF_GITHUB_BASE_URL Action: Your GitHub Enterprise API URL.
Key: WTF_GITHUB_UPLOAD_URL Action: Your GitHub Enterprise upload URL (often the same as API URL).</description>
Source Code wtf/github/ Keyboard Commands Key: / Action: Open/close the widget&amp;rsquo;s help window.
Key: h Action: Show the previous git repository.
Key: l Action: Show the next git repository.
Key: ← Action: Show the previous git repository.
Key: → Action: Show the next git repository.</description>
</item>
<item>
@ -438,10 +443,10 @@ filePath The path to the file to be displayed in the widget.</description>
<guid>https://wtfutil.com/posts/modules/newrelic/</guid>
<description>Connects to the New Relic API and displays the last n deploys of the monitored application: deploy ID, deploy time, and who deployed it.
Source Code wtf/newrelic/ Required ENV Variables Key: WTF_NEW_RELIC_API_KEY Value: Your New Relic API token.
Keyboard Commands None.
Configuration newrelic:applicationId:10549735deployCount:6enabled:trueposition:top:4left:3height:1width:2refreshInterval:900 Attributes applicationId The integer ID of the New Relic application you wish to report on. Values: A positive integer, 0..n.
deployCount The number of past deploys to display on screen.</description>
Source Code wtf/newrelic/ Keyboard Commands None.
Configuration newrelic:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;applicationId:10549735deployCount:6enabled:trueposition:top:4left:3height:1width:2refreshInterval:900 Attributes apiKey Value: Your New Relic API token.
applicationId The integer ID of the New Relic application you wish to report on. Values: A positive integer, 0..n.
deployCount The number of past deploys to display on screen. Values: A positive integer, 0.</description>
</item>
<item>
@ -451,9 +456,9 @@ deployCount The number of past deploys to display on screen.</description>
<guid>https://wtfutil.com/posts/modules/opsgenie/</guid>
<description>Connects to the OpsGenie API and displays all your scheduled rotations and who&amp;rsquo;s currently on call.
Source Code wtf/opsgenie/ Required ENV Variables Key: WTF_OPS_GENIE_API_KEY Value: Your OpsGenie API token.
Keyboard Commands None.
Configuration opsgenie:displayEmpty:falseenabled:trueposition:top:2left:1height:2width:1refreshInterval:21600 Attributes displayEmpty Whether schedules with no assigned person on-call should be displayed. Values: true, false.
Source Code wtf/opsgenie/ Keyboard Commands None.
Configuration opsgenie:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;displayEmpty:falseenabled:trueposition:top:2left:1height:2width:1refreshInterval:21600 Attributes apiKey &amp;lt; br /&amp;gt; Value: Your OpsGenie API token.
displayEmpty Whether schedules with no assigned person on-call should be displayed. Values: true, false.
enabled Whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Where in the grid this module&amp;rsquo;s widget will be displayed.</description>
</item>
@ -475,11 +480,10 @@ Wifi Network The name of the current network Whether or not the network uses enc
<guid>https://wtfutil.com/posts/modules/bamboohr/</guid>
<description>Connects to the BambooHR API and displays who will be Away today.
Source Code wtf/bamboohr/ Required ENV Variables Key: WTF_BAMBOO_HR_TOKEN Value: Your BambooHR API token.
Key: WTF_BAMBOO_HR_SUBDOMAIN Value: Your BambooHR API subdomain name.
Keyboard Commands None.
Configuration bamboohr:enabled:trueposition:top:0left:1height:2width:1refreshInterval:900 Attributes enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data.</description>
Source Code wtf/bamboohr/ Keyboard Commands None.
Configuration bamboohr:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;enabled:trueposition:top:0left:1height:2width:1refreshInterval:900subdomain:&amp;#34;testco&amp;#34; Attributes apiKey Value: Your BambooHR API token.
enabled Whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data. Values: Any positive integer, 0.</description>
</item>
<item>

View File

@ -19,12 +19,12 @@
<guid>https://wtfutil.com/posts/modules/zendesk/</guid>
<description>Added in v0.1.0.
Displays tickets in the &amp;ldquo;New&amp;rdquo; status - i.e. have not yet been assigned.
Source Code wtf/zendesk/ Required ENV Variables Key: ZENDESK_API Value: Your Zendesk API Token
Key: ZENDESK_DOMAIN Value: Your Zendesk subdomain
Keyboard Commands Key: [return] Action: Open the selected ticket in the browser.
Source Code wtf/zendesk/ Keyboard Commands Key: [return] Action: Open the selected ticket in the browser.
Key: j Action: Select the next item in the list.
Key: k Action: Select the previous item in the list.
Key: ↓ Action: Scroll down the list.</description>
Key: ↓ Action: Scroll down the list.
Key: ↑ Action: Scroll up the list.
Configuration zendesk:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;enabled:trueposition:top:0left:2height:1width:1status:&amp;#34;new&amp;#34;subdomain:&amp;#34;your_domain&amp;#34;username:&amp;#34;your_email@acme.com&amp;#34; Attributes apiKey Value: Your Zendesk API token.</description>
</item>
<item>
@ -35,10 +35,10 @@ Key: ↓ Action: Scroll down the list.</description>
<guid>https://wtfutil.com/posts/modules/travisci/</guid>
<description>Added in v0.0.12.
Displays build information for your Travis CI account.
Source Code wtf/travisci/ Required ENV Variables Key: WTF_TRAVIS_API_TOKEN Value: Your Travis CI API access token.
Keyboard Commands None.
Configuration travisci:enabled:trueposition:top:4left:1height:1width:2pro:falserefreshInterval:900 Attributes enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data.</description>
Source Code wtf/travisci/ Keyboard Commands None.
Configuration travisci:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;enabled:trueposition:top:4left:1height:1width:2pro:falserefreshInterval:900 Attributes apiKey Value: Your Travis CI API access token.
enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data. Values: A positive integer, 0.</description>
</item>
<item>
@ -49,12 +49,13 @@ position Defines where in the grid this module&amp;rsquo;s widget will be displa
<guid>https://wtfutil.com/posts/modules/todoist/</guid>
<description>Added in v0.0.11.
Displays all items on specified project.
Source Code wtf/todoist/ Required ENV Variables Key: WTF_TODOIST_TOKEN Value: Your Todoist API Token. You can get your API Token at: todoist.com/prefs/integrations.
Keyboard Commands Key: h Action: Show the previous project.
Source Code wtf/todoist/ Keyboard Commands Key: h Action: Show the previous project.
Key: ← Action: Show the previous project.
Key: l Action: Show the next project.
Key: → Action: Show the next project.
Key: j Action: Select the next item in the list.</description>
Key: j Action: Select the next item in the list.
Key: ↓ Action: Select the next item in the list.
Key: k Action: Select the previous item in the list.</description>
</item>
<item>
@ -66,11 +67,11 @@ Key: j Action: Select the next item in the list.</description>
<description>Displays information about your projects hosted on Gerrit:
Open Incoming Reviews All open reviews that are requesting your approval.
My Outgoing Reviews All open reviews created by you.
Source Code wtf/gerrit/ Required ENV Variables Key: WTF_GERRIT_PASSWORD Action: Your Gerrit HTTP Password.
Keyboard Commands Key: / Action: Open/close the widget&amp;rsquo;s help window.
Source Code wtf/gerrit/ Keyboard Commands Key: / Action: Open/close the widget&amp;rsquo;s help window.
Key: h Action: Show the previous project.
Key: l Action: Show the next project.
Key: ← Action: Show the previous project.</description>
Key: ← Action: Show the previous project.
Key: → Action: Show the next project.</description>
</item>
<item>
@ -127,10 +128,10 @@ enabled Determines whether or not this module is executed and if its data displa
<guid>https://wtfutil.com/posts/modules/circleci/</guid>
<description>Added in v0.0.7.
Displays build information for your CircleCI account.
Source Code wtf/circleci/ Required ENV Variables Key: WTF_CIRCLE_API_KEY Value: Your CircleCI API token.
Keyboard Commands None.
Configuration circleci:enabled:trueposition:top:4left:1height:1width:2refreshInterval:900 Attributes enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data.</description>
Source Code wtf/circleci/ Keyboard Commands None.
Configuration circleci:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;enabled:trueposition:top:4left:1height:1width:2refreshInterval:900 Attributes apiKey Value: Your CircleCI API token.
enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data. Values: A positive integer, 0.</description>
</item>
<item>
@ -156,9 +157,9 @@ position Where in the grid this module&amp;rsquo;s widget will be displayed.</de
<guid>https://wtfutil.com/posts/modules/jenkins/</guid>
<description>Added in v0.0.8.
Displays jenkins status of given builds in a project or view
Source Code wtf/jenkins/ Required ENV Variables Key: WTF_JENKINS_API_KEY Value: Your Jenkins API key.
Keyboard Commands None.
Configuration jenkins:enabled:trueposition:top:2left:3height:2width:3refreshInterval:300url:&amp;#34;https://jenkins.domain.com/jenkins/view_url&amp;#34;user:&amp;#34;username&amp;#34;verifyServerCertificate:true Attributes enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
Source Code wtf/jenkins/ Keyboard Commands None.
Configuration jenkins:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;enabled:trueposition:top:2left:3height:2width:3refreshInterval:300url:&amp;#34;https://jenkins.domain.com/jenkins/view_url&amp;#34;user:&amp;#34;username&amp;#34;verifyServerCertificate:true Attributes apiKey Value: Your Jenkins API key.
enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed.
refreshInterval How often, in seconds, this module will update its data.</description>
</item>
@ -173,9 +174,11 @@ refreshInterval How often, in seconds, this module will update its data.</descri
Displays information about your projects hosted on GitLab:
Open Approval Requests All open merge requests that are requesting your approval.
Open Merge Requests All open merge requests created by you.
Source Code wtf/gitlab/ Required ENV Variables Key: WTF_GITLAB_TOKEN Action: A GitLab personal access token. Requires at least api access.
Keyboard Commands Key: / Action: Open/close the widget&amp;rsquo;s help window.
Key: h Action: Show the previous project.</description>
Source Code wtf/gitlab/ Keyboard Commands Key: / Action: Open/close the widget&amp;rsquo;s help window.
Key: h Action: Show the previous project.
Key: l Action: Show the next project.
Key: ← Action: Show the previous project.
Key: → Action: Show the next project.</description>
</item>
<item>
@ -339,12 +342,12 @@ Key: j Action: Select the next item in the list.</description>
<guid>https://wtfutil.com/posts/modules/jira/</guid>
<description>Displays all Jira issues assigned to you for the specified project.
Source Code wtf/jira/ Required ENV Variables Key: WTF_JIRA_API_KEY Value: Your Jira API key.
Keyboard Commands Key: [return] Action: Open the selected issue in the browser.
Source Code wtf/jira/ Keyboard Commands Key: [return] Action: Open the selected issue in the browser.
Key: j Action: Select the next item in the list.
Key: k Action: Select the previous item in the list.
Key: ↓ Action: Select the next item in the list.
Key: ↑ Action: Select the previous item in the list.</description>
Key: ↑ Action: Select the previous item in the list.
Configuration Single Jira Project jira:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;colors:rows:even:&amp;#34;lightblue&amp;#34;odd:&amp;#34;white&amp;#34;domain:&amp;#34;https://umbrellacorp.</description>
</item>
<item>
@ -354,10 +357,11 @@ Key: ↑ Action: Select the previous item in the list.</description>
<guid>https://wtfutil.com/posts/modules/trello/</guid>
<description>Displays all Trello cards on specified lists.
Source Code wtf/trello/ Required ENV Variables Key: WTF_TRELLO_APP_KEY Value: Your Trello App Key. Key: WTF_TRELLO_ACCESS_TOKEN Value: Your Trello Access Token. You can get your API key at: trello.com/app-key.
Keyboard Commands None.
Configuration Single Trello List trello:board:Mainenabled:truelist:&amp;#34;Todo&amp;#34;position:height:1left:2top:0width:1refreshInterval:3600username:myname Multiple Trello Lists If you want to monitor multiple Trello lists, use the following configuration (note the difference in list):
trello:board:Mainenabled:truelist:[&amp;#34;Todo&amp;#34;,&amp;#34;Done&amp;#34;]position:height:1left:2top:0width:1refreshInterval:3600username:myname Attributes board The name of the Trello board.</description>
Source Code wtf/trello/ Keyboard Commands None.
Configuration Single Trello List trello:accessToken:&amp;#34;7b8b14f8743a408a93276d7155dd9ee2&amp;#34;apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;board:Mainenabled:truelist:&amp;#34;Todo&amp;#34;position:height:1left:2top:0width:1refreshInterval:3600username:myname Multiple Trello Lists If you want to monitor multiple Trello lists, use the following configuration (note the difference in list):
trello:accessToken:&amp;#34;7b8b14f8743a408a93276d7155dd9ee2&amp;#34;apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;board:Mainenabled:truelist:[&amp;#34;Todo&amp;#34;,&amp;#34;Done&amp;#34;]position:height:1left:2top:0width:1refreshInterval:3600username:myname Attributes accessToken Value: Your Trello access token.
apiKey Value: Your Trello API key.
board The name of the Trello board. enabled Determines whether or not this module is executed and if its data displayed onscreen.</description>
</item>
<item>
@ -382,10 +386,11 @@ Configuration gcal:colors:title:&amp;#34;red&amp;#34;description:&amp;#34;lightb
<description>Displays information about your git repositories hosted on GitHub:
Open Review Requests All open code review requests assigned to you.
Open Pull Requests All open pull requests created by you.
Source Code wtf/github/ GitHub Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your GitHub API token.
GitHub Enterprise Required ENV Variables Key: WTF_GITHUB_TOKEN Action: Your GitHub API token.
Key: WTF_GITHUB_BASE_URL Action: Your GitHub Enterprise API URL.
Key: WTF_GITHUB_UPLOAD_URL Action: Your GitHub Enterprise upload URL (often the same as API URL).</description>
Source Code wtf/github/ Keyboard Commands Key: / Action: Open/close the widget&amp;rsquo;s help window.
Key: h Action: Show the previous git repository.
Key: l Action: Show the next git repository.
Key: ← Action: Show the previous git repository.
Key: → Action: Show the next git repository.</description>
</item>
<item>
@ -438,10 +443,10 @@ filePath The path to the file to be displayed in the widget.</description>
<guid>https://wtfutil.com/posts/modules/newrelic/</guid>
<description>Connects to the New Relic API and displays the last n deploys of the monitored application: deploy ID, deploy time, and who deployed it.
Source Code wtf/newrelic/ Required ENV Variables Key: WTF_NEW_RELIC_API_KEY Value: Your New Relic API token.
Keyboard Commands None.
Configuration newrelic:applicationId:10549735deployCount:6enabled:trueposition:top:4left:3height:1width:2refreshInterval:900 Attributes applicationId The integer ID of the New Relic application you wish to report on. Values: A positive integer, 0..n.
deployCount The number of past deploys to display on screen.</description>
Source Code wtf/newrelic/ Keyboard Commands None.
Configuration newrelic:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;applicationId:10549735deployCount:6enabled:trueposition:top:4left:3height:1width:2refreshInterval:900 Attributes apiKey Value: Your New Relic API token.
applicationId The integer ID of the New Relic application you wish to report on. Values: A positive integer, 0..n.
deployCount The number of past deploys to display on screen. Values: A positive integer, 0.</description>
</item>
<item>
@ -451,9 +456,9 @@ deployCount The number of past deploys to display on screen.</description>
<guid>https://wtfutil.com/posts/modules/opsgenie/</guid>
<description>Connects to the OpsGenie API and displays all your scheduled rotations and who&amp;rsquo;s currently on call.
Source Code wtf/opsgenie/ Required ENV Variables Key: WTF_OPS_GENIE_API_KEY Value: Your OpsGenie API token.
Keyboard Commands None.
Configuration opsgenie:displayEmpty:falseenabled:trueposition:top:2left:1height:2width:1refreshInterval:21600 Attributes displayEmpty Whether schedules with no assigned person on-call should be displayed. Values: true, false.
Source Code wtf/opsgenie/ Keyboard Commands None.
Configuration opsgenie:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;displayEmpty:falseenabled:trueposition:top:2left:1height:2width:1refreshInterval:21600 Attributes apiKey &amp;lt; br /&amp;gt; Value: Your OpsGenie API token.
displayEmpty Whether schedules with no assigned person on-call should be displayed. Values: true, false.
enabled Whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Where in the grid this module&amp;rsquo;s widget will be displayed.</description>
</item>
@ -475,11 +480,10 @@ Wifi Network The name of the current network Whether or not the network uses enc
<guid>https://wtfutil.com/posts/modules/bamboohr/</guid>
<description>Connects to the BambooHR API and displays who will be Away today.
Source Code wtf/bamboohr/ Required ENV Variables Key: WTF_BAMBOO_HR_TOKEN Value: Your BambooHR API token.
Key: WTF_BAMBOO_HR_SUBDOMAIN Value: Your BambooHR API subdomain name.
Keyboard Commands None.
Configuration bamboohr:enabled:trueposition:top:0left:1height:2width:1refreshInterval:900 Attributes enabled Determines whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data.</description>
Source Code wtf/bamboohr/ Keyboard Commands None.
Configuration bamboohr:apiKey:&amp;#34;3276d7155dd9ee27b8b14f8743a408a9&amp;#34;enabled:trueposition:top:0left:1height:2width:1refreshInterval:900subdomain:&amp;#34;testco&amp;#34; Attributes apiKey Value: Your BambooHR API token.
enabled Whether or not this module is executed and if its data displayed onscreen. Values: true, false.
position Defines where in the grid this module&amp;rsquo;s widget will be displayed. refreshInterval How often, in seconds, this module will update its data. Values: Any positive integer, 0.</description>
</item>
<item>

View File

@ -141,31 +141,28 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/bamboohr/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_BAMBOO_HR_TOKEN</code> <br />
<span class="caption">Value:</span> Your <a href="https://www.bamboohr.com/api/documentation/">BambooHR API</a> token.</p>
<p><span class="caption">Key:</span> <code>WTF_BAMBOO_HR_SUBDOMAIN</code> <br />
<span class="caption">Value:</span> Your <a href="https://www.bamboohr.com/api/documentation/">BambooHR API</a> subdomain name.</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p>None.</p>
<h2 id="configuration">Configuration</h2>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">bamboohr<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
</span><span class="w"> </span>top<span class="p">:</span><span class="w"> </span><span class="m">0</span><span class="w">
</span><span class="w"> </span>left<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
</span><span class="w"> </span>height<span class="p">:</span><span class="w"> </span><span class="m">2</span><span class="w">
</span><span class="w"> </span>width<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">900</span></code></pre></div>
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">900</span><span class="w">
</span><span class="w"> </span>subdomain<span class="p">:</span><span class="w"> </span><span class="s2">&#34;testco&#34;</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>apiKey</code> <br />
Value: Your <a href="https://www.bamboohr.com/api/documentation/">BambooHR API</a> token.</p>
<p><code>enabled</code> <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Whether or not this module is executed and if its data displayed onscreen. <br />
Values: <code>true</code>, <code>false</code>.</p>
<p><code>position</code> <br />
@ -175,6 +172,9 @@ Defines where in the grid this module&rsquo;s widget will be displayed. <br /></
How often, in seconds, this module will update its data. <br />
Values: Any positive integer, <code>0..n</code>.</p>
<p><code>subdomain</code> <br />
Value: Your <a href="https://www.bamboohr.com/api/documentation/">BambooHR API</a> subdomain name.</p>
</div>
<div class="footer">

View File

@ -145,18 +145,13 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/circleci/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_CIRCLE_API_KEY</code> <br />
<span class="caption">Value:</span> Your <a href="https://circleci.com/account/api">CircleCI API</a>
token.</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p>None.</p>
<h2 id="configuration">Configuration</h2>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">circleci<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
</span><span class="w"> </span>top<span class="p">:</span><span class="w"> </span><span class="m">4</span><span class="w">
@ -166,6 +161,9 @@ token.</p>
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">900</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>apiKey</code> <br />
Value: Your <a href="https://circleci.com/account/api">CircleCI API</a> token.</p>
<p><code>enabled</code> <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: <code>true</code>, <code>false</code>.</p>

View File

@ -137,8 +137,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<p><img src="/imgs/modules/gerrit.png" width="640" height="384" alt="gerrit screenshot" /></p>
<p>Displays information about your projects hosted on Gerrit:</p>
<h4 id="open-incoming-reviews">Open Incoming Reviews</h4>
@ -149,13 +147,10 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<p>All open reviews created by you.</p>
<p><img src="/imgs/modules/gerrit.png" width="640" height="167" alt="gerrit screenshot" /></p>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/gerrit/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_GERRIT_PASSWORD</code> <br />
<span class="caption">Action:</span> Your <a href="https://gerrit-review.googlesource.com/Documentation/user-upload.html#http">Gerrit HTTP Password</a>.</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p><span class="caption">Key:</span> <code>/</code> <br />
@ -186,6 +181,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
</span><span class="w"> </span>projects<span class="p">:</span><span class="w">
</span><span class="w"> </span>-<span class="w"> </span>org/test-project<span class="s2">&#34;
</span><span class="s2"> - dotfiles
</span><span class="s2"> password: &#34;</span>mypassword<span class="s2">&#34;
</span><span class="s2"> username: &#34;</span>myname&#34;<span class="w">
</span><span class="w"> </span>verifyServerCertificate<span class="p">:</span><span class="w"> </span><span class="kc">false</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
@ -208,8 +204,11 @@ Values: A valid URI.</p>
<p><code>projects</code> <br />
A list of Gerrit project names to fetch data for. <br /></p>
<p><code>password</code> <br />
Value: Your <a href="https://gerrit-review.googlesource.com/Documentation/user-upload.html#http">Gerrit HTTP Password</a>.</p>
<p><code>username</code> <br />
Your Gerrit username. <br /></p>
Your Gerrit username.</p>
<p><code>verifyServerCertificate</code> <br />
<em>Optional</em> <br />

View File

@ -151,22 +151,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/github/</code></pre></div>
<h2 id="github-required-env-variables">GitHub Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_GITHUB_TOKEN</code> <br />
<span class="caption">Action:</span> Your <a href="https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization">GitHub API</a> token.</p>
<h2 id="github-enterprise-required-env-variables">GitHub Enterprise Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_GITHUB_TOKEN</code> <br />
<span class="caption">Action:</span> Your <a href="https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization">GitHub API</a> token.</p>
<p><span class="caption">Key:</span> <code>WTF_GITHUB_BASE_URL</code> <br />
<span class="caption">Action:</span> Your <a href="https://developer.github.com/enterprise/2.13/v3/enterprise-admin/">GitHub Enterprise</a> API URL.</p>
<p><span class="caption">Key:</span> <code>WTF_GITHUB_UPLOAD_URL</code> <br />
<span class="caption">Action:</span> Your <a href="https://developer.github.com/enterprise/2.13/v3/enterprise-admin/">GitHub Enterprise</a> upload URL (often the same as API URL).</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p><span class="caption">Key:</span> <code>/</code> <br />
@ -186,6 +170,8 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="configuration">Configuration</h2>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">github<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>baseURL<span class="p">:</span><span class="w"> </span><span class="s2">&#34;&#34;</span><span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>enableStatus<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
@ -197,11 +183,19 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
</span><span class="w"> </span>repositories<span class="p">:</span><span class="w">
</span><span class="w"> </span>wesker-api<span class="p">:</span><span class="w"> </span><span class="s2">&#34;UmbrellaCorp&#34;</span><span class="w">
</span><span class="w"> </span>wtf<span class="p">:</span><span class="w"> </span><span class="s2">&#34;senorprogrammer&#34;</span><span class="w">
</span><span class="w"> </span>uploadURL<span class="p">:</span><span class="w"> </span><span class="s2">&#34;&#34;</span><span class="w">
</span><span class="w"> </span>username<span class="p">:</span><span class="w"> </span><span class="s2">&#34;senorprogrammer&#34;</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>apiKey</code> <br />
Value: Your <a href="https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization">GitHub API</a> token.</p>
<p><code>baseURL</code> <br />
<em>Optional</em> <br />
Value: Your <a href="https://developer.github.com/enterprise/2.13/v3/enterprise-admin/">GitHub Enterprise</a> API URL.</p>
<p><code>enabled</code> <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Whether or not this module is executed and if its data displayed onscreen. <br />
Values: <code>true</code>, <code>false</code>.</p>
<p><code>enableStatus</code> <br />
@ -222,6 +216,10 @@ for. <br />
<span class="caption">Key:</span> The name of the repository. <br />
<span class="caption">Value:</span> The name of the account or organization that owns the repository.</p>
<p><code>uploadURL</code> <br />
<em>Optional</em> <br />
Value: Your <a href="https://developer.github.com/enterprise/2.13/v3/enterprise-admin/">GitHub Enterprise</a> upload URL (often the same as API URL).</p>
<p><code>username</code> <br />
Your GitHub username. Used to figure out which review requests you&rsquo;ve
been added to.</p>

View File

@ -153,11 +153,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/gitlab/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_GITLAB_TOKEN</code> <br />
<span class="caption">Action:</span> A <a href="https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html">GitLab personal access token</a>. Requires at least <code>api</code> access.</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p><span class="caption">Key:</span> <code>/</code> <br />
@ -177,6 +172,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="configuration">Configuration</h2>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">gitlab<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
</span><span class="w"> </span>top<span class="p">:</span><span class="w"> </span><span class="m">2</span><span class="w">
@ -190,6 +186,9 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
</span><span class="w"> </span>username<span class="p">:</span><span class="w"> </span><span class="s2">&#34;senorprogrammer&#34;</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>apiKey</code> <br />
Value: A <a href="https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html">GitLab personal access token</a>. Requires at least <code>api</code> access.</p>
<p><code>enabled</code> <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: <code>true</code>, <code>false</code>.</p>

View File

@ -146,17 +146,13 @@ width="320" height="68" alt="jenkins screenshot" /></p>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/jenkins/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_JENKINS_API_KEY</code> <br />
<span class="caption">Value:</span> Your <a href="https://wiki.jenkins.io/display/JENKINS/Remote+access+API">Jenkins API</a> key.</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p>None.</p>
<h2 id="configuration">Configuration</h2>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">jenkins<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
</span><span class="w"> </span>top<span class="p">:</span><span class="w"> </span><span class="m">2</span><span class="w">
@ -169,6 +165,9 @@ width="320" height="68" alt="jenkins screenshot" /></p>
</span><span class="w"> </span>verifyServerCertificate<span class="p">:</span><span class="w"> </span><span class="kc">true</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>apiKey</code> <br />
Value: Your <a href="https://wiki.jenkins.io/display/JENKINS/Remote+access+API">Jenkins API</a> key.</p>
<p><code>enabled</code> <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: <code>true</code>, <code>false</code>.</p>

View File

@ -143,11 +143,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/jira/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_JIRA_API_KEY</code> <br />
<span class="caption">Value:</span> Your <a href="https://confluence.atlassian.com/cloud/api-tokens-938839638.html">Jira API</a> key.</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p><span class="caption">Key:</span> <code>[return]</code> <br />
@ -169,6 +164,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h3 id="single-jira-project">Single Jira Project</h3>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">jira<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>colors<span class="p">:</span><span class="w">
</span><span class="w"> </span>rows<span class="p">:</span><span class="w">
</span><span class="w"> </span>even<span class="p">:</span><span class="w"> </span><span class="s2">&#34;lightblue&#34;</span><span class="w">
@ -191,6 +187,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<p>If you want to monitor multiple Jira projects, use the following
configuration (note the difference in <code>project</code>):</p>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">jira<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>colors<span class="p">:</span><span class="w">
</span><span class="w"> </span>rows<span class="p">:</span><span class="w">
</span><span class="w"> </span>even<span class="p">:</span><span class="w"> </span><span class="s2">&#34;lightblue&#34;</span><span class="w">
@ -210,6 +207,9 @@ configuration (note the difference in <code>project</code>):</p>
</span><span class="w"> </span>verifyServerCertificate<span class="p">:</span><span class="w"> </span><span class="kc">true</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>apiKey</code> <br />
Value: Your <a href="https://confluence.atlassian.com/cloud/api-tokens-938839638.html">Jira API</a> key.</p>
<p><code>colors.rows.even</code> <br />
Define the foreground color for even-numbered rows. <br />
Values: Any <a href="https://en.wikipedia.org/wiki/X11_color_names">X11

View File

@ -144,18 +144,13 @@ monitored application: deploy ID, deploy time, and who deployed it.</p>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/newrelic/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_NEW_RELIC_API_KEY</code> <br />
<span class="caption">Value:</span> Your <a href="">New Relic API</a>
token.</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p>None.</p>
<h2 id="configuration">Configuration</h2>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">newrelic<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>applicationId<span class="p">:</span><span class="w"> </span><span class="m">10549735</span><span class="w">
</span><span class="w"> </span>deployCount<span class="p">:</span><span class="w"> </span><span class="m">6</span><span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
@ -167,6 +162,9 @@ token.</p>
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">900</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>apiKey</code> <br />
Value: Your <a href="https://docs.newrelic.com/docs/apis/getting-started/intro-apis/access-rest-api-keys">New Relic API</a> token.</p>
<p><code>applicationId</code> <br />
The integer ID of the New Relic application you wish to report on. <br
/>

View File

@ -144,18 +144,13 @@ and who&rsquo;s currently on call.</p>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/opsgenie/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_OPS_GENIE_API_KEY</code> <br />
<span class="caption">Value:</span> Your <a href="https://docs.opsgenie.com/docs/api-integration">OpsGenie
API</a> token.</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p>None.</p>
<h2 id="configuration">Configuration</h2>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">opsgenie<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>displayEmpty<span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
@ -166,6 +161,9 @@ API</a> token.</p>
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">21600</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>apiKey</code> &lt; br /&gt;
Value: Your <a href="https://docs.opsgenie.com/docs/api-integration">OpsGenie API</a> token.</p>
<p><code>displayEmpty</code> <br />
Whether schedules with no assigned person on-call should be displayed. <br />
Values: <code>true</code>, <code>false</code>.</p>

View File

@ -145,13 +145,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/todoist/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_TODOIST_TOKEN</code> <br />
<span class="caption">Value:</span> Your Todoist API Token. <br /></p>
<p><em>You can get your API Token at: todoist.com/prefs/integrations.</em></p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p><span class="caption">Key:</span> <code>h</code> <br />
@ -189,6 +182,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="configuration">Configuration</h2>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">todoist<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
</span><span class="w"> </span>top<span class="p">:</span><span class="w"> </span><span class="m">0</span><span class="w">
@ -200,6 +194,9 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">3600</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>apiKey</code> <br />
Value: Your <a href="https://developer.todoist.com/sync/v7/">Todoist API</a> token.</p>
<p><code>enabled</code> <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: <code>true</code>, <code>false</code>.</p>

View File

@ -145,17 +145,13 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/travisci/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_TRAVIS_API_TOKEN</code> <br />
<span class="caption">Value:</span> Your <a href="https://developer.travis-ci.org/authentication">Travis CI API</a> access token.</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p>None.</p>
<h2 id="configuration">Configuration</h2>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">travisci<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
</span><span class="w"> </span>top<span class="p">:</span><span class="w"> </span><span class="m">4</span><span class="w">
@ -166,6 +162,9 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">900</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>apiKey</code> <br />
Value: Your <a href="https://developer.travis-ci.org/authentication">Travis CI API</a> access token.</p>
<p><code>enabled</code> <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: <code>true</code>, <code>false</code>.</p>

View File

@ -143,15 +143,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/trello/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>WTF_TRELLO_APP_KEY</code> <br />
<span class="caption">Value:</span> Your Trello App Key. <br />
<span class="caption">Key:</span> <code>WTF_TRELLO_ACCESS_TOKEN</code> <br />
<span class="caption">Value:</span> Your Trello Access Token. <br /></p>
<p><em>You can get your API key at: trello.com/app-key.</em></p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p>None.</p>
@ -160,6 +151,8 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h3 id="single-trello-list">Single Trello List</h3>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">trello<span class="p">:</span><span class="w">
</span><span class="w"> </span>accessToken<span class="p">:</span><span class="w"> </span><span class="s2">&#34;7b8b14f8743a408a93276d7155dd9ee2&#34;</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>board<span class="p">:</span><span class="w"> </span>Main<span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>list<span class="p">:</span><span class="w"> </span><span class="s2">&#34;Todo&#34;</span><span class="w">
@ -175,6 +168,8 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<p>If you want to monitor multiple Trello lists, use the following
configuration (note the difference in <code>list</code>):</p>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">trello<span class="p">:</span><span class="w">
</span><span class="w"> </span>accessToken<span class="p">:</span><span class="w"> </span><span class="s2">&#34;7b8b14f8743a408a93276d7155dd9ee2&#34;</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>board<span class="p">:</span><span class="w"> </span>Main<span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>list<span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">&#34;Todo&#34;</span><span class="p">,</span><span class="w"> </span><span class="s2">&#34;Done&#34;</span><span class="p">]</span><span class="w">
@ -187,6 +182,12 @@ configuration (note the difference in <code>list</code>):</p>
</span><span class="w"> </span>username<span class="p">:</span><span class="w"> </span>myname</code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>accessToken</code> <br />
Value: Your Trello access token.</p>
<p><code>apiKey</code> <br />
Value: Your Trello API key.</p>
<p><code>board</code> <br />
The name of the Trello board. <br /></p>

View File

@ -143,14 +143,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="source-code">Source Code</h2>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">wtf/zendesk/</code></pre></div>
<h2 id="required-env-variables">Required ENV Variables</h2>
<p><span class="caption">Key:</span> <code>ZENDESK_API</code> <br />
<span class="caption">Value:</span> Your Zendesk API Token</p>
<p><span class="caption">Key:</span> <code>ZENDESK_DOMAIN</code> <br />
<span class="caption">Value:</span> Your Zendesk subdomain</p>
<h2 id="keyboard-commands">Keyboard Commands</h2>
<p><span class="caption">Key:</span> <code>[return]</code> <br />
@ -170,6 +162,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<h2 id="configuration">Configuration</h2>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">zendesk<span class="p">:</span><span class="w">
</span><span class="w"> </span>apiKey<span class="p">:</span><span class="w"> </span><span class="s2">&#34;3276d7155dd9ee27b8b14f8743a408a9&#34;</span><span class="w">
</span><span class="w"> </span>enabled<span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span><span class="w"> </span>position<span class="p">:</span><span class="w">
</span><span class="w"> </span>top<span class="p">:</span><span class="w"> </span><span class="m">0</span><span class="w">
@ -177,9 +170,13 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
</span><span class="w"> </span>height<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
</span><span class="w"> </span>width<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
</span><span class="w"> </span>status<span class="p">:</span><span class="w"> </span><span class="s2">&#34;new&#34;</span><span class="w">
</span><span class="w"> </span>subdomain<span class="p">:</span><span class="w"> </span><span class="s2">&#34;your_domain&#34;</span><span class="w">
</span><span class="w"> </span>username<span class="p">:</span><span class="w"> </span><span class="s2">&#34;your_email@acme.com&#34;</span></code></pre></div>
<h3 id="attributes">Attributes</h3>
<p><code>apiKey</code> <br />
Value: Your Zendesk API token.</p>
<p><code>enabled</code> <br />
Determines whether or not this module is executed and if its data displayed onscreen. <br />
Values: <code>true</code>, <code>false</code>.</p>
@ -191,6 +188,9 @@ Defines where in the grid this module&rsquo;s widget will be displayed. <br /></
The status of tickets you want to retrieve.
Values: <code>new</code>, <code>open</code>, <code>pending</code>, <code>hold</code>.</p>
<p><code>subdomain</code> <br />
Value: Your Zendesk subdomain.</p>
<p><code>username</code> <br />
Your Zendesk username
Values: A valid Zendesk username (usually an email address).</p>

View File

@ -3,13 +3,14 @@ package gerrit
import (
"crypto/tls"
"fmt"
"net/http"
"os"
"regexp"
glb "github.com/andygrunwald/go-gerrit"
"github.com/gdamore/tcell"
"github.com/rivo/tview"
"github.com/senorprogrammer/wtf/wtf"
"net/http"
"os"
"regexp"
)
const HelpText = `
@ -43,7 +44,12 @@ var (
func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
baseURL := wtf.Config.UString("wtf.mods.gerrit.domain")
username := wtf.Config.UString("wtf.mods.gerrit.username")
password := os.Getenv("WTF_GERRIT_PASSWORD")
password := wtf.Config.UString(
"wtf.mods.gerrit.password",
os.Getenv("WTF_GERRIT_PASSWORD"),
)
verifyServerCertificate := wtf.Config.UBool("wtf.mods.gerrit.verifyServerCertificate", true)
httpClient := &http.Client{Transport: &http.Transport{

View File

@ -6,6 +6,7 @@ import (
"os"
ghb "github.com/google/go-github/github"
"github.com/senorprogrammer/wtf/wtf"
"golang.org/x/oauth2"
)
@ -22,14 +23,12 @@ type GithubRepo struct {
func NewGithubRepo(name, owner string) *GithubRepo {
repo := GithubRepo{
apiKey: os.Getenv("WTF_GITHUB_TOKEN"),
baseURL: os.Getenv("WTF_GITHUB_BASE_URL"),
uploadURL: os.Getenv("WTF_GITHUB_UPLOAD_URL"),
Name: name,
Owner: owner,
}
repo.loadAPICredentials()
return &repo
}
@ -91,6 +90,23 @@ func (repo *GithubRepo) githubClient() (*ghb.Client, error) {
return ghb.NewClient(oauthClient), nil
}
func (repo *GithubRepo) loadAPICredentials() {
repo.apiKey = wtf.Config.UString(
"wtf.mods.github.apiKey",
os.Getenv("WTF_GITHUB_TOKEN"),
)
repo.baseURL = wtf.Config.UString(
"wtf.mods.github.baseURL",
os.Getenv("WTF_GITHUB_BASE_URL"),
)
repo.uploadURL = wtf.Config.UString(
"wtf.mods.github.uploadURL",
os.Getenv("WTF_GITHUB_UPLOAD_URL"),
)
}
// myPullRequests returns a list of pull requests created by username on this repo
func (repo *GithubRepo) myPullRequests(username string) []*ghb.PullRequest {
prs := []*ghb.PullRequest{}

View File

@ -34,9 +34,14 @@ type Widget struct {
}
func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
apiKey := os.Getenv("WTF_GITLAB_TOKEN")
apiKey := wtf.Config.UString(
"wtf.mods.gitlab.apiKey",
os.Getenv("WTF_GITLAB_TOKEN"),
)
baseURL := wtf.Config.UString("wtf.mods.gitlab.domain")
gitlab := glb.NewClient(nil, apiKey)
if baseURL != "" {
gitlab.SetBaseURL(baseURL)
}

View File

@ -28,11 +28,10 @@ func (widget *Widget) Refresh() {
view, err := Create(
wtf.Config.UString("wtf.mods.jenkins.url"),
wtf.Config.UString("wtf.mods.jenkins.user"),
os.Getenv("WTF_JENKINS_API_KEY"),
widget.apiKey(),
)
widget.UpdateRefreshedAt()
//widget.View.Clear()
var content string
if err != nil {
@ -50,6 +49,13 @@ func (widget *Widget) Refresh() {
/* -------------------- Unexported Functions -------------------- */
func (widget *Widget) apiKey() string {
return wtf.Config.UString(
"wtf.mods.jenkins.apiKey",
os.Getenv("WTF_JENKINS_API_KEY"),
)
}
func (widget *Widget) contentFrom(view *View) string {
str := fmt.Sprintf(" [red]%s[white]\n", view.Name)

View File

@ -54,6 +54,13 @@ func buildJql(key string, value string) string {
/* -------------------- Unexported Functions -------------------- */
func apiKey() string {
return wtf.Config.UString(
"wtf.mods.jira.apiKey",
os.Getenv("WTF_JIRA_API_KEY"),
)
}
func jiraRequest(path string) (*http.Response, error) {
url := fmt.Sprintf("%s%s", wtf.Config.UString("wtf.mods.jira.domain"), path)
@ -61,7 +68,7 @@ func jiraRequest(path string) (*http.Response, error) {
if err != nil {
return nil, err
}
req.SetBasicAuth(wtf.Config.UString("wtf.mods.jira.email"), os.Getenv("WTF_JIRA_API_KEY"))
req.SetBasicAuth(wtf.Config.UString("wtf.mods.jira.email"), apiKey())
verifyServerCertificate := wtf.Config.UBool("wtf.mods.jira.verifyServerCertificate", true)
httpClient := &http.Client{Transport: &http.Transport{

View File

@ -8,7 +8,7 @@ import (
)
func Application() (*nr.Application, error) {
client := nr.NewClient(os.Getenv("WTF_NEW_RELIC_API_KEY"))
client := nr.NewClient(apiKey())
application, err := client.GetApplication(wtf.Config.UInt("wtf.mods.newrelic.applicationId"))
if err != nil {
@ -19,7 +19,7 @@ func Application() (*nr.Application, error) {
}
func Deployments() ([]nr.ApplicationDeployment, error) {
client := nr.NewClient(os.Getenv("WTF_NEW_RELIC_API_KEY"))
client := nr.NewClient(apiKey())
opts := &nr.ApplicationDeploymentOptions{Page: 1}
deployments, err := client.GetApplicationDeployments(wtf.Config.UInt("wtf.mods.newrelic.applicationId"), opts)
@ -29,3 +29,10 @@ func Deployments() ([]nr.ApplicationDeployment, error) {
return deployments, nil
}
func apiKey() string {
return wtf.Config.UString(
"wtf.mods.newrelic.apiKey",
os.Getenv("WTF_NEW_RELIC_API_KEY"),
)
}

View File

@ -31,7 +31,7 @@ func (widget *Widget) Refresh() {
}
widget.UpdateRefreshedAt()
widget.View.SetTitle(fmt.Sprintf("%s- [green]%s[white]", widget.Name, appName))
widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - [green]%s[white]", widget.Name, appName)))
widget.View.Clear()
var content string

View File

@ -5,6 +5,8 @@ import (
"fmt"
"net/http"
"os"
"github.com/senorprogrammer/wtf/wtf"
)
type OnCallResponse struct {
@ -28,16 +30,22 @@ type Parent struct {
/* -------------------- Exported Functions -------------------- */
func Fetch() (*OnCallResponse, error) {
apiKey := os.Getenv("WTF_OPS_GENIE_API_KEY")
scheduleUrl := "https://api.opsgenie.com/v2/schedules/on-calls?flat=true"
response, err := opsGenieRequest(scheduleUrl, apiKey)
response, err := opsGenieRequest(scheduleUrl, apiKey())
return response, err
}
/* -------------------- Unexported Functions -------------------- */
func apiKey() string {
return wtf.Config.UString(
"wtf.mods.opsgenie.apiKey",
os.Getenv("WTF_OPS_GENIE_API_KEY"),
)
}
func opsGenieRequest(url string, apiKey string) (*OnCallResponse, error) {
req, err := http.NewRequest("GET", url, nil)
if err != nil {

View File

@ -25,7 +25,7 @@ func (widget *Widget) Refresh() {
data, err := Fetch()
widget.UpdateRefreshedAt()
widget.View.SetTitle(widget.Name)
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
var content string
if err != nil {

View File

@ -44,7 +44,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
pages: pages,
}
todoist.Token = os.Getenv("WTF_TODOIST_TOKEN")
widget.loadAPICredentials()
widget.projects = loadProjects()
widget.View.SetInputCapture(widget.keyboardIntercept)
@ -170,7 +170,13 @@ func (w *Widget) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey {
return event
}
// TODO: Rename this List to Projects so the internal can be Checklist
func (widget *Widget) loadAPICredentials() {
todoist.Token = wtf.Config.UString(
"wtf.mods.todoist.apiKey",
os.Getenv("WTF_TODOIST_TOKEN"),
)
}
func loadProjects() []*Project {
projects := []*Project{}

View File

@ -72,7 +72,10 @@ func travisRequest(path string) (*http.Response, error) {
}
func apiToken() string {
return os.Getenv(APIEnvToken)
return wtf.Config.UString(
"wtf.mods.travisci.apiKey",
os.Getenv(APIEnvToken),
)
}
func parseJson(obj interface{}, text io.Reader) {

View File

@ -23,7 +23,10 @@ func NewWidget() *Widget {
/* -------------------- Exported Functions -------------------- */
func (widget *Widget) Refresh() {
client := trello.NewClient(os.Getenv("WTF_TRELLO_APP_KEY"), os.Getenv("WTF_TRELLO_ACCESS_TOKEN"))
client := trello.NewClient(
widget.apiKey(),
widget.accessToken(),
)
// Get the cards
searchResult, err := GetCards(client, getLists())
@ -50,6 +53,21 @@ func (widget *Widget) Refresh() {
}
/* -------------------- Unexported Functions -------------------- */
func (widget *Widget) accessToken() string {
return wtf.Config.UString(
"wtf.mods.trello.accessToken",
os.Getenv("WTF_TRELLO_ACCESS_TOKEN"),
)
}
func (widget *Widget) apiKey() string {
return wtf.Config.UString(
"wtf.mods.trello.apiKey",
os.Getenv("WTF_TRELLO_APP_KEY"),
)
}
func (widget *Widget) contentFrom(searchResult *SearchResult) string {
str := ""

View File

@ -1,13 +1,11 @@
package weather
import (
"fmt"
"os"
owm "github.com/briandowns/openweathermap"
"github.com/gdamore/tcell"
"github.com/rivo/tview"
"github.com/senorprogrammer/wtf/logger"
"github.com/senorprogrammer/wtf/wtf"
)
@ -43,14 +41,10 @@ func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
app: app,
pages: pages,
APIKey: os.Getenv("WTF_OWM_API_KEY"),
Idx: 0,
}
if widget.APIKey == "" {
logger.Log("loading weather API key from config")
widget.APIKey = wtf.Config.UString(fmt.Sprintf("wtf.mods.%s.apiKey", configKey), "")
}
widget.loadAPICredentials()
widget.View.SetInputCapture(widget.keyboardIntercept)
@ -188,6 +182,15 @@ func (widget *Widget) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey {
}
}
// loadAPICredentials loads the API authentication credentials for this module
// First checks to see if they're in the config file. If not, checks the ENV var
func (widget *Widget) loadAPICredentials() {
widget.APIKey = wtf.Config.UString(
"wtf.mods.weather.apiKey",
os.Getenv("WTF_OWM_API_KEY"),
)
}
func (widget *Widget) showHelp() {
closeFunc := func() {
widget.pages.RemovePage("help")

View File

@ -1,4 +1,4 @@
package bargraphtests
package bargraph_test
import (
"testing"

14
wtf_tests/colors_test.go Normal file
View File

@ -0,0 +1,14 @@
package wtf_tests
import (
"testing"
. "github.com/senorprogrammer/wtf/wtf"
. "github.com/stretchr/testify/assert"
)
func TestASCIItoTviewColors(t *testing.T) {
Equal(t, "", ASCIItoTviewColors(""))
Equal(t, "cat", ASCIItoTviewColors("cat"))
Equal(t, "[38;5;226mcat/[-]", ASCIItoTviewColors("[38;5;226mcat/"))
}

View File

@ -1,4 +1,4 @@
package wtftests
package wtf_tests
import (
"testing"

View File

@ -1,4 +1,4 @@
package wtftests
package wtf_tests
import (
"testing"

View File

@ -1,4 +1,4 @@
package wtftests
package wtf_tests
import (
"testing"

View File

@ -16,9 +16,19 @@ type Resource struct {
Raw string
}
var a = os.Getenv("ZENDESK_API")
var subdomain = os.Getenv("ZENDESK_SUBDOMAIN")
var baseURL = fmt.Sprintf("https://%v.zendesk.com/api/v2", subdomain)
func apiKey() string {
return wtf.Config.UString(
"wtf.mods.zendesk.apiKey",
os.Getenv("ZENDESK_API"),
)
}
func subdomain() string {
return wtf.Config.UString(
"wtf.mods.zendesk.apiKey",
os.Getenv("ZENDESK_API"),
)
}
func errHandler(err error) {
if err != nil {
@ -26,20 +36,15 @@ func errHandler(err error) {
}
}
func buildUrl(baseURL string) string {
ticketURL := baseURL + "/tickets.json?sort_by=status"
return ticketURL
}
func api(key string, meth string, path string, params string) (*Resource, error) {
trn := &http.Transport{}
client := &http.Client{
Transport: trn,
}
var URL = buildUrl(baseURL)
baseURL := fmt.Sprintf("https://%v.zendesk.com/api/v2", subdomain())
URL := baseURL + "/tickets.json?sort_by=status"
req, err := http.NewRequest(meth, URL, bytes.NewBufferString(params))
if err != nil {

View File

@ -55,7 +55,7 @@ func listTickets(pag ...string) (*TicketArray, error) {
} else {
path = pag[0]
}
resource, err := api(a, "GET", path, "")
resource, err := api(apiKey(), "GET", path, "")
if err != nil {
return nil, err
}

View File

@ -103,7 +103,7 @@ func (widget *Widget) openTicket() {
sel := widget.selected
if sel >= 0 && widget.result != nil && sel < len(widget.result.Tickets) {
issue := &widget.result.Tickets[widget.selected]
ticketUrl := fmt.Sprintf("https://%s.zendesk.com/agent/tickets/%d", subdomain, issue.Id)
ticketUrl := fmt.Sprintf("https://%s.zendesk.com/agent/tickets/%d", subdomain(), issue.Id)
wtf.OpenFile(ticketUrl)
}
}