1 | <!DOCTYPE html>
|
2 | <html lang="en" class="height-full">
|
3 |
|
4 | <head>
|
5 | <meta charset="UTF-8">
|
6 | <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 | <meta http-equiv="X-UA-Compatible" content="ie=edge">
|
8 | <title>Import {{#if pkg.name }}{{ pkg.name }}{{else}}Your App{{/if}} | built with Probot</title>
|
9 | <link rel="icon" href="/probot/static/probot-head.png">
|
10 | <link rel="stylesheet" href="/probot/static/primer.css">
|
11 | </head>
|
12 |
|
13 | <body class="bg-gray-light">
|
14 | <div class="d-flex flex-column flex-justify-center flex-items-center text-center height-full py-6">
|
15 | <a href="/probot"><img src="/probot/static/robot.svg" alt="Probot Logo" width="100" class="mb-6"></a>
|
16 | <div class="box-shadow rounded-2 border p-6 bg-white">
|
17 | <h2>Use existing Github App</h2>
|
18 | <br>
|
19 |
|
20 | <h3>Step 1:</h3>
|
21 | <p class="d-block mt-2">
|
22 | Replace your app's Webhook URL with <br>
|
23 | <b>{{ WEBHOOK_PROXY_URL }}</b>
|
24 | </p>
|
25 | <a class="d-block mt-2" href="{{ GH_HOST }}/settings/apps" target="__blank" rel="noreferrer">
|
26 | You can do it here
|
27 | </a>
|
28 |
|
29 | <br>
|
30 | <h3>Step 2:</h3>
|
31 | <p class="mt-2">Fill out this form</p>
|
32 | <form onsubmit="return onSubmit(event) || false">
|
33 | <label class="d-block mt-2" for="appId">App Id</label>
|
34 | <input class="form-control width-full" type="text" required="true" id="appId" name="appId"><br>
|
35 |
|
36 | <label class="d-block mt-3" for="whs">Webhook secret (required!)</label>
|
37 | <input class="form-control width-full" type="password" required="true" id="whs" name="whs"><br>
|
38 |
|
39 | <label class="d-block mt-3" for="pem">Private Key</label>
|
40 | <input class="form-control width-full m-2" type="file" accept=".pem" required="true" id="pem"
|
41 | name="pem">
|
42 | <br>
|
43 |
|
44 | <button class="btn btn-outline m-2" type="submit">Submit</button>
|
45 | </form>
|
46 | </div>
|
47 |
|
48 | <div class="mt-4">
|
49 | <h4 class="alt-h4 text-gray-light">Need help?</h4>
|
50 | <div class="d-flex flex-justify-center mt-2">
|
51 | <a href="https://probot.github.io/docs/" class="btn btn-outline mr-2">Documentation</a>
|
52 | <a href="https://probot-slackin.herokuapp.com/" class="btn btn-outline">Chat on Slack</a>
|
53 | </div>
|
54 | </div>
|
55 | </div>
|
56 | <script>
|
57 | function onSubmit(e) {
|
58 | e.preventDefault();
|
59 |
|
60 | const idEl = document.getElementById('appId');
|
61 | const appId = idEl.value;
|
62 |
|
63 |
|
64 | const secretEl = document.getElementById('whs');
|
65 | const webhook_secret = secretEl.value;
|
66 |
|
67 | const fileEl = document.getElementById('pem');
|
68 | const file = fileEl.files[0];
|
69 |
|
70 | file.text().then((text) => fetch('', {
|
71 | method: 'POST',
|
72 | headers: { 'content-type': 'application/json' },
|
73 | body: JSON.stringify({ appId, pem: text, webhook_secret })
|
74 | })).then((r) => {
|
75 | if (r.ok) {
|
76 | location.replace('/probot/success');
|
77 | }
|
78 | }).catch((e) => alert(e));
|
79 | return false;
|
80 | }
|
81 | </script>
|
82 | </body>
|
83 |
|
84 | </html> |
\ | No newline at end of file |