-
Notifications
You must be signed in to change notification settings - Fork 19
/
paste.html
737 lines (678 loc) · 28.9 KB
/
paste.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
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
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="/favicon.ico" />
<script src="/cryptojs/core.js" integrity="sha256-J+rNifeY/oCTf6N0pQRiRCEePpfMeFLIjLoHds/Cty8="></script>
<script src="/cryptojs/enc-base64.js" integrity="sha256-ZI1+CuyNcia+Vucl/2bX6SZHichglaL8L1gyw8l8j1c="></script>
<script src="/cryptojs/evpkdf.js" integrity="sha256-BugM3Jj5NhEB4AhjoExCxAfyo2pmlE3EQuwdSxvSMk8="></script>
<script src="/cryptojs/hmac.js" integrity="sha256-pietFDNE66M/Oh2TMiCEF4NGVSvrq6IMKKBnHZegIEE="></script>
<script src="/cryptojs/pbkdf2.js" integrity="sha256-uA2803UHxZZKqjf0OKZI5jUV0LWWGxhw5DEx9R7u5wU="></script>
<script src="/cryptojs/cipher-core.js" integrity="sha256-MtuPdcLFCdAzdf3zQay8pkxDrd6uJ3Hqeezg9opuiPY="></script>
<script src="/cryptojs/aes.js" integrity="sha256-zv8VFScGndG98F3RFjK9E94Tkc6hmNuIF5mUTPrPMpA="></script>
<script src="/cryptojs/x64-core.js" integrity="sha256-pazpxy7vEXKRc5u5MZt9vArdACbkqM5evVRenrJwhek="></script>
<script src="/cryptojs/sha512.js" integrity="sha256-7jMSjFvKwTzCu7HXcbN1ydvyD1CEj9tMDmzwGrpekxo="></script>
<script src="/cryptojs/opensslpbkdf2.js" integrity="sha256-oMd+FVHsOUPYtC3Blivb/17OQ/dTtJQ3959UFKn7G/0="></script>
<title>paste.sh · {{encrypted}} pastebin</title>
<script>
const placeholder="This is an encrypted paste site. Simply type or paste code here and share the URL. Saving is automatic 🪄\n\n🐚 For command line users there is paste.sh, a command line script, see about for more details.";
var paste = {
id: "",
clientkey: "",
shouldSave: false,
saveTimer: null,
text: "",
subject: "",
ct: "",
lastLength: 0,
};
const rawHTMLPolicy = window.trustedTypes && location.pathname.length == 6 && location.pathname.substr(0, 3) == "/ab" ? trustedTypes.createPolicy("raw", {
createHTML: (string) => string,
}) : null;;
var editable, serverkey = "", ptype, etag;
onload = function() {
var content = document.forms.bootstrap.content.value;
serverkey = document.forms.bootstrap.serverkey.value;
editable = document.forms.bootstrap.editable.value;
ptype = document.forms.bootstrap.type.value;
etag = document.forms.bootstrap.etag.value;
var textarea = document.getElementById('x');
var subjectArea = document.getElementById('s');
document.querySelector('#settings').addEventListener('click', e => {
document.querySelector('#controls').className = 'open';
});
textarea.onfocus = function() {
document.querySelector('#controls').classNAme = '';
}
if (navigator.userAgent.match(/iPhone;/)) {
// Avoid zoom in when editing.
textarea.style.fontSize = '16px';
}
if (location.hash.match(/:/)) {
// PWA special
let m = location.hash.match(/:(pasteauth=[A-Za-z0-9_-]+)$/);
if (m && !document.cookie.match(/pasteauth=/)) {
document.cookie = m[1];
location.reload();
}
location.hash = location.hash.replace(/:(.*)/, "");
}
var raw = document.getElementById('raw');
raw.onclick = raw.oncontextmenu = e => rawme(e.srcElement);
paste.id = location.pathname.substr(1);
if (content.length > 0) {
try {
let text = decrypt(getKey(), content, etag);
if (ptype == 'v3') {
let endHeader = text.indexOf("\n\n");
let header = text.slice(0, endHeader);
let subject = header.match(/^Subject:\s*(.*)/im);
if (subject) {
paste.subject = document.getElementById('s').innerText = subject[1];
updateTitle(paste.subject);
}
let ct = header.match(/^Content-Type:\s*(.*)/im);
if (ct) {
paste.ct = ct[1];
}
text = text.slice(endHeader + 2);
}
paste.text = textarea.value = text;
if (location.pathname.length == 6 && location.pathname.substr(0, 3) == "/ab") {
if (rawHTMLPolicy) {
textarea.outerHTML = rawHTMLPolicy.createHTML("<div id=x>" + paste.text + "</div>");
} else {
textarea.outerHTML = "<div id=x>" + paste.text + "</div>";
}
}
if (paste.ct.match(/^image\//)) {
let img = document.createElement("img");
img.id = "i";
img.src = rawit();
textarea.parentElement.insertBefore(img, textarea);
setTimeout(() => textarea.style.maxHeight = textarea.style.minHeight = (textarea.clientHeight - img.height) + "px", 0);
}
let manifest = document.createElement("link");
manifest.rel = "manifest";
// XXX: awfulness https://stackoverflow.com/questions/12271547/shouldnt-json-stringify-escape-unicode-characters
escapeUnicode = s => [...s].map(c => /^[\x20-\x7f]$/.test(c) ? c : c.split("").map(a => "\\u" + a.charCodeAt().toString(16).padStart(4, "0")).join("")).join("");
manifest.href = "data:application/manifest+json;base64," + btoa(escapeUnicode(JSON.stringify({
name: paste.subject || "paste.sh",
display: "standalone",
start_url: "https://paste.sh/" + paste.id + location.hash + ":" + document.cookie,
theme_color: "#254B85",
icons: []
})));
document.head.appendChild(manifest);
} catch(e) {
textarea.value = "Decryption failed (" + e + ")";
editable = false;
}
} else {
textarea.setAttribute("placeholder", placeholder);
if (editable) {
paste.clientkey = randomStr(18);
}
}
textarea.focus();
textarea.selectionStart = 0;
textarea.selectionEnd = 0;
textarea.scrollTo(0, 0);
if(!editable) {
textarea.setAttribute('spellcheck', false);
subjectArea.removeAttribute('contenteditable');
subjectArea.style.cursor = 'pointer';
subjectArea.addEventListener("click", _ => location = '/');
} else {
subjectArea.setAttribute('contenteditable', navigator.vendor.match(/Google/) ? "plaintext-only" : "");
}
textarea.onmousedown = function(e) {
if(!editable) return;
}
textarea.onbeforeinput = editWarning;
// Note the content changed and we should save this.
textarea.onchange = shouldSave;
textarea.oninput = shouldSave;
subjectArea.addEventListener("input", shouldSave);
subjectArea.addEventListener("keydown", function(e) {
if (e.key == 'Enter') {
e.preventDefault();
textarea.focus();
}
});
subjectArea.addEventListener("paste", e => {
e.preventDefault();
let paste = (e.clipboardData || window.clipboardData).getData("text");
paste = paste.replace(/\n/g, "");
const selection = window.getSelection();
if (!selection.rangeCount) return;
selection.deleteFromDocument();
selection.getRangeAt(0).insertNode(document.createTextNode(paste));
selection.collapseToEnd();
});
textarea.onkeydown = function(e) {
if(!editable) return;
if(!e.ctrlKey && !e.altKey && !e.metaKey) {
shouldSave();
}
// Make tab key work, keep shift+tab as a method to get to the URL bar.
if(e.keyCode == 9 && !e.shiftKey && !e.ctrlKey) {
e.preventDefault();
var s = this.selectionStart;
this.value = this.value.substring(0, this.selectionStart) + "\t" +
this.value.substring(this.selectionEnd);
this.selectionEnd = s + 1;
}
}
// Ensure typing and ctrl-a works even if the textarea wasn't focused
window.onkeydown = function(e) {
if (e.ctrlKey || e.keyCode >= 32) {
if (e.target.id != "s" && e.target.id != "x") {
textarea.focus();
}
}
}
// If the document loses focus save right away (the idea being this is likely
// someone selecting the URL to share).
window.onblur = maybeSave;
window.onresize = maybeSave;
textarea.onmouseout = maybeSave;
textarea.onblur = maybeSave;
window.onbeforeunload = function() {
if(paste.shouldSave) {
maybeSave();
return "Data is still being saved. You may lose data if you leave the page now.";
}
return null;
}
}
function updateTitle(subject) {
if (subject && !subject.match(/^(📋🔐|[\p{Letter}\p{Number}])/u)) {
const canvas = document.createElement("canvas");
canvas.width = 96;
canvas.height = 96;
const contex = canvas.getContext("2d");
contex.font = (navigator.platform == 'Win32' || /Linux/.test(navigator.platform)) ? '80px serif' : '96px serif';
contex.textAlign = "left";
contex.textBaseline = "top";
let chars = [...subject];
contex.fillText(chars[0], 0, 14);
let oldIcon = document.querySelector("link[rel='shortcut icon']");
if (oldIcon) oldIcon.remove();
let link = document.createElement("link");
link.rel = "shortcut icon";
link.href = canvas.toDataURL('image/png');
document.head.appendChild(link)
}
if (subject && !subject.match(/ paste\.sh$/)) {
let chars = [...subject];
if (!subject.match(/^[\p{Letter}\p{Number}]/u)) {
chars.shift();
}
let newTitle = chars.join("");
document.title = newTitle.replace(/^(🔐|\s+)/g, "") + " · paste.sh";
}
}
function getKey() {
if (!paste.clientkey) {
// Remove "." from the end or other characters that corrupt the key unintentionally.
paste.clientkey = location.hash.substr(1).replace(/[^A-Za-z0-9_-]/g, "");
}
let hash = paste.clientkey;
// Allow empty keys on special URLs like /about and public pastes (/p.{8}) but not encrypted ones.
if(hash.length < 18 && (paste.id.length == 7 ||
(paste.id.length >= 8 && paste.id[0] != 'p'))) {
throw "Invalid hash, ensure you have the full URL, including the full '#xxxx' part at the end";
}
return paste.id + serverkey + hash + 'https://paste.sh';
}
function maybeSave() {
if(paste.shouldSave) {
let status = document.getElementById('status')
status.textContent = 'Saving...';
status.className = '';
paste.lastLength = paste.text.length;
try {
if (serverkey) {
// This keeps the key unique per save
serverkey = serverkey.substr(0, 8) + randomStr(6);
}
// Always upgrade to v3 on save
let version = 3;
let ec = encrypt(getKey(), version);
serverSave("/" + paste.id, ec.ciphertext, version, ec.auth);
} catch(e) {
alert(e);
}
}
}
function serverSave(path, content, version, auth) {
if (paste.saving) return;
paste.saving = true;
var xhr = new XMLHttpRequest;
xhr.open("PUT", path, true);
xhr.setRequestHeader('X-Server-Key', serverkey);
xhr.setRequestHeader('ETag', '"' + auth + '"');
if (etag) {
xhr.setRequestHeader('If-Match', '"' + etag + '"');
}
xhr.setRequestHeader('Content-Type',
version == 3 ? 'text/vnd.paste.sh-v3' :
version == 2 ? 'text/vnd.paste.sh-v2' :'text/plain');
xhr.onreadystatechange = function() {
if(this.readyState == this.DONE) {
let status = document.getElementById('status')
status.textContent = this.responseText;
paste.saving = false;
switch (this.status) {
case 403:
if (!etag) {
// (Unlikely) ID clash, try a new ID...
generate();
maybeSave();
} else {
paste.shouldSave = false;
}
return;
case 400:
case 413:
paste.shouldSave = false;
return;
case 412:
// TODO: conflict resolution?
document.getElementById('status').style.color = 'red';
document.getElementById('x').disabled = true;
paste.shouldSave = false;
return;
case 0:
case 500:
case 502:
case 503:
case 504:
// XXX: for 502-504 it is possible the server saw the request but didn't
// respond, should potentially add to "If-Match" list.
return;
}
paste.shouldSave = false;
status.className = 'low';
status.style.color = '';
etag = auth;
if (location.pathname != ('/' + paste.id) || location.hash != "#" + paste.clientkey) {
history.replaceState(null, '', '/' + paste.id + (paste.clientkey ? '#' + paste.clientkey : ''));
}
}
}
xhr.onerror = function(e) {
let status = document.getElementById('status');
status.textContent = "Error saving!";
status.style.color = 'red';
status.className = '';
paste.saving = false;
}
xhr.send(content);
}
var oldwarning = false;
function editWarning(e) {
var textarea = document.getElementById('x');
var subjectArea = document.getElementById('s');
if(!('crypto' in window) || !('getRandomValues' in window.crypto)) {
if(!oldwarning) {
alert('This browser does not have crypto.getRandomValues. To securely create pastes please upgrade to a recent browser.');
oldwarning = true;
}
document.getElementById('x').disabled = true;
e.preventDefault();
return;
}
if(!editable) {
if (confirm("You can't edit this paste, would you like to create a copy? You'll need to share the new URL.")) {
editable = true;
generate();
textarea.removeAttribute('spellcheck');
} else {
e.preventDefault();
}
}
}
function shouldSave(e) {
var textarea = document.getElementById('x');
var subjectArea = document.getElementById('s');
if(!('crypto' in window) || !('getRandomValues' in window.crypto)) {
return;
}
if(!editable) return /* should be unreachable, assuming onbeforeinput support */;
if(paste.id == "" && location.pathname == '/') {
generate();
}
let subjectChanged = paste.subject != subjectArea.innerText;
if(paste.text != textarea.value || subjectChanged) {
paste.shouldSave = true;
let delta = Math.abs(paste.lastLength - textarea.value.length);
paste.text = textarea.value;
if (subjectChanged) {
paste.subject = subjectArea.innerText;
updateTitle(paste.subject);
}
let status = document.getElementById('status');
status.textContent = 'Unsaved 💾';
status.className = '';
if (paste.saveTimer)
clearTimeout(paste.saveTimer);
paste.saveTimer = setTimeout(maybeSave, delta > 2 ? 5000 / Math.log(delta) : 5000);
}
}
function randomStr(n) {
return CryptoJS.lib.WordArray.random(n).toString(
CryptoJS.enc.Base64).replace(/[\+\/]/g, function(x) { return x == '+' ? '-' : '_'});
}
function generate() {
if(!document.cookie.match(/pasteauth=/)) {
document.cookie = 'pasteauth=' + randomStr(18);
let status = document.querySelector('#status');
}
paste.id = randomStr(6);;
paste.clientkey = randomStr(18);
}
function encrypt(password, version) {
message = document.getElementById('x').value;
if (version == 3) {
message = "Subject: " + document.getElementById('s').innerText.replace(/\n/g, "") + "\n\n" +
message;
}
var e;
if (version == 1) {
// This matches "openssl enc -aes-256-cbc -md sha512"
e = CryptoJS.lib.PasswordBasedCipher.encrypt(
CryptoJS.algo.AES, message, password,
{ hasher: CryptoJS.algo.SHA512 });
} else {
// This matches "openssl enc -aes-256-cbc -md sha512 -iter 1" (PBKDF2)
let kdf = OpenSSLPbkdf2;
e = CryptoJS.lib.PasswordBasedCipher.encrypt(
CryptoJS.algo.AES, message, password,
{ kdf: kdf, hasher: CryptoJS.algo.SHA512 });
}
// This is OpenSSLFormatter.stringify, without base64 encoding, to avoid base64 roundtrip for
// MAC.
let ciphertext = CryptoJS.lib.WordArray.create([0x53616c74, 0x65645f5f]).concat(e.salt).concat(e.ciphertext);
// This adds an extra HMAC step to avoid directly using the secret key as the HMAC secret, mostly out of paranoia.
// This way both keys are derived differently, with a salt included in the derivation above and the HMAC construction used below.
// It would be better to directly use HKDF on both, but in order to be compatible with the
// openssl command line we need to use PBKDF2 above.
// Some discussion: https://security.stackexchange.com/questions/37880/why-cant-i-use-the-same-key-for-encryption-and-mac
let hmacInner = CryptoJS.HmacSHA512(password, "auth key");
let hmac = CryptoJS.HmacSHA512(ciphertext,
hmacInner).toString(CryptoJS.enc.Base64).replace(/=+$/, "");
return {
ciphertext: ciphertext.toString(CryptoJS.enc.Base64),
auth: hmac,
};
}
function decrypt(password, message, auth) {
var wa = CryptoJS.enc.Base64.parse(message);
if (auth) {
let hmacInner = CryptoJS.HmacSHA512(password, "auth key");
let hmac = CryptoJS.HmacSHA512(wa,
hmacInner).toString(CryptoJS.enc.Base64).replace(/=+$/, "");
if (auth != hmac) {
throw "Invalid decryption key or damaged data";
}
}
let ciphertext = CryptoJS.format.OpenSSL.parse(wa);
var e;
let version = ptype == 'v2' || ptype == 'v3' ? 2 : 1;
if (version == 1) {
e = CryptoJS.lib.PasswordBasedCipher.decrypt(
CryptoJS.algo.AES, ciphertext, password,
{ hasher: CryptoJS.algo.SHA512 });
} else {
let kdf = OpenSSLPbkdf2;
e = CryptoJS.lib.PasswordBasedCipher.decrypt(
CryptoJS.algo.AES, ciphertext, password,
{ kdf: kdf, hasher: CryptoJS.algo.SHA512 });
}
let out;
try {
out = e.toString(CryptoJS.enc.Utf8);
} catch(err) {
console.error(err);
out = e.toString(CryptoJS.enc.Latin1);
}
return out;
}
function rawit() {
let ct = paste.ct != "";
let data;
if (ct && !/^image\/(png|jpeg|gif)/.test(paste.ct)) {
ct = false;
} else {
data = new Uint8Array([...paste.text].map(x => x.charCodeAt(0)));
}
let text = data ? [data.buffer] : [document.getElementById('x').value || paste.text];
let blob = new Blob(text, { type: ct ? paste.ct : "text/plain" });
return URL.createObjectURL(blob);
}
function rawme(l) {
l.href = rawit();
}
</script>
<style>
body {
margin: 0;
padding: .6em;
padding-top: .4em;
background: #eee;
overflow: hidden;
}
#settings {
display: none;
float: right;
text-align: right;
cursor: pointer;
}
#settings, #s {
font-size: 120%;
}
#s {
float: left;
width: calc(100% - 4ex);
font-weight: bold;
color: #777;
height: 3ex;
margin-left: .2em;
vertical-align: bottom;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
#x {
width: 100%;
border: 1px solid #ddd;
border-radius: 8px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: .5em;
margin-top: .5em;
padding: .8em;
min-height: calc(100dvh - 5em);
max-height: calc(100dvh - 4em);
font-family:
Consolas,
Monaco,
Lucida Console,
Liberation Mono,
DejaVu Sans Mono,
Bitstream Vera Sans Mono,
Courier New,
monospace;
font-size: small;
}
@media only screen and (max-width: 900px) {
body {
padding: .5em;
padding-top: .3em;
}
#x {
border-radius: 5px;
padding: .7em;
}
}
@media only screen and (min-width: 451px) {
#controls, #status {
position: absolute;
bottom: 0;
padding-bottom: .15em;
}
#controls {
right: 1.25em;
}
#status {
right: 22ex;
}
}
@media only screen and (max-width: 450px) {
body {
padding: 0;
padding-top: .2em;
}
#settings {
position: absolute;
display: block;
right: 0;
top: .2rem;
}
#controls {
display: none;
position: absolute;
right: 0;
top: .2rem;
z-index: 10;
height: 2.5em;
padding-left: 1em;
font-size: 120%;
}
#controls::after {
content: "⚙️";
}
#controls.open, #settings:active + #controls, #controls:hover, #controls:active {
display: inline-block;
}
#x {
border-radius: 0px;
border: none;
border-top: 1px solid #ddd;
margin: 0;
margin-top: .3em;
padding: .5em;
min-height: calc(100dvh - 2.5em);
}
#status {
position: absolute;
font-size: 120%;
right: 3ex;
top: .2rem;
z-index: 9;
}
#controls:hover + #status, #controls:active + #status, #controls.open + #status {
right: 22ex;
}
}
input {
width: 20em;
font-size: 120%;
}
div#x {
overflow: scroll;
overflow-x: auto;
display: inline-block;
font-size: small;
}
div#x,
textarea#x:focus,
textarea#x:active,
textarea:disabled {
background: white;
color: black;
outline: none;
resize: none;
}
#controls {
color: #aaa;
}
#status {
color: #aaa;
opacity: 1;
}
#status.low {
opacity: 0;
transition: opacity 11s ease-in;
}
#i {
text-align: center;
padding: .4em;
max-height: 88vh;
}
@media (prefers-color-scheme: dark) {
body {
background: #222;
color: #999;
}
#s {
color: #bbb;
}
#x {
color: #ddd;
background: black;
border-color: #555;
}
div#x, #x:focus, textarea#x:focus, textarea#x:active, textarea:disabled {
color: white;
background: black;
}
a {
color: #ccf;
}
}
</style>
</head>
<body>
<form name="bootstrap">
<input type="hidden" name="content" value="{{content}}">
<input type="hidden" name="editable" value="{{editable}}">
<input type="hidden" name="serverkey" value="{{serverkey}}">
<input type="hidden" name="type" value="{{type}}">
<input type="hidden" name="etag" value="{{etag}}">
</form>
<noscript>
This site requires JavaScript. However there is a command line
client:
<br />
<pre>
cd ~/bin
curl -OJ https://paste.sh
chmod +x paste.sh
</pre
>
Then use either:
<pre>
$ paste.sh some-file
</pre
>
to upload text, or:
<pre>
$ paste.sh https://paste.sh/...
</pre
>
to view text. See
<a href="https://github.com/dgl/paste.sh">github</a> for more details.
</noscript>
<div id="s">📋🔐 paste.sh</div>
<div id="settings">⚙️</div>
<span id="controls">
<a href="" id="raw">raw</a> • <a href="/">new</a> • <a href="/about">about</a>
</span>
<span id="status"></span>
<textarea id="x"></textarea>
</body>
</html>