From 82742d5d13dc7b0691a79c79f8e62782fcb16e10 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Thu, 27 Mar 2025 12:52:11 +0300 Subject: Doing SQL (work in progress) --- README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..ca47fd4 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# What is this? +This is a URL shortener, a sort of a backend project practice. It uses GNU's +`libmicrohttpd` and `sqlite3` the database. The reason for me chosing +`libmicrohttpd` is simple: it's lightweight and does not have too much magic. +The reason for me chosing `sqlite` as a database is even simpler: it's fucking +based. + +Sadly, I think I might want to run this inside a docker container on my server, +because it's C after and I'm no expect on security. Maybe I'll run it in a +chroot environment, who knows. + +# Features +* Will try to process URLs in this order: +0. Checks if API endpoint exists at that URL, and if it does, and executes it. +0. Checks if URL is a shortened link name, and if it is, redirects there. +0. Tries to send a file at the location pointed to by URL (relative to + executable's location). +0. Tries to format file like this: `www/{URL}.html` and display the page \[e.g. + `/docs` -> `www/docs.html`\] +0. Returns 404 +* \[In future\]: uses `inotify` to track changes in `endpoints.so` and reload it +* \[In future\]: `SIGUSR1` makes it reload `endpoints.so` + +# API +Pretty small. See [html docs page](www/docs.html). + +# Build +## Requirements +0. `gperf` +0. `cc` +0. linker that supports `.ld` scripts +0. `libmicrohttpd` installed with headers available. +0. `sqlite` installed with headers available. +0. git submodules cloned ([c\_headers](https://git.twistea.su/cgit/c_headers)) +all of the paths can be configured in [`Makefile`](Makefile) +## Steps +`make` + +# License +AGPL. Sorry fellas, gotta stay free (as in "freedom"). + +# Contributing +[my email](mailto:sotov@twistea.su) + +I highly doubt that anyone whould contribute to this meme of a project, but you +know better, so mail me if you want. I accept modifications in code as tar'ed +archives of git repos. -- cgit v1.2.3-70-g09d2