Skip to content

Commit

Permalink
Remove hipchat
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaime Piña committed Nov 24, 2019
1 parent 16943d4 commit 7629d6b
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 232 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Noti can send notifications on a number of services.
Banner | ✔ | ✔ | ✔
Speech | ✔ | ✔ | ✔
BearyChat | ✔ | ✔ | ✔
HipChat | ✔ | ✔ | ✔
Keybase | ✔ | ✔ | ✔
Mattermost | ✔ | ✔ | ✔
Pushbullet | ✔ | ✔ | ✔
Expand Down
24 changes: 18 additions & 6 deletions docs/man/noti.1
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Default is utility name.
.B -m <string>, --message <string>
Set notification message.
Default is \[lq]Done!\[rq].
Read from stdin with \[lq]-\[rq].
.TP
.B -b, --banner
Trigger a banner notification.
Expand All @@ -39,10 +40,9 @@ This will be either \f[C]say\f[R], \f[C]espeak\f[R], or
Trigger a BearyChat notification.
This requires \f[C]bearychat.incomingHookURI\f[R] to be set.
.TP
.B -i, --hipchat
Trigger a HipChat notification.
This requires \f[C]hipchat.accessToken\f[R] and \f[C]hipchat.room\f[R]
to be set.
.B \[en]keybase
Trigger a Keybase notification.
This requires \f[C]keybase.conversation\f[R] to be set.
.TP
.B -p, --pushbullet
Trigger a Pushbullet notification.
Expand Down Expand Up @@ -98,9 +98,13 @@ Print \f[C]noti\f[R] help and exit.
.IP \[bu] 2
\f[C]NOTI_BEARYCHAT_INCOMINGHOOKURI\f[R]
.IP \[bu] 2
\f[C]NOTI_HIPCHAT_ACCESSTOKEN\f[R]
\f[C]NOTI_KEYBASE_CONVERSATION\f[R]
.IP \[bu] 2
\f[C]NOTI_KEYBASE_CHANNEL\f[R]
.IP \[bu] 2
\f[C]NOTI_KEYBASE_PUBLIC\f[R]
.IP \[bu] 2
\f[C]NOTI_HIPCHAT_ROOM\f[R]
\f[C]NOTI_KEYBASE_EXPLODINGLIFETIME\f[R]
.IP \[bu] 2
\f[C]NOTI_PUSHBULLET_ACCESSTOKEN\f[R]
.IP \[bu] 2
Expand Down Expand Up @@ -155,6 +159,14 @@ you can do this to get notified when that process\[cq] PID disappears.
noti --pwatch $(pgrep docker-machine)
\f[R]
.fi
.PP
Receive your message from stdin with \f[C]-\f[R].
.IP
.nf
\f[C]
rsync -az --stats \[ti]/ server:/backups/homedir | noti -t \[dq]backup stats\[dq] -m -
\f[R]
.fi
.SH REPORTING BUGS
.PP
Report bugs on GitHub at https://github.com/variadico/noti/issues.
Expand Down
6 changes: 0 additions & 6 deletions docs/man/noti.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ when it's done. You can receive messages on your computer or phone.
: Trigger a BearyChat notification. This requires `bearychat.incomingHookURI` to
be set.

-i, \--hipchat
: Trigger a HipChat notification. This requires `hipchat.accessToken` and
`hipchat.room` to be set.

--keybase
: Trigger a Keybase notification. This requires `keybase.conversation` to
be set.
Expand Down Expand Up @@ -86,8 +82,6 @@ when it's done. You can receive messages on your computer or phone.
* `NOTI_ESPEAK_VOICENAME`
* `NOTI_SPEECHSYNTHESIZER_VOICE`
* `NOTI_BEARYCHAT_INCOMINGHOOKURI`
* `NOTI_HIPCHAT_ACCESSTOKEN`
* `NOTI_HIPCHAT_ROOM`
* `NOTI_KEYBASE_CONVERSATION`
* `NOTI_KEYBASE_CHANNEL`
* `NOTI_KEYBASE_PUBLIC`
Expand Down
33 changes: 22 additions & 11 deletions docs/man/noti.yaml.5
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,27 @@ Name of voice used for speech notifications.
.TP
.B incomingHookURI
BearyChat incoming URI.
.SH HIPCHAT
.SH KEYBASE
.TP
.B accessToken
HipChat access token.
Log into your HipChat account and retrieve a token from the Room
Notification Tokens page.
.B conversation
Keybase message destination.
Can be either users (comma-separated) or team.
.TP
.B room
HipChat message destination.
Can be either a Room name or ID.
.B channel
Keybase team\[cq]s chat channel to send to.
Conversation must be a team.
If empty, the team\[cq]s default channel will be used (typically
\[lq]general\[rq]).
.TP
.B explodingLifetime
Keybase self-destructing message, after the specified time.
Times are written like \f[C]30s\f[R] (30 seconds), \f[C]15m\f[R] (15
minutes), \f[C]24h\f[R] (24 hours).
.TP
.B public
Enables broadcasting a message to everyone (when \f[C]conversation\f[R]
is your username), or to teams (when \f[C]conversation\f[R] is your team
name).
.SH PUSHBULLET
.TP
.B accessToken
Expand Down Expand Up @@ -124,9 +135,9 @@ speechsynthesizer:
voice: Microsoft David Desktop
bearychat:
incomingHookURI: 1234567890abcdefg
hipchat:
accessToken: 1234567890abcdefg
room: 1234567890abcdefg
keybase:
conversation: yourteam
channel: general
pushbullet:
accessToken: 1234567890abcdefg
deviceIden: 1234567890abcdefg
Expand Down
12 changes: 0 additions & 12 deletions docs/man/noti.yaml.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ voice
incomingHookURI
: BearyChat incoming URI.

