├── README.md ├── cron_entries ├── paste_content ├── favicon.ico ├── img │ ├── 11.png │ ├── 12.png │ ├── 13.png │ ├── 14.png │ ├── 15.png │ ├── 16.png │ └── bg.png └── pomf.min.css ├── runipfs.conf ├── schema.sql ├── site ├── classes │ ├── Response.class.php │ ├── UploadException.class.php │ └── UploadedFile.class.php ├── faq.html ├── favicon.ico ├── grill.php ├── img │ ├── 11.png │ ├── 12.png │ ├── 13.png │ ├── 14.png │ ├── 15.png │ ├── 16.png │ ├── bg.png │ ├── bitcoin.png │ ├── donate.png │ ├── flattr.png │ └── paypal.png ├── includes │ ├── database.inc.php │ └── settings.inc.php ├── index.html ├── paste.html ├── paste.php ├── pomf.min.css ├── pomf.min.js ├── tools.html └── upload.php ├── snapshot.py └── vhosts /README.md: -------------------------------------------------------------------------------- 1 | # Glop 2 | Included here is code for running an instance of glop.me, including the IPFS-specific scripts. 3 | 4 | ## Requirements 5 | Pomf's suggested setup was Nginx + PHP5.5 + MySQL, but was also confirmed to work with Apache 2.4 6 | and newer PHP versions. glop.me runs a standard Ubuntu LAMP stack, but Nginx should still work (note that install locations/vhosts/etc. would need to be adjusted appropriately). Python is required for the snapshot utility. 7 | 8 | ## Install 9 | * Follow the instructions at https://ipfs.io/docs/install/ to install IPFS. 10 | * Set up the local IPFS repo: 11 | ```` 12 | mkdir /home/www-data 13 | chown -R -v www-data /home/www-data 14 | sudo -u www-data HOME=/home/www-data ipfs init 15 | ```` 16 | * If you are using upstart, move runipfs.conf to /etc/init/, otherwise adapt it as appropriate for your system. 17 | * Set up the DB from schema.sql 18 | * Alter includes/settings.inc.php as appropriate 19 | * For the paste utility, you will need to either: 20 | ```` 21 | sudo -u www-data HOME=/home/www-data ipfs pin add -r QmazFHudWq91G7GxuWTpyRWZ1Pc2jg3wnwc2RrgVy5GSa3 22 | ```` 23 | OR if that doesn't work (i.e. glop.me is offline) 24 | ```` 25 | sudo -u www-data HOME=/home/www-data ipfs add -rq paste_content/ 26 | ```` 27 | and move the hash to paste.php:34. 28 | * For the snapshot utility, move snapshot.py to /home/www-data/ and change the DB info as appropriate. You may also need to do 29 | ```` 30 | sudo -u www-data HOME=/home/www-data ipfs object new unixfs-dir 31 | sudo -u www-data HOME=/home/www-data ipfs pin add -r QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn 32 | ```` 33 | * Finally, merge cron_entries with your server's crontab. 34 | -------------------------------------------------------------------------------- /cron_entries: -------------------------------------------------------------------------------- 1 | 0 * * * * sudo -u www-data HOME=/home/www-data python /home/www-data/snapshot.py 2 | 3 | # Enterprise grade administration(tm) 4 | # (this may no longer be necessary, an earlier version of IPFS had a memory leak that broke everything after a while) 5 | 30 6 * * * killall ipfs && sleep 60 && killall ipfs 6 | -------------------------------------------------------------------------------- /paste_content/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/paste_content/favicon.ico -------------------------------------------------------------------------------- /paste_content/img/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/paste_content/img/11.png -------------------------------------------------------------------------------- /paste_content/img/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/paste_content/img/12.png -------------------------------------------------------------------------------- /paste_content/img/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/paste_content/img/13.png -------------------------------------------------------------------------------- /paste_content/img/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/paste_content/img/14.png -------------------------------------------------------------------------------- /paste_content/img/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/paste_content/img/15.png -------------------------------------------------------------------------------- /paste_content/img/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/paste_content/img/16.png -------------------------------------------------------------------------------- /paste_content/img/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/paste_content/img/bg.png -------------------------------------------------------------------------------- /paste_content/pomf.min.css: -------------------------------------------------------------------------------- 1 | /*! pomf (https://github.com/nokonoko/Pomf.git) @ 2015-06-15 */ 2 | textarea{width:100%;background-color:white;} 3 | *,:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{background-attachment:fixed,fixed;background-color:#F7F7F7;background-image:url(img/bg.png),url(img/bg.png);background-position:85% 100%,top left;background-repeat:no-repeat,repeat;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;height:100%;line-height:20px;margin:0;padding-top:20px;padding-bottom:40px}.container{margin:0 auto;max-width:700px}p{margin:0 0 10px}input[type=image],img{vertical-align:middle}a{color:#08C;text-decoration:none;transition:color .25s}a:hover,a:focus,a:active{color:#005580}a:focus{outline:thin dotted #333}.jumbotron{margin:60px 0;text-align:center;transition:width .5s,height .5s,margin .5s,padding .5s}.jumbotron h1{color:inherit;font-family:inherit;font-size:72px;font-weight:700;line-height:1;margin:10px 0;cursor:default;text-rendering:optimizelegibility}.jumbotron .lead{font-size:21px;font-weight:200;line-height:30px;margin-bottom:20px;transition:font-size .5s}.jumbotron .btn{background:rgba(202,230,190,.75);border:1px solid #B7D1A0;border-radius:4px;color:#468847;cursor:pointer;display:inline-block;font-size:24px;padding:28px 48px;text-shadow:0 1px rgba(255,255,255,.5);transition:background-color .25s,width .5s,height .5s}.jumbotron .btn:hover,.jumbotron .btn:active,.jumbotron .btn:focus,.jumbotron .btn.drop{background-color:#bce4aa;text-decoration:none}#no-file-api{display:none}.alert{background-color:#FCF8E3;border:1px solid #FBEED5;border-radius:4px;margin-bottom:20px;padding:8px 14px;text-shadow:0 1px rgba(255,255,255,.5);transition:width .5s,margin .5s,padding .5s,background-color .5s}.alert-error{background-color:#F2DEDE;border-color:#EED3D7;color:#B94A48}.alert-info{background-color:#D9EDF7;border-color:#BCE8F1;color:#3A87AD}span.donate-btns{display:block;text-align:center;margin:11px 0 3px}a.donate-btn{height:26px;display:inline-block;margin:2px 5px;background:#f2f2f2;line-height:16px;padding:3px 8px 3px 24px;border-radius:3px;color:#3f3f3f;border:1px solid #d8d8d8;transition:all .2s}a.donate-btn:hover{color:#000;border:1px solid #b2b2b2;background-color:#ccc}.icon{display:block;height:16px;width:16px;float:left;margin-left:-20px;margin-top:1px}.icon-paypal{background-image:url(img/paypal.png)}.icon-bitcoin{background-image:url(img/bitcoin.png)}.icon-flattr{background-image:url(img/flattr.png)}nav>ul,nav a{color:#3A87AD;list-style:none;margin:0;padding:0;text-align:center}nav>ul>li{display:inline-block;margin:0;padding:0;cursor:default}nav>ul>li:after{content:"|";margin:0 8px;opacity:.3}nav>ul>li:last-child:after{content:"";margin:0}#upload-input{position:absolute;top:0;left:-5000px}#upload-filelist{list-style-type:none;margin:20px 50px;padding:0;text-align:left}.error#upload-filelist{color:#891A18}.error#upload-filelist .file-size{color:#B94A48}.error#upload-filelist .file-progress{display:none}#upload-filelist>li{margin-top:5px;overflow:hidden}#upload-filelist>li.total{border-top:1px solid rgba(0,0,0,.05);font-weight:700;padding-top:5px}.file-name{float:left;overflow:hidden;max-width:70%;text-overflow:ellipsis;white-space:nowrap}.file-size,.file-url{display:inline-block;float:right;font-size:.9em;margin-left:8px;color:#5C5C5C;vertical-align:middle}.file-url a{color:#5C5C5C}.file-url a:hover{color:#1C1C1C}.completed .file-progress,.completed .file-size{display:none}.completed .file-url{display:block}.progress-outer{background-color:rgba(255,255,255,.8);border:1px solid #fff;border-radius:4px;box-shadow:0 0 0 1px #000;color:transparent;display:inline-block;font-size:0;float:right;height:8px;margin:6px 6px 0;overflow:hidden;vertical-align:middle;width:50px}.progress-inner{background-color:#000;height:6px;margin:0;width:0}.pocky{margin:20px auto;text-align:center}.pocky img{max-width:100%}span.old{text-transform:uppercase;font-size:.8em;border-radius:4px;background-color:#722726;color:#fff;padding:2px 8px;margin:0 4px;font-weight:200}section.ded{opacity:.5}@media only screen and (max-device-width:320px),only screen and (max-width:400px){body{padding:10px 0 0}.jumbotron{margin:20px 0 30px}.jumbotron .lead{font-size:18px}.jumbotron .btn,.alert,#upload-filelist{border-radius:0;border-width:1px 0;width:100%;margin-left:0;margin-right:0;padding-left:20px;padding-right:20px}#upload-filelist{background-color:rgba(255,255,255,.75);overflow:hidden}#upload-filelist>li.file{margin-top:12px;margin-bottom:12px}.file-progress{float:left;width:70%}.file-size{float:left;max-width:30%;overflow:hidden}.file-name,.file-url{width:100%;max-width:100%}.file-url a{text-decoration:underline;margin-left:15px}.file-url a:before{content:"http://"}.alert{font-size:13px}.alert-error{background-color:rgba(248,223,223,.75)}nav{background-color:rgba(255,255,255,.75);border:#FFF;padding:10px 0}} 4 | -------------------------------------------------------------------------------- /runipfs.conf: -------------------------------------------------------------------------------- 1 | start on runlevel [2345] 2 | stop on runlevel [!2345] 3 | 4 | respawn 5 | respawn limit unlimited 6 | 7 | exec sudo -u www-data HOME=/home/www-data ipfs daemon 8 | -------------------------------------------------------------------------------- /schema.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.6.21-70.1, for debian-linux-gnu (x86_64) 2 | -- 3 | -- Host: localhost Database: pomf 4 | 5 | -- 6 | -- Table structure for table `accounts` 7 | -- 8 | 9 | CREATE TABLE `accounts` ( 10 | `id` int(10) unsigned NOT NULL auto_increment, 11 | `email` varchar(255) NOT NULL, 12 | `pass` varchar(255) NOT NULL, 13 | `level` int(11) NOT NULL, 14 | PRIMARY KEY (`id`) 15 | ) ENGINE=InnoDB; 16 | 17 | -- 18 | -- Table structure for table `files` 19 | -- 20 | 21 | CREATE TABLE `files` ( 22 | `id` int(10) unsigned NOT NULL auto_increment, 23 | `hash` char(40) default NULL, 24 | `originalname` varchar(255) default NULL, 25 | `filename` varchar(30) default NULL, 26 | `size` int(10) unsigned default NULL, 27 | `date` date default NULL, 28 | `expire` date default NULL, 29 | `delid` char(40) default NULL, 30 | `user` int(10) unsigned default '0', 31 | `dir` int(2) default '0', 32 | PRIMARY KEY (`id`) 33 | ) ENGINE=InnoDB; 34 | -- `filename` length (30) may be a bit excessive, since the average length would be smaller 35 | -- [6 for the name + the file extension length], but since there is no limit for the file 36 | -- extension length (at the moment, at least) let's keep it high in order to avoid problems 37 | 38 | -- 39 | -- Table structure for table `invites` 40 | -- 41 | 42 | CREATE TABLE `invites` ( 43 | `id` int(10) unsigned NOT NULL auto_increment, 44 | `email` varchar(50) default '0', 45 | `code` varchar(50) default '0', 46 | `used` int(11) default '0', 47 | `level` int(11) default NULL, 48 | PRIMARY KEY (`id`) 49 | ) ENGINE=InnoDB; 50 | 51 | -- 52 | -- Table structure for table `reports` 53 | -- 54 | 55 | CREATE TABLE `reports` ( 56 | `id` int(10) unsigned NOT NULL auto_increment, 57 | `hash` char(40) default '0', 58 | `date` date default NULL, 59 | `file` varchar(255) NOT NULL default '0', 60 | `fileid` int(11) default '0', 61 | `reporter` varchar(255) NOT NULL default '0', 62 | `status` int(11) default '0', 63 | PRIMARY KEY (`id`) 64 | ) ENGINE=InnoDB; 65 | 66 | 67 | -- Dump completed on 2014-12-07 19:30:13 68 | -------------------------------------------------------------------------------- /site/classes/Response.class.php: -------------------------------------------------------------------------------- 1 | type = $response_type; 12 | break; 13 | default: 14 | header('Content-Type: application/json; charset=UTF-8'); 15 | $this->type = 'json'; 16 | break; 17 | } 18 | } 19 | 20 | public function error ($code, $desc) { 21 | $response = null; 22 | 23 | switch ($this->type) { 24 | case 'csv': 25 | $response = $this->csv_error($desc); 26 | break; 27 | case 'gyazo': 28 | $response = $this->gyazo_error($code, $desc); 29 | break; 30 | default: 31 | $response = $this->json_error($code, $desc); 32 | break; 33 | } 34 | 35 | http_response_code($code); 36 | echo $response; 37 | } 38 | 39 | public function send ($files) { 40 | $response = null; 41 | 42 | switch ($this->type) { 43 | case 'csv': 44 | $response = $this->csv_success($files); 45 | break; 46 | case 'gyazo': 47 | $response = $this->gyazo_success($files); 48 | break; 49 | default: 50 | $response = $this->json_success($files); 51 | break; 52 | } 53 | 54 | http_response_code(200); 55 | echo $response; 56 | } 57 | 58 | private static function csv_error ($description) { 59 | return "error\n" . $description . "\n"; 60 | } 61 | 62 | private static function csv_success ($files) { 63 | $result = "name,url,hash,size\n"; 64 | foreach ($files as $file) { 65 | $result .= $file['name'] . "," . 66 | $file['url'] . "," . 67 | $file['hash'] . "," . 68 | $file['size'] . "\n"; 69 | } 70 | 71 | return $result; 72 | } 73 | 74 | private static function gyazo_error ($code, $description) { 75 | return "ERROR: (" . $code . ") " . $description; 76 | } 77 | 78 | private static function gyazo_success ($files) { 79 | return POMF_URL . $files[0]['url']; 80 | } 81 | 82 | private static function json_error ($code, $description) { 83 | return json_encode(array( 84 | 'success' => false, 85 | 'errorcode' => $code, 86 | 'description' => $description 87 | )); 88 | } 89 | 90 | private static function json_success ($files) { 91 | return json_encode(array( 92 | 'success' => true, 93 | 'files' => $files 94 | )); 95 | } 96 | } 97 | 98 | ?> -------------------------------------------------------------------------------- /site/classes/UploadException.class.php: -------------------------------------------------------------------------------- 1 | codeToMessage($code); 9 | parent::__construct($message, 500); 10 | } 11 | 12 | private function codeToMessage($code) { 13 | switch ($code) { 14 | case UPLOAD_ERR_INI_SIZE: 15 | $message = "The uploaded file exceeds the upload_max_filesize directive in php.ini"; 16 | break; 17 | case UPLOAD_ERR_FORM_SIZE: 18 | $message = "The uploaded file exceeds the MAX_FILE_SIZE directive that was " . 19 | "specified in the HTML form"; 20 | break; 21 | case UPLOAD_ERR_PARTIAL: 22 | $message = "The uploaded file was only partially uploaded"; 23 | break; 24 | case UPLOAD_ERR_NO_FILE: 25 | $message = "No file was uploaded"; 26 | break; 27 | case UPLOAD_ERR_NO_TMP_DIR: 28 | $message = "Missing a temporary folder"; 29 | break; 30 | case UPLOAD_ERR_CANT_WRITE: 31 | $message = "Failed to write file to disk"; 32 | break; 33 | case UPLOAD_ERR_EXTENSION: 34 | $message = "File upload stopped by extension"; 35 | break; 36 | 37 | default: 38 | $message = "Unknown upload error"; 39 | break; 40 | } 41 | return $message; 42 | } 43 | } 44 | 45 | ?> -------------------------------------------------------------------------------- /site/classes/UploadedFile.class.php: -------------------------------------------------------------------------------- 1 | sha1) 22 | $this->sha1 = sha1_file($this->tempfile); 23 | 24 | return $this->sha1; 25 | } 26 | 27 | /** 28 | * Generates the CRC32 or returns the cached CRC32 hash for the file. 29 | * 30 | * @return string 31 | */ 32 | public function get_crc32 () { 33 | if (!$this->crc32) 34 | $this->crc32 = hash_file('crc32b', $this->tempfile); 35 | 36 | return $this->crc32; 37 | } 38 | } 39 | ?> 40 | -------------------------------------------------------------------------------- /site/faq.html: -------------------------------------------------------------------------------- 1 | Glop.me · FAQ

