toiling toiling
back to indexback to homei have been hard working on this computer girlies.... i've been wanting to get back into gemspace for a bit and smolnet stuff in general. i wanna use it as an opportunity to be social and stuff, sharing my thoughts and writing cool things to put out there. but a big part of it for me too is i'm really interested in the technical side of things and it's easy for me to get so bogged down by it that i never actually get around to writing things down. so! the project i am working on right now is a teminal-based gemini browser. but i am making the effort to put it down for long enough to actually write the damn gemlog
which is to say. i put it down for long enough to set up a gemini server
i started with setting up a local gemini server on my freebsd laptop, because that's where i'm developing the browser on, and i wanted a local server for protoyping that. i chose gmid, which installed really easily thru pkg, and even installed a nice man page. then, when i decided it was time to start working on an actual capsule, i switched to my debian laptop, which is moreso my daily driver. same idea there, i set up a local server, this time with the goal of actually hosting and testing the capsule locally before sticking it on the internet. it wasn't in my package manager, so i had to manually install it and add some dependencies and stuff, but it still worked great. i really like this software, it's nice to configure.
then i set up a git repo on my VPS, where i'd be hosting the server. i fiddled to get both my laptops to push to it, and set up a githook to get the VPS to keep the capsule's root directory in line with the repo, so i don't have to ssh into my server just to add a gemlog. i also took the opportunity to make my ssh passwordless, which for some reason i hadn't done. it uses ed25519 now, because one person on the internet said it's better or something. probably this metric of choosing how to handle cryptography is a larger security vulnerability than password-based ssh access
when i tried to install gmid on my VPS though, which runs ubuntu, it was a big mess and i couldn't get it to work. installing the dependencies gave me a lot more trouble, a c header file was missing, and once i finally got everything built, it just didn't work and idk why. i gave up and switched to molly-brown, as that's what i'd previously used to host a gemini capsule. probably for the better anyway since gmid gets mad if it's not run as root, which i wouldn't wanna daemonize, but it really is great at least for those local servers. kinda a shame. regardless, molly-brown wanted a little more tinkering, but it was nothing cryptic and it's working great now (assuming you can read this!)
but the point of all this is i wanna make a gemini browser :3
i'd previously tried and sorta failed to make a terminal-based gemini browser. it was this really pretty thing i did up in python with curses, which in the end i got to the point of being very functional. but as i got there i realized i didn't really like the direction of the design. it was kinda too souped up and in the end a pretty graphical looking thing
but anyway.. now i'm a little wiser and maybe even know what i'm doing sometimes. it's time to try again, with different design goals. the idea with this thing, basically, is that my freebsd laptop doesn't have a desktop environment installed, and i intend to keep it that way. it's the subject of its own gemlog, but i wanted to experiment with having a computer that doesn't have a desktop environment for various reasons, and one of my goals is to see how viable i can make it as my daily driver. i'm really at a point now where on my linux machines, i'm much more comfortable at the command line than dealing with graphical interfaces when possible. so i do use the terminal for a lot of my "utility" stuff, but i wanna push myself into using it also for more recreational and social stuff. and i could find software that does this already, but this is something fun i can build myself.
but i'm bad at prototyping
i get too bogged down with projects to finish them. and the way i make them, it seems like they aren't usable until the end. especially in this case, that kinda sucks, because i wanna have a working prototype to actually use while i'm still developing it, and to test it out and such. i also just wanna have fun with it, and don't wanna be missing out on gemini space because i'm too busy trying to perfect the software i wanna use to engage with it.
so.. part of my gameplan with this is that i don't wanna do what i always do, which is picking a target language and developing in that from day one. instead, i wanna do quick and dirty prototyping in one language at a time and move on to the next language. what i'm trying is going from sh to python to C. if i can't get it done in C though then so be it, i do like python a lot, too.
what i'm basically looking for is a vim-style interface. scrolling up and down like less, with the little ":" prompt at the bottom to bang out quick one-letter shortcuts or longer commands. links get numbered and are followed by using the number in the prompt.
messing about with a shell script, it's only a couple lines to get the basics of browsing down with openssl.
#!/bin/sh
uri="gemini://$1"
host=$(echo "$1" | sed s/\\/.*//)
echo "$uri" | openssl s_client -quiet -crlf -connect "$host:1965"
magic :3
at this point i wanted to make it browsable with like. link following, and bookmarks.. so my idea here was spin up a local gemini server, have a bookmarks.gmi page and a history.gmi page. every call to the shell script adds a link to the page you're at to history.gmi, and a simple command adds the last line of history.gmi to bookmarks.gmi
following links is a lot more convoluted; entering a command with the link number causes it to repeat the last request in history.gmi, pipe that into grep to find the link you selected, parse that and make *that* request on your behalf. in the end this was a really ugly pipe! definitely the whole thing is a lot more functional now. but it's also jankier and about a page long instead of four lines, so i started moving it to python
my initiral idea was to trim the shell script down to these four lines again, and pipe those into python to work on the UI before starting the actual networking stuff. but i think there's some weirdness with handling input when you pipe another process into python or something. so i scrapped that, and will work on the networking stuff in python next. it shouldn't be too bad, it's stuff i've done before. it really bogs me down trying to do that stuff in C though, since i'm only much more recently learning C and all the pointer dereferencing stuff ties my brain in knots....
that's where i'm at now though! maybe tomorrow i'll work some on setting the browser up to make the actual internet requests.
back to gemlogback to home