# HIPCHAT

accessToken
: HipChat access token. Log into your HipChat account and retrieve a token
from the Room Notification Tokens page.

room
: HipChat message destination. Can be either a Room name or ID.

# KEYBASE

conversation
Expand Down Expand Up @@ -139,9 +130,6 @@ username
voice: Microsoft David Desktop
bearychat:
incomingHookURI: 1234567890abcdefg
hipchat:
accessToken: 1234567890abcdefg
room: 1234567890abcdefg
keybase:
conversation: yourteam
channel: general
Expand Down
31 changes: 1 addition & 30 deletions docs/noti.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Noti can send notifications on a number of services.
Banner | ✔ | ✔ | ✔
Speech | ✔ | ✔ | ✔
BearyChat | ✔ | ✔ | ✔
HipChat | ✔ | ✔ | ✔
Keybase | ✔ | ✔ | ✔
Pushbullet | ✔ | ✔ | ✔
Pushover | ✔ | ✔ | ✔
Expand Down Expand Up @@ -79,10 +78,6 @@ curl -L $(curl -s https://api.github.com/repos/variadico/noti/releases/latest |
Trigger a BearyChat notification. This requires
bearychat.incomingHookURI to be set.
-i, --hipchat
Trigger a HipChat notification. This requires hipchat.accessToken and
hipchat.room to be set.
--keybase
Trigger a Keybase notification. This requires keybase.conversation
to be set.
Expand Down Expand Up @@ -136,8 +131,6 @@ curl -L $(curl -s https://api.github.com/repos/variadico/noti/releases/latest |
* `NOTI_ESPEAK_VOICENAME`
* `NOTI_SPEECHSYNTHESIZER_VOICE`
* `NOTI_BEARYCHAT_INCOMINGHOOKURI`
* `NOTI_HIPCHAT_ACCESSTOKEN`
* `NOTI_HIPCHAT_ROOM`
* `NOTI_KEYBASE_CONVERSATION`
* `NOTI_KEYBASE_CHANNEL`
* `NOTI_KEYBASE_PUBLIC`
Expand Down Expand Up @@ -200,15 +193,6 @@ BEARYCHAT
incomingHookURI
BearyChat incoming URI.
HIPCHAT
accessToken
HipChat access token. Log into your HipChat account and retrieve a token
from the Room Notification Tokens page.
room
HipChat message destination. Can be either a Room name or ID.
KEYBASE
conversation
Expand Down Expand Up @@ -320,9 +304,6 @@ speechsynthesizer:
voice: Microsoft David Desktop
bearychat:
incomingHookURI: 1234567890abcdefg
hipchat:
accessToken: 1234567890abcdefg
room: 1234567890abcdefg
keybase:
conversation: yourteam
channel: general
Expand Down Expand Up @@ -355,16 +336,6 @@ Log into your BearyChat account. Then create an [incoming robot][bc-incoming].
Next, look for the "Hook Address" (or "Hook 地址" in Chinese), this is what
you'll set `bearychat.incomingHookURI` to.

### HipChat

Log into your HipChat account. Go to My Account > Rooms > {pick a room} >
Tokens. Create a new token. Set the Scope to "Send Notification". That's what
you'll set `hipchat.accessToken` to.

Next, go to My Account > Rooms > {pick a room} > Summary. Look for "API ID". You
can set `hipchat.room` to "API ID" or you can use the Room name, like
"MyRoom".

### Keybase

Log into your [Keybase] account and go to the Chat section.
Expand Down Expand Up @@ -417,7 +388,7 @@ The variable `slack.channel` can be set to a channel like `#general` or

### Telegram

Open your telegram app, and start a conversation with the [BotFather](https://telegram.me/botfather)
Open your telegram app, and start a conversation with the [BotFather](https://telegram.me/botfather)
and use the `/newbot` to get the BotFather to create your bot and lastly copy and keep the bot token


Expand Down
11 changes: 0 additions & 11 deletions internal/command/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/spf13/viper"
"github.com/variadico/noti/service/bearychat"
"github.com/variadico/noti/service/hipchat"
"github.com/variadico/noti/service/keybase"
"github.com/variadico/noti/service/mattermost"
"github.com/variadico/noti/service/pushbullet"
Expand All @@ -29,16 +28,6 @@ func getBearyChat(title, message string, v *viper.Viper) notification {
}
}

func getHipChat(title, message string, v *viper.Viper) notification {
return &hipchat.Notification{
AccessToken: v.GetString("hipchat.accessToken"),
Room: v.GetString("hipchat.room"),
Message: fmt.Sprintf("%s\n%s", title, message),
MessageFormat: "text",
Client: httpClient,
}
}

func getKeybase(title, message string, v *viper.Viper) notification {
var explodeTime time.Duration
if v.GetString("keybase.explodingLifetime") != "" {
Expand Down
15 changes: 0 additions & 15 deletions internal/command/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ var baseDefaults = map[string]interface{}{

"bearychat.incomingHookURI": "",

"hipchat.accessToken": "",
"hipchat.room": "",

"keybase.conversation": "",
"keybase.channel": "",
"keybase.public": "",
Expand Down Expand Up @@ -92,9 +89,6 @@ var keyEnvBindings = map[string]string{

"bearychat.incomingHookURI": "NOTI_BEARYCHAT_INCOMINGHOOKURI",

"hipchat.accessToken": "NOTI_HIPCHAT_ACCESSTOKEN",
"hipchat.room": "NOTI_HIPCHAT_ROOM",

"keybase.conversation": "NOTI_KEYBASE_CONVERSATION",
"keybase.channel": "NOTI_KEYBASE_CHANNEL",
"keybase.public": "NOTI_KEYBASE_PUBLIC",
Expand Down Expand Up @@ -139,8 +133,6 @@ var keyEnvBindingsDeprecated = map[string]string{
"NOTI_ESPEAK_VOICENAME": "NOTI_VOICE",
"NOTI_SPEECHSYNTHESIZER_VOICE": "NOTI_VOICE",
"NOTI_BEARYCHAT_INCOMINGHOOKURI": "NOTI_BC_INCOMING_URI",
"NOTI_HIPCHAT_ACCESSTOKEN": "NOTI_HIPCHAT_TOK",
"NOTI_HIPCHAT_ROOM": "NOTI_HIPCHAT_DEST",
"NOTI_PUSHBULLET_ACCESSTOKEN": "NOTI_PUSHBULLET_TOK",
"NOTI_PUSHOVER_APITOKEN": "NOTI_PUSHOVER_TOK",
"NOTI_PUSHOVER_USERKEY": "NOTI_PUSHOVER_DEST",
Expand Down Expand Up @@ -243,7 +235,6 @@ func enabledFromSlice(defaults []string) map[string]bool {
services := map[string]bool{
"banner": false,
"bearychat": false,
"hipchat": false,
"keybase": false,
"pushbullet": false,
"pushover": false,
Expand Down Expand Up @@ -271,7 +262,6 @@ func hasServiceFlags(flags *pflag.FlagSet) bool {
services := map[string]bool{
"banner": false,
"bearychat": false,
"hipchat": false,
"keybase": false,
"pushbullet": false,
"pushover": false,
Expand Down Expand Up @@ -302,7 +292,6 @@ func enabledFromFlags(flags *pflag.FlagSet) map[string]bool {
services := map[string]bool{
"banner": false,
"bearychat": false,
"hipchat": false,
"keybase": false,
"pushbullet": false,
"pushover": false,
Expand Down Expand Up @@ -373,10 +362,6 @@ func getNotifications(v *viper.Viper, services map[string]struct{}) []notificati
notis = append(notis, getBearyChat(title, message, v))
}

if _, ok := services["hipchat"]; ok {
notis = append(notis, getHipChat(title, message, v))
}

if _, ok := services["keybase"]; ok {
notis = append(notis, getKeybase(title, message, v))
}
Expand Down
1 change: 0 additions & 1 deletion internal/command/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ func TestGetNotifications(t *testing.T) {
services := []string{
"banner",
"bearychat",
"hipchat",
"keybase",
"pushbullet",
"pushover",
Expand Down
1 change: 0 additions & 1 deletion internal/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func InitFlags(flags *pflag.FlagSet) {
flags.BoolP("banner", "b", false, "Trigger a banner notification. This is enabled by default.")
flags.BoolP("speech", "s", false, "Trigger a speech notification.")
flags.BoolP("bearychat", "c", false, "Trigger a BearyChat notification.")
flags.BoolP("hipchat", "i", false, "Trigger a HipChat notification.")
flags.Bool("keybase", false, "Trigger a Keybase notification.")
flags.BoolP("pushbullet", "p", false, "Trigger a Pushbullet notification.")
flags.BoolP("pushover", "o", false, "Trigger a Pushover notification.")
Expand Down
Loading

0 comments on commit 7629d6b

Please sign in to comment.