This commit is contained in:
grant 2022-11-20 18:16:09 -06:00
parent ab9acf02ae
commit 554bded1d4
4 changed files with 1307 additions and 3 deletions

1271
pages/ascii.gemini Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,11 @@ i am grant:) a software engineer^^ i run bedrock(hijacked-gentoo) linux
i love any lisp-esque languages/syntax,
functional languages, and open source <3
=> gemini://{domain}/git my git servers:)
=> gemini://{domain}/git git
=> gemini://{domain}/aboutme about me
=> gemini://{domain}/forums forums
=> gemini://{domain}/ascii ascii
=> gemini://{domain}/links links (NOT DONE)
## languages:

View File

@ -1,3 +1,13 @@
_ _ _ _
| |_____| |____ __ __ ____ _| |_ ___ ___ _ _ ___| |_
| / / -_) / /\ V V /(_-< || | _/ -_|_-<_| ' \/ -_) _|
|_\_\___|_\_\ \_/\_(_)__/\_, |\__\___/__(_)_||_\___|\__|
|__/
to generate keys : `openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj '/CN=localhost'`
todo:

View File

@ -1,3 +1,14 @@
console.log(`
_ _ _ _
| |_____| |____ __ __ ____ _| |_ ___ ___ _ _ ___| |_
| / / -_) / /\ V V /(_-< || | _/ -_|_-<_| ' \/ -_) _|
|_\_\___|_\_\ \_/\_(_)__/\_, |\__\___/__(_)_||_\___|\__|
|__/
`);
import { existsSync,readFileSync, writeFileSync,mkdirSync,unlinkSync,rmSync,readdirSync} from "fs";
import gemini, { Request, Response, TitanRequest, NextFunction } from "gemini-server";
import { Sequelize, DataTypes } from "sequelize";
@ -100,8 +111,12 @@ app.use(async(_req: Request, res: Response) => {
} else {
if(_req.url.pathname.split("/")[3]==undefined){
let parsedGit
try{
parsedGit = await gitToJs(__dirname+_req.url.pathname)
} catch (e){
res.data("not a valid git page")
return;
}
let a:any = Math.random()
let cList = ''
for(let commit of parsedGit){
@ -352,7 +367,13 @@ app.on("/aboutme", (_req: Request, res: Response) => {
res.file("tmp/"+a+".gemini");
unlinkSync("tmp/"+a+".gemini")
});
app.on("/ascii", (_req: Request, res:Response) => {
let a:any = Math.random()
let t = readFileSync("./pages/ascii.gemini").toString().replace(/{domain}/g,_req.url.host)
writeFileSync("tmp/"+a+".gemini",t)
res.file("tmp/"+a+".gemini");
unlinkSync("tmp/"+a+".gemini")
})
app.listen(() => {
console.log("Listening...");
});