add most importtant pages

This commit is contained in:
gnat 2024-09-01 14:29:08 -07:00
parent 823c6a1ac9
commit b098c63351
19 changed files with 476 additions and 5 deletions

2
.gitignore vendored
View File

@ -1,5 +1,3 @@
out/*
src/*
templates/*
files
scripts

View File

@ -1,12 +1,14 @@
(defun exec-command (command &key (env-vars nil))
(let* ((default-env '(("PATH" . "\"$PATH:./scripts\"")))
(combined-env (append default-env env-vars))
(full-command (format nil "~{~a=~a~} ; ~a"
(cd-command "cd ./site ; ")
(full-command (format nil "~{~a=~a~} ; ~a~a"
(mapcan (lambda (kv) (list (car kv) (cdr kv)))
combined-env)
cd-command
command)))
(with-open-stream (output-stream
(ext:run-program "/bin/sh" :arguments (list "-c" full-command)
(ext:run-program "/bin/bash" :arguments (list "-c" full-command)
:output :stream))
(with-output-to-string (result)
(loop for line = (read-line output-stream nil nil)

View File

@ -2,7 +2,7 @@
(load "html.lisp")
(load "exec.lisp")
(load "templates/page.lsp")
(load "templates/page.lisp")
(ql:quickload "uiop")

44
src/home.lisp Normal file
View File

@ -0,0 +1,44 @@
(defun html ()
(page "home" `((section ()
(p ()
"I'm natalie[ee]"
(br)
"$[find files/homepage-statements/* | shuf -n1 | xargs -I % cat %]"
(br)
"I am not sure what I am going to use this site for, it only exists because I was <del>procrastinating my calculus homework</del> bored one day"
(br)
"website homepage visit-counter: $[echo visit >> files/home_visit_counter; cat files/home_visit_counter | wc -l]"))
(section ()
(h2 () "particularly notable pages")
(a (:href "/html/site-info.html") "information about this website")
(a (:href "/html/natalie-info.html") "information about this natalie")
(a (:href "/html/blog/index.html") "there is a blog. I do not frequently use it.")
(a (:href "/html/random-thoughts.html") "arbitrary natalie thoughts. they are interesting, sometimes")
(a (:href "/html/cool-sites.html") "other webloci"))
(section ()
(h2 () "directories")
(span () ,(exec-command "find -maxdepth 1 -type d | sed 1d | sed 's/\\.\\///g' | xargs -I% echo \"<a href=%>%</a>\" | grep -v pycache | grep -v .git")))
(section ()
(h2 () "changelog")
(pre () ,(exec-command "cat changelog")))
(section ()
(h2 () "site file tree")
(p () "(as of last build)")
(details ()
(summary () "file tree hidden for brevity")
,(exec-command "tree . | sed 's/^\\./site/; s/─/-/g; s/├/|/g; s/└/\\\\/g; s/│/|/g' | sed '1i<pre>' | sed '$a</pre>'")))
(section ()
(h2 () "88x31 collection")
(span () ,(exec-command "for file in ./files/88x31/*; do (file -i \"$file\" | grep -qE 'image/') && echo \"<img src=\\\"$file\\\" width=88 height=31/>\" || cat \"$file\"; done | shuf")))
(section ()
(h2 () "post arbitrary data to be displayed here")
"yes, I do sanitize this" (a (:href "/html/albert-hack-1.html") "<del>(No you don't --sanitization tester)</del>") "yes I do")
(section (:class "ignore-section")
(form (:action "#" :method "post")
(label (:for "text") "post text:")
(input (:type "text" :id "text" :name "text" :required))
(label (:for "name") "username:")
(input (:type "text" :id "name" :name "name" :required))
(button (:type "submit") "submit"))
(div ()
"$[ls -r ./files/posts-to-homepage | while read -r file; do echo \"<div class=post>$(cat files/posts-to-homepage/${file})</div>\"; done]")))))

View File

@ -0,0 +1,14 @@
(defun html ()
(page "albert" `((section ()
(h1 () "a friend hacked my website.")
(p () "but how?"))
(section ()
(p () "
prior to me rewriting the backend of my website, there was a bug that would allow a bash command in a comment inside $[echo \\$\\[]] and not containing &lt; or &rt; to be executed if you querried the url /html/%2e%2e/files/posts-to-homepage/{post file}.
this was due to any url beginning with '/html/' being unconditionally put through parse_file(), which generates static content from the embedded bash in the html (see <a href='/html/site-info.html'></a>).
in addition to this, the source code of the server could be attained via a similar method, requesting the path of the file, but with /files/ or /html/ in front of it, followed by %2e%2e.")
(p () "
albert was able to exploit this by first getting the source code of the webserver via the second method discussed above, examining it, and deducing the first vulnerability mentioned above.
upon discovering the RCE available via the comment untrusted command evaluation, they were able to add an ssh key to my server and thus gain a shell.
amazingly, at the same time that they did this, my other friend's girlfriend (appearing in the comments as gexfan) was halfheartedly trying to mess with my site.
this ended with around 15 messages on discord telling me my site had been hacked, only around two of which were from albert.")))))

13
src/html/blog/index.lisp Normal file
View File

@ -0,0 +1,13 @@
(defun html ()
(page "blogosphere"
`((section ()
(h1 () "my subunit of the blogosphere")
"I do not know if I will use this, but I was bored and thus have made a blog system")
(section ()
(h2 () "posts")
(table ()
(tbody ()
(tr () (th () (p () "title")) (th () (p () "editted")) (th () (p () "posted")) (th () (p () "size")))
(tr () (th (:colspan 4) (hr)))
,(exec-command "for file in $(ls ./site/html/blog/posts --time=creation); do echo \"<tr><td><a href=\\\"/html/blog/posts/$file\\\">$file</a></td><td>$(stat -c %y site/html/blog/posts/$file | head -c 16)</td><td><p>$(stat -c %y site/html/blog/posts/$file | head -c 10)</p></td><td align=\\\"right\\\">$(numfmt --to=iec --suffix=B $(stat -c %s \"site/html/blog/posts/$file\"))</td></tr>\"; done | sed 's/\\\/\\\//\\\//g'")
(tr () (th (:colspan 4)))))))))

75
src/html/cool-sights.lisp Normal file
View File

@ -0,0 +1,75 @@
(defun html ()
(page "{adjective} websites" `((section ()
(h1 () "{adjective} websites")
(ul ()
(li ()
(a (:href "https://eightyeightthirty.one/") "eightyeightthirty.one")
"a graph of website badges.")
(li ()
(a (:href "http://lena.kiev.ua/") "lena.kiev.ua")
(li ()
(a (:href "https://www.webcoves.com/tgring.html") "transgendering")
"this one is interesting to explore.")
(li ()
(a (:href "https://he.net/") "he.net")
"I don't remember how or why I found this, but its home page is sort of cool.")
(li ()
(a (:href "https://ftp.cdc.gov/pub/GOODMAN/") "ftp.cdc.gov/pub/GOODMAN/")
"cdc saul goodman.")
(li ()
(a (:href "https://wiki.alquds.edu/?query=Main_Page") "wiki.alquds.edu/?query=Main_Page")
"weird wikipedia mirror.")
(li ()
(a (:href "https://lhohq.info/") "lhohq.info")
"who knows.")
(li ()
(a (:href "http://plaza.ufl.edu/virus86") "plaza.ufl.edu/virus86")
"a random ufl student's files sitting on some university server somewhere, for some reason.")
(li ()
(a (:href "https://www.cs.arizona.edu/icon") "www.cs.arizona.edu/icon")
"a cool programming language.")
(li ()
(a (:href "https://observatory.db.erau.edu/generators/signs/") "observatory.db.erau.edu/generators/signs/")
"warning sign generator.")
(li ()
(a (:href "https://adams.nrc.gov/wba/") "adams.nrc.gov/wba")
"nuclear regulatory commission agencywide documents access and management system.")
(li ()
(a (:href "https://owd.tcnj.edu/~hofmann/") "owd.tcnj.edu/~hofmann")
"random professor's homepage.")
(li ()
(a (:href "https://citrons.xyz") "citrons.xyz")
"this entity seems odd.")
(li ()
(a (:href "https://w3.pppl.gov") "w3.pppl.gov")
" i quite like the w3 subdomain of the princeton plasma physics laboratory.")
(li ()
(a (:href "https://eda.gay") "eday.gay")
" she owns less thinkpads than I do. brainwormed.")
(li ()
(a (:href "https://www.yourworldoftext.com/apionet") "https://www.yourworldoftext.com/apionet")
" buzzzzzzzzzzzzzzzzzzz")))
"this website compelled me to put it somewhere:"
(a (:href "https://citrons.xyz/a/memetic-apioform-page.html") (img (:src "https://citrons.xyz/a/static/apiopage.png"))))
(section ()
(h2 () "entities that I sometimes interact with physically")
(span ()
"winter: "
(a (:href "https://bunbun.dev") "bunbun.dev")
(a (:href "https://bunbun.dev")
(img (:style "float: right" :src "../files/88x31/bunbun.dev.gif"))))
(span ()
"odette: "
(a (:href "http://puppygirl.systems") "puppygirl.systems")
" Semi functional now")
(span ()
"albert: "
(a (:href "https://iso-9995-9.com") "iso-9995-9.com")
" (down? dns issue maybe)")
(span ()
"sam: "
(a (:href "https://hellzone.org") "hellzone.org")
(a (:href "https://hellzone.org")
(img (:style "float: right" :src "https://hellzone.org/src/images/88x31.gif"))))))))

7
src/html/discord.lisp Normal file
View File

@ -0,0 +1,7 @@
(defun html ()
(page "discord"
`((section ()
(h1 () "discord")
"as one who is not particularly partial to internet centralization, and seeing as I have had discord accounts get banned for seemingly nothing, I am nnot particularly fond of using discord."
"unfortunately, humans that I like speaking to use discord in large enough volumes that it is likely to be rather challenging to convince all of the ones I particularly care about to migrate to some other platform."
"this is not a very nice state of things."))))

69
src/html/my-laptop.lisp Normal file
View File

@ -0,0 +1,69 @@
(defun html ()
(page "laptop"
`((section ()
(h1 () "my laptop is rather haunted")
"see also: " (a (:href "/html/my-old-laptop.html") "old laptop")
"I am bad at using technology."
(br)
"this is not due to lack of technical ability, but instead due to the accumulation of unreasonable quirks over time in every computer I exert any degree of control over.")
(section ()
(h2 () "booting and the operating system")
(p () "I do not use a bootloader. "
"instead, I have a custom kernel build based off the arch kernel with filesystem and compression drivers such that I can boot straight from my kernel. "
"I also do not have an initramfs.")
(p () "technically, I don't use arch linux. "
"I use [a custom build of] the arch kernel and arch package repos, but actually run artix. "
"a function of this is that instead of systemd, I use openrc."))
(section ()
(h2 () "seat management and hardware issue mitigation")
(p () "I once thought it would be entertaining to remove elogind from my system. "
"of course, I still needed it installed as a library, but disabling it was trivial. "
"it was replaced with seatd for seat management and acpid to suspend my computer when I close the lid. "
"this worked for a time, however after a couple months of this setup, elogind inexplicably began to be started by my init system. "
"I do not know how or why, I did not change anything, nor is there anything matching 'elogind' in /etc/init.d/. "
"this was bad because it would interfere with acpid.")
(h3 () "the solution")
(pre () "~ &lambda; cat /etc/acpi/lid.sh
#!/bin/sh
cat /proc/acpi/button/lid/LID0/state | grep open && (modprobe i2c_hid_acpi) || (
killall elogind-daemon
rmmod i2c_hid_acpi
(test -e /home/catalie/.should-power-off) && s2ram)")
(p () "I overcame this issue simply by attempting to kill elogind every time I close the lid of my computer.")
(p () "you may wonder, why is it running rmmod i2c_hid_acpi every time it close its laptop's lid. "
"you see, the framework 16 has an issue in which the trackpad and keyboard are not properly barred from waking the computer from suspend while the lid is closed. "
"in addition to this, the screen can flex just enough to press a key or bump the trackpad. "
"this causes the laptop to wake in my bag and attempt to boil the contents of my backpack. "
"the keyboard waking the computer from suspend can be ammended by running "
(pre () "sudo acpitool -w | grep enabled | awk '{print $1}' | sed 's/\\.//' | xargs -I{} sudo acpitool -W {}")
"however, the trackpad is not in the list of acpi wakeup devices for whatever reason. "
"thus, upon the lid being closed, I simply unload the kernel module the trackpad requires and load it again upon opening the lid."))
(section ()
(h2 () "environment")
(p () "I use wayland, specifically hyprland. "
"this is unfortunate because it is bad software (this will be elaborated upon), but I like the special workspace system. "
"my status bar and notification system are written in gjs with ags. I resent this because it involves javascript, but oh well. "
"when libastal gets documentation, I will probably rewrite my ui in that. "
"my terminal emulator is my own build of st. "
"I have yet to find a good terminal that supports all the things I want for wayland, so xwayland it is."))
(section ()
(h2 () "keyboard")
(p () "unlike my previous laptop, I had the option to buy this laptop such that it came with a blank keyboard. "
"in accordance with this, I have not sanded my keyboard. "
"the framework 16 keyboard runs qmk, this is very nice. "
"the keyboard firmware is now hardcoded to be dvorak instead of using a custom console and xkb map. "
"on one hand this is nice because it means I do not need to edit xkb files to remap caps lock to control, but on the other hand if I plug an external keyboard in to my laptop, it will be qwerty and I will have to load my xkb map or type in qwerty. I can probably type in qwerty. "
"I need to remember to finish my keyboard config at some point. also, I should make the button that breaks the keyboard until I remove it and put it back in harder to press."))
(section ()
(h2 () "irregular bugs")
(ul ()
(li () "killing firefox kills my compositor what I would estimate to be 20% of the time")
(li () "killing firefox causes my headphones to disconnect what I would estimate to be 40% of the time")
(li () "no audio devices other than my headphones are recognized after boot until I run "
(pre () "unfuck audio"))
(li () "when displaying https://wiki.gnuradio.org/index.php/Embedded_Python_Block in any web browser, or a screenshot of this webpage fullscreen on my laptop in any wayland compositor, my screen starts flickering. it only occures with this page. unplugging my computer causes the flickering to reduce in frequency. this will not occur if my mouse pointer is not in the top 2/5ths of the screen.")
(li () "closing my computer causes network manager to become inoperable. it does not crash, it just stops working.")
(li () "closing my computer causes firefox to be unable to retrieve data regardless of if network manager is working")
(li () "sometimes, pipewire ceases to function. this typically happens after several days of uptime."))))))

View File

@ -0,0 +1,76 @@
(defun html ()
(page "laptop (old)"
`((section ()
(h1 () "my old laptop")
(p () "see " (a (:href "/html/blog/posts/new-laptop.html") "blog post") (br) "and " (a (:href "/html/my-laptop.html") "updated page"))
(p () "Currently, I am using a T530 that has been heavily modified. "
"I used to use a W530, but I fucked it up trying to get tianocore on it and haven't bothered fixing the bios on it yet. "
"I have preordered a Framework 16 because I am the definition of their target audience. "
"Since W530s and T530s are basically identical barring the mainboard, there is no external difference between my W530 and T530 because I just yoinked all the parts from the W530."
(br)))
(section ()
(image-column-container ()
(image-container ()
(flex-column (:style "margin-right: 10px;")
,(exec-command "img-caption \"/files/laptop-keyboard.png\" \"photograph of my laptop's keyboard, which is blank because I sanded it.\"")
,(exec-command "img-caption \"/files/laptop-radio.jpg\" \"The software defined radio that goes in my laptop's disc drive.\"")
,(exec-command "img-caption \"/files/keybinds_graph.png\" \"Graph of my keybindings, they are hard to see\"")
,(exec-command "img-caption \"/files/laptop-charger-barrel.jpg\" \"charger barrel size adapter sticking out the back of my laptop\"")))
(text-column ()
(p () "I have put an unreasonable amount of time in to messing with my laptop and as such am equally unreasonably proud of it."
(br))
(h3 () "Hardware modifications I have made to my laptop:")
(p () (ul ()
(li () "Installed an older model's keyboard")
(li () "Sanded the keyboard such that it is blank.")
(li () "Upgraded most of its parts.")
(li () "Put an SDR in its disc drive")
(li () "Replaced the charging barrel with a worst bodge ever contest finalist because I left my charger at school for a weekend once and wanted to use my laptop."))
"Additionally, I have written a custom xkb file. Unfortunately the geometry file hasn't been updated since I modded in the new keyboard, but here it is anyways:"
(br))
,(exec-command "img-caption \"/files/laptop-xkb-geometry.png\" \"my xkb geometry file compiled to a pdf\"")
(p () "Disregard the fucked up escape key, I was messing with it earlier. My keyboard isn't that notable beyond binding control to caps lock and binding the old control key to mode_switch. "
"Additionally, when mode_switch is pressed while an alphabetic key is pressed, it types a greek letter instead.")
(p () "I run artix (for the anti systemd meme), though upon getting my framework I intend to switch to gentoo. "
"I use i3 as my window manager with a somewhat cursed script to programmatically generate its config from a yaml file. "
"This script is vaguely necessary because"
(ul ()
(li () "I wanted a (programmatically generated) graph of all my keybinds as leaf nodes with different modes as trunk nodes and individual keys as edges")
(li () "I wanted to easily nest an arbitrarily large number of modes without it being a hassle"))
(br)
"an example of the function of this script is something like"
(br)
(br)
(div :class "code-container"
(div :class "io-container"
(h3 () "Input (yaml):")
(pre () (code () "
keybinds:
a: !Mode
name: a
keybinds:
b: !Mode
name: b
keybinds: ...")))
(div :class "io-container"
(h3 () "Output (i3config):")
(pre () (code () "
mode a {
bindsym b mode b
}
mode b {
bindsym ... ...
}
bindsym a mode a")))))
(p () "From the yaml config, my python script can parse it either into a (really bad) graph of keybinds (using the graphviz library or something like that) or into a valid i3 config file. "
"In my real config, I have a mode 'base' which is the default mode with no keybinds other than mod4+space, followed by a mode 'space' reached by pressing mod4+space. "
"From 'space' mode, other modes may be accessed, such as 'workspaces or windows' mode, bound under w. "
"This gets rather absurd (intentionally so) very quickly. "
"The combination to move to workspace 0 while in 'base' mode is to press mod4+space ('space' mode), w ('workspaces_or_windows' mode), s ('workspaces'), g ('workspaces_goto'), 0 (move to workspace 0).")
(p () "This system results in horrible user experience (but I don't care), great security (close to least intuitive setup possible), and—most importantly—an incredibly stupid graph of keybinds. "
"I find this unreasonably amusing.")
(p () "to my endless amusement, I may be partially to blame for the niri compositor having keybinding modes")
,(exec-command "img-caption \"/files/niri-dev-keybind-graph.png \" \"YaLTeR, the niri dev, seeing my keybind graph and deciding to implement keybinding modes\"")))))))

View File

@ -0,0 +1,42 @@
(defun html ()
(page "natalie info" `((section ()
(h1 () "what is a \"natalie\"?")
(span () "I am <a href='/html/natalie-sightings.html'>natalie</a>. obviously.")
(p () "words are not a thing I am good at. this is exacerbaited when the words are about myself."
"despite this, I shall attempt a suitable description of myself.")
(br)
"ideally, I am to be referred to as an \"it\" or a \"she\". the former is preferred to some degree" (br)
"timezone I am in: " (exec-command "date +%Z (UTC%z)") (br)
"age: $[echo $(( $(date +%s) - $(date -d \"2007-04-01\" +%s) ))] seconds. that is $[echo \"scale=8; ($(date +%s) - $(date -d '2007-04-01' +%s)) / (365.25*24*3600)\" | bc] [earth] years." (br)
"I am kind of a college student. it is complicated. I will be a college student with less complicated circumstances by fall of 2025, barring unforseen circumstances." (br)
"I like systems. particularly ones that have reasonably consistent behavior based on a set of rules. this is omnipresent in my interests." (br)
"list of interests (incomplete):"
(ul ()
(li () "technical computer things, so long as they do not involve javascript")
(li () "infrastructure, particularly pertaining to trains")
(li () "languistics, especially conlangs")
(li () "key making and lock picking")
(li () "math"))
"things that I enjoy:"
(ul ()
(li () "friends")
(li () "going on long walks")
(li () "utilizing public transportation")
(li () "train tracks"))
"things that I find displeasing:"
(ul ()
(li () "grease or oil on my skin")
(li () "non friend people")
(li () "ultraviolet radiation")
(li () "busywork")))
(section ()
(h2 () "somewhat irregular natalie facts")
(ul ()
(li () "I own 12 thinkpads, all of which were manufactured prior to 2014")
(li () "the number of people that can effectively use my computer is, to my knowledge, 1 (me)")
(li () "I can replace the screen on my first generation iphonen se a1662 in 70 seconds")))
(section ()
(h2 () "contact information")
(a (:href "/html/discord.html") "discord: _natalieeee_")
"email: natalie at natalieee.net" (br)
"xmpp: nat@natalieee.net"))))

View File

@ -0,0 +1,9 @@
(defun html ()
(page "natalie sightings" `((section ()
(h1 () "natalie sightings")
(p () "these are reasonably rare"
(br)
"these photographs are uneditted, some of the cameras that were used to take them are simply quite bad"))
(section ()
(flex-grid () ,(exec-command "for file in files/natalie-sightings/*; do echo \"<flex-grid-item>$(img-caption \"/$file\")</flex-grid-item>\"; done"))))))

View File

@ -0,0 +1,6 @@
(defun html ()
(page "natalie \"thoughts\"" `((section ()
(h1 () "arbitrary thoughts generated by natalie")
"I am bad at thinking of things to make blog posts for. this webpage might contain things that I would put in a blog post if I was more proficient at writing filler. it might also contain other things.")
,(exec-command "for file in ./html/thoughts/*; do echo $(grep DATE $file | awk '{print $3 $4}') $file; done | sort -k1,1 -r | cut -d' ' -f2 | while read -r file; do echo \"<section><details id='$(basename $file)'><summary>$(grep '^<!-- DATE:' $file | sed 's/^<!-- DATE: //; s/-->$//; s/.$//'): $(grep '^<!-- TITLE:' $file | sed 's/^<!-- TITLE: //; s/-->$//')</summary><div>$(include $file)</details></section>\"; done"))))

View File

@ -0,0 +1,25 @@
(defun html ()
(page "server migration"
`((section ()
(h1 () "this website runs on a big server now")
"it used to run on a dell optiplex 3040 I had laying around, but I got a server from the school basement (you can just take their servers, apparently).")
(section ()
(image-column-container ()
(image-container ()
(flex-column ()
,(exec-command "img-caption \"/files/natalie-holding-server.png\" \"me holding the server I got from the school basement\"")))
(text-column ()
(h2 () "why do I have a server from my school's basement?")
(p ()
"at the time, my school was at a temporary campus while our regular campus is being remodelled."
"I hope this means there will be less lead in the water when they are done, but given how the district is, who knows."
"The current campus is notably smaller than the regular campus, thus a large amount of things are in storage."
"The man who is in charge of the storage and moving stored items back to the new campus does not like moving items."
"For this reason, when I ask him to let me in to the school's basement to just take random cool things, he says yes.")
(h2 () "it is kind of horrible that I have this server")
(p ()
"this server used to be part of the district's network infrastructure.
when I got it, it had an unencrypted raid array on the disks that contained district information.
it should not have been stored like this, and I definitely should not have been allowed to take it.
I did of course wipe the drives and didn't even look at what was on them beyond identifying that it was from the district because I am not evil.")))))))

48
src/html/site-info.lisp Normal file
View File

@ -0,0 +1,48 @@
(defun html ()
(page "site info"
`((section ()
(h1 () "information about this website"))
(section ()
(h2 () "/(.*\\.)?natalieee.net/")
(h3 () "why?")
(p () "I was displeased with my former status of not having a website")
(h3 () "how?")
(p () "requests to /(.*\\.)?natalieee.net/ get routed to nginx, which acts as a proxy for my subdomains. "
"nginx routes requests to /^natalieee.net/ to this webserver, which is named "
(a (:href "https://git.natalieee.net/nat/sludge") "sludge") ". "
"requests to /.*\\.natalieee.net/ are routed according to the /.*\\.natalieee.net/ section."))
(section ()
(h2 () "/^natalieee.net/")
(p () "the root domain of this website, which you are currently observing, is running sludge. "
"the colors of both the light and dark mode are based off of the colorscheme of my laptop."))
(section ()
(h2 () "sludge")
(h3 () "what is a sludge?")
(p () "s[ite][k]ludge is my from-scratch webserver. it has features.")
(h3 () "why?")
(p () "I dislike \"web development\". also, I was bored.")
(h3 () "what does sludge do?")
(ul ()
(li () "send data")
(li () "receive data")
(li () "process data")
(li () "create new data")
(li () "move data")
(li () "coerce data[types]")
(li () "other verbs prepended to data"))
(h3 () "how does sludge?")
(p () "sludge receives requests for paths. if these paths are in the routing table, it determines what it should respond with. "
"generally, if the path starts with /html/, it will read an html document from the filesystem. "
"following this, it will locate any instance of \"{key}\" and replace these instances with a value determined by a function associated to the route being requested in the routing table. "
"after substituting these values, it will find any instances of the pattern \"$[echo \\$[...]]\", where ... is a valid bash expression. "
"for each match, it replaces the original matching text with the output of said text executed in bash. "
"this functions as a static sight generator. an example of this is the headers on this site, which are included via the following expression: \"$[echo \\$[include ./html/header.html]]\"")
(p () "sludge also has the ability to apply arbitrary edits to outgoing data prior to said data being sent, but after it has been generated. "
"you may observe this "
(a (:href "?uwu=true") "here") "."))
(section ()
(h2 () "/.*\\.natalieee.net/")
(ul ()
(li () ,(exec-command "make-link https://git.natalieee.net") ": Gitea instance. You may use it if you feel so inclined for some reason. I wouldn't.")
(li () ,(exec-command "make-link https://dns.natalieee.net") ": Pointless CNAME record to my main domain so that entities using my dns (A number greater than 0!) can put dns.natalieee.net down as their nameserver instead of natalieee.net."))))))

9
src/html/stats.lisp Normal file
View File

@ -0,0 +1,9 @@
(defun html ()
(page "woah, data"
`((section ()
(h1 () "stats! data! wow!")
"boring information about me and my computes, delivered right to your web browser (or terminal)!"
"why collect information about your users when your users could collect information about you?")
(section ()
(h2 () "information:")
,(exec-command "for line in $(cat sludge/src/lib/router.py | grep Route -A1 | grep '/stats/' | sed \"s/'//g; s/,//g\" | cut -d= -f3); do echo \"$(make-link $line)\"; done")))))

5
templates/footer.lisp Normal file
View File

@ -0,0 +1,5 @@
(defun footer ()
`(footer ()
"page rendered at $[date +%s]"
(br)
,(exec-command "include files/88x31/natalieee.net.html")))

14
templates/header.lisp Normal file
View File

@ -0,0 +1,14 @@
(defun header ()
'(header ()
(nav ()
(ul ()
(li ()
(h1 () "$[(for i in {0..10}; do echo natalieee.net; done; echo catalieee.net) | shuf -n1]"))
(li ()
(a (:href "/") "home"))
(li ()
(a (:href "..") "back"))
(li ()
(a (:href "/html/site-info.html") "site info"))
(li ()
(a (:href "/html/natalie-info.html") "natalie info"))))))

15
templates/page.lisp Normal file
View File

@ -0,0 +1,15 @@
(load "./templates/header.lisp")
(load "./templates/footer.lisp")
(defun page (title html)
`(html (:lang "en")
(head ()
(meta (:http-equiv "content-type" :content "text/html; charset=utf-8"))
(meta (:name "viewport" :content "width=device-width, initial-scale=1"))
(link (:rel "stylesheet" :href "/style.css"))
(title () ,title))
(body ()
,(header)
(main ()
,html)
,(footer))))