FAQ

2 | 3 |
4 | 5 | 19 | 20 |

Follow the rules and tips I have set up above, please. The FAQ may also be changed and updated at any time. 21 | 22 |

23 | 24 | 27 | -------------------------------------------------------------------------------- /site/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/favicon.ico -------------------------------------------------------------------------------- /site/grill.php: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /site/img/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/img/11.png -------------------------------------------------------------------------------- /site/img/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/img/12.png -------------------------------------------------------------------------------- /site/img/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/img/13.png -------------------------------------------------------------------------------- /site/img/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/img/14.png -------------------------------------------------------------------------------- /site/img/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/img/15.png -------------------------------------------------------------------------------- /site/img/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/img/16.png -------------------------------------------------------------------------------- /site/img/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/img/bg.png -------------------------------------------------------------------------------- /site/img/bitcoin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/img/bitcoin.png -------------------------------------------------------------------------------- /site/img/donate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/img/donate.png -------------------------------------------------------------------------------- /site/img/flattr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/img/flattr.png -------------------------------------------------------------------------------- /site/img/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2yrs/Pomf/a10c84660685171aa562d7e4d48b6103323b71c9/site/img/paypal.png -------------------------------------------------------------------------------- /site/includes/database.inc.php: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /site/includes/settings.inc.php: -------------------------------------------------------------------------------- 1 | 26 | -------------------------------------------------------------------------------- /site/index.html: -------------------------------------------------------------------------------- 1 | Glop.me · Ecchi File Hosting - Using IPFS! 2 | 3 |
4 | 5 | 6 |

