commit cf8a823ad88d99d45b4bcde010d05bf40bde538d Author: ewin Date: Fri May 9 00:14:15 2025 -0400 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2211df6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..ff66a11 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# minimum viable chat + +all my friends seem to be building chat apps as their pet projects these days. i +find they usually do so because existing solutions are lacking in one or more +ways; their projects often aim to improve the chat experience in areas such as: + +- interface customization +- identity management +- security/encryption capabilities +- (de)centralization of identity and/or messages + +minimum viable chat does none of this. it doesn't give a fuck what you want, and +you're probably going to find it charming enough to fuck with it for a while +anyway. this is due to the core advantage it has over its competitors: + +- it actually exists + +![i can say very little else in its favor. but it does in fact exist](lol.png) + +[you can use minimum viable chat right now.](https://minimumviable.chat)[^1] or +you can run your own instance somewhere else and give it to your friends and use +it that way. or you can just laugh at this shitpost of a project and move on, +that's fine too. but you can't deny that it it exists now. + +[^1]: at least, for now. this domain was on sale for the first year and i might +let it expire instead of paying full price for it next year. and also you guys +are probably freaks who are going to fill up my vps's disk with garbage +immediately. im a shitty queer web developer not a content moderator or sysadmin +or particularly interested in doing what you want me to do. but if neither of +those things has happened yet you can probably use the app. + +## usage + + node shit.mjs + +listens on port 80 by default; override with the `PORT` environment variable. + +## license + +i will assign this code's copyright to the next person who donates ten dollars +to my ko-fi. i am writing this document while bored in the las vegas airport on +a five hour layover and all the food here is so fucking expensive oh my god dude +i just wanted a slice of pizza. diff --git a/lol.png b/lol.png new file mode 100644 index 0000000..ce41856 Binary files /dev/null and b/lol.png differ diff --git a/shit.mjs b/shit.mjs new file mode 100644 index 0000000..aa28217 --- /dev/null +++ b/shit.mjs @@ -0,0 +1,27 @@ +import {appendFile, readFile} from 'node:fs/promises'; +import {createServer} from 'node:http'; + +createServer(async (request, response) => { + const chat = new URL(`http://a${request.url}`).searchParams.get('chat'); + if (chat) { + await appendFile('a.txt', `${chat}\n`, {flag: 'a+', encoding: 'utf8'}); + response.writeHead(303, {location: '/'}).end(); // without query + } else { + response.writeHead(200, { + 'content-type': 'text/html', + 'refresh': '30', // lfmoa + }).end( + `
${
+				(await readFile('a.txt', {flag: 'a+', encoding: 'utf8'}))
+					// ugh, fine, i'll html escape it. no xss for you
+					.replace(/[<>&'"]/g, match => ({
+						'<': '<',
+						'>': '>',
+						'&': '&',
+						'\'': '&apos',
+						'"': '"',
+					})[match])
+			}