|
1 | 1 | <!DOCTYPE html>
|
2 | 2 | <html lang="en">
|
3 | 3 | <head>
|
4 |
| - <meta charset="utf-8"> |
5 |
| - <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
6 |
| - <meta name="description" content="Replicated App Manager"> |
7 |
| - <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
| 6 | + <meta name="description" content="Replicated App Manager" /> |
| 7 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> |
8 | 8 | <title>TLS Warning | Admin Console</title>
|
| 9 | + <link rel="stylesheet" href="/assets/output.css" /> |
9 | 10 | <link rel="stylesheet" href="/assets/tls-custom.css" />
|
10 | 11 | {{if .AppIcon }}
|
11 |
| - <link rel="icon" type="image/png" href="{{ .AppIcon }}" /> |
| 12 | + <link rel="icon" type="image/png" href="{{ .AppIcon }}" /> |
12 | 13 | {{end}}
|
13 | 14 | <script>
|
14 | 15 | //defaults to chrome example
|
15 |
| - var firefoxText = "On the next screen, click \"I Understand the Risks\", then click \"Add Exception\". Finally, click \"Confirm Security Exception\" to proceed to the Admin Console."; |
16 |
| - var ieText = "On the next screen, click \"Continue to this website\" to proceed to the Admin Console."; |
17 |
| - var safariText = "On the next screen, click \"Continue\" when prompted to proceed to the Admin Console."; |
18 |
| - var chromeText = "On the next screen, click \"Advanced\", then click \"Proceed\" to continue to the Admin Console."; |
| 16 | + var firefoxText = |
| 17 | + 'On the next screen, click "I Understand the Risks", then click "Add Exception". Finally, click "Confirm Security Exception" to proceed to the Admin Console.'; |
| 18 | + var ieText = |
| 19 | + 'On the next screen, click "Continue to this website" to proceed to the Admin Console.'; |
| 20 | + var safariText = |
| 21 | + 'On the next screen, click "Continue" when prompted to proceed to the Admin Console.'; |
| 22 | + var chromeText = |
| 23 | + 'On the next screen, click "Advanced", then click "Proceed" to continue to the Admin Console.'; |
19 | 24 |
|
20 | 25 | var browserPlainText = "Chrome";
|
21 | 26 | var browserBodyText = chromeText;
|
22 |
| - if (typeof InstallTrigger !== 'undefined'){ |
| 27 | + if (typeof InstallTrigger !== "undefined") { |
23 | 28 | browserPlainText = "Firefox";
|
24 | 29 | browserBodyText = chromeText;
|
25 |
| - } else if (Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0) { |
| 30 | + } else if ( |
| 31 | + Object.prototype.toString |
| 32 | + .call(window.HTMLElement) |
| 33 | + .indexOf("Constructor") > 0 |
| 34 | + ) { |
26 | 35 | browserPlainText = "Safari";
|
27 | 36 | browserBodyText = safariText;
|
28 |
| - } else if (/*@cc_on!@*/false || !!document.documentMode || !!window.StyleMedia) { |
| 37 | + } else if ( |
| 38 | + /*@cc_on!@*/ false || |
| 39 | + !!document.documentMode || |
| 40 | + !!window.StyleMedia |
| 41 | + ) { |
29 | 42 | //grouping Edge + IE 6 - 11 in this one
|
30 | 43 | browserPlainText = "Internet Explorer";
|
31 | 44 | browserBodyText = ieText;
|
32 | 45 | }
|
33 | 46 |
|
34 |
| - var rawLink = window.location.href.substring(window.location.protocol.length).replace(/\/$/,''); |
| 47 | + var rawLink = window.location.href |
| 48 | + .substring(window.location.protocol.length) |
| 49 | + .replace(/\/$/, ""); |
35 | 50 | var httpsLink = "https:" + rawLink;
|
36 |
| - var opensslLink = rawLink.substring(2).replace("/", ""); |
37 |
| - var tlsManagementLink = httpsLink + "/tls"; |
| 51 | + var opensslLink = rawLink.substring(2).replace("/insecure", ""); |
| 52 | + var tlsManagementLink = "/tls"; |
38 | 53 | </script>
|
39 | 54 | </head>
|
40 | 55 | <body>
|
| 56 | + <div class="flex !flex-col flex-1"> |
| 57 | + <div class="NavBarWrapper"> |
| 58 | + <div class="flex flex-auto h-[50px]"> |
| 59 | + <div class="flex items-center flex-1 relative"> |
| 60 | + <div class="HeaderLogo"> |
| 61 | + {{if .AppIcon }}<span |
| 62 | + class="appIcon flex" |
| 63 | + style="background-image: url('{{ .AppIcon }}')" |
| 64 | + ></span |
| 65 | + >{{end}} |
| 66 | + </div> |
| 67 | + </div> |
| 68 | + </div> |
| 69 | + </div> |
41 | 70 |
|
42 |
| - <div class="flex-column flex1"> |
43 |
| - <div class="tlsContent--wrapper"> |
44 |
| - <div> |
45 |
| - <p class="tls-header">Bypass browser TLS warning</p> |
46 |
| - <p class="tls-header-sub">We use a self-signed SSL/TLS Certificate to secure the communication between your local machine and the Admin Console during setup. You'll see a warning about this in your browser, but you can be confident that this is secure.</p> |
| 71 | + <div class="min-h-full w-full flex flex-1"> |
| 72 | + {{if .IsEmbeddedCluster }} |
| 73 | + <div class="bg-[#F9FBFC] min-400"> |
| 74 | + <div class="py-8 pl-8 shadow-[0_1px_0_#c4c8ca]"> |
| 75 | + <span class="text-lg font-semibold text-gray-[#323232]"> |
| 76 | + Let's get you started! |
| 77 | + </span> |
47 | 78 | </div>
|
48 |
| - <div class="flex1 flex"> |
49 |
| - <div class="flex-column flex1 left-block"> |
50 |
| - <div> |
51 |
| - <p class="tls-section-header"><script>document.write(browserPlainText)</script></p> |
52 |
| - <p class="tls-section-sub"><script>document.write(browserBodyText)</script></p> |
53 |
| - </div> |
54 |
| - <div class="CodeSnippet"> |
55 |
| - <div class="CodeSnippet-content"> |
56 |
| - <p>Verifying the certificate's authenticity</p> |
57 |
| - <pre> |
58 |
| - <code id="verify-snippet"> |
59 |
| - </code> |
60 |
| - </pre> |
| 79 | + <div |
| 80 | + class="p-8 shadow-[0_1px_0_#c4c8ca] font-medium flex text-[#323232]" |
| 81 | + > |
| 82 | + <img src="/assets/images/check.svg" alt="check" /> |
| 83 | + <span class="font-bold ml-2"> Secure the Admin Console </span> |
| 84 | + </div> |
| 85 | + <div |
| 86 | + class="p-8 shadow-[0_1px_0_#c4c8ca] font-medium flex text-[#9c9c9c9c]" |
| 87 | + > |
| 88 | + <img src="/assets/images/check.svg" alt="check" /> |
| 89 | + <span class="font-normal ml-2"> |
| 90 | + Configure the cluster (optional) |
| 91 | + </span> |
| 92 | + </div> |
| 93 | + <div |
| 94 | + class="p-8 shadow-[0_1px_0_#c4c8ca] font-medium flex text-[#9c9c9c9c]" |
| 95 | + > |
| 96 | + <img src="/assets/images/check.svg" alt="check" /> |
| 97 | + <span class="font-normal ml-2"> Configure {{.AppTitle}} </span> |
| 98 | + </div> |
| 99 | + <div |
| 100 | + class="p-8 shadow-[0_1px_0_#c4c8ca] font-medium flex text-[#9c9c9c9c]" |
| 101 | + > |
| 102 | + <img src="/assets/images/check.svg" alt="check" /> |
| 103 | + <span class="font-normal ml-2"> |
| 104 | + Validate the environment & deploy {{.AppTitle}} |
| 105 | + </span> |
| 106 | + </div> |
| 107 | + </div> |
| 108 | + {{end}} |
| 109 | + <div class="tlsContent--wrapper px-8"> |
| 110 | + <p class="tls-header my-8">Secure the Admin Console</p> |
| 111 | + <hr /> |
| 112 | + <div class="mt-8 p-8 bg-[#F9FBFC]"> |
| 113 | + <div> |
| 114 | + <p class="tls-header-sub"> |
| 115 | + We use a self-signed TLS Certificate to secure the communication |
| 116 | + between your local machine and the Admin Console during setup. |
| 117 | + You'll see a warning about this in your browser, but you can be |
| 118 | + confident that this is secure. |
| 119 | + </p> |
| 120 | + </div> |
| 121 | + <div class="flex1 flex"> |
| 122 | + <div class="flex-column flex1 left-block"> |
| 123 | + <div> |
| 124 | + <p class="tls-section-header"> |
| 125 | + <script> |
| 126 | + document.write(browserPlainText); |
| 127 | + </script> |
| 128 | + </p> |
| 129 | + <p class="tls-header-sub"> |
| 130 | + <script> |
| 131 | + document.write(browserBodyText); |
| 132 | + </script> |
| 133 | + </p> |
61 | 134 | </div>
|
62 |
| - </div> |
63 |
| - <div class="CodeSnippet"> |
64 |
| - <div class="CodeSnippet-content"> |
65 |
| - <p>SHA Fingerprint</p> |
66 |
| - <pre> |
67 |
| - <code>{{ .fingerprintSHA1 }}</code> |
68 |
| - </pre> |
| 135 | + |
| 136 | + <div |
| 137 | + class="flex-column right-block alignItems--center justifyContent--center" |
| 138 | + > |
| 139 | + <script> |
| 140 | + document.write( |
| 141 | + '<img class="insecure-image m-auto" src="/assets/images/' + |
| 142 | + browserPlainText.toLowerCase().replace(" ", "") + |
| 143 | + '-insecure.png" />', |
| 144 | + ); |
| 145 | + </script> |
69 | 146 | </div>
|
70 |
| - </div> |
71 |
| - <div class="button-wrapper flex alignItems--center"> |
72 |
| - <button type="submit" class="btn primary" onclick="location.href=tlsManagementLink;">Continue to Setup</button> |
73 |
| - <div class="flex-column justifyContent--center"> |
| 147 | + <div class="flex gap-2 cursor mb-4" id="verify-link"> |
74 | 148 | <p class="text-muted">
|
75 |
| - <script>document.write( |
76 |
| - 'or visit <a class="replicated-link" href="' + tlsManagementLink + '">' + tlsManagementLink + '</a> to proceed' |
77 |
| - )</script> |
| 149 | + Verify the certificate's authenticity (optional) |
78 | 150 | </p>
|
| 151 | + <img |
| 152 | + src="/assets/images/down_arrow.svg" |
| 153 | + alt="check" |
| 154 | + width="10" |
| 155 | + id="down-arrow" |
| 156 | + /> |
| 157 | + <img |
| 158 | + src="/assets/images/up_arrow.svg" |
| 159 | + alt="check" |
| 160 | + width="10" |
| 161 | + id="up-arrow" |
| 162 | + style="display: none" |
| 163 | + /> |
| 164 | + </div> |
| 165 | + <div |
| 166 | + id="verification-container" |
| 167 | + className="cursor " |
| 168 | + style="display: none" |
| 169 | + > |
| 170 | + <div class="flex flex-column"> |
| 171 | + <div class="CodeSnippet"> |
| 172 | + <div class="CodeSnippet-content"> |
| 173 | + <p> |
| 174 | + Run this command on the host to calculate the |
| 175 | + certificate's fingerprint. |
| 176 | + </p> |
| 177 | + <pre> |
| 178 | + <code id="verify-snippet"> |
| 179 | + </code> |
| 180 | + </pre> |
| 181 | + <div class="copy-command"> |
| 182 | + <a id="copy-command" class="replicated-link" |
| 183 | + >Copy command</a |
| 184 | + > |
| 185 | + </div> |
| 186 | + </div> |
| 187 | + </div> |
| 188 | + <div class="CodeSnippet"> |
| 189 | + <div class="CodeSnippet-content"> |
| 190 | + <p>Expected fingerprint</p> |
| 191 | + <pre> |
| 192 | + <code>{{ .fingerprintSHA1 }}</code> |
| 193 | + </pre> |
| 194 | + </div> |
| 195 | + </div> |
| 196 | + </div> |
| 197 | + </div> |
| 198 | + <div class="button-wrapper flex justifyContent--end"> |
| 199 | + <button |
| 200 | + type="submit" |
| 201 | + class="btn primary" |
| 202 | + onclick="location.href=tlsManagementLink;" |
| 203 | + > |
| 204 | + Continue |
| 205 | + </button> |
79 | 206 | </div>
|
80 | 207 | </div>
|
81 | 208 | </div>
|
82 |
| - <div class="flex-column flex1 right-block alignItems--center justifyContent--center"> |
83 |
| - <script>document.write( |
84 |
| - '<img class="insecure-image" src="/assets/images/' + browserPlainText.toLowerCase().replace(" ", "") + '-insecure.png" />' |
85 |
| - )</script> |
86 |
| - </div> |
87 | 209 | </div>
|
88 | 210 | </div>
|
89 | 211 | </div>
|
| 212 | + </div> |
90 | 213 | </body>
|
91 | 214 | <script>
|
92 |
| - document.getElementById('verify-snippet').innerHTML = |
93 |
| - '$ echo | openssl s_client -servername local -connect ' + opensslLink + ' 2>/dev/null | openssl x509 -noout -fingerprint'; |
| 215 | + document.getElementById("verify-snippet").innerHTML = |
| 216 | + "echo | openssl s_client -servername local -connect " + |
| 217 | + opensslLink + |
| 218 | + " 2>/dev/null | openssl x509 -noout -fingerprint"; |
| 219 | + </script> |
| 220 | + <script> |
| 221 | + const replicatedLink = document.getElementById("verify-link"); |
| 222 | + |
| 223 | + const verificationContainer = document.getElementById( |
| 224 | + "verification-container", |
| 225 | + ); |
| 226 | + |
| 227 | + replicatedLink.addEventListener("click", () => { |
| 228 | + if (verificationContainer.style.display === "block") { |
| 229 | + verificationContainer.style.display = "none"; |
| 230 | + document.getElementById("down-arrow").style.display = "none"; |
| 231 | + document.getElementById("up-arrow").style.display = "block"; |
| 232 | + } else { |
| 233 | + verificationContainer.style.display = "block"; |
| 234 | + document.getElementById("down-arrow").style.display = "block"; |
| 235 | + document.getElementById("up-arrow").style.display = "none"; |
| 236 | + } |
| 237 | + }); |
| 238 | + |
| 239 | + document |
| 240 | + .getElementById("copy-command") |
| 241 | + .addEventListener("click", function () { |
| 242 | + const codeSnippet = |
| 243 | + document.getElementById("verify-snippet").textContent; |
| 244 | + |
| 245 | + navigator.clipboard |
| 246 | + .writeText(codeSnippet) |
| 247 | + .then(() => { |
| 248 | + const copyCommandElement = document.getElementById("copy-command"); |
| 249 | + const originalText = copyCommandElement.textContent; |
| 250 | + copyCommandElement.textContent = "Copied!"; |
| 251 | + |
| 252 | + setTimeout(() => { |
| 253 | + copyCommandElement.textContent = originalText; |
| 254 | + }, 3000); |
| 255 | + }) |
| 256 | + .catch((err) => { |
| 257 | + console.error("Failed to copy text: ", err); |
| 258 | + }); |
| 259 | + }); |
94 | 260 | </script>
|
95 | 261 | </html>
|
0 commit comments