-
Notifications
You must be signed in to change notification settings - Fork 424
/
webhook_info.html.erb
124 lines (104 loc) · 4.55 KB
/
webhook_info.html.erb
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
<%- title t('webhooks.info.title') %>
<%- description "Setting up a webook to update scripts on #{site_name} automatically." %>
<h2><%= t('webhooks.info.title') %></h2>
<%= it('webhooks.info.intro_html', site_name: site_name, import_link: import_start_path) %>
<% if @webhook_scripts.any? %>
<p><%= t('webhooks.info.already_syncing_list') %></p>
<ul>
<% @webhook_scripts.each do |s| %>
<li><%= t('webhooks.info.synced_item_html', script_name: link_to(s.name, s), sync_type: t("scripts.sync_type_#{s.script_sync_type_id}.name"), sync_url: link_to(s.sync_identifier, s.sync_identifier)) %></li>
<% end %>
</ul>
<% end %>
<% unless I18n.locale == :en %>
<p><%= t('webhooks.info.language_note') %></p>
<% end %>
<h3>GitHub</h3>
<p>The sync URL you supply to <%= site_name %> must be one of the following formats:</p>
<ul>
<li>https://raw.githubusercontent.com/<b>YourRepoName</b>/<b>YourProjectName</b>/<b>main</b>/<b>path/to/script.user.js</b></li>
<li>https://github.com/<b>YourRepoName</b>/<b>YourProjectName</b>/raw/<b>main</b>/<b>path/to/script.user.js</b></li>
<li>https://github.com/<b>YourRepoName</b>/<b>YourProjectName</b>/releases/latest/download/<b>path/to/script.user.js</b> (only for release events)</li>
</ul>
<p>To set up the webhook on GitHub, access your GitHub repository and go to Settings, Webhooks, Add webhook, then enter the data below.</p>
<dl>
<dt>Payload URL</dt>
<dd><%= user_webhook_url(@user) %></dd>
<dt>Content type</dt>
<dd>application/json</dd>
<dt>Secret</dt>
<dd>
<%= form_tag do |f| %>
<% if @user.webhook_secret.nil? %>
<input type="submit" value="Generate">
<% else %>
<textarea cols="64" rows="2" readonly><%= @user.webhook_secret %></textarea> <input type="submit" value="Regenerate">
<% end %>
<% end %>
</dd>
<dt>Which events would you like to trigger this webhook?</dt>
<dd>
To update <%= site_name %> on all pushes, choose "Just the push event".<br>
To update <%= site_name %> only on releases, choose "Let me select individual events", uncheck "Pushes", and check "Releases".<br>
(In either case, <%= site_name %> will be looking for modified files in these events.)
</dd>
<dt>Active</dt>
<dd>(Checked)</dd>
</dl>
<h3>Bitbucket</h3>
<p>The sync URL you supply to <%= site_name %> must be one of the following formats:</p>
<ul>
<li>https://bitbucket.org/<b>YourRepoName</b>/<b>YourProjectName</b>/raw/<b>master</b>/<b>path/to/script.user.js</b></li>
</ul>
<p>To set up the webhook on Bitbucket, access your Bitbucket repository and go to Repository Settings, Webhooks, Add webhook, then enter the data below.</p>
<dl>
<dt>Title</dt>
<dd><%= site_name %></dd>
<dt>URL</dt>
<dd>
<%= form_tag do |f| %>
<% if @user.webhook_secret.nil? %>
<input type="submit" value="Generate">
<% else %>
<textarea cols="64" rows="2" readonly><%= user_webhook_url(@user, secret: @user.webhook_secret) %></textarea> <input type="submit" value="Regenerate">
<% end %>
<% end %>
</dd>
<dt>Active</dt>
<dd>(Checked)</dd>
<dt>Skip certificate verification</dt>
<dd>(Unchecked)</dd>
<dt>Enable request history collection</dt>
<dd>(Unchecked)</dd>
<dt>Triggers</dt>
<dd>Repository push</dd>
</dl>
<h3>GitLab</h3>
<p>The sync URL you supply to <%= site_name %> must be one of the following formats:</p>
<ul>
<li>https://gitlab.com/<b>YourRepoName</b>/<b>YourProjectName</b>/raw/<b>master</b>/<b>path/to/script.user.js</b></li>
<li>https://gitlab.com/<b>YourRepoName</b>/<b>YourProjectName</b>/-/raw/<b>master</b>/<b>path/to/script.user.js</b></li>
<li>https://gitlab.com/api/v4/projects/<b>YourNumericalProjectID</b>/repository/files/<b>path/to/script.user.js</b>/raw?ref=<b>master</b> (can include further parameters - this is mostly useful for private repos)</li>
</ul>
<p>To set up the webhook on GitLab, access your GitLab repository and go to Settings, Integrations, then enter the data below.</p>
<dl>
<dt>URL</dt>
<dd><%= user_webhook_url(@user) %></dd>
<dt>Secret Token</dt>
<dd>
<%= form_tag do |f| %>
<% if @user.webhook_secret.nil? %>
<input type="submit" value="Generate">
<% else %>
<textarea cols="64" rows="2" readonly><%= @user.webhook_secret %></textarea> <input type="submit" value="Regenerate">
<% end %>
<% end %>
</dd>
<dt>Trigger</dt>
<dd>
To update <%= site_name %> on all pushes, choose "Push events".<br>
To update <%= site_name %> only on releases, choose "Releases events".</dd>
</dd>
<dt>Enable SSL Verification</dt>
<dd>(Checked)</dd>
</dl>