-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpytibot.yaml.example
More file actions
249 lines (237 loc) · 11.3 KB
/
pytibot.yaml.example
File metadata and controls
249 lines (237 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# this is a comment
Connection:
server: localhost
sslport: 6697
port: 6667
nickname: PyTIBot
username:
serverpassword:
channels:
channelkeys:
channel1: secret
adminbyhost: False
admins:
ignore:
rejoinkicked: True
Logging:
directory: /tmp/log/
log_minor: True
yaml: True
HTTPServer:
port: 8080
sslport: 8081
certificate: /path/to/cert.pem
privkey: /path/to/privkey.pem
root:
type: OverviewPage
title: Root Resource
children:
logs:
type: LogPage
channel: '#mysuperchannel'
title: Awesome Log Server
search_pagelen: 5
indexer_procs: 4 # use multiple processes for indexing logs
vote:
type: VotePage
title: Votes for my project
channel: '#myweirdchannel'
secret: secret
# assets is automatically added to root
GitWebhook:
channels:
my_project:
- "#mysuperchannel"
- "#myotherchannel"
default:
- "#mydefaultchannel"
confidential_channels: # only supported with GitLab
default:
- "#mysecretchannel"
sslport: 4041
certificate: /path/to/cert.pem
privkey: /path/to/privkey.pem
github_secret: SECRETKEY
gitlab_secret: SECRETKEY
hook_report_users: [myadmin]
hook_report_success: false # defaults to true
PreventGitHubReviewFlood: false
HideGitHubCommitList: false # don't show individual commits for push events
FilterRules:
# example for github
- eventtype == issues AND action == pinned
# example for gitlab
- eventtype == note AND object_attributes.noteable_type == Snippet
# url shortener for gitlab
url_shortener:
# $URL will be replaced by the url to shorten
service_url: "https://example.com/shorten"
method: GET # Defaults to POST
headers:
TOKEN: SECRET_TOKEN
request_params: # GET parameters
url: $URL
#post_data: # POST data
# TOKEN: SECRET_TOKEN
# long_url: $URL
payload_accessor:
#DirectAccessor # received payload is plaintext shortened url, DEFAULT
JsonAccessor: # extract shortened url from a received Json response
path: # keys to the shortened url value
- response
- shortened_url
#HeaderAccessor: # shortened url is contained in the HTTP headers
# key: Location
#MessageTemplates:
# reponame_stub: '[<a><font color="lime"><t:slot name="repo_name"/></font></a>]'
# author_stub: '<font color="darkcyan"><t:slot name="author"/></font>'
# user_stub: '<font color="darkcyan"><t:slot name="user"/></font>'
# action_stub: '<font><t:attr name="color"><t:slot name="actioncolor"/></t:attr><t:slot name="action"/></font>'
# issue_description_stub: 'Issue #<font color="darkorange"><t:slot name="issue_id"/></font> <a><t:attr name="href"><t:slot name="issue_url"/></t:attr><t:slot name="issue_title"/></a>'
# pr_description_stub: 'Pull Request #<font color="darkorange"><t:slot name="pr_id"/></font> <a><t:attr name="href"><t:slot name="pr_url"/></t:attr><t:slot name="pr_title"/> (<font color="magenta"><t:slot name="head"/></font>-><font color="red"><t:slot name="base"/></font>)</a>'
# pr_description_without_href_stub: 'Pull Request #<font color="darkorange"><t:slot name="pr_id"/></font> <t:slot name="pr_title"/> (<font color="magenta"><t:slot name="head"/></font>-><font color="red"><t:slot name="base"/></font>)'
# ref_stub: '<t:slot name="ref_type"/> <font color="magenta"><t:slot name="ref"/></font>'
# push_stub: '{reponame_stub} {user_stub} pushed <t:slot name="num_commits"/> commit(s) to <font color="magenta"><t:slot name="branch"/></font>'
# github_push_stub: '{reponame_stub} {user_stub} {action_stub} <a><t:attr name="href"><t:slot name="compare_url"/></t:attr><t:slot name="num_commits"/> commit(s) to <font color="magenta"><t:slot name="branch"/></font></a>'
# commit_stub: '{author_stub}: <a><t:attr name="href"><t:slot name="url"/></t:attr><t:slot name="message"/></a>'
# issue_stub: '{reponame_stub} {user_stub} {action_stub} {issue_description_stub}'
# issue_comment_stub: '{reponame_stub} {user_stub} {action_stub} <a><t:attr name="href"><t:slot name="comment_url"/></t:attr>comment</a> on {issue_description_stub}'
# pr_stub: '{reponame_stub} {user_stub} {action_stub} {pr_description_stub}'
# pr_review_stub: '{reponame_stub} {user_stub} <t:slot name="action"/> <t:slot name="review_type"/> for {pr_description_without_href_stub}: '
# create_stub: '{reponame_stub} {user_stub} created {ref_stub}'
# delete_stub: '{reponame_stub} {user_stub} <font color="red">deleted</font> {ref_stub}'
# fork_stub: '{reponame_stub} {user_stub} created <a><t:attr name="href"><t:slot name="url"/></t:attr>fork</a>'
# commit_comment_stub: '{reponame_stub} {user_stub} commented on <a><t:attr name="href"><t:slot name="url"/></t:attr>commit <t:slot name="commit_id"/></a>'
# release_stub: '{reponame_stub} {user_stub} {action_stub} <a><t:attr name="href"><t:slot name="url"/></t:attr>release <t:slot name="release_name"/></a>'
# gitlab_note_stub: '{reponame_stub} {user_stub} commented on <t:slot name="noteable_type"/> <t:slot name="id_prefix"/><font color="darkorange"><t:slot name="id"/></font> <a><t:attr name="href"><t:slot name="url"/></t:attr><t:slot name="title"/></a>'
# gitlab_mr_stub: '{reponame_stub} {user_stub} {action_stub} Merge Request !<font color="darkorange"><t:slot name="id"/></font> <a><t:attr name="href"><t:slot name="url"/></t:attr><t:slot name="title"/> (<font color="magenta"><t:slot name="source"/></font>-><font color="red"><t:slot name="target"/></font>)</a>'
Hooks:
Push:
default:
- action: act1
filter:
# available data:
# commits: list of commits as given from github/gitlan
# branch
# project.{name,namespace,description,url,homepage}
# pusher.{name,username,id}
- "branch != master"
- commits.0.title == Update translation
my_project:
- action: do_noop # exclude my_project from the default Push hook
- action: act1
filter: # NOTE: this filter only applies to act1, but not to do_noop
- "branch != master"
Actions:
act1:
type: process
command: ./my_process
path: /some/path/
args: [1, 2]
rungroup: run1
do_noop:
type: noop
# rungroup is automatically set to default if not specified
RungroupSettings:
run1:
clear_previous: True
stop_running: False
Manhole:
telnetport: 9999
Commands:
hello: hello
tell: tell
morse: morse
unmorse: unmorse
joke: joke
say: say
random: rand
fortune: fortune
kick: kick
ban: ban
Aliases:
cointoss: random heads tails
whoami: whois $USER
Triggers:
- youtube:
youtube_api_key: SECRET
- import_this
- enable_command
- simple_trigger:
-
trigger: trigger
answer: This line was triggered by $USER in $CHANNEL.
-
trigger: can contain regex (\d+)
answer: "be sure to escape : or #"
# Modules that are specific to a channel
Channelmodules:
"#mysuperchannel":
-
ChannelLogger
-
Autokick:
user_blacklist:
- bad_user
- evil_user
msg_blacklist:
- "evil word"
user_whitelist:
- trusted_user
msg_whitelist:
# regex!
- $BOTNAME:\s*fortune
# simple spam protection
enable_spam_check: true
buffer_length: 6 # default 5
repeat_count: 3 # default 3
max_highlights: 3 # default 5
mode: KICK # one of KICK, KICK_THEN_BAN, BAN_CHANMODE, BAN_SERVICE
ban_service: Q # on Quakenet, ChanServ on Freenode etc
ban_service_command: "TEMPBAN $CHANNEL $NICK!$USER@$HOST 5d" # Quakenet
# ban_service_command: "BAN $CHANNEL $NICK!$USER@$HOST" # Freenode
# ban_chanmode_mask: "*!*@$HOST"
min_delay: 0
max_delay: 0 # delay before kicking or banning to hide the fact that it's automated (0 to disable)
-
Greeter:
standard_nicks: [test]
patterns: ["*!webchat@*", "*!*@gateway/web/*"] # shell like pattern matching
message: Welcome, <t:slot name="user"/>
"#myweirdchannel":
-
ChannelLogger
-
Vote:
prefix: "@"
poll_url: https://example.org:8081/vote
secret: secret
notification_channel: '#mysuperchannel' # will be notified of major events
#MessageTemplates:
# poll_id_stub: 'Poll #<font color="darkorange"><t:slot name="poll_id"/></font>'
# poll_status_stub: '<font><t:attr name="color"><t:slot name="status_color"/></t:attr><t:slot name="status"/></font>'
# description_stub: '<font color="darkcyan"><t:slot name="description"/></font>'
# creator_stub: '<font color="blue"><t:slot name="creator"/></font>'
# user_stub: '<font color="blue"><t:slot name="user"/></font>'
# comment_stub: '<font color="cyan"><t:slot name="comment"/></font>'
# standing_stub: 'YES:<font color="lime"><t:slot name="yes"/></font> | NO:<font color="red"><t:slot name="no"/></font> | ABSTAINED:<t:slot name="abstained"/> | OPEN:<t:slot name="not_voted"/>'
# final_standing_stub: 'YES:<font color="lime"><t:slot name="yes"/></font> | NO:<font color="red"><t:slot name="no"/></font> | ABSTAINED:<t:slot name="abstained"/> | NOT VOTED:<t:slot name="not_voted"/>'
# missing_voter_stub: 'Your vote is required in channel <t:slot name="channel"/> for poll #<font color="darkorange"><t:slot name="poll_id"/></font>'
# user_added_stub: 'Successfully added user <font color="blue"><t:slot name="user"/></font> (<t:slot name="auth"/>)'
# user_modified_stub: 'Successfully modified user <font color="blue"><t:slot name="user"/></font>'
# new_poll_stub: 'New {poll_id_stub} by {creator_stub}: <a><t:attr name="href"><t:slot name="url"/></t:attr>{description_stub}</a>'
# poll_description_change_stub: '{poll_id_stub}: description changed to <t:slot name="description"/>'
# poll_vetoed_stub: '{poll_id_stub}: vetoed'
# poll_decided_stub: '{poll_id_stub}: decided'
# poll_cancelled_stub: '{poll_id_stub}: cancelled'
# warn_poll_end_stub: '{poll_id_stub} is running out soon: {description_stub} by {creator_stub}: {standing_stub}'
# poll_end_stub: '{poll_id_stub} {poll_status_stub}: {description_stub} by {creator_stub}: {final_standing_stub}'
# poll_list_stub: '{poll_id_stub} by {creator_stub} ({poll_status_stub}).format(**crumbs): {description_stub}'
# poll_info_stub: '{poll_id_stub} by {creator_stub} ({poll_status_stub}).format(**crumbs): {description_stub}<br/>{standing_stub}'
# vote_changed_stub: '{poll_id_stub}: {user_stub} changed vote from <font><t:attr name="color"><t:slot name="previous_decision_color"/></t:attr><t:slot name="previous_decision"/></font> to <font><t:attr name="color"><t:slot name="decision_color"/></t:attr><t:slot name="decision"/></font>: {comment_stub}'
# new_vote_stub: '{poll_id_stub}: {user_stub} voted <font><t:attr name="color"><t:slot name="decision_color"/></t:attr><t:slot name="decision"/></font>: {comment_stub}'
# current_result_stub: 'Current Result: {standing_stub}'
# already_voted_stub: 'You already voted for this poll (<font><t:attr name="color"><t:slot name="decision_color"/></t:attr><t:slot name="decision"/></font>: {comment_stub}).format(**crumbs), please confirm, with \'<t:slot name="prefix"/>yes\' or \'<t:slot name="prefix"/>no\''
Actions:
userkicked: Nice work $KICKER, noone liked $KICKEE anyways!
kickedfrom: Nice try $KICKER, but that was to easy.