-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
646 lines (588 loc) · 22.9 KB
/
index.html
File metadata and controls
646 lines (588 loc) · 22.9 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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Open Cloud Web Terminal Shell | WebSSH | OpenCloudShell</title>
<meta
name="description"
content="OpenCloudShell is an Open Cloud Web Terminal Shell and WebSSH link generator for secure browser-based SSH access. Create and share WebSSH connection URLs quickly."
/>
<meta
name="keywords"
content="Open Cloud, Open Cloud Web Terminal, Open Cloud Web Terminal Shell, Web Terminal, WebSSH, browser SSH, OpenCloudShell"
/>
<meta name="robots" content="index, follow" />
<meta name="author" content="OpenCloudShell" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Open Cloud Web Terminal Shell | WebSSH | OpenCloudShell" />
<meta
property="og:description"
content="Build secure WebSSH launch links for your Open Cloud Web Terminal Shell and connect over SSH directly from the browser."
/>
<meta property="og:url" content="https://opencloudshell.com/" />
<meta property="og:site_name" content="OpenCloudShell" />
<meta property="og:image" content="https://i.imgur.com/abnqsXU.jpeg" />
<meta property="og:image:secure_url" content="https://i.imgur.com/abnqsXU.jpeg" />
<meta property="og:image:alt" content="OpenCloudShell OGP image" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Open Cloud Web Terminal Shell | WebSSH | OpenCloudShell" />
<meta
name="twitter:description"
content="OpenCloudShell helps you generate secure WebSSH URLs for browser-based cloud terminal access."
/>
<meta name="twitter:image" content="https://i.imgur.com/abnqsXU.jpeg" />
<link rel="icon" type="image/png" href="https://i.imgur.com/Hr2JFg3.png" />
<link rel="shortcut icon" href="https://i.imgur.com/Hr2JFg3.png" />
<link rel="canonical" href="https://opencloudshell.com/" />
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "OpenCloudShell",
"url": "https://opencloudshell.com/",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Web",
"description": "Open Cloud Web Terminal Shell and WebSSH link generator for secure browser-based SSH access.",
"keywords": "Open Cloud, Open Cloud Web Terminal Shell, WebSSH, browser SSH, OpenCloudShell"
}
</script>
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<style>
:root {
--bg: #f4f7f5;
--panel: #ffffff;
--ink: #14221d;
--muted: #5c6b64;
--accent: #0c7d59;
--accent-2: #0a5f44;
--border: #d8e2dc;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
color: var(--ink);
background:
radial-gradient(circle at 15% 15%, #d8efe4 0, transparent 35%),
radial-gradient(circle at 85% 85%, #d6e9ff 0, transparent 38%),
var(--bg);
}
.container {
max-width: 920px;
width: 100%;
min-height: 100vh;
margin: 0 auto;
padding: 0 16px;
display: flex;
align-items: center;
}
.card {
width: 100%;
background: var(--panel);
border: 1px solid var(--border);
border-radius: 16px;
box-shadow: 0 10px 30px rgba(20, 34, 29, 0.08);
padding: 22px;
}
h1 {
margin: 0 0 8px;
font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
}
.hint {
margin: 0 0 20px;
color: var(--muted);
}
.grid {
display: grid;
gap: 12px;
}
label {
font-size: 0.95rem;
font-weight: 600;
}
input,
textarea {
width: 100%;
padding: 11px 12px;
border: 1px solid var(--border);
border-radius: 10px;
font: inherit;
color: var(--ink);
background: #fff;
}
textarea {
min-height: 120px;
resize: vertical;
}
.key-dropzone {
margin-top: 8px;
border: 1px dashed var(--border);
border-radius: 10px;
padding: 10px;
background: #fbfefc;
transition: border-color 0.15s ease, background-color 0.15s ease;
}
.key-dropzone.dragging {
border-color: var(--accent);
background: #eefaf5;
}
.key-actions {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.key-select {
border: 1px solid var(--border);
border-radius: 8px;
background: #fff;
color: var(--ink);
padding: 8px 10px;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
}
.key-help {
margin: 6px 0 0;
color: var(--muted);
font-size: 0.85rem;
}
.actions {
margin-top: 14px;
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.toolbar {
display: flex;
justify-content: flex-end;
margin-bottom: 10px;
}
.lang-select-wrap {
display: inline-flex;
align-items: center;
gap: 8px;
color: var(--muted);
font-size: 0.9rem;
}
.lang-select {
border: 1px solid var(--border);
border-radius: 8px;
background: #fff;
color: var(--ink);
padding: 6px 8px;
font: inherit;
}
button,
.open-link {
border: 0;
border-radius: 10px;
padding: 11px 14px;
font: inherit;
font-weight: 700;
cursor: pointer;
text-decoration: none;
}
button {
background: var(--accent);
color: #fff;
}
button:hover {
background: var(--accent-2);
}
.open-link {
background: #10392d;
color: #fff;
display: inline-flex;
align-items: center;
}
.result {
margin-top: 16px;
border: 1px dashed var(--border);
border-radius: 10px;
padding: 12px;
background: #fafdfb;
}
.result p {
margin: 0 0 8px;
color: var(--muted);
font-size: 0.9rem;
}
.url {
word-break: break-all;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (max-width: 640px) {
.container {
min-height: auto;
margin: 20px auto;
align-items: flex-start;
}
.card {
padding: 16px;
}
}
</style>
</head>
<body>
<a href="https://github.com/GitHub30/OpenCloudShell" class="github-corner" aria-label="View source on GitHub">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.3,141.5 141.4,141.5 Z" fill="currentColor" class="octo-body"></path>
</svg>
</a>
<style>
.github-corner:hover .octo-arm { animation: octocat-wave 560ms ease-in-out; }
@keyframes octocat-wave { 0%, 100% { transform: rotate(0); } 20%, 60% { transform: rotate(-25deg); } 40%, 80% { transform: rotate(10deg); } }
@media (max-width: 500px) { .github-corner:hover .octo-arm { animation: none; } .github-corner .octo-arm { animation: octocat-wave 560ms ease-in-out; } }
</style>
<div id="root"></div>
<script type="text/babel">
const { useEffect, useMemo, useRef, useState } = React;
const translations = {
en: {
languageLabel: "Language",
hint: "Generate secure browser SSH launch links for your Open Cloud environment with this WebSSH URL builder.",
destinationLabel: "Destination",
destinationPlaceholder: "user@localhost",
portLabel: "Port",
portPlaceholder: "22",
passwordLabel: "Password / Passphrase for Private Key",
passwordPlaceholder: "Optional login password or passphrase for private key",
privateKeyLabel: "Private Key",
privateKeyPlaceholder: "Optional private key content",
selectKeyFile: "Select key file",
keyHelpEmpty: "Drag and drop your private key file here or choose a file.",
loadedFile: (name) => `Loaded: ${name}`,
copyUrl: "Copy URL",
copied: "Copied",
openInNewTab: "Open in New Tab",
connected: "Connected",
generatedLink: "Generated Link",
enterDetails: "Enter connection details to generate a link."
},
ja: {
languageLabel: "言語",
hint: "Open Cloud 環境向けの安全なブラウザSSH起動リンクを、この WebSSH URL ビルダーで生成できます。",
destinationLabel: "接続先",
destinationPlaceholder: "user@localhost",
portLabel: "ポート",
portPlaceholder: "22",
passwordLabel: "パスワード / 秘密鍵のパスフレーズ",
passwordPlaceholder: "任意: ログイン用パスワードまたは秘密鍵のパスフレーズ",
privateKeyLabel: "秘密鍵",
privateKeyPlaceholder: "任意の秘密鍵内容",
selectKeyFile: "鍵ファイルを選択",
keyHelpEmpty: "秘密鍵ファイルをここにドラッグ&ドロップ、またはファイルを選択してください。",
loadedFile: (name) => `読み込み済み: ${name}`,
copyUrl: "URLをコピー",
copied: "コピー済み",
openInNewTab: "新しいタブで開く",
connected: "接続確認",
generatedLink: "生成リンク",
enterDetails: "接続情報を入力するとリンクが生成されます。"
},
zh: {
languageLabel: "语言",
hint: "使用此 WebSSH URL 生成器,为你的 Open Cloud 环境创建安全的浏览器 SSH 启动链接。",
destinationLabel: "目标地址",
destinationPlaceholder: "user@localhost",
portLabel: "端口",
portPlaceholder: "22",
passwordLabel: "密码 / 私钥口令",
passwordPlaceholder: "可选:登录密码或私钥口令",
privateKeyLabel: "私钥",
privateKeyPlaceholder: "可选私钥内容",
selectKeyFile: "选择密钥文件",
keyHelpEmpty: "将私钥文件拖放到此处,或选择文件。",
loadedFile: (name) => `已加载: ${name}`,
copyUrl: "复制URL",
copied: "已复制",
openInNewTab: "在新标签页打开",
connected: "已连接",
generatedLink: "生成链接",
enterDetails: "输入连接信息以生成链接。"
},
vi: {
languageLabel: "Ngon ngu",
hint: "Tao lien ket khoi dong SSH tren trinh duyet an toan cho moi truong Open Cloud bang trinh tao URL WebSSH nay.",
destinationLabel: "Dich den",
destinationPlaceholder: "user@localhost",
portLabel: "Cong",
portPlaceholder: "22",
passwordLabel: "Mat khau / Passphrase cho private key",
passwordPlaceholder: "Tuy chon: mat khau dang nhap hoac passphrase cua private key",
privateKeyLabel: "Private Key",
privateKeyPlaceholder: "Noi dung private key tuy chon",
selectKeyFile: "Chon tep key",
keyHelpEmpty: "Keo tha tep private key vao day hoac chon tep.",
loadedFile: (name) => `Da tai: ${name}`,
copyUrl: "Sao chep URL",
copied: "Da sao chep",
openInNewTab: "Mo tab moi",
connected: "Da ket noi",
generatedLink: "Lien ket da tao",
enterDetails: "Nhap thong tin ket noi de tao lien ket."
},
ko: {
languageLabel: "언어",
hint: "이 WebSSH URL 빌더로 Open Cloud 환경용 안전한 브라우저 SSH 실행 링크를 생성하세요.",
destinationLabel: "대상",
destinationPlaceholder: "user@localhost",
portLabel: "포트",
portPlaceholder: "22",
passwordLabel: "비밀번호 / 개인 키 암호문",
passwordPlaceholder: "선택 사항: 로그인 비밀번호 또는 개인 키 암호문",
privateKeyLabel: "개인 키",
privateKeyPlaceholder: "선택 사항 개인 키 내용",
selectKeyFile: "키 파일 선택",
keyHelpEmpty: "개인 키 파일을 여기로 드래그 앤 드롭하거나 파일을 선택하세요.",
loadedFile: (name) => `불러옴: ${name}`,
copyUrl: "URL 복사",
copied: "복사됨",
openInNewTab: "새 탭에서 열기",
connected: "연결됨",
generatedLink: "생성된 링크",
enterDetails: "연결 정보를 입력하면 링크가 생성됩니다."
}
};
function detectInitialLanguage() {
const browserLang = (navigator.language || "en").toLowerCase();
if (browserLang.startsWith("ja")) return "ja";
if (browserLang.startsWith("zh")) return "zh";
if (browserLang.startsWith("vi")) return "vi";
if (browserLang.startsWith("ko")) return "ko";
return "en";
}
function App() {
const endpoint = "https://opencloudshell.com/c.php";
const [language, setLanguage] = useState(detectInitialLanguage);
const [port, setPort] = useState("");
const [destination, setDestination] = useState("");
const [password, setPassword] = useState("");
const [key, setKey] = useState("");
const [keyFileName, setKeyFileName] = useState("");
const [draggingKey, setDraggingKey] = useState(false);
const [copied, setCopied] = useState(false);
const [connectionStatus, setConnectionStatus] = useState(null); // null | 'ok' | 'error'
const keyFileInputRef = useRef(null);
const t = translations[language] || translations.en;
useEffect(() => {
document.documentElement.lang = language;
}, [language]);
useEffect(() => {
setConnectionStatus(null);
if (!destination.trim()) return;
const tid = setTimeout(async () => {
const dest = destination.trim();
let username = '';
let host = dest;
if (dest.includes('@')) {
const atIdx = dest.lastIndexOf('@');
username = dest.slice(0, atIdx);
host = dest.slice(atIdx + 1);
}
const config = {};
if (host) config.host = host;
if (username) config.username = username;
if (port.trim()) config.port = port.trim();
if (key.trim()) {
config.privateKey = key.trim();
if (password.trim()) config.passphrase = password.trim();
} else if (password.trim()) {
config.password = password.trim();
}
try {
const r = await fetch('https://ssh.fr.deno.net/?' + new URLSearchParams(config));
setConnectionStatus(r.ok ? 'ok' : 'error');
} catch {
setConnectionStatus('error');
}
}, 800);
return () => clearTimeout(tid);
}, [destination, port, password, key]);
const applyKeyFile = async (file) => {
if (!file) return;
try {
const text = await file.text();
setKey(text);
setKeyFileName(file.name);
} catch {
setKeyFileName("");
}
};
const generatedUrl = useMemo(() => {
const base = endpoint.trim();
if (!base) return "";
try {
const url = new URL(base);
if (port.trim()) {
url.searchParams.set("port", port);
} else {
url.searchParams.delete("port");
}
if (destination.trim()) {
url.searchParams.set("destination", destination);
} else {
url.searchParams.delete("destination");
}
if (password.trim()) {
url.searchParams.set("password", password);
} else {
url.searchParams.delete("password");
}
if (key.trim()) {
url.searchParams.set("key", key);
} else {
url.searchParams.delete("key");
}
return url.toString();
} catch {
return "";
}
}, [port, destination, password, key]);
const handleCopy = async () => {
if (!generatedUrl) return;
try {
await navigator.clipboard.writeText(generatedUrl);
setCopied(true);
setTimeout(() => setCopied(false), 1200);
} catch {
setCopied(false);
}
};
return (
<div className="container">
<div className="card">
<div className="toolbar">
<label className="lang-select-wrap">
<span>{t.languageLabel}</span>
<select
className="lang-select"
value={language}
onChange={(e) => setLanguage(e.target.value)}
aria-label={t.languageLabel}
>
<option value="en">English</option>
<option value="ja">日本語</option>
<option value="zh">中文</option>
<option value="vi">Tiếng Việt</option>
<option value="ko">한국어</option>
</select>
</label>
</div>
<h1>OpenCloudShell</h1>
<p className="hint">{t.hint}</p>
<div className="grid">
<label>
{t.destinationLabel}
<input
type="text"
value={destination}
onChange={(e) => setDestination(e.target.value)}
placeholder={t.destinationPlaceholder}
/>
</label>
<label>
{t.portLabel}
<input
type="text"
value={port}
onChange={(e) => setPort(e.target.value)}
placeholder={t.portPlaceholder}
/>
</label>
<label>
{t.passwordLabel}
<input
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
placeholder={t.passwordPlaceholder}
/>
</label>
<label>
{t.privateKeyLabel}
<div
className={"key-dropzone" + (draggingKey ? " dragging" : "")}
onDragOver={(e) => {
e.preventDefault();
setDraggingKey(true);
}}
onDragLeave={() => setDraggingKey(false)}
onDrop={(e) => {
e.preventDefault();
setDraggingKey(false);
const file = e.dataTransfer?.files?.[0];
if (file) applyKeyFile(file);
}}
>
<textarea
value={key}
onChange={(e) => setKey(e.target.value)}
placeholder={t.privateKeyPlaceholder}
/>
<div className="key-actions">
<button
type="button"
className="key-select"
onClick={() => keyFileInputRef.current?.click()}
>
{t.selectKeyFile}
</button>
<input
ref={keyFileInputRef}
type="file"
accept=".key,.pem,.ppk,.txt"
style={{ display: "none" }}
onChange={(e) => {
const file = e.target.files?.[0];
if (file) applyKeyFile(file);
e.target.value = "";
}}
/>
<span className="key-help">
{keyFileName ? t.loadedFile(keyFileName) : t.keyHelpEmpty}
</span>
</div>
</div>
</label>
</div>
<div className="actions">
<button type="button" onClick={handleCopy}>
{copied ? t.copied : t.copyUrl}
</button>
<a
className="open-link"
href={generatedUrl || "#"}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => {
if (!generatedUrl) e.preventDefault();
}}
>
{t.openInNewTab}
</a>
{connectionStatus === 'ok' && (
<span style={{ color: 'var(--accent)', fontWeight: 700, display: 'inline-flex', alignItems: 'center' }}>✓ {t.connected}</span>
)}
</div>
<div className="result">
<p>{t.generatedLink}</p>
<div className="url">{generatedUrl || t.enterDetails}</div>
</div>
</div>
</div>
);
}
ReactDOM.createRoot(document.getElementById("root")).render(<App />);
</script>
</body>
</html>