deletion token in ui, other minor fixes
This commit is contained in:
parent
ac7014a9c3
commit
8b8af59a0f
|
@ -242,6 +242,12 @@ module.exports = function (grunt) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'npm-command': {
|
'npm-command': {
|
||||||
|
'videojs-update': {
|
||||||
|
options: {
|
||||||
|
cmd: 'update',
|
||||||
|
cwd: '<%= yeoman.app %>/bower_components/videojs/'
|
||||||
|
}
|
||||||
|
},
|
||||||
'videojs-install': {
|
'videojs-install': {
|
||||||
options: {
|
options: {
|
||||||
cmd: 'install',
|
cmd: 'install',
|
||||||
|
|
26196
bindata_gen.go
26196
bindata_gen.go
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,7 @@
|
||||||
"tests"
|
"tests"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"videojs": "~7.10.2",
|
"videojs": "~7.13.3",
|
||||||
"bootstrap": "~3.0.0",
|
"bootstrap": "~3.0.0",
|
||||||
"modernizr": "~2.6.2",
|
"modernizr": "~2.6.2",
|
||||||
"uri.js": "~1.14.1",
|
"uri.js": "~1.14.1",
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,3 +1,5 @@
|
||||||
module github.com/dutchcoders/transfer.sh-web
|
module github.com/dutchcoders/transfer.sh-web
|
||||||
|
|
||||||
go 1.15
|
go 1.15
|
||||||
|
|
||||||
|
require github.com/shuLhan/go-bindata v4.0.0+incompatible // indirect
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
github.com/shuLhan/go-bindata v4.0.0+incompatible h1:xD8LkuVZLV5OOn/IEuFdt6EEAW7deWiqgwaaSGhjAJc=
|
||||||
|
github.com/shuLhan/go-bindata v4.0.0+incompatible/go.mod h1:pkcPAATLBDD2+SpAPnX5vEM90F7fcwHCvvLCMXcmw3g=
|
File diff suppressed because it is too large
Load Diff
|
@ -38,6 +38,10 @@ include "includes/download-navigation.html"
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
include "includes/download-delete.html"
|
||||||
|
|
||||||
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -18,6 +18,10 @@ include "includes/download-navigation.html"
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
|
|
||||||
include "includes/download-top.html"
|
include "includes/download-top.html"
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
include "includes/download-delete.html"
|
||||||
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,11 @@ include "includes/download-navigation.html"
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div>
|
|
||||||
<div>
|
include "includes/download-delete.html"
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
include "includes/download-footer.html"
|
include "includes/download-footer.html"
|
||||||
|
|
|
@ -29,6 +29,10 @@ include "includes/download-navigation.html"
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
include "includes/download-delete.html"
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,10 @@ include "includes/download-navigation.html"
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
include "includes/download-delete.html"
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,10 @@ include "includes/download-navigation.html"
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
include "includes/download-delete.html"
|
||||||
|
|
||||||
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<a href="{{.Url}}" id="fire-delete" class="btn-cta btn"> delete</i> </a> <br/><br/>
|
||||||
|
<div class="delete-modal row animated fadeInDown">
|
||||||
|
<div id="from-terminal" class=" box col-md-8 col-md-offset-2 col-xs-12">
|
||||||
|
<div class="terminal-top">
|
||||||
|
</div>
|
||||||
|
<div class="terminal">
|
||||||
|
<div id="web">
|
||||||
|
<input type="text" id="deletion-token" value="" placeholder="Please enter the deletion token">
|
||||||
|
<a href="#" id="confirm-delete" class="btn-cta btn"> confirm</i> </a> <br/><br/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -43,11 +43,11 @@ include "includes/navigation.html"
|
||||||
</div>
|
</div>
|
||||||
<div id="terminal" class="terminal">
|
<div id="terminal" class="terminal">
|
||||||
<code class="code-wrapper"><span class="code-title"># Upload using cURL</span>
|
<code class="code-wrapper"><span class="code-title"># Upload using cURL</span>
|
||||||
$ curl --upload-file ./hello.txt {{.WebAddress}}hello.txt {{.WebAddress}}66nb8/hello.txt
|
$ curl --upload-file ./hello.txt {{.WebAddress}}hello.txt {{.WebAddress}}{{.SampleToken}}/hello.txt
|
||||||
|
|
||||||
<span class="code-title"># Using the shell function</span>
|
<span class="code-title"># Using the shell function</span>
|
||||||
$ transfer hello.txt
|
$ transfer hello.txt
|
||||||
##################################################### 100.0% {{.WebAddress}}eibhM/hello.txt
|
##################################################### 100.0% {{.WebAddress}}{{.SampleToken2}}/hello.txt
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
<div id="web">
|
<div id="web">
|
||||||
|
@ -95,10 +95,17 @@ include "includes/navigation.html"
|
||||||
<i class="icon-database"></i>
|
<i class="icon-database"></i>
|
||||||
<h3>Upload up to 10 GB</h3>
|
<h3>Upload up to 10 GB</h3>
|
||||||
</div>
|
</div>
|
||||||
|
{{ if .PurgeTime }}
|
||||||
<div class="col-md-3 col-xs-6">
|
<div class="col-md-3 col-xs-6">
|
||||||
<i class="icon-clock"></i>
|
<i class="icon-clock"></i>
|
||||||
<h3>Files stored for 14 days</h3>
|
<h3>Files stored for {{ .PurgeTime }}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
{{ else }}
|
||||||
|
<div class="col-md-3 col-xs-6">
|
||||||
|
<i class="icon-clock"></i>
|
||||||
|
<h3>Files stored forever</h3>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="row animated fadeInDown">
|
<div class="row animated fadeInDown">
|
||||||
<div class="col-md-offset-3 col-md-3 col-xs-6">
|
<div class="col-md-offset-3 col-md-3 col-xs-6">
|
||||||
|
@ -138,13 +145,13 @@ include "includes/navigation.html"
|
||||||
<div class="terminal">
|
<div class="terminal">
|
||||||
<code class="code-wrapper"><span class="code-title"># Uploading is easy using curl</span>
|
<code class="code-wrapper"><span class="code-title"># Uploading is easy using curl</span>
|
||||||
$ curl --upload-file ./hello.txt {{.WebAddress}}hello.txt
|
$ curl --upload-file ./hello.txt {{.WebAddress}}hello.txt
|
||||||
{{.WebAddress}}66nb8/hello.txt
|
{{.WebAddress}}{{.SampleToken}}/hello.txt
|
||||||
|
|
||||||
$ curl -H "Max-Downloads: 1" -H "Max-Days: 5" --upload-file ./hello.txt {{.WebAddress}}hello.txt
|
$ curl -H "Max-Downloads: 1" -H "Max-Days: 5" --upload-file ./hello.txt {{.WebAddress}}hello.txt
|
||||||
{{.WebAddress}}66nb8/hello.txt
|
{{.WebAddress}}{{.SampleToken}}/hello.txt
|
||||||
|
|
||||||
<span class="code-title"># Download the file</span>
|
<span class="code-title"># Download the file</span>
|
||||||
$ curl {{.WebAddress}}66nb8/hello.txt -o hello.txt
|
$ curl {{.WebAddress}}{{.SampleToken}}/hello.txt -o hello.txt
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -177,8 +184,8 @@ include "includes/navigation.html"
|
||||||
$ curl -i -F filedata=@/tmp/hello.txt -F filedata=@/tmp/hello2.txt {{.WebAddress}}
|
$ curl -i -F filedata=@/tmp/hello.txt -F filedata=@/tmp/hello2.txt {{.WebAddress}}
|
||||||
|
|
||||||
<span class="code-title"># Combining downloads as zip or tar archive</span>
|
<span class="code-title"># Combining downloads as zip or tar archive</span>
|
||||||
$ curl {{.WebAddress}}(15HKz/hello.txt,15HKz/hello.txt).tar.gz
|
$ curl {{.WebAddress}}({{.SampleToken}}/hello.txt,{{.SampleToken2}}/world.txt).tar.gz
|
||||||
$ curl {{.WebAddress}}(15HKz/hello.txt,15HKz/hello.txt).zip
|
$ curl {{.WebAddress}}({{.SampleToken}}/hello.txt,{{.SampleToken2}}/world.txt).zip
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -193,7 +200,7 @@ include "includes/navigation.html"
|
||||||
$ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" {{.WebAddress}}test.txt
|
$ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" {{.WebAddress}}test.txt
|
||||||
|
|
||||||
<span class="code-title"># Download and decrypt</span>
|
<span class="code-title"># Download and decrypt</span>
|
||||||
$ curl {{.WebAddress}}1lDau/test.txt|gpg -o- > /tmp/hello.txt
|
$ curl {{.WebAddress}}{{.SampleToken}}/test.txt|gpg -o- > /tmp/hello.txt
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -245,7 +252,7 @@ include "includes/navigation.html"
|
||||||
<span class="code-title"># Encrypt for recipient(s)</span>
|
<span class="code-title"># Encrypt for recipient(s)</span>
|
||||||
$ cat somebackupfile.tar.gz | keybase encrypt [them] | curl --upload-file '-' {{.WebAddress}}test.txt
|
$ cat somebackupfile.tar.gz | keybase encrypt [them] | curl --upload-file '-' {{.WebAddress}}test.txt
|
||||||
<span class="code-title"># Decrypt</span>
|
<span class="code-title"># Decrypt</span>
|
||||||
$ curl {{.WebAddress}}sqUFi/test.md |keybase decrypt
|
$ curl {{.WebAddress}}{{.SampleToken}}/test.md |keybase decrypt
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -306,7 +313,7 @@ include "includes/navigation.html"
|
||||||
<span class="code-title"># transfersh-cli (https://github.com/tanrax/transfersh-cli)</span>
|
<span class="code-title"># transfersh-cli (https://github.com/tanrax/transfersh-cli)</span>
|
||||||
$ transfersh photos.zip
|
$ transfersh photos.zip
|
||||||
<span class="code-title"># Uploading file</span>
|
<span class="code-title"># Uploading file</span>
|
||||||
<span class="code-title"># Download from here: {{.WebAddress}}xxxxxx/photos.zip</span>
|
<span class="code-title"># Download from here: {{.WebAddress}}{{.SampleToken}}/photos.zip</span>
|
||||||
<span class="code-title"># It has also been copied to the clipboard!</span>
|
<span class="code-title"># It has also been copied to the clipboard!</span>
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
|
@ -320,7 +327,7 @@ include "includes/navigation.html"
|
||||||
$ cat /tmp/hello.txt|openssl aes-256-cbc -pbkdf2 -e|curl -X PUT --upload-file "-" {{.WebAddress}}test.txt
|
$ cat /tmp/hello.txt|openssl aes-256-cbc -pbkdf2 -e|curl -X PUT --upload-file "-" {{.WebAddress}}test.txt
|
||||||
|
|
||||||
<span class="code-title"># Download and decrypt</span>
|
<span class="code-title"># Download and decrypt</span>
|
||||||
$ curl {{.WebAddress}}1lDau/test.txt|openssl aes-256-cbc -pbkdf2 -d > /tmp/hello.txt
|
$ curl {{.WebAddress}}{{.SampleToken}}/test.txt|openssl aes-256-cbc -pbkdf2 -d > /tmp/hello.txt
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,13 +9,13 @@ Encrypt with gpg & upload:
|
||||||
$ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" {{.WebAddress}}test.txt
|
$ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" {{.WebAddress}}test.txt
|
||||||
|
|
||||||
Download & decrypt with gpg:
|
Download & decrypt with gpg:
|
||||||
$ curl {{.WebAddress}}1lDau/test.txt|gpg -o- > /tmp/hello.txt
|
$ curl {{.WebAddress}}{{.SampleToken}}/test.txt|gpg -o- > /tmp/hello.txt
|
||||||
|
|
||||||
Encrypt with openssl & upload:
|
Encrypt with openssl & upload:
|
||||||
$ cat /tmp/hello.txt|openssl aes-256-cbc -pbkdf2 -e|curl -X PUT --upload-file "-" {{.WebAddress}}test.txt
|
$ cat /tmp/hello.txt|openssl aes-256-cbc -pbkdf2 -e|curl -X PUT --upload-file "-" {{.WebAddress}}test.txt
|
||||||
|
|
||||||
Download & decrypt with openssl:
|
Download & decrypt with openssl:
|
||||||
$ curl {{.WebAddress}}1lDau/test.txt|openssl aes-256-cbc -pbkdf2 -d > /tmp/hello.txt
|
$ curl {{.WebAddress}}{{.SampleToken}}/test.txt|openssl aes-256-cbc -pbkdf2 -d > /tmp/hello.txt
|
||||||
|
|
||||||
Grep pound from syslog and transfer
|
Grep pound from syslog and transfer
|
||||||
cat /var/log/syslog|grep pound|curl --upload-file - {{.WebAddress}}pound.log
|
cat /var/log/syslog|grep pound|curl --upload-file - {{.WebAddress}}pound.log
|
||||||
|
@ -28,7 +28,7 @@ $ keybase track [them]
|
||||||
$ cat somebackupfile.tar.gz | keybase encrypt [them] | curl --upload-file '-' {{.WebAddress}}test.txt
|
$ cat somebackupfile.tar.gz | keybase encrypt [them] | curl --upload-file '-' {{.WebAddress}}test.txt
|
||||||
|
|
||||||
# decrypt
|
# decrypt
|
||||||
$ curl {{.WebAddress}}sqUFi/test.md |keybase decrypt
|
$ curl {{.WebAddress}}{{.SampleToken}}/test.md |keybase decrypt
|
||||||
|
|
||||||
Upload to Virustotal:
|
Upload to Virustotal:
|
||||||
$ curl -X PUT --upload-file nhgbhhj {{.WebAddress}}test.txt/virustotal
|
$ curl -X PUT --upload-file nhgbhhj {{.WebAddress}}test.txt/virustotal
|
||||||
|
|
|
@ -30,6 +30,41 @@ $(document).ready(function() {
|
||||||
return 'There are still ' + queue.length + ' files being uploaded.';
|
return 'There are still ' + queue.length + ' files being uploaded.';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function deleteFile(baseURL) {
|
||||||
|
var deleteModal = $('.delete-modal');
|
||||||
|
if (deleteModal.hasClass('show')) {
|
||||||
|
deleteModal.removeClass('show');
|
||||||
|
} else {
|
||||||
|
deleteModal.addClass('show');
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteModal.find('input[placeholder]').each(function () {
|
||||||
|
$(this).attr('size', $(this).attr('placeholder').length);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#confirm-delete').on('click', function (event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
var deletionToken = $('#deletion-token').val();
|
||||||
|
if (deletionToken.length > 0) {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.onreadystatechange = function() {
|
||||||
|
if (xhr.readyState === 4) {
|
||||||
|
if (xhr.status === 200) {
|
||||||
|
deleteModal.find('#web').html('<span style="clear:both">File deleted</span></div>');
|
||||||
|
} else {
|
||||||
|
deleteModal.find('#web').append('<span>Error (' + xhr.status + ') during deletion of file</span>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// start deletion
|
||||||
|
xhr.open('DELETE', baseURL + '/' + deletionToken, true);
|
||||||
|
xhr.send();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function upload(file) {
|
function upload(file) {
|
||||||
$('.browse').addClass('uploading');
|
$('.browse').addClass('uploading');
|
||||||
|
|
||||||
|
@ -44,17 +79,18 @@ $(document).ready(function() {
|
||||||
var pc = parseInt((e.loaded / e.total * 100));
|
var pc = parseInt((e.loaded / e.total * 100));
|
||||||
$('.upload-progress', $(li)).show();
|
$('.upload-progress', $(li)).show();
|
||||||
$('.upload-progress .bar', $(li)).css('width', pc + '%');
|
$('.upload-progress .bar', $(li)).css('width', pc + '%');
|
||||||
$('.upload-progress span ', $(li)).empty().append(pc + '%');
|
$('.upload-progress span', $(li)).empty().append(pc + '%');
|
||||||
|
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if (xhr.readyState === 4) {
|
if (xhr.readyState === 4) {
|
||||||
/* $('.upload-progress', $(li)).hide();*/
|
|
||||||
$('#web').addClass('uploading');
|
$('#web').addClass('uploading');
|
||||||
// progress.className = (xhr.status == 200 ? "success" : "failure");
|
|
||||||
if (xhr.status === 200) {
|
if (xhr.status === 200) {
|
||||||
$(li).html('<a target="_blank" href="' + xhr.responseText + '">' + xhr.responseText + '</a>');
|
var deletionToken = xhr.getResponseHeader('X-Url-Delete').split('/').pop();
|
||||||
|
var url = $('<p></p>').text(xhr.responseText).html();
|
||||||
|
$(li).html('<a target="_blank" href="' + url + '">' + url + '</a><br/><br/>' +
|
||||||
|
'<span class="code-title"># Delete URL</span><br/>' + deletionToken);
|
||||||
} else {
|
} else {
|
||||||
$(li).html('<span>Error (' + xhr.status + ') during upload of file ' + file.name + '</span>');
|
$(li).html('<span>Error (' + xhr.status + ') during upload of file ' + file.name + '</span>');
|
||||||
}
|
}
|
||||||
|
@ -118,6 +154,12 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('a#fire-delete').on('click', function(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
deleteFile($(this).attr('href'));
|
||||||
|
});
|
||||||
|
|
||||||
// clipboard
|
// clipboard
|
||||||
if (window.location.href.indexOf('download') > -1 ) {
|
if (window.location.href.indexOf('download') > -1 ) {
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ $(document).ready(function () {
|
||||||
|
|
||||||
// Terminal typing animation
|
// Terminal typing animation
|
||||||
$("#from-terminal p").typed({
|
$("#from-terminal p").typed({
|
||||||
strings: ["curl --upload-file ./hello.txt {{.WebAddress}}hello.txt\n{{.WebAddress}}66nb8/hello.txt \n "],
|
strings: ["curl --upload-file ./hello.txt {{.WebAddress}}hello.txt\n{{.WebAddress}}{{.SampleToken}}/hello.txt \n "],
|
||||||
typeSpeed: 0,
|
typeSpeed: 0,
|
||||||
loop: true,
|
loop: true,
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
.delete-modal {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.delete-modal .show {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.preview-wrapper {
|
.preview-wrapper {
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6555,6 +6555,12 @@ blockquote.tweet-xl a {
|
||||||
.icon-gplus:before {
|
.icon-gplus:before {
|
||||||
content: "p";
|
content: "p";
|
||||||
}
|
}
|
||||||
|
.delete-modal {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.delete-modal .show {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
.preview-wrapper {
|
.preview-wrapper {
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue