├── i └── .placeholder ├── .gitignore ├── client ├── favicon │ ├── 128px.png │ ├── 16px.png │ ├── 32px.png │ └── 64px.png ├── config.js.example ├── deps │ ├── hybrid.min.css │ ├── sjcl.min.js │ ├── zepto.min.js │ └── highlight.min.js ├── js │ ├── shims.js │ ├── textpaste.js │ ├── loadencryption.js │ ├── updown.js │ ├── dragresize.js │ ├── encryption.js │ ├── main.js │ ├── home.js │ └── download.js ├── index.html └── css │ └── up1.css ├── server ├── package.json ├── server.conf.example ├── server.go └── server.js ├── LICENSE └── README.md /i/.placeholder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | i/ 2 | server.conf 3 | config.js 4 | node_modules 5 | -------------------------------------------------------------------------------- /client/favicon/128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upload/Up1/master/client/favicon/128px.png -------------------------------------------------------------------------------- /client/favicon/16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upload/Up1/master/client/favicon/16px.png -------------------------------------------------------------------------------- /client/favicon/32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upload/Up1/master/client/favicon/32px.png -------------------------------------------------------------------------------- /client/favicon/64px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/upload/Up1/master/client/favicon/64px.png -------------------------------------------------------------------------------- /client/config.js.example: -------------------------------------------------------------------------------- 1 | upload.config.server = '' // Empty if the webapp is in the same place as the server 2 | // upload.config.server = 'https://yourserver.com/' // If the webapp is separated from the server - remember the trailing slash 3 | upload.config.api_key = 'c61540b5ceecd05092799f936e27755f' // Should be the same as the server, used for uploading 4 | upload.config.footer = 'Source Code - Contact' 5 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Up1", 3 | "version": "0.3.1", 4 | "description": "Client-side encrypted host for images, text, and other forms of data.", 5 | "main": "server.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git://github.com/upload/up1" 9 | }, 10 | "author": "The Up1 Authors", 11 | "license": "MIT", 12 | "bugs": { 13 | "url": "https://github.com/upload/up1/issues" 14 | }, 15 | "dependencies": { 16 | "busboy": "^0.2.12", 17 | "express": "~4.13.4", 18 | "multer": "^1.1.0", 19 | "request": "~2.69.0", 20 | "tmp": "0.0.28" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /server/server.conf.example: -------------------------------------------------------------------------------- 1 | { 2 | "api_key": "c61540b5ceecd05092799f936e27755f", 3 | "delete_key": "", 4 | "maximum_file_size": 50000000, 5 | 6 | "path": { 7 | "i": "../i", 8 | "client": "../client" 9 | }, 10 | 11 | "http": { 12 | "enabled": true, 13 | "listen": ":80" 14 | }, 15 | 16 | "https": { 17 | "enabled": false, 18 | "listen": ":443", 19 | "cert": "./cert.pem", 20 | "key": "./key.pem" 21 | }, 22 | 23 | "cloudflare-cache-invalidate": { 24 | "enabled": false, 25 | "token": "Cloudflare API token here", 26 | "email": "Cloudflare login email here", 27 | "domain": "Domain to invalidate cache on" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /client/deps/hybrid.min.css: -------------------------------------------------------------------------------- 1 | .hljs{display:block;overflow-x:auto;padding:0.5em;background:#1d1f21}.hljs{color:#c5c8c6}.hljs-title,.hljs-name{color:#f0c674}.hljs-comment,.hljs-meta,.hljs-meta .hljs-keyword{color:#707880}.hljs-number,.hljs-symbol,.hljs-literal,.hljs-deletion,.hljs-link{color:#c66}.hljs-string,.hljs-doctag,.hljs-addition,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo{color:#b5bd68}.hljs-attribute,.hljs-code,.hljs-selector-id{color:#b294bb}.hljs-keyword,.hljs-selector-tag,.hljs-bullet,.hljs-tag{color:#81a2be}.hljs-subst,.hljs-variable,.hljs-template-tag,.hljs-template-variable{color:#8abeb7}.hljs-type,.hljs-built_in,.hljs-builtin-name,.hljs-quote,.hljs-section,.hljs-selector-class{color:#de935f}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold} 2 | -------------------------------------------------------------------------------- /client/js/shims.js: -------------------------------------------------------------------------------- 1 | if (typeof String.prototype.startsWith != 'function') { 2 | String.prototype.startsWith = function (str) { 3 | return this.slice(0, str.length) == str 4 | } 5 | } 6 | 7 | function dataURItoBlob(dataURI) { 8 | // convert base64 to raw binary data held in a string 9 | // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this 10 | var byteString = atob(dataURI.split(',')[1]); 11 | 12 | // separate out the mime component 13 | var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0] 14 | 15 | // write the bytes of the string to an ArrayBuffer 16 | var ab = new ArrayBuffer(byteString.length); 17 | var ia = new Uint8Array(ab); 18 | for (var i = 0; i < byteString.length; i++) { 19 | ia[i] = byteString.charCodeAt(i); 20 | } 21 | 22 | // write the ArrayBuffer to a blob, and you're done 23 | return new Blob([ab], { type: mimeString }); 24 | } 25 | 26 | function isiframed() { 27 | try { 28 | return window.self !== window.top; 29 | } catch (e) { 30 | return true; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Andre Drapeau 2 | Copyright (c) 2015 Keith Morrow 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Up1 11 | 12 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /client/js/textpaste.js: -------------------------------------------------------------------------------- 1 | upload.modules.addmodule({ 2 | name: 'textpaste', 3 | init: function () { 4 | $(document).on('submit', '#textview', this.save.bind(this)) 5 | $(document).on('click', '#retbtn', this.closethis.bind(this)) 6 | $(document).on('keydown', this.keypress.bind(this)) 7 | }, 8 | keypress: function(e) { 9 | if (!this.current) { 10 | return 11 | } 12 | 13 | if (!(e.which == 83 && (e.ctrlKey || e.metaKey))) { 14 | return 15 | } 16 | 17 | this.save() 18 | e.preventDefault() 19 | }, 20 | save: function(e) { 21 | e ? e.preventDefault() : undefined 22 | var blob = new Blob([this.current.find('textarea').val()], 23 | { 24 | type: this.current.find('#create_mime').val() 25 | } 26 | ) 27 | blob.name = this.current.find('#create_filename').val() 28 | window.location = '#noref' 29 | upload.route.setroute(upload.home) 30 | upload.home.doupload(blob) 31 | }, 32 | cleanup: function() { 33 | delete this['closeback'] 34 | delete this['current'] 35 | }, 36 | closethis: function() { 37 | var closeback = this.closeback 38 | this.current.remove() 39 | this.cleanup() 40 | closeback() 41 | }, 42 | render: function(view, filename, data, mime, closeback) { 43 | var main = $('
').prop('id', 'textview').prop('autocomplete', 'off') 44 | 45 | main.appendTo(view) 46 | 47 | this.closeback = closeback 48 | this.current = main 49 | 50 | main.append($('
').addClass('topbar').append($('
').addClass('viewswitcher').append( 51 | $('