+++ /dev/null
-*.avif filter=lfs diff=lfs merge=lfs -text
-*.png filter=lfs diff=lfs merge=lfs -text
<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#" lang="en">
<head>
-<link rel="icon" type="image/png" sizes="32x32" href="https://files.chud.cyou/chuddies/chuddicon.png">
-<link rel="stylesheet" type="text/css" href="https://files.chud.cyou/webshit/style2.css">
+<link rel="icon" type="image/png" sizes="32x32" href="/favicon.png">
+<link rel="stylesheet" type="text/css" href="/css/style.css">
<style>
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.5">
<meta property="og:title" content="HomeChud">
<meta property="og:type" content="website">
-<meta property="og:url" content="https://chud.cyou/">
+<meta property="og:url" content="https://chud.cyou/404">
<meta property="og:image" content="https://files.chud.cyou/chuddies/chud7.png">
<meta property="og:site_name" content="HomeChud">
<meta name="description" content="For Chuds, By Chuds">
p, div {
padding: 0em 2em 0em 2em;
}
-body {
-background: url(/img/flowers.png) repeat 0 0;
-}
a:link {
color: blue;
text-decoration: none;
+++ /dev/null
-<!DOCTYPE html>
- <html>
- <head>
- <title>Sopel Help</title>
- <meta charset="utf-8">
- <meta content="light dark" name="color-scheme">
- </head>
- <body>
- <h1>Sopel Help</h1>
- <div><h2 id="plugin-admin"><a href="#plugin-admin">ADMIN</a></h2><ul><li>chanlist</li><li>join</li><li>me</li><li>mode</li><li>part</li><li>quit</li><li>raw</li><li>restart</li><li>save</li><li>say</li><li>set</li><li>tmpjoin</li><li>tmppart</li><li>unset</li></ul></div>
-<div><h2 id="plugin-adminchannel"><a href="#plugin-adminchannel">ADMINCHANNEL</a></h2><ul><li>ban</li><li>deop</li><li>devoice</li><li>kick</li><li>kickban</li><li>op</li><li>quiet</li><li>tmask set</li><li>topic</li><li>unban</li><li>unquiet</li><li>voice</li></ul></div>
-<div><h2 id="plugin-announce"><a href="#plugin-announce">ANNOUNCE</a></h2><ul><li>announce</li></ul></div>
-<div><h2 id="plugin-calc"><a href="#plugin-calc">CALC</a></h2><ul><li>c</li></ul></div>
-<div><h2 id="plugin-choose"><a href="#plugin-choose">CHOOSE</a></h2><ul><li>choose</li></ul></div>
-<div><h2 id="plugin-clock"><a href="#plugin-clock">CLOCK</a></h2><ul><li>getchanneltimeformat</li><li>getchanneltz</li><li>gettimeformat</li><li>gettz</li><li>setchanneltimeformat</li><li>setchanneltz</li><li>settimeformat</li><li>settz</li><li>t</li><li>tz</li><li>unsetchanneltimeformat</li><li>unsetchanneltz</li><li>unsettimeformat</li><li>unsettz</li></ul></div>
-<div><h2 id="plugin-coretasks"><a href="#plugin-coretasks">CORETASKS</a></h2><ul><li>blocks</li><li>execute</li><li>useserviceauth</li></ul></div>
-<div><h2 id="plugin-countdown"><a href="#plugin-countdown">COUNTDOWN</a></h2><ul><li>countdown</li></ul></div>
-<div><h2 id="plugin-currency"><a href="#plugin-currency">CURRENCY</a></h2><ul><li>cur</li><li>currencies</li></ul></div>
-<div><h2 id="plugin-dice"><a href="#plugin-dice">DICE</a></h2><ul><li>roll</li></ul></div>
-<div><h2 id="plugin-emoticons"><a href="#plugin-emoticons">EMOTICONS</a></h2><ul><li>afraid</li><li>confused</li><li>crazy</li><li>cry</li><li>happy</li><li>hungry</li><li>lenny</li><li>love</li><li>rage</li><li>shrug</li><li>sick</li><li>smirk</li><li>success</li><li>surprised</li><li>tableflip</li><li>unflip</li><li>worried</li></ul></div>
-<div><h2 id="plugin-help"><a href="#plugin-help">HELP</a></h2><ul><li>help</li></ul></div>
-<div><h2 id="plugin-invite"><a href="#plugin-invite">INVITE</a></h2><ul><li>invite</li></ul></div>
-<div><h2 id="plugin-isup"><a href="#plugin-isup">ISUP</a></h2><ul><li>isup</li><li>isupinsecure</li></ul></div>
-<div><h2 id="plugin-lmgtfy"><a href="#plugin-lmgtfy">LMGTFY</a></h2><ul><li>lmgtfy</li></ul></div>
-<div><h2 id="plugin-ping"><a href="#plugin-ping">PING</a></h2><ul><li>ping</li></ul></div>
-<div><h2 id="plugin-pronouns"><a href="#plugin-pronouns">PRONOUNS</a></h2><ul><li>clearpronouns</li><li>pronouns</li><li>setpronouns</li></ul></div>
-<div><h2 id="plugin-rand"><a href="#plugin-rand">RAND</a></h2><ul><li>rand</li></ul></div>
-<div><h2 id="plugin-reload"><a href="#plugin-reload">RELOAD</a></h2><ul><li>load</li><li>reload</li></ul></div>
-<div><h2 id="plugin-safety"><a href="#plugin-safety">SAFETY</a></h2><ul><li>safety</li><li>virustotal</li></ul></div>
-<div><h2 id="plugin-search"><a href="#plugin-search">SEARCH</a></h2><ul><li>bing</li><li>duck</li><li>search</li><li>suggest</li></ul></div>
-<div><h2 id="plugin-seen"><a href="#plugin-seen">SEEN</a></h2><ul><li>seen</li></ul></div>
-<div><h2 id="plugin-tell"><a href="#plugin-tell">TELL</a></h2><ul><li>tell</li></ul></div>
-<div><h2 id="plugin-tld"><a href="#plugin-tld">TLD</a></h2><ul><li>tld</li><li>tldcache</li></ul></div>
-<div><h2 id="plugin-translate"><a href="#plugin-translate">TRANSLATE</a></h2><ul><li>mangle</li><li>translate</li></ul></div>
-<div><h2 id="plugin-unicode_info"><a href="#plugin-unicode_info">UNICODE_INFO</a></h2><ul><li>u</li></ul></div>
-<div><h2 id="plugin-units"><a href="#plugin-units">UNITS</a></h2><ul><li>length</li><li>temp</li><li>weight</li></ul></div>
-<div><h2 id="plugin-uptime"><a href="#plugin-uptime">UPTIME</a></h2><ul><li>uptime</li></ul></div>
-<div><h2 id="plugin-url"><a href="#plugin-url">URL</a></h2><ul><li>title</li><li>urlallow</li><li>urlexclude</li></ul></div>
-<div><h2 id="plugin-version"><a href="#plugin-version">VERSION</a></h2><ul><li>version</li></ul></div>
-<div><h2 id="plugin-wikipedia"><a href="#plugin-wikipedia">WIKIPEDIA</a></h2><ul><li>wikipedia</li><li>wpclang</li><li>wplang</li></ul></div>
-<div><h2 id="plugin-wiktionary"><a href="#plugin-wiktionary">WIKTIONARY</a></h2><ul><li>ety</li><li>wt</li></ul></div>
-<div><h2 id="plugin-xkcd"><a href="#plugin-xkcd">XKCD</a></h2><ul><li>xkcd</li></ul></div>
- </body>
- </html>
-
\ No newline at end of file
</center>
<hr>
<h1 class="subbox">- - - - - - - - - - - - - ChudHome - - - - - - - - - - - -</h1>
-<center><div style="padding-top: 1em"><img width="300px" src="/img/home/6086kwuo2.avif"></div></center>
+<center><div style="padding-top: 1em; color: green">> If only you knew how bad things really were</div></center>
<hr/>
<div class="container">
<div>[C] <a href="https://libdill.org/">LibDill</a></div>
<div>[C] <a href="https://github.com/jart/bestline">Bestline</a></div>
<div>[C] <a href="http://skeeto.s3.amazonaws.com/share/onward17-essays2.pdf">Some Were Meant</a></div>
<div>[Fun] <a href="https://home.cern/resources?topic=1116">CERN</a></div>
+<div>[Fun] <a href="https://copradar.com/tencodes/index.html">10-code</a></div>
<div>[Fun] <a href="https://tss8.sdf.org/">PDP-8</a></div>
<div>[Fun] <a href="https://www.speedsolving.com/threads/cube-sed.93122/">cube.sed</a></div>
<div>[Fun] <a href="https://www.ternary-computing.com/">Ternary</a></div>
<div>[Web] <a href="https://github.com/simonrob/email-oauth2-proxy">begone oauth2</a></div>
<div>[People] <a href="https://www.someodd.zip">someodd</a></div>
<div>[People] <a href="https://c353.net/">c353</a></div>
+<div>NEVER trust LFS</div>
+<div>[Servers] <a href="https://advinservers.com/">Advin</a></div>
+<div>[Servers] <a href="https://contabo.com/">Contabo</a></div>
+<div>[Buy] <a href="https://diskprices.com/">Disk Prices</a></div>
+<div>[India] <a href="https://github.com/herrbischoff/country-ip-blocks">Ban India</a></div>
+<div>[HTTP/3] <a href="https://cloudflare-quic.com">Cloudflare QUIC</a></div>
+<div>[DNS] <a href="https://porkbun.com">Porky</a></div>
</div>
<hr/>
<div class="box2">
<div class="container">
-<div><img class="small" src="/img/home/235it's.avif"></div>
-<div><img class="small" src="/img/home/254greenismypepper.avif"></div>
-<div><img class="small" src="/img/home/61360wheels.avif"></div>
-<div><img class="small" src="/img/home/256gondala-3.avif"></div>
-<div><img class="small" src="/img/home/262glowie.avif"></div>
-<div><img class="small" src="/img/home/397braindamage.avif"></div>
-<div><img class="small" src="/img/home/thankyouxolatile.avif"></div>
-<div><img class="small" src="/img/home/pdp8.avif"></div>
-<div><img class="small" src="/img/home/133pain.avif"></div>
-<div><img class="small" src="/img/home/141ohhh.avif"></div>
-<div><img class="small" src="/img/home/192lisent.avif"></div>
-<div><img class="small" src="/img/home/226jestlain.avif"></div>
-<div><img class="small" src="/img/home/579COOMPILING.avif"></div>
-<div><img class="small" src="/img/home/604782vaq.avif"></div>
-<div><img class="small" src="/img/home/341cosmos brain.avif"></div>
-<div><img class="small" src="/img/home/60571349124.avif"></div>
-<div><img class="small" src="/img/home/6223letglow.avif"></div>
-<div><img class="small" src="/img/home/270gentlemen.avif"></div>
-<div><img class="small" src="/img/home/108rarest.avif"></div>
-<div><img class="small" src="/img/home/228jej.avif"></div>
-<div><img class="small" src="/img/home/6511984.avif"></div>
-<div><img class="small" src="/img/home/6751712383973534a.avif"></div>
-<div><img class="small" src="/img/home/6771711576511290336.avif"></div>
-<div><img class="small" src="/img/home/7531684757913922057.avif"></div>
-<div><img class="small" src="/img/home/347coffee&love.avif"></div>
-<div><img class="small" src="/img/home/8881681056060933667.avif"></div>
-<div><img class="small" src="/img/home/AH.avif"></div>
-<div><img class="small" src="/img/home/nothing.avif"></div>
-<div><img class="small" src="/img/home/reiphone.avif"></div>
+<div><img class="small" src="/img/10641606944612965.avif"></div>
+<div><img class="small" src="/img/1106$chadpanik.avif"></div>
+<div><img class="small" src="/img/110rage.avif"></div>
+<div><img class="small" src="/img/113question.avif"></div>
+<div><img class="small" src="/img/129pepe.avif"></div>
+<div><img class="small" src="/img/134ownnothingbehappy.avif"></div>
+<div><img class="small" src="/img/139old.avif"></div>
+<div><img class="small" src="/img/141ohhh.avif"></div>
+<div><img class="small" src="/img/142ocd.avif"></div>
+<div><img class="small" src="/img/1743154712513091.jpg"></div>
+<div><img class="small" src="/img/1743192834675151.png"></div>
+<div><img class="small" src="/img/1743194410174259.jpg"></div>
+<div><img class="small" src="/img/1743270609737517.jpg"></div>
+<div><img class="small" src="/img/1743362761778059.jpg"></div>
+<div><img class="small" src="/img/174meirl2.avif"></div>
+<div><img class="small" src="/img/178master_of_nothing.avif"></div>
+<div><img class="small" src="/img/194lindypistol.avif"></div>
+<div><img class="small" src="/img/203laravel_user.avif"></div>
+<div><img class="small" src="/img/214lagh.gif"></div>
+<div><img class="small" src="/img/215kubra.avif"></div>
+<div><img class="small" src="/img/222joke.avif"></div>
+<div><img class="small" src="/img/226jestlain.avif"></div>
+<div><img class="small" src="/img/235it's.avif"></div>
+<div><img class="small" src="/img/237inb4.avif"></div>
+<div><img class="small" src="/img/261gnu.avif"></div>
+<div><img class="small" src="/img/262glowie.avif"></div>
+<div><img class="small" src="/img/269gentolmen.avif"></div>
+<div><img class="small" src="/img/270gentlemen.avif"></div>
+<div><img class="small" src="/img/278frogcels.gif"></div>
+<div><img class="small" src="/img/292factpepe.avif"></div>
+<div><img class="small" src="/img/294example.avif"></div>
+<div><img class="small" src="/img/301emacjihad.avif"></div>
+<div><img class="small" src="/img/318downchang.avif"></div>
+<div><img class="small" src="/img/356chuder.avif"></div>
+<div><img class="small" src="/img/357chudchad.avif"></div>
+<div><img class="small" src="/img/447aftermath.avif"></div>
+<div><img class="small" src="/img/537ITSOVERSHINJI.avif"></div>
+<div><img class="small" src="/img/543IMCOOOMMMMMMMMPILLLLING.avif"></div>
+<div><img class="small" src="/img/593AAAAAAAAAAAA.avif"></div>
+<div><img class="small" src="/img/604782vaq.avif"></div>
+<div><img class="small" src="/img/6223letglow.avif"></div>
+<div><img class="small" src="/img/6292a6aac4391a872929c7c5723e5e493db.avif"></div>
+<div><img class="small" src="/img/6342607-24108-12807.avif"></div>
+<div><img class="small" src="/img/64820445-19965-66.avif"></div>
+<div><img class="small" src="/img/665172073521242067.avif"></div>
+<div><img class="small" src="/img/6751712383973534a.gif"></div>
+<div><img class="small" src="/img/6771711576511290336.avif"></div>
+<div><img class="small" src="/img/6891709318435493132.avif"></div>
+<div><img class="small" src="/img/7011706171717962026.avif"></div>
+<div><img class="small" src="/img/7191699463219093145.avif"></div>
+<div><img class="small" src="/img/7531684757913922057.avif"></div>
+<div><img class="small" src="/img/98reeeeee.gif"></div>
+<div><img class="small" src="/img/readingcomprehension.avif"></div>
+<div><img class="small" src="/img/resum.jpg"></div>
+<div><img class="small" src="/img/shanji.avif"></div>
+<div><img class="small" src="/img/short.avif"></div>
+<div><img class="small" src="/img/theybought$rddt.avif"></div>
+<div><img class="small" src="/img/uwuzrite.avif"></div>
+<div><img class="small" src="/img/xolat.png"></div>
<div><p>It's<br/>Peak Web Design</p></div>
</div>
-<img width="760px" src="/img/home/699170714601569299.avif">
+<img width="760px" src="/img/699170714601569299.avif">
</div>
<p class="center">Copyright?</p>
<p class="center">It's free - as long as you don't value your time, idiot.</p>
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:c3f78ab09e787781ca66526a087fb42747e9917f3bc253ff5a2f29a839726750
+size 1783
<a href="https://chud.cyou/up">UpChud</a> |
<a href="https://chud.cyou/home">Home</a> |
<a href="https://chud.cyou/weather">Weather</a> |
-<!-- <a href="https://wiki.chud.cyou/">Wiki</a> | -->
-<!-- <a href="https://files.chud.cyou/">Files</a> | -->
<a href="/img/Off%20To%20Hang%20Myself.webm">Exit</a>
</p>
<hr>
<h2 class="subbox">You're Illegally in <b>✶<i>Chud Airspace</i>✶</b></h2>
<center class="shake-angry"><i>Get the fuck out</i></center>
<hr>
-<!-- these png/jpg files are so recompressed that they can't be converted to avif without corruption -->
-<img width="180px" height="auto" src="/img/chuddies/chud1.jpg">
-<img width="180px" height="auto" src="/img/chuddies/chud3.png">
-<img width="180px" height="auto" src="/img/chuddies/chud4.avif"><br/>
-<img width="180px" height="auto" src="/img/chuddies/chud5.png">
-<img width="180px" height="auto" src="/img/chuddies/chud6.avif">
-<img width="180px" height="auto" src="/img/chuddies/chud7.avif"><br/>
-<img width="180px" height="auto" src="/img/chuddies/chud8.avif">
-<img width="180px" height="auto" class="shake" src="/img/chuddies/chud10.avif">
-<img width="180px" height="auto" src="/img/chuddies/chud11.avif">
<br/>
+<img width=200 height=200 src="/img/chuddies/chud1.jpg">
+<img width=200 height=200 src="/img/chuddies/chud3.png">
+<img width=200 height=200 src="/img/chuddies/chud4.png"><br/>
+<img width=200 height=200 src="/img/chuddies/chud5.png">
+<img width=200 height=200 src="/img/chuddies/chud6.png">
+<img width=200 height=200 src="/img/chuddies/chud7.png"><br/>
+<img width=200 height=200 src="/img/chuddies/chud8.png">
+<img width=200 height=200 src="/img/chuddies/chud10.png">
+<img width=200 height=200 src="/img/chuddies/chud11.png">
<p style="color:grey">I fucking LOVE avif</p>
+<p style="color:grey">I fucking HATE Git LFS</p>
<hr>
<p>We will forsake our countries, we will leave our mother lands behind us, and become one with <b>CHUDness</b>.</p>
<p>We have no nation, no philosophy, no ideology, and no bitches.</p>
<hr>
<div class="box2">
<p>I demand FREE SHEKELS<br/><small>for buying the dip of INTC<br/>and paying back the fines I keep getting from the German government</small></p>
-<p><a href="monero:89YhoqxStExKtzQJh119MULDWqGr8WBspLFp9X34KyEacdK8Y2zaWHVeQoR1UpPqxoTzxxGpPiLm374xtstMrJ3TGTgFV3V">XMR</a></p>
-<img src="/img/monero.avif">
+<p>monero:89YhoqxStExKtzQJh119MULDWqGr8WBspLFp9X34KyEacdK8Y2zaWHVeQoR1UpPqxoTzxxGpPiLm374xtstMrJ3TGTgFV3V"</p>
+<img src="/img/monero.png">
</div>
<div class="box2">
<p>
Current Balance:
</p>
<p>
-( $55.77 + ${jewish_student_loan} + ${bail} + ${credit_card_interest} + ${inherited_dept} + ${court_fees} + ${crack_dept} + ${what_i_own_to_the_jewish_mob} + ${what_i_own_to_the_german_trannies} + ${powdered_milk_for_wifes_boyfriends_baby[0-3]} )
+( $55.77 + ${jewish_student_loan} + ${bail} + ${credit_card_interest} + ${inherited_dept} + ${court_fees} + ${crack_dept} + ${what_i_own_to_the_jewish_mob} + ${what_i_own_to_the_german_trannies} + ${powdered_milk_for_wifes_boyfriends_baby[0-3]} + ${paying_lfs_damages} )
</p> (that's negative if you didn't notice)
</div>
<hr>
<div class="box2">
<p>CHUD.CYOU was created by this internationally wanted chud</p>
-<img width="300px" height="auto" src="/img/chuddies/chud9.avif">
+<img width=280 src="/img/chuddies/chud9.png">
<h5>"I fucking hate <<i>The Web</i>> so much it's unreal"<br/>- Email , 79 AH</h5>
+<h5>"I fucking hate <<i>Git LFS</i>> so much it's unreal"<br/>- Lime , 79 AH</h5>
<p><a href="mailto:admin@chud.cyou">Emil me</a> about your lady-like concerns.</p>
</div>
<div class="box2">
<h4 style="color:red">1 BILLION YEARS of torture will be admitted to copyright ignorers</h4>
<p><small>Just kidding, all shit on this website is Public Domain, except this sentence</small></p>
</div>
-<!-- <div hidden> -->
-<!-- <p>Muh 2004-style badges</p> -->
-<!-- <a href="https://www.abuseipdb.com/user/187039" title="AbuseIPDB is an IP address blacklist for webmasters and sysadmins to report IP addresses engaging in abusive behavior on their networks"> -->
-<!-- <img src="https://www.abuseipdb.com/contributor/187039.svg" alt="AbuseIPDB Contributor Badge" style="width: 401px;"> -->
-<!-- </a> -->
-<!-- </div> -->
</center>
</div>
</body>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<urlset\r
- xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9\r
- http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">\r
-<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->\r
-\r
-
-<url>
- <loc>https://chud.cyou/</loc>
- <lastmod>2025-04-09T00:19:46+00:00</lastmod>
- <priority>1.00</priority>
-</url>
-<url>
- <loc>https://chud.cyou/irc.html</loc>
- <lastmod>2025-04-10T03:05:26+00:00</lastmod>
- <priority>0.80</priority>
-</url>
-<url>
- <loc>https://chud.cyou/home.html</loc>
- <lastmod>2025-04-09T00:17:38+00:00</lastmod>
- <priority>0.80</priority>
-</url>\r
-\r
-\r
-</urlset>
\ No newline at end of file
--- /dev/null
+# I am bash, bourne of pure evil
+upload(){
+ url="$1"
+ shift
+ for i in "$@"; do
+ curl "$url" -F"file=@$i"
+ done
+}
+lainsafe(){ upload "https://lainsafe.kalli.st/" "$@" ; echo ; }
+0x0(){ upload "https://0x0.st/" "$@" ; }
+x0(){ upload "https://x0.at/" "$@" ; }
+chud(){ upload "https://up.chud.cyou/" "$@" ; }
+random(){
+ # chud omitted due to low allocated MiB and limited suffixes
+ l=("lainsafe" "0x0" "x0")
+ j=${l[$(($RANDOM % ${#l[@]}))]}
+ "$j" "$@"
+}
--- /dev/null
+<?php
+class CONFIG
+{
+ const MAX_FILESIZE = 1; //max. filesize in MiB
+ const MAX_FILEAGE = 365; //max. age of files in days
+ const MIN_FILEAGE = 3; //min. age of files in days
+ const DECAY_EXP = 1.5;
+
+ const UPLOAD_TIMEOUT = 5*60; //max. time an upload can take before it times out
+ const MIN_ID_LENGTH = 1; //min. length of the random file ID
+ const MAX_ID_LENGTH = 2; //max. length of the random file ID, set to MIN_ID_LENGTH to disable
+ const STORE_PATH = '/var/www/html/up/load/'; //directory to store uploaded files in
+ const LOG_PATH = '/tmp/0x0log'; //path to log uploads + resulting links to
+ const DOWNLOAD_PATH = '%s'; //the path part of the download url. %s = placeholder for filename
+ const MAX_EXT_LEN = 8; //max. length for file extensions
+ const EXTERNAL_HOOK = null; //external program to call for each upload
+ const AUTO_FILE_EXT = true; //automatically try to detect file extension for files that have none
+
+ const PERMITTED_EXT = array(
+ 'c' => true,
+ 'h' => true,
+ 'm4' => true,
+ 'md' => true,
+ 'org' => true,
+ 'txt' => true,
+ 'gpg' => true,
+ 'pdf' => true,
+ 'avif' => true,
+ 'jpeg' => true,
+ 'jpg' => true,
+ 'png' => true,
+ 'jxl' => true,
+ 'gif' => true,
+ 'mkv' => true,
+ 'mp4' => true,
+ 'webm' => true
+);
+ const LIMIT_EXT = true; // to enable the usage of the above
+
+ const FORCE_HTTPS = true; //force generated links to be https://
+
+ const ADMIN_EMAIL = 'admin@chud.cyou'; //address for inquiries
+
+ public static function SITE_URL() : string
+ {
+ $proto = ($_SERVER['HTTPS'] ?? 'off') == 'on' || CONFIG::FORCE_HTTPS ? 'https' : 'http';
+ return "$proto://up.{$_SERVER['HTTP_HOST']}";
+ }
+
+ public static function SCRIPT_URL() : string
+ {
+ return CONFIG::SITE_URL().$_SERVER['REQUEST_URI'];
+ }
+};
+
+
+// generate a random string of characters with given length
+function rnd_str(int $len) : string
+{
+ $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
+ $max_idx = strlen($chars) - 1;
+ $out = '';
+ while ($len--)
+ {
+ $out .= $chars[mt_rand(0,$max_idx)];
+ }
+ return $out;
+}
+
+// check php.ini settings and print warnings if anything's not configured properly
+function check_config() : void
+{
+ return;
+ $warn_config_value = function($ini_name, $var_name, $var_val)
+ {
+ $ini_val = intval(ini_get($ini_name));
+ if ($ini_val < $var_val)
+ print("<pre>Warning: php.ini: $ini_name ($ini_val) set lower than $var_name ($var_val)\n</pre>");
+ };
+
+ $warn_config_value('upload_max_filesize', 'MAX_FILESIZE', CONFIG::MAX_FILESIZE);
+ $warn_config_value('post_max_size', 'MAX_FILESIZE', CONFIG::MAX_FILESIZE);
+ $warn_config_value('max_input_time', 'UPLOAD_TIMEOUT', CONFIG::UPLOAD_TIMEOUT);
+ $warn_config_value('max_execution_time', 'UPLOAD_TIMEOUT', CONFIG::UPLOAD_TIMEOUT);
+}
+
+//extract extension from a path (does not include the dot)
+function ext_by_path(string $path) : string
+{
+ $ext = pathinfo($path, PATHINFO_EXTENSION);
+ //special handling of .tar.* archives
+ $ext2 = pathinfo(substr($path,0,-(strlen($ext)+1)), PATHINFO_EXTENSION);
+ if ($ext2 === 'tar')
+ {
+ $ext = $ext2.'.'.$ext;
+ }
+ return $ext;
+}
+
+function ext_by_finfo(string $path) : string
+{
+ $finfo = finfo_open(FILEINFO_EXTENSION);
+ $finfo_ext = finfo_file($finfo, $path);
+ finfo_close($finfo);
+ if ($finfo_ext != '???')
+ {
+ return explode('/', $finfo_ext, 2)[0];
+ }
+ else
+ {
+ $finfo = finfo_open();
+ $finfo_info = finfo_file($finfo, $path);
+ finfo_close($finfo);
+ if (strstr($finfo_info, 'text') !== false)
+ {
+ return 'txt';
+ }
+ }
+ return '';
+}
+
+// store an uploaded file, given its name and temporary path (e.g. values straight out of $_FILES)
+// files are stored wit a randomised name, but with their original extension
+//
+// $name: original filename
+// $tmpfile: temporary path of uploaded file
+// $formatted: set to true to display formatted message instead of bare link
+function store_file(string $name, string $tmpfile, bool $formatted = false) : void
+{
+ //create folder, if it doesn't exist
+ if (!file_exists(CONFIG::STORE_PATH))
+ {
+ mkdir(CONFIG::STORE_PATH, 0750, true); //TODO: error handling
+ }
+
+ //check file size
+ $size = filesize($tmpfile);
+ if ($size > CONFIG::MAX_FILESIZE * 1024 * 1024)
+ {
+ header('HTTP/1.0 413 Payload Too Large');
+ print("Error 413: Max File Size ({CONFIG::MAX_FILESIZE} MiB) Exceeded\n");
+ return;
+ }
+ if ($size == 0)
+ {
+ header('HTTP/1.0 400 Bad Request');
+ print('Error 400: Uploaded file is empty\n');
+ return;
+ }
+
+ $ext = ext_by_path($name);
+ if (empty($ext) && CONFIG::AUTO_FILE_EXT)
+ {
+ $ext = ext_by_finfo($tmpfile);
+ }
+ $ext = substr($ext, 0, CONFIG::MAX_EXT_LEN);
+
+ if (CONFIG::LIMIT_EXT) {
+ $permitted_ext = CONFIG::PERMITTED_EXT;
+ if ($permitted_ext[$ext] != true) {
+ header('HTTP/1.0 400 Bad Request');
+ return;
+ }
+ }
+
+ $tries_per_len=3; //try random names a few times before upping the length
+
+ $id_length=CONFIG::MIN_ID_LENGTH;
+ if(isset($_POST['id_length']) && ctype_digit($_POST['id_length'])) {
+ $id_length = max(CONFIG::MIN_ID_LENGTH, min(CONFIG::MAX_ID_LENGTH, $_POST['id_length']));
+ }
+
+ for ($len = $id_length; ; ++$len)
+ {
+ for ($n=0; $n<=$tries_per_len; ++$n)
+ {
+ $id = rnd_str($len);
+ $basename = $id . (empty($ext) ? '' : '.' . $ext);
+ $target_file = CONFIG::STORE_PATH . $basename;
+
+ if (!file_exists($target_file))
+ break 2;
+ }
+ }
+
+ $res = move_uploaded_file($tmpfile, $target_file);
+ if (!$res)
+ {
+ //TODO: proper error handling?
+ header('HTTP/1.0 520 Unknown Error');
+ return;
+ }
+
+ if (CONFIG::EXTERNAL_HOOK !== null)
+ {
+ putenv('REMOTE_ADDR='.$_SERVER['REMOTE_ADDR']);
+ putenv('ORIGINAL_NAME='.$name);
+ putenv('STORED_FILE='.$target_file);
+ $ret = -1;
+ $out = null;
+ $last_line = exec(CONFIG::EXTERNAL_HOOK, $out, $ret);
+ if ($last_line !== false && $ret !== 0)
+ {
+ unlink($target_file);
+ header('HTTP/1.0 400 Bad Request');
+ print("Error: $last_line\n");
+ return;
+ }
+ }
+
+ //print the download link of the file
+ $url = sprintf(CONFIG::SITE_URL().'/'.CONFIG::DOWNLOAD_PATH, $basename);
+
+ if ($formatted)
+ {
+ print("<center><h1>Uploaded!</h1><h2>Access your file here: <a href=\"$url\">$url</a></h2></center>");
+ }
+ else
+ {
+ print("$url\n");
+ }
+
+ // log uploader's IP, original filename, etc.
+ if (CONFIG::LOG_PATH)
+ {
+ file_put_contents(
+ CONFIG::LOG_PATH,
+ implode("\t", array(
+ date('c'),
+ $_SERVER['REMOTE_ADDR'],
+ filesize($tmpfile),
+ escapeshellarg($name),
+ $basename
+ )) . "\n",
+ FILE_APPEND
+ );
+ }
+}
+
+// purge all files older than their retention period allows.
+function purge_files() : void
+{
+ $num_del = 0; //number of deleted files
+ $total_size = 0; //total size of deleted files
+
+ //for each stored file
+ foreach (scandir(CONFIG::STORE_PATH) as $file)
+ {
+ //skip virtual . and .. files
+ if ($file === '.' ||
+ $file === '..')
+ {
+ continue;
+ }
+
+ $file = CONFIG::STORE_PATH . $file;
+
+ $file_size = filesize($file) / (1024*1024); //size in MiB
+ $file_age = (time()-filemtime($file)) / (60*60*24); //age in days
+
+ //keep all files below the min age
+ if ($file_age < CONFIG::MIN_FILEAGE)
+ {
+ continue;
+ }
+
+ //calculate the maximum age in days for this file
+ $file_max_age = CONFIG::MIN_FILEAGE +
+ (CONFIG::MAX_FILEAGE - CONFIG::MIN_FILEAGE) *
+ pow(1 - ($file_size / CONFIG::MAX_FILESIZE), CONFIG::DECAY_EXP);
+
+ //delete if older
+ if ($file_age > $file_max_age)
+ {
+ unlink($file);
+
+ print("deleted $file, $file_size MiB, $file_age days old\n");
+ $num_del += 1;
+ $total_size += $file_size;
+ }
+ }
+ print("Deleted $num_del files totalling $total_size MiB\n");
+}
+
+function send_text_file(string $filename, string $content) : void
+{
+ header('Content-type: application/octet-stream');
+ header("Content-Disposition: attachment; filename=\"$filename\"");
+ header('Content-Length: '.strlen($content));
+ print($content);
+}
+
+// send a ShareX custom uploader config as .json
+function send_sharex_config() : void
+{
+ $name = $_SERVER['SERVER_NAME'];
+ $site_url = str_replace("?sharex", "", CONFIG::SCRIPT_URL());
+ send_text_file($name.'.sxcu', <<<EOT
+{
+ "Name": "$name",
+ "DestinationType": "ImageUploader, FileUploader",
+ "RequestType": "POST",
+ "RequestURL": "$site_url",
+ "FileFormName": "file",
+ "ResponseType": "Text"
+}
+EOT);
+}
+
+// send a Hupl uploader config as .hupl (which is just JSON)
+function send_hupl_config() : void
+{
+ $name = $_SERVER['SERVER_NAME'];
+ $site_url = str_replace("?hupl", "", CONFIG::SCRIPT_URL());
+ send_text_file($name.'.hupl', <<<EOT
+{
+ "name": "$name",
+ "type": "http",
+ "targetUrl": "$site_url",
+ "fileParam": "file"
+}
+EOT);
+}
+
+// print a plaintext info page, explaining what this script does and how to
+// use it, how to upload, etc.
+function print_index() : void
+{
+ $site_url = CONFIG::SCRIPT_URL();
+ $sharex_url = $site_url.'?sharex';
+ $hupl_url = $site_url.'?hupl';
+ $decay = CONFIG::DECAY_EXP;
+ $min_age = CONFIG::MIN_FILEAGE;
+ $max_size = CONFIG::MAX_FILESIZE;
+ $max_age = CONFIG::MAX_FILEAGE;
+ $mail = CONFIG::ADMIN_EMAIL;
+ $max_id_length = CONFIG::MAX_ID_LENGTH;
+
+ $length_info = "\nTo use a longer file ID (up to $max_id_length characters), add -F id_length=<number>\n";
+ if (CONFIG::MIN_ID_LENGTH == CONFIG::MAX_ID_LENGTH)
+ {
+ $length_info = "";
+ }
+
+$ext = array_keys(CONFIG::PERMITTED_EXT);
+$permitted_ext = "";
+
+for($i=0; $i < count($ext); ++$i) {
+if ($i+1 < count($ext)) { $permitted_ext .= $ext[$i] . ", "; }
+else { $permitted_ext .= $ext[$i]; }
+}
+
+$alias_file = file_get_contents('aliases');
+
+echo <<<EOT
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<title>UpChud</title>
+<meta name="description" content="Minimalistic service for sharing temporary files." />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<link rel="stylesheet" type="text/css" href="/css/style.css">
+<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon.png">
+</head>
+<body>
+<div class="box">
+<div class="back"><a href="https://chud.cyou/">< Back</a></div>
+<h1 class="subbox">- - - - - - - - - - - - - UpChud - - - - - - - - - - - -</h1>
+<p>You can upload files to this site via a simple HTTP POST, e.g. using curl:</p>
+<div class="box2"><pre>curl -F "file=@./file" $site_url</pre></div>
+<p>Or simply choose a file and click "Upload" below:</p>
+<div class="box2">
+<br/>
+<small>Notice: by using this method, you accept that you have lost "The Game"</small>
+<form id="frm" method="post" enctype="multipart/form-data">
+<input type="file" name="file" id="file" />
+<input type="hidden" name="formatted" value="true" />
+<input type="submit" value="Upload"/>
+</form>
+<br/>
+</div>
+<hr/>
+<h2>Limits!</h2>
+<lo>
+<li>The maximum allowed file size is $max_size MiB.</li>
+<li>Files are kept for a minimum of $min_age, and a maximum of $max_age Days.</li>
+<li>Permitted filetypes are:
+<div class="box2">
+<pre>$permitted_ext</pre>
+</div>
+</li>
+</lo>
+<p>
+How long a file is kept depends on its size. Larger files are deleted earlier
+than small ones.<br/> This relation is non-linear and skewed in favour of small
+files.<br />
+</p>
+<div class="box2">
+<pre>MIN_AGE + (MAX_AGE - MIN_AGE) * (1-(FILE_SIZE/MAX_SIZE))^$decay</pre>
+</div>
+<hr/>
+<h2><a href="aliases">Aliases</a></h2>
+<small>These really aren't aliases, but bash functions, but... it's bash. - And I put these in my aliases file.</small>
+<div class="box2">
+<pre>$alias_file</pre>
+</div>
+<hr/>
+<h2>Source</h2>
+<p>The UpChud page's source can be seen on <a href="https://git.xolatile.top/emil/up">the git</a>.</p>
+<p>The unmodified PHP script used to provide this service is open source and available on
+<a href="https://github.com/Rouji/single_php_filehost">GitHub</a>.</p>
+<hr/>
+<h2>"Muh TOS"</h2>
+<p>- No Porn Or Illegal Activity As Per U.S. Law.</p>
+<p>- For programming, screenshots, small file transfer, & mildly amusing images.</p>
+<hr/>
+<h2>Contact</h2>
+<p>If you want to report abuse of this service, or have any other inquiries,
+please write an email to <a href="mailto:$mail">$mail</a></p>
+</div>
+</body>
+</html>
+EOT;
+}
+
+
+// decide what to do, based on POST parameters etc.
+if (isset($_FILES['file']['name']) &&
+ isset($_FILES['file']['tmp_name']) &&
+ is_uploaded_file($_FILES['file']['tmp_name']))
+{
+ //file was uploaded, store it
+ $formatted = isset($_REQUEST['formatted']);
+ store_file($_FILES['file']['name'],
+ $_FILES['file']['tmp_name'],
+ $formatted);
+}
+else if (isset($_GET['sharex']))
+{
+ send_sharex_config();
+}
+else if (isset($_GET['hupl']))
+{
+ send_hupl_config();
+}
+else if ($argv[1] ?? null === 'purge')
+{
+ purge_files();
+}
+else
+{
+ check_config();
+ print_index();
+}