forked from plesk/redirect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-sign-in.html
256 lines (245 loc) · 9.66 KB
/
github-sign-in.html
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
249
250
251
252
253
254
255
256
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta http-equiv='x-ua-compatible' content='ie=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<script>
(function() {
var redirect = getStateParam(window.location)['redirect-plesk'];
if (isValidUrl(redirect)) {
redirect += (redirect.indexOf('?') > -1 ? '&' : '?') + window.location.search.substr(1);
var baseUrl = redirect.substr(0, redirect.indexOf('?'));
if (isTrustedUrl(baseUrl)) {
window.location.href = redirect;
}
document.addEventListener("DOMContentLoaded", function (event) {
var link = document.getElementById('redirect-link');
var autoConfirm = document.getElementById('auto-confirm');
if (!link) {
return;
}
link.href = redirect;
link.innerText = baseUrl + '...';
link.onclick = function () {
if (autoConfirm && autoConfirm.checked) {
addTrustedUrl(baseUrl);
}
};
var toReplace = document.querySelectorAll('.hostname');
Array.prototype.forEach.call(toReplace, function (element) {
element.innerText = link.hostname;
});
});
}
function isValidUrl(url) {
return url && (
0 === url.indexOf('http://') || 0 === url.indexOf('https://')
);
}
function getStateParam(location) {
var params = splitParams(location.search.substr(1).split('&'));
params.state = params.state || '';
return splitParams(params.state.split('|'));
}
function splitParams(params) {
params = params || [];
var pairs = {};
params.map(function (param) {
return param.split('=');
}).forEach(function (param) {
var name = param[0], value = param[1] && decodeURIComponent(param[1]);
pairs[name] = value;
});
return pairs;
}
function addTrustedUrl(url) {
var trustedUrls = JSON.parse(getCookie('gitHubTrustedUrls') || '[]');
setCookie('gitHubTrustedUrls', JSON.stringify(trustedUrls.concat(url)), 365);
}
function isTrustedUrl(url) {
var trustedUrls = JSON.parse(getCookie('gitHubTrustedUrls') || '[]');
return trustedUrls.indexOf(url) > -1;
}
function setCookie(cname, cvalue, exdays) {
var exDate = new Date();
exDate.setTime(exDate.getTime() + (exdays * 24 * 60 * 60 * 1000));
var expires = "expires=" + exDate.toUTCString();
var secure = window.location.protocol === "https:" ? ";secure" : '';
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/" + secure;
}
function getCookie(cname) {
var name = cname + "=";
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i];
while (cookie.charAt(0) == ' ') {
cookie = cookie.substring(1);
}
if (cookie.indexOf(name) == 0) {
return cookie.substring(name.length, cookie.length);
}
}
return "";
}
})();
</script>
<style>
html {
font: normal 16px/1.4 Arial, "Helvetica Neue", Helvetica, sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
overflow-y: scroll;color: #000;
}
html,body {
height: 100%;
min-height: 100%;
}
body {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
margin: 0;
padding: 20px;
background-color: #dedede;
box-sizing: border-box;
-webkit-box-align: center;
-ms-flex-align: center;
-ms-grid-row-align: center;
align-items: center;
}
a { background-color: transparent; }
a:active,
a:hover { outline: 0; }
a {
color: #2498e3;
text-decoration: none;
cursor: pointer;
word-wrap: break-word;
overflow-wrap: break-word;
word-break: break-word;
}
a:hover {
color: #188dd9;
text-decoration: underline;
}
h1 {
margin: 0;
padding: 0;
font-size: 24px;
line-height: 1;
text-align: center;
}
main {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-align: center;
-ms-flex-align: center;
-ms-grid-row-align: center;
align-items: center;
margin: auto;
padding: 20px;
max-width: 900px;
background: #fff;
border-radius: 0.625rem;
box-shadow: 0 8px 17px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
-webkit-animation: bounceInUp 1s;
animation: bounceInUp 1s;
}
figure {
flex: none;
width: 64px;
height: 64px;
margin: 0;
padding: 0 0 10px;
}
figure svg, figure img {
display: block;
width: 100%;
height: 100%;
}
section p:last-child { margin-bottom: 0; }
label {
display: inline-block;
padding-left: 1.5rem;
}
input[type=checkbox] {
box-sizing: border-box;
position: absolute;
margin-top: 0.36rem;
margin-left: -1.5rem;
padding: 0;
width: 16px;
height: 16px;
}
.hostname { border-bottom: 1px dashed #2498e3; }
@media screen and (min-width: 600px) {
main {
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-align: start;
-ms-flex-align: start;
-ms-grid-row-align: flex-start;
align-items: flex-start;
padding: 40px;
}
figure {
flex: none;
width: 84px;
height: 84px;
margin: 0;
padding: 0 20px 0 0;
}
h1 {
font-size: 44px;
font-weight: 400;
text-align: left;
}
p { font-size: 20px; }
}
@-webkit-keyframes bounceInUp {
0%,100%,60%,75%,90% {-webkit-animation-timing-function: cubic-bezier(0.215,.61,.355,1);animation-timing-function: cubic-bezier(0.215,.61,.355,1)}
0% {opacity: 0;-webkit-transform: translate3d(0,3000px,0);transform: translate3d(0,3000px,0)}
60% {opacity: 1;-webkit-transform: translate3d(0,-20px,0);transform: translate3d(0,-20px,0)}
75% {-webkit-transform: translate3d(0,10px,0);transform: translate3d(0,10px,0)}
90% {-webkit-transform: translate3d(0,-5px,0);transform: translate3d(0,-5px,0)}
100% {-webkit-transform: translate3d(0,0,0);transform: translate3d(0,0,0)}
}
@keyframes bounceInUp {
0%,100%,60%,75%,90% {-webkit-animation-timing-function: cubic-bezier(0.215,.61,.355,1);animation-timing-function: cubic-bezier(0.215,.61,.355,1)}
0% {opacity: 0;-webkit-transform: translate3d(0,3000px,0);transform: translate3d(0,3000px,0)}
60% {opacity: 1;-webkit-transform: translate3d(0,-20px,0);transform: translate3d(0,-20px,0)}
75% {-webkit-transform: translate3d(0,10px,0);transform: translate3d(0,10px,0)}
90% {-webkit-transform: translate3d(0,-5px,0);transform: translate3d(0,-5px,0)}
100% {-webkit-transform: translate3d(0,0,0);transform: translate3d(0,0,0)}
}
</style>
<title>Confirm Sending Data</title>
</head>
<body>
<main>
<figure>
<svg viewBox="-1163 1657.7 56.7 56.7" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M-1134.7 1663a24.6 24.6 0 0 0-7.7 48c1.2.1 1.6-.6 1.6-1.3v-4.6c-6.8 1.5-8.3-2.9-8.3-2.9-1.1-2.8-2.7-3.6-2.7-3.6-2.3-1.5.1-1.5.1-1.5 2.5.2 3.8 2.6 3.8 2.6 2.2 3.7 5.8 2.7 7.2 2 .2-1.6.8-2.7 1.5-3.3-5.4-.6-11.2-2.7-11.2-12.1 0-2.7 1-5 2.6-6.7-.3-.6-1.1-3 .2-6.5 0 0 2-.6 6.8 2.6a23.6 23.6 0 0 1 12.3 0c4.7-3.2 6.8-2.6 6.8-2.6 1.3 3.4.5 6 .2 6.5 1.6 1.8 2.6 4 2.6 6.7 0 9.4-5.8 11.5-11.3 12.1.9.8 1.7 2.3 1.7 4.6v6.7c0 .7.4 1.5 1.6 1.2a24.6 24.6 0 0 0-7.8-48z" fill-rule="evenodd"/><path d="M-1150 1698.3c0 .1-.2.1-.4 0-.2 0-.3-.2-.2-.3 0-.1.2-.2.4 0 .2 0 .3.2.2.3zm1 1.1l-.5-.1c-.1-.2-.2-.4 0-.5h.5c.1.3.2.5 0 .6zm1 1.4c-.1.1-.4 0-.5-.2-.2-.2-.2-.5 0-.6.1 0 .4 0 .5.2.2.2.2.5 0 .6zm1.3 1.4c-.1.1-.4 0-.6-.1-.2-.2-.3-.5-.1-.6.1-.2.4-.1.6 0 .2.3.3.5.1.7zm1.9.8c0 .2-.4.3-.6.2-.3-.1-.5-.3-.4-.5 0-.2.3-.3.6-.2.2 0 .4.3.4.5zm2 .1c0 .2-.2.4-.5.4s-.6-.2-.6-.4.3-.3.6-.3c.2 0 .5.1.5.3zm1.8-.3c.1.2-.1.4-.4.5-.3 0-.5-.1-.6-.3 0-.2.2-.4.5-.5.3 0 .5.1.6.3zm0 0"/></svg> </figure>
<section>
<header><h1>Confirm Sending Data</h1></header>
<p>To prevent possible phishing attacks, you need to manually confirm sending the GitHub Sign-In data to the Plesk instance with hostname <span class="hostname">undefined</span>.</p>
<p>
<label for="auto-confirm">
<input type="checkbox" id="auto-confirm">
Trust <span class="hostname">hostname</span> for 365 days and do not show this dialog (we will use cookies to store the data in your browser).
</label>
</p>
<p>Click the link below to continue.</p>
<p><a id="redirect-link">Destination URL was not found in the query.</a></p>
</section>
</main>
</body>
</html>