@@ -34,10 +34,6 @@ import ( | |||
"compress/gzip" | |||
"errors" | |||
"fmt" | |||
"github.com/dutchcoders/go-clamd" | |||
"github.com/gorilla/mux" | |||
"github.com/kennygrant/sanitize" | |||
"github.com/russross/blackfriday" | |||
html_template "html/template" | |||
"io" | |||
"io/ioutil" | |||
@@ -51,6 +47,12 @@ import ( | |||
"strings" | |||
text_template "text/template" | |||
"time" | |||
clamd "github.com/dutchcoders/go-clamd" | |||
"github.com/gorilla/mux" | |||
"github.com/kennygrant/sanitize" | |||
"github.com/russross/blackfriday" | |||
) | |||
func healthHandler(w http.ResponseWriter, r *http.Request) { | |||
@@ -102,7 +104,7 @@ func previewHandler(w http.ResponseWriter, r *http.Request) { | |||
} else if strings.HasPrefix(contentType, "text/plain") { | |||
content = html_template.HTML(fmt.Sprintf("<pre>%s</pre>", data)) | |||
} else { | |||
content = html_template.HTML(data) | |||
templatePath = "download.sandbox.html" | |||
} | |||
default: | |||
@@ -85,11 +85,7 @@ | |||
<footer> | |||
<div class="wrapper"> | |||
<div style=""> | |||
<a href="bitcoin:164ybRMLbg1dhhWWiUkXtiNr7jUhMKdJqH" label="Bitcoin+Donation" style="word-wrap: break-word;"> | |||
<img border="0" src=" /images/bitcoin.png" style="margin: 0 auto;;"> | |||
</a> | |||
</div> | |||
<br/> | |||
<br/> | |||
<img src="/images/Logo-orange.png" alt="Founded in Holland"> | |||
@@ -70,11 +70,7 @@ | |||
<footer> | |||
<div class="wrapper"> | |||
<div style=""> | |||
<a href="bitcoin:164ybRMLbg1dhhWWiUkXtiNr7jUhMKdJqH" label="Bitcoin+Donation" style="word-wrap: break-word;"> | |||
<img border="0" src=" /images/bitcoin.png" style="margin: 0 auto;;"> | |||
</a> | |||
</div> | |||
<br/> | |||
<br/> | |||
<img src="/images/Logo-orange.png" alt="Founded in Holland"> | |||
@@ -82,11 +82,7 @@ | |||
<footer> | |||
<div class="wrapper"> | |||
<div style=""> | |||
<a href="bitcoin:164ybRMLbg1dhhWWiUkXtiNr7jUhMKdJqH" label="Bitcoin+Donation" style="word-wrap: break-word;"> | |||
<img border="0" src=" /images/bitcoin.png" style="margin: 0 auto;;"> | |||
</a> | |||
</div> | |||
<br/> | |||
<br/> | |||
<img src="/images/Logo-orange.png" alt="Founded in Holland"> | |||
@@ -81,11 +81,7 @@ | |||
<footer> | |||
<div class="wrapper"> | |||
<div style=""> | |||
<a href="bitcoin:164ybRMLbg1dhhWWiUkXtiNr7jUhMKdJqH" label="Bitcoin+Donation" style="word-wrap: break-word;"> | |||
<img border="0" src=" /images/bitcoin.png" style="margin: 0 auto;;"> | |||
</a> | |||
</div> | |||
<br/> | |||
<br/> | |||
<img src="/images/Logo-orange.png" alt="Founded in Holland"> | |||
@@ -0,0 +1,120 @@ | |||
<!doctype html> | |||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |||
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |||
<!--[if gt IE 8]><!--> | |||
<html class="no-js"> | |||
<!--<![endif]--> | |||
<head> | |||
<meta charset="utf-8"> | |||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |||
<title>transfer.sh - Easy and fast file sharing from the command-line.</title> | |||
<meta name="description" content="Easy and fast file sharing from the command-line."> | |||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |||
<!-- Place favicon.ico and apple-touch-icon.png in the root directory --> | |||
<link rel="stylesheet" href="/styles/main.css"> | |||
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:100,200,300' rel='stylesheet' type='text/css'> | |||
<link href='//fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'> | |||
<script src="/scripts/vendor/modernizr.js"></script> | |||
</head> | |||
<body id="download"> | |||
<script> | |||
(function(i, s, o, g, r, a, m) { | |||
i['GoogleAnalyticsObject'] = r; | |||
i[r] = i[r] || function() { | |||
(i[r].q = i[r].q || []).push(arguments) | |||
}, i[r].l = 1 * new Date(); | |||
a = s.createElement(o), | |||
m = s.getElementsByTagName(o)[0]; | |||
a.async = 1; | |||
a.src = g; | |||
m.parentNode.insertBefore(a, m) | |||
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); | |||
ga('create', 'UA-40833733-1', 'transfer.sh'); | |||
ga('send', 'pageview'); | |||
</script> | |||
<div id="navigation"> | |||
<div class="wrapper"> | |||
<a href="/"> | |||
<h1>transfer.sh</h1> | |||
</a> | |||
<ul class="hidden-xs"> | |||
<li><a href="/">home</a> | |||
</li> | |||
<li><a href="/#samples">sample use cases</a> | |||
</li> | |||
<li><a href="/#contact">contact us</a> | |||
</li> | |||
</ul> | |||
</div> | |||
</div> | |||
<section id="home"> | |||
<div class="wrapper"> | |||
<br/> | |||
<h2 class="page-title">{{.Filename}}</h2> | |||
<h4>type: <b>{{.ContentType}}</b></h4> | |||
<h4>size: <b>{{.ContentLength | format "#,###."}}</b> bytes</h4> | |||
<a href="{{.Url}}" class="btn-cta btn"> download</i> </a> <br/><br/> | |||
<div class="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 id="terminal" class="terminal"> | |||
<iframe src="{{ .Url }}" id="md-preview" sandbox></iframe> | |||
</div> | |||
</div> | |||
</div> | |||
<br/> | |||
</section> | |||
<footer> | |||
<div class="wrapper"> | |||
<br/> | |||
<br/> | |||
<img src="/images/Logo-orange.png" alt="Founded in Holland"> | |||
<p>Made with <i class="icon-heart"></i> by <a href="http://blog.dutchcoders.io/" title="Dutch Coders">Dutch Coders</a> | |||
</p> | |||
</div> | |||
</footer> | |||
<a href="https://github.com/dutchcoders/transfer.sh/"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a> | |||
<script> | |||
(function() { | |||
var uv = document.createElement('script'); | |||
uv.type = 'text/javascript'; | |||
uv.async = true; | |||
uv.src = '//widget.uservoice.com/5rkATbLIm8ClJQeOirOhFg.js'; | |||
var s = document.getElementsByTagName('script')[0]; | |||
s.parentNode.insertBefore(uv, s) | |||
})() | |||
</script> | |||
<!--[if lt IE 7]> | |||
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> | |||
<![endif]--> | |||
<script src="/scripts/main.js"></script> | |||
</body> | |||
</html> |
@@ -85,11 +85,7 @@ | |||
<footer> | |||
<div class="wrapper"> | |||
<div style=""> | |||
<a href="bitcoin:164ybRMLbg1dhhWWiUkXtiNr7jUhMKdJqH" label="Bitcoin+Donation" style="word-wrap: break-word;"> | |||
<img border="0" src=" /images/bitcoin.png" style="margin: 0 auto;;"> | |||
</a> | |||
</div> | |||
<br/> | |||
<br/> | |||
<img src="/images/Logo-orange.png" alt="Founded in Holland"> | |||
@@ -1,10 +1,6 @@ | |||
<footer> | |||
<div class="wrapper"> | |||
<div style=""> | |||
<a href="bitcoin:164ybRMLbg1dhhWWiUkXtiNr7jUhMKdJqH" label="Bitcoin+Donation" style="word-wrap: break-word;"> | |||
<img border="0" src=" /images/bitcoin.png" style="margin: 0 auto;;"> | |||
</a> | |||
</div> | |||
<br/> | |||
<br/> | |||
<img src="/images/Logo-orange.png" alt="Founded in Holland"> | |||
@@ -24,19 +24,19 @@ | |||
<body> | |||
<script> | |||
(function(i, s, o, g, r, a, m) { | |||
i['GoogleAnalyticsObject'] = r; | |||
i[r] = i[r] || function() { | |||
(i[r].q = i[r].q || []).push(arguments) | |||
}, i[r].l = 1 * new Date(); | |||
a = s.createElement(o), | |||
m = s.getElementsByTagName(o)[0]; | |||
a.async = 1; | |||
a.src = g; | |||
m.parentNode.insertBefore(a, m) | |||
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); | |||
ga('create', 'UA-40833733-1', 'transfer.sh'); | |||
ga('send', 'pageview'); | |||
(function (i, s, o, g, r, a, m) { | |||
i['GoogleAnalyticsObject'] = r; | |||
i[r] = i[r] || function () { | |||
(i[r].q = i[r].q || []).push(arguments) | |||
}, i[r].l = 1 * new Date(); | |||
a = s.createElement(o), | |||
m = s.getElementsByTagName(o)[0]; | |||
a.async = 1; | |||
a.src = g; | |||
m.parentNode.insertBefore(a, m) | |||
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); | |||
ga('create', 'UA-40833733-1', 'transfer.sh'); | |||
ga('send', 'pageview'); | |||
</script> | |||
<div id="navigation"> | |||
@@ -72,7 +72,7 @@ | |||
<br> | |||
<span class="code-title"># Using the alias</span> | |||
<br>$ transfer hello.txt | |||
<br>##################################################### 100.0% https://transfer.sh/eibhM/hello.txt | |||
<br>###################################s################## 100.0% https://transfer.sh/eibhM/hello.txt | |||
</code> | |||
</div> | |||
<div id="web"> | |||
@@ -93,7 +93,7 @@ | |||
<span class="code-title"># Download all your files</span> | |||
<br/> | |||
<br/> | |||
<a class="download-zip btn-cta" href="#">zip</a> <a class="download-tar btn-cta" href="#">tar.gz</a> | |||
<a class="download-zip btn-cta" href="#">zip</a> <a class="download-tar btn-cta" href="#">tar.gz</a> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -140,7 +140,12 @@ | |||
</div> | |||
</section> | |||
<section id="share"> | |||
<div class="wrapper"> | |||
<h2 class="page-title">Preview your files in the browser!</h2> | |||
</div> | |||
</section> | |||
<section id="samples"> | |||
<div class="wrapper"> | |||
@@ -165,7 +170,7 @@ | |||
</div> | |||
</div> | |||
<div class="col-md-6 "> | |||
<h3>Create an alias and add it to .bashrc or .zshrc <a href='https://gist.github.com/nl5887/a511f172d3fb3cd0e42d'>[gist]</a></h3> | |||
<h3>Add an alias to .bashrc or .zshrc <a href='https://gist.github.com/nl5887/a511f172d3fb3cd0e42d'>[gist]</a></h3> | |||
<div class="terminal-top"> | |||
</div> | |||
<div class="terminal"> | |||
@@ -317,7 +322,7 @@ | |||
</div> | |||
</section> | |||
<section id="share"> | |||
<section id="share"> | |||
<div class="wrapper"> | |||
<h2 class="page-title">Follow on GitHub</h2> | |||
<br> | |||
@@ -381,6 +386,8 @@ | |||
</div> | |||
</section> | |||
<section id="share"> | |||
<div class="wrapper"> | |||
<h2 class="page-title">Share the love</h2> | |||
@@ -415,10 +422,35 @@ | |||
</div> | |||
</section> | |||
<section id="thank-you"> | |||
<div class="wrapper"> | |||
<h2 class="page-title"> | |||
Special thanks to </h2> | |||
<br> | |||
<div class="row"> | |||
<div class="col-md-4 col-md-offset-2 col-xs-12"> | |||
<a class="btn-cta" href="https://twitter.com/remco_verhoef"><i class="icon-twitter"></i> Remco Verhoef</a> | |||
</div> | |||
<div class="col-md-4 col-xs-12"> | |||
<a class="btn-cta" href="http://twitter.com/uvisgrinfelds"><i class="icon-twitter"></i> Uvis Grinfelds</a> | |||
</div> | |||
</div> | |||
<h3>Want to be here? Support us!</h3> | |||
<div class="donate"> | |||
<a href="bitcoin:164ybRMLbg1dhhWWiUkXtiNr7jUhMKdJqH" label="Bitcoin+Donation" style="word-wrap: break-word;"> | |||
<img border="0" src=" /images/bitcoin.png" style="margin: 0 auto;;"> | |||
</a> | |||
</div> | |||
</div> | |||
</section> | |||
<section id="tor"> | |||
<div class="wrapper"> | |||
<a href="https://www.torproject.org"><img src="images/tor.svg" alt=""></a><br/> | |||
<a href="https://www.torproject.org"><img src="images/tor.svg" alt=""> | |||
</a> | |||
<br/> | |||
<a href="http://jxm5d6emw5rknovg.onion/">http://jxm5d6emw5rknovg.onion/</a> | |||
</div> | |||
</section> | |||
@@ -426,11 +458,7 @@ | |||
<footer> | |||
<div class="wrapper"> | |||
<div style=""> | |||
<a href="bitcoin:164ybRMLbg1dhhWWiUkXtiNr7jUhMKdJqH" label="Bitcoin+Donation" style="word-wrap: break-word;"> | |||
<img border="0" src=" /images/bitcoin.png" style="margin: 0 auto;;"> | |||
</a> | |||
</div> | |||
<br/> | |||
<br/> | |||
<img src="/images/Logo-orange.png" alt="Founded in Holland"> | |||
@@ -461,15 +489,11 @@ | |||
<script src="/scripts/main.js"></script> | |||
</body> | |||
</html> | |||
</html> |
@@ -0,0 +1,39 @@ | |||
<!doctype html> | |||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |||
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |||
<!--[if gt IE 8]><!--> | |||
<html class="no-js"> | |||
<!--<![endif]--> | |||
include "includes/head.html" | |||
<body id="download"> | |||
include "includes/ga.html" | |||
include "includes/navigation.html" | |||
<section id="home"> | |||
<div class="wrapper"> | |||
include "includes/download-top.html" | |||
<div class="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 id="terminal" class="terminal"> | |||
<iframe src="{{ .Url }}" id="md-preview" sandbox></iframe> | |||
</div> | |||
</div> | |||
</div> | |||
<br/> | |||
</section> | |||
include "includes/footer.html" | |||
include "includes/js.html" | |||
</body> | |||
</html> |