diff --git a/cron.php b/cron.php new file mode 100644 index 0000000..860f0db --- /dev/null +++ b/cron.php @@ -0,0 +1,16 @@ +expiration != "never"){ + if(time() > $file->expiration * 10 + $file->date){ + rename($filename, "../exp/" . $filename) + echo "deleted" . $filename . "
"; + } + } +} + +?> diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..c86bffa --- /dev/null +++ b/css/style.css @@ -0,0 +1,74 @@ +body{ + margin:0px; + padding:0px; + text-align:center; +} +#logo{ + display:inline; + margin:5px; +} +#menu{ + background:#efe; + border-bottom:1px solid #aaa; + width:100%; +} +#menu-item{ + border-right:1px solid #aaa; + padding:5px; +} +#menu-items{ + +} +#main{ +padding:25px; +padding-top:0px; +margin:auto; +width:80%; +height:100%; +background:#fcfcfc; +border-left:1px solid #aaa; +border-right:1px solid #aaa; +text-align:center; +overflow:auto; +} +#newPaste{ + display:inline-block; + text-align:left; + padding:5px; + width:100%; +} + +#paste{ + height:50%; + width:50%; +} + +#displayPaste{ + display:inline-block; + padding:5px; + width:100%; + text-align:left; +} +a{ + color:#000; + text-decoration:none; +} +#pasteitem{ + border:1px solid #ccc; + padding:10px; + margin:2%; +} +input{ +margin:5px; + +} +#statuslink{ + color:#11c; + text-decoration:underline; +} +#status{ + padding:10px; + background:#fdd; + border-radius:5px; + border:2px solid #daa; +} diff --git a/display.php b/display.php new file mode 100644 index 0000000..8146cfc --- /dev/null +++ b/display.php @@ -0,0 +1,46 @@ +name, $paste->paste, $paste->prettydate, ""], + file_get_contents("templates/displayPaste.html")); +} + +function displayEncryptedPaste($paste, $password){ + echo str_replace( + ["_NAME_", "_PASTE_", "_DATE_", "_STATUS_"], + [ + openssl_decrypt($paste->name, "AES-256-OFB", $password), + openssl_decrypt($paste->paste, "AES-256-OFB", $password), + $paste->prettydate, + "This is an encrypted paste. If it is displaying as gibberish or random symbols then that means you entered the wrong password and need to try again.", + ], + file_get_contents("templates/displayPaste.html")); +} + + +if($_POST["password"]){ + displayEncryptedPaste($pasteJSON, $_POST["password"]); +} + +if($paste == false){ + echo "Paste not found."; + $displayPaste = false; +} +else { + $paste = json_decode($paste); + if($paste->privacy != "Private"){ + displayPaste($paste); + } + if($paste->privacy == "Private"){ + $passPage = str_replace("_id_", $_GET["paste"], file_get_contents("templates/password.html")); + echo $passPage; + } +} + + +?> diff --git a/index.php b/index.php new file mode 100644 index 0000000..8b1f9d4 --- /dev/null +++ b/index.php @@ -0,0 +1,45 @@ + + +Getgle Docs: Military-Grade Hardened Texthost + + + + +
+
+ WARNING! You are accessing this site without SSL. Please click here to use SSL"; +} +?> +
+

New paste

+ +

Paste options

+Paste Name: +
+Paste Privacy: + +
+Password: +
+
+ +
+
+
+ + diff --git a/list.json b/list.json new file mode 100644 index 0000000..01adda2 --- /dev/null +++ b/list.json @@ -0,0 +1 @@ +[{"name":"e","url":"5eff162ea1a56","date":1593775662,"prettydate":"2020\/07\/03 7:27:42"},{"name":"CRIME STATISTICS 50\/13","url":"5effb23128200","date":1593815601,"prettydate":"2020\/07\/03 6:33:21"},{"name":"fizzbuzz in small","url":"5f00ceb5c0388","date":1593888437,"prettydate":"2020\/07\/04 2:47:17"},{"name":"i hate sweden","url":"5f01d67ca0688","date":1593955964,"prettydate":"2020\/07\/05 9:32:44"},{"name":"discord","url":"5f02bf3c995ce","date":1594015548,"prettydate":"2020\/07\/06 2:05:48"},{"name":"puffin browser server list","url":"5f034432d1f79","date":1594049586,"prettydate":"2020\/07\/06 11:33:06"},{"name":"Script","url":"5f08f0b6a6dcc","date":1594421430,"prettydate":"2020\/07\/10 6:50:30"},{"name":"SCRRIIIIPT","url":"5f093499b3327","date":1594438809,"prettydate":"2020\/07\/10 11:40:09"},{"name":"fugger","url":"5f0cf9b96de32","date":1594685881,"prettydate":"2020\/07\/13 8:18:01"},{"name":"Untitled","url":"5f0efcbfbaf59","date":1594817727,"prettydate":"2020\/07\/15 8:55:27"},{"name":"hywzwhzj","url":"5f0f88ee7980b","date":1594853614,"prettydate":"2020\/07\/15 6:53:34"},{"name":"ai-dungeon-3-cures-coronachan","url":"5f11cf3c2a657","date":1595002684,"prettydate":"2020\/07\/17 12:18:04"},{"name":"ai-dungeon-3-cures-coronachan-2","url":"5f11d0d0c780a","date":1595003088,"prettydate":"2020\/07\/17 12:24:48"},{"name":"gpt-3-calculates-pi","url":"5f11e479ba629","date":1595008121,"prettydate":"2020\/07\/17 1:48:41"},{"name":"hhnrrmnyng","url":"5f129f51e83f3","date":1595055953,"prettydate":"2020\/07\/18 3:05:53"},{"name":"Untitled","url":"5f137372b232a","date":1595110258,"prettydate":"2020\/07\/18 6:10:58"},{"name":"bv","url":"5f14fc4736128","date":1595210823,"prettydate":"2020\/07\/19 10:07:03"},{"name":"language-models-cant","url":"5f185e96ea5bf","date":1595432598,"prettydate":"2020\/07\/22 11:43:18"},{"name":"Untitled","url":"5f1a2752f0264","date":1595549522,"prettydate":"2020\/07\/23 8:12:02"},{"name":"Untitled","url":"5f1c9f6b879c5","date":1595711339,"prettydate":"2020\/07\/25 5:08:59"},{"name":"disk","url":"5f1e1ead98071","date":1595809453,"prettydate":"2020\/07\/26 8:24:13"},{"name":"wegw","url":"5f1e1ed8f1bda","date":1595809496,"prettydate":"2020\/07\/26 8:24:56"},{"name":"Send this message to 15 people","url":"5f1f4e8746050","date":1595887239,"prettydate":"2020\/07\/27 6:00:39"}] \ No newline at end of file diff --git a/list.php b/list.php new file mode 100644 index 0000000..0bc9109 --- /dev/null +++ b/list.php @@ -0,0 +1,14 @@ +url . "'>
" . $paste->name . "
Uploaded on " . $paste->prettydate ."
"; + $displayPastes = $displayPaste . $displayPastes; + } + return $displayPastes; +} +echo str_replace("_PASTES_", renderPastes($pastes), $template); +?> diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..fa00c0c Binary files /dev/null and b/logo.png differ diff --git a/upload.php b/upload.php new file mode 100644 index 0000000..bfacccd --- /dev/null +++ b/upload.php @@ -0,0 +1,35 @@ + $pi["name"], + "url" => $url, + "date" => $pi["date"], + "prettydate" => $pi["prettydate"] + ); + array_push($listfile, $list); + file_put_contents("list.json", json_encode($listfile)); + } + header("Location: display.php?paste=" . $url); +} + +?>