Oyasumi!

7 | 8 |

Max upload size is 10MiB, read the FAQ

9 | 10 | 11 | 12 |

Your browser is shit. Install the latestFirefox or Botnet and come back <3

13 | 14 | Select or dropfile(s)
    15 | 16 | 17 | 18 |

    glop.me is a free service, and at current usage levels I can afford to float the site myself. However, to do this properly extra mirrors/backups should be utilized, and I'm going to need help for that. Anything you can contribute would be greatly appreciated.

    21 | 22 |
    23 | -------------------------------------------------------------------------------- /site/paste.html: -------------------------------------------------------------------------------- 1 | Glop.me · Ecchi Paste Hosting - Using IPFS!
    2 | 3 |
    4 | 5 |

    Glop Paste

    6 | 7 |

    Paste utility using IPFS

    8 | 9 |

    10 | 11 | 12 | 13 |
    14 | 15 | 16 | 17 |

    18 | 19 |
    20 | 21 |
    22 | 23 | 24 | -------------------------------------------------------------------------------- /site/paste.php: -------------------------------------------------------------------------------- 1 | Glop.me · Ecchi Paste Hosting - Using IPFS! 4 |
    5 | 6 |
    7 | 8 |

    Glop Paste

    9 | 10 |

    Paste utility using IPFS

    11 | 12 | 13 | 14 |
    15 | 16 |
    17 | 18 | 19 | 23 | 24 | "; 25 | 26 | $infile = tmpfile(); 27 | fwrite($infile, $out); 28 | $meta_data = stream_get_meta_data($infile); 29 | $filename = $meta_data["uri"]; 30 | 31 | $inhash = shell_exec("HOME=/home/www-data ipfs add -q ".$filename); 32 | fclose($infile); 33 | 34 | $fullhash = shell_exec('HOME=/home/www-data ipfs object patch QmazFHudWq91G7GxuWTpyRWZ1Pc2jg3wnwc2RrgVy5GSa3 add-link index.html '.$inhash); 35 | exec('HOME=/home/www-data ipfs pin add -r '.$fullhash); 36 | 37 | /*$proc_echo = proc_open("echo ".escapeshellarg($out), 38 | array( 39 | array("pipe","r"), //stdin 40 | array("pipe","w"), //stdout 41 | array("pipe","w") //stderr 42 | ), 43 | $pipes); 44 | 45 | $output_echo = stream_get_contents($pipes[1]); 46 | fclose($pipes[0]); 47 | fclose($pipes[1]); 48 | fclose($pipes[2]); 49 | $return_value_echo = proc_close($proc_echo); 50 | 51 | 52 | $proc_ipfs = proc_open("HOME=/home/www-data ipfs add -q", 53 | array( 54 | array("pipe","r"), //stdin 55 | array("pipe","w"), //stdout 56 | array("pipe","w") //stderr 57 | ), 58 | $pipes); 59 | 60 | fwrite($pipes[0], $output_echo); 61 | fclose($pipes[0]); 62 | $output_ipfs = stream_get_contents($pipes[1]); 63 | 64 | fclose($pipes[1]); 65 | fclose($pipes[2]); 66 | $return_value_ipfs = proc_close($proc_ipfs); 67 | 68 | exec('HOME=/home/www-data ipfs object patch QmazFHudWq91G7GxuWTpyRWZ1Pc2jg3wnwc2RrgVy5GSa3 add-link index.html '.$output_ipfs, $output_patch); 69 | //error_log('patch:'.$output_patch[0]); 70 | exec('HOME=/home/www-data ipfs pin add -r '.$output_patch[0], $output_pin); 71 | //error_log('pin:'.$output_pin[0]);*/ 72 | 73 | /*$proc_patch = proc_open("HOME=/home/www-data /home/www-data/gocode/bin/ipfs object patch QmVT9kUFUdAwCp22Htivb5kUFj9ABy9QQm2jNG1BKqRmTp add-link index.html ".$output_ipfs, 74 | array( 75 | array("pipe","r"), //stdin 76 | array("pipe","w"), //stdout 77 | array("pipe","w") //stderr 78 | ), 79 | $pipes); 80 | 81 | //fwrite($pipes[0], $output_ipfs); 82 | fclose($pipes[0]); 83 | $output_patch = stream_get_contents($pipes[1]); 84 | 85 | fclose($pipes[1]); 86 | fclose($pipes[2]); 87 | $return_value_patch = proc_close($proc_patch);*/ 88 | 89 | header('Location: http://gateway.glop.me/ipfs/'.$fullhash); 90 | 91 | ?> 92 | -------------------------------------------------------------------------------- /site/pomf.min.css: -------------------------------------------------------------------------------- 1 | /*! pomf (https://github.com/nokonoko/Pomf.git) @ 2015-06-15 */ 2 | textarea{width:100%;background-color:white;} 3 | *,:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{background-attachment:fixed,fixed;background-color:#F7F7F7;background-image:url(grill.php),url(img/bg.png);background-position:85% 100%,top left;background-repeat:no-repeat,repeat;color:#333;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;height:100%;line-height:20px;margin:0;padding-top:20px;padding-bottom:40px}.container{margin:0 auto;max-width:700px}p{margin:0 0 10px}input[type=image],img{vertical-align:middle}a{color:#08C;text-decoration:none;transition:color .25s}a:hover,a:focus,a:active{color:#005580}a:focus{outline:thin dotted #333}.jumbotron{margin:60px 0;text-align:center;transition:width .5s,height .5s,margin .5s,padding .5s}.jumbotron h1{color:inherit;font-family:inherit;font-size:72px;font-weight:700;line-height:1;margin:10px 0;cursor:default;text-rendering:optimizelegibility}.jumbotron .lead{font-size:21px;font-weight:200;line-height:30px;margin-bottom:20px;transition:font-size .5s}.jumbotron .btn{background:rgba(202,230,190,.75);border:1px solid #B7D1A0;border-radius:4px;color:#468847;cursor:pointer;display:inline-block;font-size:24px;padding:28px 48px;text-shadow:0 1px rgba(255,255,255,.5);transition:background-color .25s,width .5s,height .5s}.jumbotron .btn:hover,.jumbotron .btn:active,.jumbotron .btn:focus,.jumbotron .btn.drop{background-color:#bce4aa;text-decoration:none}#no-file-api{display:none}.alert{background-color:#FCF8E3;border:1px solid #FBEED5;border-radius:4px;margin-bottom:20px;padding:8px 14px;text-shadow:0 1px rgba(255,255,255,.5);transition:width .5s,margin .5s,padding .5s,background-color .5s}.alert-error{background-color:#F2DEDE;border-color:#EED3D7;color:#B94A48}.alert-info{background-color:#D9EDF7;border-color:#BCE8F1;color:#3A87AD}span.donate-btns{display:block;text-align:center;margin:11px 0 3px}a.donate-btn{height:26px;display:inline-block;margin:2px 5px;background:#f2f2f2;line-height:16px;padding:3px 8px 3px 24px;border-radius:3px;color:#3f3f3f;border:1px solid #d8d8d8;transition:all .2s}a.donate-btn:hover{color:#000;border:1px solid #b2b2b2;background-color:#ccc}.icon{display:block;height:16px;width:16px;float:left;margin-left:-20px;margin-top:1px}.icon-paypal{background-image:url(img/paypal.png)}.icon-bitcoin{background-image:url(img/bitcoin.png)}.icon-flattr{background-image:url(img/flattr.png)}nav>ul,nav a{color:#3A87AD;list-style:none;margin:0;padding:0;text-align:center}nav>ul>li{display:inline-block;margin:0;padding:0;cursor:default}nav>ul>li:after{content:"|";margin:0 8px;opacity:.3}nav>ul>li:last-child:after{content:"";margin:0}#upload-input{position:absolute;top:0;left:-5000px}#upload-filelist{list-style-type:none;margin:20px 50px;padding:0;text-align:left}.error#upload-filelist{color:#891A18}.error#upload-filelist .file-size{color:#B94A48}.error#upload-filelist .file-progress{display:none}#upload-filelist>li{margin-top:5px;overflow:hidden}#upload-filelist>li.total{border-top:1px solid rgba(0,0,0,.05);font-weight:700;padding-top:5px}.file-name{float:left;overflow:hidden;max-width:70%;text-overflow:ellipsis;white-space:nowrap}.file-size,.file-url{display:inline-block;float:right;font-size:.9em;margin-left:8px;color:#5C5C5C;vertical-align:middle}.file-url a{color:#5C5C5C}.file-url a:hover{color:#1C1C1C}.completed .file-progress,.completed .file-size{display:none}.completed .file-url{display:block}.progress-outer{background-color:rgba(255,255,255,.8);border:1px solid #fff;border-radius:4px;box-shadow:0 0 0 1px #000;color:transparent;display:inline-block;font-size:0;float:right;height:8px;margin:6px 6px 0;overflow:hidden;vertical-align:middle;width:50px}.progress-inner{background-color:#000;height:6px;margin:0;width:0}.pocky{margin:20px auto;text-align:center}.pocky img{max-width:100%}span.old{text-transform:uppercase;font-size:.8em;border-radius:4px;background-color:#722726;color:#fff;padding:2px 8px;margin:0 4px;font-weight:200}section.ded{opacity:.5}@media only screen and (max-device-width:320px),only screen and (max-width:400px){body{padding:10px 0 0}.jumbotron{margin:20px 0 30px}.jumbotron .lead{font-size:18px}.jumbotron .btn,.alert,#upload-filelist{border-radius:0;border-width:1px 0;width:100%;margin-left:0;margin-right:0;padding-left:20px;padding-right:20px}#upload-filelist{background-color:rgba(255,255,255,.75);overflow:hidden}#upload-filelist>li.file{margin-top:12px;margin-bottom:12px}.file-progress{float:left;width:70%}.file-size{float:left;max-width:30%;overflow:hidden}.file-name,.file-url{width:100%;max-width:100%}.file-url a{text-decoration:underline;margin-left:15px}.file-url a:before{content:"http://"}.alert{font-size:13px}.alert-error{background-color:rgba(248,223,223,.75)}nav{background-color:rgba(255,255,255,.75);border:#FFF;padding:10px 0}} 4 | -------------------------------------------------------------------------------- /site/pomf.min.js: -------------------------------------------------------------------------------- 1 | /*! pomf (https://github.com/nokonoko/Pomf.git) @ 2015-06-15 */ 2 | /*var grills = ["img/11.png", "img/12.png", "img/13.png", "img/14.png", "img/15.png", "img/16.png", ] 3 | document.getElementsByTagName("body")[0].style["background-image"] = "url(grill.php),url(img/bg.png)";*/ 4 | var Zepto=function(){function a(a){return null==a?String(a):W[X.call(a)]||"object"}function b(b){return"function"==a(b)}function c(a){return null!=a&&a==a.window}function d(a){return null!=a&&a.nodeType==a.DOCUMENT_NODE}function e(b){return"object"==a(b)}function f(a){return e(a)&&!c(a)&&a.__proto__==Object.prototype}function g(a){return a instanceof Array}function h(a){return"number"==typeof a.length}function i(a){return E.call(a,function(a){return null!=a})}function j(a){return a.length>0?y.fn.concat.apply([],a):a}function k(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(a){return a in H?H[a]:H[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function m(a,b){return"number"!=typeof b||J[k(a)]?b:b+"px"}function n(a){var b,c;return G[a]||(b=F.createElement(a),F.body.appendChild(b),c=I(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),"none"==c&&(c="block"),G[a]=c),G[a]}function o(a){return"children"in a?D.call(a.children):y.map(a.childNodes,function(a){return 1==a.nodeType?a:void 0})}function p(a,b,c){for(x in b)c&&(f(b[x])||g(b[x]))?(f(b[x])&&!f(a[x])&&(a[x]={}),g(b[x])&&!g(a[x])&&(a[x]=[]),p(a[x],b[x],c)):b[x]!==w&&(a[x]=b[x])}function q(a,b){return null==b?y(a):y(a).filter(b)}function r(a,c,d,e){return b(c)?c.call(a,d,e):c}function s(a,b,c){null==c?a.removeAttribute(b):a.setAttribute(b,c)}function t(a,b){var c=a.className,d=c&&c.baseVal!==w;return b===w?d?c.baseVal:c:void(d?c.baseVal=b:a.className=b)}function u(a){var b;try{return a?"true"==a||("false"==a?!1:"null"==a?null:isNaN(b=Number(a))?/^[\[\{]/.test(a)?y.parseJSON(a):a:b):a}catch(c){return a}}function v(a,b){b(a);for(var c in a.childNodes)v(a.childNodes[c],b)}var w,x,y,z,A,B,C=[],D=C.slice,E=C.filter,F=window.document,G={},H={},I=F.defaultView.getComputedStyle,J={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},K=/^\s*<(\w+|!)[^>]*>/,L=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,M=/^(?:body|html)$/i,N=["val","css","html","text","data","width","height","offset"],O=["after","prepend","before","append"],P=F.createElement("table"),Q=F.createElement("tr"),R={tr:F.createElement("tbody"),tbody:P,thead:P,tfoot:P,td:Q,th:Q,"*":F.createElement("div")},S=/complete|loaded|interactive/,T=/^\.([\w-]+)$/,U=/^#([\w-]*)$/,V=/^[\w-]+$/,W={},X=W.toString,Y={},Z=F.createElement("div");return Y.matches=function(a,b){if(!a||1!==a.nodeType)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=Z).appendChild(a),d=~Y.qsa(e,b).indexOf(a),f&&Z.removeChild(a),d},A=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},B=function(a){return E.call(a,function(b,c){return a.indexOf(b)==c})},Y.fragment=function(a,b,c){a.replace&&(a=a.replace(L,"<$1>")),b===w&&(b=K.test(a)&&RegExp.$1),b in R||(b="*");var d,e,g=R[b];return g.innerHTML=""+a,e=y.each(D.call(g.childNodes),function(){g.removeChild(this)}),f(c)&&(d=y(e),y.each(c,function(a,b){N.indexOf(a)>-1?d[a](b):d.attr(a,b)})),e},Y.Z=function(a,b){return a=a||[],a.__proto__=y.fn,a.selector=b||"",a},Y.isZ=function(a){return a instanceof Y.Z},Y.init=function(a,c){if(a){if(b(a))return y(F).ready(a);if(Y.isZ(a))return a;var d;if(g(a))d=i(a);else if(e(a))d=[f(a)?y.extend({},a):a],a=null;else if(K.test(a))d=Y.fragment(a.trim(),RegExp.$1,c),a=null;else{if(c!==w)return y(c).find(a);d=Y.qsa(F,a)}return Y.Z(d,a)}return Y.Z()},y=function(a,b){return Y.init(a,b)},y.extend=function(a){var b,c=D.call(arguments,1);return"boolean"==typeof a&&(b=a,a=c.shift()),c.forEach(function(c){p(a,c,b)}),a},Y.qsa=function(a,b){var c;return d(a)&&U.test(b)?(c=a.getElementById(RegExp.$1))?[c]:[]:1!==a.nodeType&&9!==a.nodeType?[]:D.call(T.test(b)?a.getElementsByClassName(RegExp.$1):V.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},y.contains=function(a,b){return a!==b&&a.contains(b)},y.type=a,y.isFunction=b,y.isWindow=c,y.isArray=g,y.isPlainObject=f,y.isEmptyObject=function(a){var b;for(b in a)return!1;return!0},y.inArray=function(a,b,c){return C.indexOf.call(b,a,c)},y.camelCase=A,y.trim=function(a){return null==a?"":String.prototype.trim.call(a)},y.uuid=0,y.support={},y.expr={},y.map=function(a,b){var c,d,e,f=[];if(h(a))for(d=0;d=0?a:a+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(a){return C.every.call(this,function(b,c){return a.call(b,c,b)!==!1}),this},filter:function(a){return b(a)?this.not(this.not(a)):y(E.call(this,function(b){return Y.matches(b,a)}))},add:function(a,b){return y(B(this.concat(y(a,b))))},is:function(a){return this.length>0&&Y.matches(this[0],a)},not:function(a){var c=[];if(b(a)&&a.call!==w)this.each(function(b){a.call(this,b)||c.push(this)});else{var d="string"==typeof a?this.filter(a):h(a)&&b(a.item)?D.call(a):y(a);this.forEach(function(a){d.indexOf(a)<0&&c.push(a)})}return y(c)},has:function(a){return this.filter(function(){return e(a)?y.contains(this,a):y(this).find(a).size()})},eq:function(a){return-1===a?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!e(a)?a:y(a)},last:function(){var a=this[this.length-1];return a&&!e(a)?a:y(a)},find:function(a){var b,c=this;return b="object"==typeof a?y(a).filter(function(){var a=this;return C.some.call(c,function(b){return y.contains(b,a)})}):1==this.length?y(Y.qsa(this[0],a)):this.map(function(){return Y.qsa(this,a)})},closest:function(a,b){var c=this[0],e=!1;for("object"==typeof a&&(e=y(a));c&&!(e?e.indexOf(c)>=0:Y.matches(c,a));)c=c!==b&&!d(c)&&c.parentNode;return y(c)},parents:function(a){for(var b=[],c=this;c.length>0;)c=y.map(c,function(a){return(a=a.parentNode)&&!d(a)&&b.indexOf(a)<0?(b.push(a),a):void 0});return q(b,a)},parent:function(a){return q(B(this.pluck("parentNode")),a)},children:function(a){return q(this.map(function(){return o(this)}),a)},contents:function(){return this.map(function(){return D.call(this.childNodes)})},siblings:function(a){return q(this.map(function(a,b){return E.call(o(b.parentNode),function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return y.map(this,function(b){return b[a]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=null),"none"==I(this,"").getPropertyValue("display")&&(this.style.display=n(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){var c=b(a);if(this[0]&&!c)var d=y(a).get(0),e=d.parentNode||this.length>1;return this.each(function(b){y(this).wrapAll(c?a.call(this,b):e?d.cloneNode(!0):d)})},wrapAll:function(a){if(this[0]){y(this[0]).before(a=y(a));for(var b;(b=a.children()).length;)a=b.first();y(a).append(this)}return this},wrapInner:function(a){var c=b(a);return this.each(function(b){var d=y(this),e=d.contents(),f=c?a.call(this,b):a;e.length?e.wrapAll(f):d.append(f)})},unwrap:function(){return this.parent().each(function(){y(this).replaceWith(y(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(a){return this.each(function(){var b=y(this);(a===w?"none"==b.css("display"):a)?b.show():b.hide()})},prev:function(a){return y(this.pluck("previousElementSibling")).filter(a||"*")},next:function(a){return y(this.pluck("nextElementSibling")).filter(a||"*")},html:function(a){return a===w?this.length>0?this[0].innerHTML:null:this.each(function(b){var c=this.innerHTML;y(this).empty().append(r(this,a,b,c))})},text:function(a){return a===w?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=a})},attr:function(a,b){var c;return"string"==typeof a&&b===w?0==this.length||1!==this[0].nodeType?w:"value"==a&&"INPUT"==this[0].nodeName?this.val():!(c=this[0].getAttribute(a))&&a in this[0]?this[0][a]:c:this.each(function(c){if(1===this.nodeType)if(e(a))for(x in a)s(this,x,a[x]);else s(this,a,r(this,b,c,this.getAttribute(a)))})},removeAttr:function(a){return this.each(function(){1===this.nodeType&&s(this,a)})},prop:function(a,b){return b===w?this[0]&&this[0][a]:this.each(function(c){this[a]=r(this,b,c,this[a])})},data:function(a,b){var c=this.attr("data-"+k(a),b);return null!==c?u(c):w},val:function(a){return a===w?this[0]&&(this[0].multiple?y(this[0]).find("option").filter(function(a){return this.selected}).pluck("value"):this[0].value):this.each(function(b){this.value=r(this,a,b,this.value)})},offset:function(a){if(a)return this.each(function(b){var c=y(this),d=r(this,a,b,c.offset()),e=c.offsetParent().offset(),f={top:d.top-e.top,left:d.left-e.left};"static"==c.css("position")&&(f.position="relative"),c.css(f)});if(0==this.length)return null;var b=this[0].getBoundingClientRect();return{left:b.left+window.pageXOffset,top:b.top+window.pageYOffset,width:Math.round(b.width),height:Math.round(b.height)}},css:function(b,c){if(arguments.length<2&&"string"==typeof b)return this[0]&&(this[0].style[A(b)]||I(this[0],"").getPropertyValue(b));var d="";if("string"==a(b))c||0===c?d=k(b)+":"+m(b,c):this.each(function(){this.style.removeProperty(k(b))});else for(x in b)b[x]||0===b[x]?d+=k(x)+":"+m(x,b[x])+";":this.each(function(){this.style.removeProperty(k(x))});return this.each(function(){this.style.cssText+=";"+d})},index:function(a){return a?this.indexOf(y(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return C.some.call(this,function(a){return this.test(t(a))},l(a))},addClass:function(a){return this.each(function(b){z=[];var c=t(this),d=r(this,a,b,c);d.split(/\s+/g).forEach(function(a){y(this).hasClass(a)||z.push(a)},this),z.length&&t(this,c+(c?" ":"")+z.join(" "))})},removeClass:function(a){return this.each(function(b){return a===w?t(this,""):(z=t(this),r(this,a,b,z).split(/\s+/g).forEach(function(a){z=z.replace(l(a)," ")}),void t(this,z.trim()))})},toggleClass:function(a,b){return this.each(function(c){var d=y(this),e=r(this,a,c,t(this));e.split(/\s+/g).forEach(function(a){(b===w?!d.hasClass(a):b)?d.addClass(a):d.removeClass(a)})})},scrollTop:function(){return this.length?"scrollTop"in this[0]?this[0].scrollTop:this[0].scrollY:void 0},position:function(){if(this.length){var a=this[0],b=this.offsetParent(),c=this.offset(),d=M.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(y(a).css("margin-top"))||0,c.left-=parseFloat(y(a).css("margin-left"))||0,d.top+=parseFloat(y(b[0]).css("border-top-width"))||0,d.left+=parseFloat(y(b[0]).css("border-left-width"))||0,{top:c.top-d.top,left:c.left-d.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||F.body;a&&!M.test(a.nodeName)&&"static"==y(a).css("position");)a=a.offsetParent;return a})}},y.fn.detach=y.fn.remove,["width","height"].forEach(function(a){y.fn[a]=function(b){var e,f=this[0],g=a.replace(/./,function(a){return a[0].toUpperCase()});return b===w?c(f)?f["inner"+g]:d(f)?f.documentElement["offset"+g]:(e=this.offset())&&e[a]:this.each(function(c){f=y(this),f.css(a,r(this,b,c,f[a]()))})}}),O.forEach(function(b,c){var d=c%2;y.fn[b]=function(){var b,e,f=y.map(arguments,function(c){return b=a(c),"object"==b||"array"==b||null==c?c:Y.fragment(c)}),g=this.length>1;return f.length<1?this:this.each(function(a,b){e=d?b:b.parentNode,b=0==c?b.nextSibling:1==c?b.firstChild:2==c?b:null,f.forEach(function(a){if(g)a=a.cloneNode(!0);else if(!e)return y(a).remove();v(e.insertBefore(a,b),function(a){null==a.nodeName||"SCRIPT"!==a.nodeName.toUpperCase()||a.type&&"text/javascript"!==a.type||a.src||window.eval.call(window,a.innerHTML)})})})},y.fn[d?b+"To":"insert"+(c?"Before":"After")]=function(a){return y(a)[b](this),this}}),Y.Z.prototype=y.fn,Y.uniq=B,Y.deserializeValue=u,y.zepto=Y,y}();window.Zepto=Zepto,"$"in window||(window.$=Zepto),function(a){function b(a){return a._zid||(a._zid=n++)}function c(a,c,f,g){if(c=d(c),c.ns)var h=e(c.ns);return(m[b(a)]||[]).filter(function(a){return!(!a||c.e&&a.e!=c.e||c.ns&&!h.test(a.ns)||f&&b(a.fn)!==b(f)||g&&a.sel!=g)})}function d(a){var b=(""+a).split(".");return{e:b[0],ns:b.slice(1).sort().join(" ")}}function e(a){return new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)")}function f(b,c,d){"string"!=a.type(b)?a.each(b,d):b.split(/\s/).forEach(function(a){d(a,c)})}function g(a,b){return a.del&&("focus"==a.e||"blur"==a.e)||!!b}function h(a){return p[a]||a}function i(c,e,i,j,k,l){var n=b(c),o=m[n]||(m[n]=[]);f(e,i,function(b,e){var f=d(b);f.fn=e,f.sel=j,f.e in p&&(e=function(b){var c=b.relatedTarget;return!c||c!==this&&!a.contains(this,c)?f.fn.apply(this,arguments):void 0}),f.del=k&&k(e,b);var i=f.del||e;f.proxy=function(a){var b=i.apply(c,[a].concat(a.data));return b===!1&&(a.preventDefault(),a.stopPropagation()),b},f.i=o.length,o.push(f),c.addEventListener(h(f.e),f.proxy,g(f,l))})}function j(a,d,e,i,j){var k=b(a);f(d||"",e,function(b,d){c(a,b,d,i).forEach(function(b){delete m[k][b.i],a.removeEventListener(h(b.e),b.proxy,g(b,j))})})}function k(b){var c,d={originalEvent:b};for(c in b)s.test(c)||void 0===b[c]||(d[c]=b[c]);return a.each(t,function(a,c){d[a]=function(){return this[c]=q,b[a].apply(b,arguments)},d[c]=r}),d}function l(a){if(!("defaultPrevented"in a)){a.defaultPrevented=!1;var b=a.preventDefault;a.preventDefault=function(){this.defaultPrevented=!0,b.call(this)}}}var m=(a.zepto.qsa,{}),n=1,o={},p={mouseenter:"mouseover",mouseleave:"mouseout"};o.click=o.mousedown=o.mouseup=o.mousemove="MouseEvents",a.event={add:i,remove:j},a.proxy=function(c,d){if(a.isFunction(c)){var e=function(){return c.apply(d,arguments)};return e._zid=b(c),e}if("string"==typeof d)return a.proxy(c[d],c);throw new TypeError("expected function")},a.fn.bind=function(a,b){return this.each(function(){i(this,a,b)})},a.fn.unbind=function(a,b){return this.each(function(){j(this,a,b)})},a.fn.one=function(a,b){return this.each(function(c,d){i(this,a,b,null,function(a,b){return function(){var c=a.apply(d,arguments);return j(d,b,a),c}})})};var q=function(){return!0},r=function(){return!1},s=/^([A-Z]|layer[XY]$)/,t={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};a.fn.delegate=function(b,c,d){return this.each(function(e,f){i(f,c,d,b,function(c){return function(d){var e,g=a(d.target).closest(b,f).get(0);return g?(e=a.extend(k(d),{currentTarget:g,liveFired:f}),c.apply(g,[e].concat([].slice.call(arguments,1)))):void 0}})})},a.fn.undelegate=function(a,b,c){return this.each(function(){j(this,b,c,a)})},a.fn.live=function(b,c){return a(document.body).delegate(this.selector,b,c),this},a.fn.die=function(b,c){return a(document.body).undelegate(this.selector,b,c),this},a.fn.on=function(b,c,d){return!c||a.isFunction(c)?this.bind(b,c||d):this.delegate(c,b,d)},a.fn.off=function(b,c,d){return!c||a.isFunction(c)?this.unbind(b,c||d):this.undelegate(c,b,d)},a.fn.trigger=function(b,c){return("string"==typeof b||a.isPlainObject(b))&&(b=a.Event(b)),l(b),b.data=c,this.each(function(){"dispatchEvent"in this&&this.dispatchEvent(b)})},a.fn.triggerHandler=function(b,d){var e,f;return this.each(function(g,h){e=k("string"==typeof b?a.Event(b):b),e.data=d,e.target=h,a.each(c(h,b.type||b),function(a,b){return f=b.proxy(e),e.isImmediatePropagationStopped()?!1:void 0})}),f},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(b){a.fn[b]=function(a){return a?this.bind(b,a):this.trigger(b)}}),["focus","blur"].forEach(function(b){a.fn[b]=function(a){return a?this.bind(b,a):this.each(function(){try{this[b]()}catch(a){}}),this}}),a.Event=function(a,b){"string"!=typeof a&&(b=a,a=b.type);var c=document.createEvent(o[a]||"Events"),d=!0;if(b)for(var e in b)"bubbles"==e?d=!!b[e]:c[e]=b[e];return c.initEvent(a,d,!0,null,null,null,null,null,null,null,null,null,null,null,null),c.isDefaultPrevented=function(){return this.defaultPrevented},c}}(Zepto),function(){EventEmitter=function(){},EventEmitter.prototype.on=function(a,b){this._events=this._events||{},this._events[a]=this._events[a]||[],this._events[a].push(b)},EventEmitter.prototype.off=function(a,b){this.hasOwnProperty("_events")&&a in this._events!=!1&&this._events[a].splice(this._events[a].indexOf(b),1)},EventEmitter.prototype.emit=function(a){if(this.hasOwnProperty("_events")&&a in this._events!=!1)for(var b=0,c=this._events[a].length;c>b;b++)this._events[a][b].apply(this,Array.prototype.slice.call(arguments,1))},FileList.prototype.forEach=Array.prototype.forEach,FileList.prototype.every=Array.prototype.every,FileList.prototype.some=Array.prototype.some,FileList.prototype.filter=Array.prototype.filter,FileList.prototype.map=Array.prototype.map,FileList.prototype.reduce=Array.prototype.reduce,FileList.prototype.reduceRight=Array.prototype.reduceRight,Object.defineProperty(FileList.prototype,"size",{get:function(){return this.reduce(function(a,b){return a+b.size},0)}});var a={get:function(){var a=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],b=Math.floor(Math.log(this.size)/Math.log(1024));return(this.size/Math.pow(1024,b)).toFixed(2)+" "+a[b]}};Object.defineProperty(FileList.prototype,"humanSize",a),Object.defineProperty(File.prototype,"humanSize",a);var b={get:function(){return this.uploadedSize/this.size}};Object.defineProperty(FileList.prototype,"percentUploaded",b),Object.defineProperty(File.prototype,"percentUploaded",b),Object.defineProperty(FileList.prototype,"uploadedSize",{get:function(){return this.reduce(function(a,b){return a+(b.uploadedSize||0)},0)}}),Object.defineProperty(File.prototype,"url",{get:function(){return window.URL.createObjectURL(this)}}),File.revokeURL=function(a){window.URL.revokeObjectURL(a)};var c=function e(a,b){var c=a;for(var d in b)"object"==typeof b[d]?c[d]=e(a[d],b[d]):c[d]=b[d];return c},d=function(a,b,d){this.url=a,this.files=b,d=d||{},this.opts=c({field:"files[]",method:"POST",data:{}},d)};d.prototype=Object.create(EventEmitter.prototype),d.prototype.upload=function(a){a&&this.on("uploadcomplete",a);var b=this.opts,c=this.files,d=this,e=new FormData;c.forEach(function(a){e.append(b.field,a)});var f=new XMLHttpRequest;f.open(b.method,this.url,!0),f.upload.addEventListener("loadstart",function(a){for(var b=0,d=c.length;d>b;b++)c[b].uploadedSize=0}),f.upload.addEventListener("progress",function(a){if(a.lengthComputable){size=a.loaded;for(var b=0,e=c.length;e>b;b++)c[b].uploadedSize=Math.min(size,c[b].size),size-=c[b].uploadedSize,size<=0&&(c.current=c[b],size=0)}d.emit("uploadprogress",a,c)},!1),f.upload.addEventListener("loadstart",function(a){d.emit("uploadstart",a)}),f.upload.addEventListener("load",function(a){d.emit("uploadcomplete",a)}),f.addEventListener("progress",function(a){d.emit("progress",a)}),f.addEventListener("load",function(a){d.emit("load",a,f.responseText)}),f.send(e)},FileList.prototype.upload=function(a,b){return new d(a,this,b)}}(),function(a){a.hasFileAPI=function(){return void 0!==window.FormData},a.fn.cabinet=function(b){b=a(b);var c=this,d=function(a,d,e,f){c.on(a,function(a){"click"===d?b[0].click():b.trigger(d),e&&a.preventDefault(),f&&f(a)},!1)};b[0].filelist=Object.create(FileList),b.on("change",function(a){this.filelist=a.target.files,c.change()}),d("dragenter","dragenter",!0),d("dragover","dragover",!0),d("dragleave","dragleave",!0),d("click","click",!1),d("drop","dragleave",!0,function(a){b[0].filelist=a.dataTransfer.files,c.change()})}}($),$(function(){var a=$("#upload-input"),b=$("#upload-btn"),c=$("#upload-filelist"),d="";$.hasFileAPI()||($("#no-file-api").show(),b.hide()),b.cabinet(a),b.on("dragenter",function(a){this===a.target&&($(this).addClass("drop"),d=$(this).html(),$(this).html("Drop it here~"))}),b.on("drop",function(a){$(this).trigger("dragleave")}),b.on("dragleave",function(a){node=a.target;do if(node===this){$(this).removeClass("drop"),$(this).html(d);break}while(node=node.parentNode)});var e=function(a){var b=a.attr("data-max-size")||"10MiB",c=parseInt(/([0-9,]+).*/.exec(b)[1].replace(",","")),d=/(?:([KMGTPEZY])(i)?B|([BKMGTPEZY]))/.exec(b)||["B","",""],e=Math.pow("i"===d[2]?1024:1e3,"BKMGTPEZY".indexOf(d[1]));return c*e}(a),f=function(a,b,c){var d=$("
  • "),e=$(""),f=$('
    '),g=$(""),h=$("");return d.addClass(c||""),$("
    ").appendTo(f),d.attr("data-filename",escape(a)),e.text(a),g.text(b),d.append(e,f,g,h),d};b.on("change",function(b){c.empty().removeClass("error completed");var d=a[0].filelist;d.forEach(function(a){f(a.name,a.humanSize).appendTo(c)});var g=f("",d.humanSize,"total");if(g.appendTo(c),d.size>e)return c.addClass("error"),void $(".file-name",g).text("onii-chan y-your upload is t-too big…");var h=d.upload("upload.php"),i=function(a,b){var c={};a.forEach(function(d){++c[d.name]||(c[d.name]=0);var e=$($('li[data-filename="'+escape(d.name)+'"]')[c[d.name]||0]);b.call(e,e,d,a)})},j=$(".file-name",g);h.on("uploadprogress",function(a,b){i(b,function(a,b,c){$(".progress-inner",a).width(100*b.percentUploaded+"%")}),$(".progress-inner",g).width(100*b.percentUploaded+"%")}),h.on("uploadcomplete",function(a){$(".progress-inner").width("100%"),j.text("Grabbing URLs...")}),h.on("load",function(a,b){switch(a.target.status){case 200:var b=JSON.parse(b);if(!b.success){c.addClass("error"),$(".file-name",g).text("Something went wrong; try again later.");break}i(b.files,function(a,b,c){var d=$("");d.attr("href","http://gateway.glop.me/ipfs/"+b.url).attr("target","_BLANK").text("gateway.glop.me/ipfs/"+b.url),$(".file-url",a).append(d)}),c.addClass("completed"),j.text("Done!");break;case 413:c.addClass("error completed"),j.html($("
    ").html("onii-chan, y-your upload is t-too big...").text());break;default:c.addClass("error completed"),j.text("Something went wrong; try again later.")}}),h.upload()})}); 5 | -------------------------------------------------------------------------------- /site/tools.html: -------------------------------------------------------------------------------- 1 | Glop.me · Tools
    4 | 5 | Yes, these are the old tools from Pomf but I see no reason why they shouldn't work here. 6 | 7 |

    Pomfit

    Download
    https://github.com/Senketsu/pomfit
    Contact
    https://twitter.com/Senketsu_Dev

    Bash Pomf Uploader

    Download
    https://gist.github.com/KittyKatt/5818701
    Contact
    https://twitter.com/AnonymousLink

    Simple Bash Pomf Uploader

    Download
    https://gist.github.com/Shizmob/7984374
    Contact
    https://twitter.com/dev_console

    Bash Screenshot Uploader

    Download
    https://gist.github.com/aki--aki/6258422
    Contact
    https://twitter.com/__akiaki

    Gyazo Client (Puush like client)

    Download
    https://github.com/Availu/gyazowin
    http://getrektby.us/files/uploader-pomf.exe
    Contact
    https://twitter.com/4vailable

    Python Pomf Uploader

    Download
    https://github.com/wahpomf/POMF
    Contact
    https://twitter.com/FuzzyPomf

    Sharex

    Download
    https://code.google.com/p/sharex/
    Settings
    http://a.pomf.se/kcqwuc.png or http://p.pomf.se/2426

    Scotty

    Download
    https://github.com/mavanmanen/Scotty
    Contact
    https://twitter.com/mavanmanenDev

    Pomf.se Windows Client Dead

    Download
    http://mavanmanen.nl/index.php?page=projects
    Contact
    https://twitter.com/mavanmanenDev

    ScrotUP Dead

    Download
    https://github.com/mavanmanen/ScrotUP
    Contact
    https://twitter.com/mavanmanenDev

    Perl Pomf Uploaer Dead

    Download
    http://p.pomf.se/624
    Contact
    Kori
    8 | -------------------------------------------------------------------------------- /site/upload.php: -------------------------------------------------------------------------------- 1 | error) throw new UploadException($file->error); 25 | 26 | 27 | if (!file_exists(POMF_FILES_ROOT)) { 28 | mkdir(POMF_FILES_ROOT, 0777, true); 29 | } 30 | 31 | $adderdirfull = explode('/', $file->tempfile); 32 | $adderdir = $adderdirfull[count($adderdirfull) - 1]; 33 | 34 | if (!file_exists(POMF_FILES_ROOT.$adderdir)) { 35 | mkdir(POMF_FILES_ROOT.$adderdir, 0777, true); 36 | 37 | if (move_uploaded_file($file->tempfile, POMF_FILES_ROOT.$adderdir.'/'.$file->name)) { 38 | //if (move_uploaded_file($file->tempfile, escapeshellarg(POMF_FILES_ROOT.$adderdir.'/'.$file->name) )) { 39 | exec('HOME=/home/www-data ipfs add -rq '.POMF_FILES_ROOT.$adderdir, $ipfsout); 40 | 41 | //what a horrible scary line... 42 | exec('rm -rf '.POMF_FILES_ROOT.$adderdir); 43 | 44 | //$ipfsprocess = explode(' ', $ipfsout[count($ipfsout) - 1]); 45 | $ipfsdirhash = $ipfsout[count($ipfsout) - 1]; 46 | $ipfshash = $ipfsout[0]; 47 | 48 | // Generate a name for the file 49 | //$newname = generate_name($file); 50 | $newname = $ipfsdirhash.'/'.$file->name; 51 | 52 | //file_put_contents ("/tmp/hurrr.txt", "Added thing to ipfs, result was: " . count($ipfsout) . "\n", FILE_APPEND); 53 | //for ($muhi = 0; $muhi < count($ipfsout); $muhi++) 54 | // file_put_contents ("/tmp/hurrr.txt", "thing $muhi was " . $ipfsout[$muhi] . "\n", FILE_APPEND); 55 | 56 | // Check if a file with the same hash and size (a file which is the same) does already exist in 57 | // the database; if it does, delete the file just uploaded and return the proper link and data. 58 | /*$q = $db->prepare('SELECT filename, COUNT(*) AS count FROM files WHERE hash = (:hash) ' . 59 | 'AND size = (:size)'); 60 | //$q->bindValue(':hash', $file->get_sha1(), PDO::PARAM_STR); 61 | $q->bindValue(':hash', $ipfshash, PDO::PARAM_STR); 62 | $q->bindValue(':size', $file->size, PDO::PARAM_INT); 63 | $q->execute(); 64 | $result = $q->fetch(); 65 | if ($result['count'] > 0) { 66 | //unlink($file->tempfile); 67 | exec('rm -rf '.POMF_FILES_ROOT.$adderdir); 68 | return array( 69 | 'hash' => $ipfshash, 70 | 'name' => $file->name, 71 | 'url' => $result['filename'], 72 | 'size' => $file->size 73 | ); 74 | }*/ 75 | 76 | // Add it to the database 77 | if (empty($_SESSION['id'])) { 78 | // Query if user is NOT logged in 79 | $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, ' . 80 | 'expire, delid) VALUES (:hash, :orig, :name, :size, :date, ' . 81 | ':exp, :del)'); 82 | } else { 83 | // Query if user is logged in (insert user id together with other data) 84 | $q = $db->prepare('INSERT INTO files (hash, originalname, filename, size, date, ' . 85 | 'expire, delid, user) VALUES (:hash, :orig, :name, :size, ' . 86 | ':date, :expires, :delid, :user)'); 87 | $q->bindValue(':user', $_SESSION['id'], PDO::PARAM_INT); 88 | } 89 | 90 | // Common parameters binding 91 | //$q->bindValue(':hash', $file->get_sha1(), PDO::PARAM_STR); 92 | $q->bindValue(':hash', $ipfshash, PDO::PARAM_STR); 93 | $q->bindValue(':orig', strip_tags($file->name), PDO::PARAM_STR); 94 | $q->bindValue(':name', strip_tags($newname), PDO::PARAM_STR); 95 | $q->bindValue(':size', $file->size, PDO::PARAM_INT); 96 | $q->bindValue(':date', date('Y-m-d'), PDO::PARAM_STR); 97 | $q->bindValue(':exp', null, PDO::PARAM_STR); 98 | $q->bindValue(':del', sha1($file->tempfile), PDO::PARAM_STR); 99 | $q->execute(); 100 | 101 | //unlink($file->tempfile); 102 | 103 | //'hash' => $file->get_sha1(), 104 | return array( 105 | 'hash' => $ipfshash, 106 | 'name' => $file->name, 107 | 'url' => $newname, 108 | 'size' => $file->size 109 | ); 110 | } else { 111 | throw new Exception('Failed to move file to destination', 500); 112 | } 113 | } else { 114 | throw new Exception('Race condition detected, please try again.', 500); 115 | } 116 | } 117 | 118 | /** 119 | * Reorder files array by file 120 | * 121 | * @param $_FILES 122 | * @return array 123 | */ 124 | function diverse_array ($files) { 125 | $result = array(); 126 | foreach ($files as $key1 => $value1) 127 | foreach ($value1 as $key2 => $value2) 128 | $result[$key2][$key1] = $value2; 129 | 130 | return $result; 131 | } 132 | 133 | /** 134 | * Reorganize the $_FILES array into something saner 135 | * 136 | * @param $_FILES 137 | * @return array 138 | */ 139 | function refiles ($files) { 140 | $result = array(); 141 | $files = diverse_array($files); 142 | 143 | foreach ($files as $file) { 144 | $f = new UploadedFile(); 145 | $f->name = $file['name']; 146 | $f->mime = $file['type']; 147 | $f->size = $file['size']; 148 | $f->tempfile = $file['tmp_name']; 149 | $f->error = $file['error']; 150 | // 'expire' doesn't exist neither in $_FILES nor in UploadedFile; 151 | // commented out for future implementation 152 | //$f->expire = $file['expire']; 153 | $result[] = $f; 154 | } 155 | 156 | return $result; 157 | } 158 | 159 | 160 | 161 | $type = isset($_GET['output']) ? $_GET['output'] : 'json'; 162 | $response = new Response($type); 163 | if (isset($_FILES['files'])) { 164 | $uploads = refiles($_FILES['files']); 165 | try { 166 | foreach ($uploads as $upload) 167 | $res[] = upload_file($upload); 168 | $response->send($res); 169 | } catch (Exception $e) { 170 | $response->error($e->getCode(), $e->getMessage()); 171 | } 172 | } else { 173 | $response->error(400, 'No input file(s)'); 174 | } 175 | 176 | ?> 177 | -------------------------------------------------------------------------------- /snapshot.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import MySQLdb 3 | import subprocess 4 | 5 | db = MySQLdb.connect(host="localhost", # your host, usually localhost 6 | user="root", # your username 7 | passwd="changeme", # your password 8 | db="pomf") # name of the data base 9 | 10 | cur = db.cursor() 11 | cur.execute("SELECT filename FROM files") 12 | 13 | outputs = [] 14 | 15 | for row in cur.fetchall(): 16 | outputs.append(row[0].split('/')[0].strip()) 17 | 18 | output_hash = "QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn" 19 | 20 | for curr_hash in outputs: 21 | output_hash = subprocess.check_output(['ipfs', 'object', 'patch', output_hash, 'add-link', curr_hash, curr_hash]).strip() 22 | 23 | subprocess.call(['ipfs', 'name', 'publish', output_hash]) 24 | 25 | 26 | #hash_dict[entry.link] = subprocess.check_output(['transmission-show', '-m', '/tmp/rawtorrent']).split('&')[0] 27 | 28 | -------------------------------------------------------------------------------- /vhosts: -------------------------------------------------------------------------------- 1 | 2 | ServerName www.gateway.glop.me 3 | ServerAlias gateway.glop.me 4 | 5 | ProxyRequests Off 6 | ProxyPass / http://127.0.0.1:8080/ 7 | ProxyPassReverse / http://127.0.0.1:8080/ 8 | 9 | --------------------------------------------------------------------------------