From de551a26b6fa880fe2e66e9146f92d0d106d100c Mon Sep 17 00:00:00 2001 From: Remco Date: Thu, 16 Oct 2014 21:25:04 +0200 Subject: [PATCH] several improvements --- README.md | 7 +- bower.json | 1 + transfersh-server/static/index.html | 19 +- transfersh-server/static/scripts/main.js | 4 +- .../templates/index.html.template | 194 ----------- .../index.html.template.bak.template | 309 ------------------ .../templates/index.txt.template | 29 -- transfersh-web/index.html | 20 +- transfersh-web/scripts/main.js | 4 +- 9 files changed, 29 insertions(+), 558 deletions(-) delete mode 100644 transfersh-server/templates/index.html.template delete mode 100644 transfersh-server/templates/index.html.template.bak.template delete mode 100644 transfersh-server/templates/index.txt.template diff --git a/README.md b/README.md index df7d358..e1f2a70 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # transfer.sh -Easy and fast file sharing from the command-line. This code contains the server with everything you need to create your own instance. +Easy and fast file sharing from the command-line. This code contains the server with everything you need to create your own instance. Transfer.sh currently runs on top of Amazon S3. Other storage types will be added shortly. [![Build Status](https://travis-ci.org/dutchcoders/transfer.sh.svg?branch=master)](https://travis-ci.org/dutchcoders/transfer.sh) @@ -57,7 +57,7 @@ sh transfer-server/run.sh ## Build ``` -go build *.go -o transfersh-server +go build -o transfersh-server *.go ``` ## Contributions @@ -74,4 +74,5 @@ Contributions are welcome. ## Copyright and license -Code and documentation copyright 2011-2014 Remco Verhoef. Code released under [the MIT license](LICENSE). +Code and documentation copyright 2011-2014 Remco Verhoef. +Code released under [the MIT license](LICENSE). diff --git a/bower.json b/bower.json index f59ba0c..901f1b7 100644 --- a/bower.json +++ b/bower.json @@ -16,6 +16,7 @@ "dependencies": { "bootstrap": "~3.0.0", "modernizr": "~2.6.2", + "uri.js": "~1.14.1", "typed.js": "https://github.com/mattboldt/typed.js.git" } } diff --git a/transfersh-server/static/index.html b/transfersh-server/static/index.html index 5b76f9d..cf2786d 100644 --- a/transfersh-server/static/index.html +++ b/transfersh-server/static/index.html @@ -130,14 +130,14 @@

Uploading

Uploading is easy using curl.

- curl --upload-file ./hello.txt https://transfer.sh/hello.txt + $ curl --upload-file ./hello.txt https://transfer.sh/hello.txt

Download the file.

- curl --upload-file ./hello.txt https://transfer.sh/hello.txt + $ curl --upload-file ./hello.txt https://transfer.sh/hello.txt

Make an alias

Create an alias, and add it to .bashrc for faster use

- transfer() { + $ transfer() { # write to output to tmpfile because of progress bar tmpfile=$( mktemp -t transfer ) curl --progress-bar --upload-file $1 https://transfer.sh/$(basename $1) >> $tmpfile; @@ -147,7 +147,7 @@ alias transfer=transfer

Now you can just use transfer command

- transfer hello.txt + $transfer hello.txt
@@ -156,22 +156,21 @@ alias transfer=transfer

Transfer multiple files

Upload multiple files at once

- curl -i -F filedata=@/tmp/hello.txt -F filedata=@/tmp/hello2.txt https://transfer.sh/ + $ curl -i -F filedata=@/tmp/hello.txt -F filedata=@/tmp/hello2.txt https://transfer.sh/

Combining downloads as zip or tar archive

- curl https://transfer.sh/(15HKz/hello.txt,15HKz/hello.txt).tar.gz + $ curl https://transfer.sh/(15HKz/hello.txt,15HKz/hello.txt).tar.gz
- curl https://transfer.sh/(15HKz/hello.txt,15HKz/hello.txt).zip + $ curl https://transfer.sh/(15HKz/hello.txt,15HKz/hello.txt).zip

Encrypt your files before the transfer

You can encrypt files using gpg. The following command will encrypt the data before it leaves your server using the password you enter and upload it to transfer.sh.

- cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.sh/test.txt + $ cat /tmp/hello.txt|gpg -ac -o-|curl -X PUT --upload-file "-" https://transfer.sh/test.txt

Encrypt and upload

- curl https://transfer.sh/1lDau/test.txt|gpg -o- > /tmp/hello.txt + $ curl https://transfer.sh/1lDau/test.txt|gpg -o- > /tmp/hello.txt
- diff --git a/transfersh-server/static/scripts/main.js b/transfersh-server/static/scripts/main.js index cb1b85d..f9f677d 100644 --- a/transfersh-server/static/scripts/main.js +++ b/transfersh-server/static/scripts/main.js @@ -1,3 +1,5 @@ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=a.length,c=_.type(a);return"function"===c||_.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(hb.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=ob[a]={};return _.each(a.match(nb)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+Math.random()}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ub,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:tb.test(c)?_.parseJSON(c):c}catch(e){}sb.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Kb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)rb.set(a[c],"globalEval",!b||rb.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(rb.hasData(a)&&(f=rb.access(a),g=rb.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)_.event.add(b,e,j[e][c])}sb.hasData(a)&&(h=sb.access(a),i=_.extend({},h),sb.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&_.nodeName(a,b)?_.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&yb.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d,e=_(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:_.css(e[0],"display");return e.detach(),f}function u(a){var b=Z,c=Ob[a];return c||(c=t(a,b),"none"!==c&&c||(Nb=(Nb||_("