Stephen Castro-Starkey

tag: coding

There is a ton of infrastructure I built around the old lean coffee app that relied on Selenium WebDriver. Now that I’m developing on Linux for the first time and struggling with it, I’m realizing I should probably throw all that away. Spent many hours trying to figure out why my tests wouldn’t run at all.

I feel like a return to simplicity is in order.

I’ve been thinking a lot about authentication in My Cafe. It’s starting to look like you will register/logon using your email address, and then afterwards you can add a passkey so you can login that way if you want to.

Almost done implementing email based authn!

Feeling a bit down lately. But maybe that's just sleep deprivation? Have made some small edits to my legacy lean coffee app in preparation for bringing a few friends down memory lane as we consider rebuilding it! Or maybe I'll find a way to hack up the old one to make it easier to self service? Not sure what I want to do really. But, I'm certain I don't like compiling JavaScript. Ha!

Visit the old app if you want!

The new cafe app is coming along nicely. Just copied over the site config code from My Life and tweaked it a bit to correct some sins I've discovered. Next up: authentication!

Earlier I wrote that I would try out SuperTokens. Sadly, I don't think I want people to have to manage multiple server processes, and they require a backend written in either golang, nodejs, or python. Our backend is Java-based. Guess we'll have to try something else!

Small update to the blog -- I no longer show my daily activities on the front page. You'll need to click through to one of the categories to see all that stuff.

I was kind of proud of how easy it was to add this feature -- it's a mix of code and template magic, so I was able to deploy the code without any behavior. Then I updated the home page template and it showed up!

My Life Experiment

My blog is now running on aleph instead of jetty. Interestingly, it uses up a lot more memory. Capping the heap at 340m makes it performant enough. Was able to cap the jetty implementation at 192m.

Perhaps it is more resource efficient in other ways? You can see what I had to change.

I might try out yada next. But it seems to be a lot more opinionated.

My brain is currently noodling on why I’m using nginx to route traffic to fossil and so forth, while simultaneously allowing mylife to host its own SSL cert, thus losing out on tracking which IP is hitting the app at any given time. Looking for alternative approaches! I don’t want to go deeper into virtual networking but I may have to!

My Life Improvement

Today's work on My Life revolved around making it easier to log in and stay logged in. I realized my phone was purging session cookies basically every day, so I changed the cookie management to set explicit expiration dates. And extend those expiration dates every time you use the app. Therefore, so long as you keep using the app you won't get logged out.

more inside...

Made a bit more progress on "New Activity" -- had to refactor the front page to have a "new..." link instead of separate links for each "new" thing I could do. It just didn't look good on mobile! On the new options page I'll add "new activity" or just put the activities directly there. Not sure!

Almost ready to wire up the activity code to the UI! Soon I'll be able to configure and execute recurring activities.

Today's Activities

The morning as a bit stressful with a tornado warning but all is well. Did some things today:

  • ✔ Rowing
  • ✔ Standing Meditation
  • ✔ Wrote some code in My Life to set the foundation for tracking recurring activities (habits)

I can now export the entire blog, including page and post edit history. Very happy about that! I'll still keep my pages checked in so I can easily use a fancy editor to modify them, at least for now, since I'm still stuck on not having any JavaScript.

I now have a local Nexus repository running that allows folks to download the docker images I publish for My Life. However, the links are all wrong because I don't have it configured properly. It'll get there! I hope? :-) Will set up a link to it soon as I have it all figured out. Or shut it down because it isn't worth it. Likely this is a path I didn't need to tread down, as nobody really wants to run this software anyway except me!

Did a bit of research on what it takes to host the container images for My Life today. It wasn’t the easiest thing in the world! And that’s basically all I accomplished today. Did have some fun playing Baldur’s Gate 3 with my best buddy though! So, a bit of coding and a lot of rest.

Feels fine. :-)

Need to get back on track and find a smaller bite to take.

We have upgraded to JDK 21! I attempted to make this thing work with native image compilation using GraalVM, but that failed miserably. I didn't try too hard, so maybe if I did somehow find the energy to build that skillset it would happen later?

re: https://notes.jatan.space/2023/12/20/im-so-happy.html, I agree, but I wish it was easier to build small apps that you can self host that also federate. I'm doing an experiment using just IndieWeb constructs and avoiding ActivityPub because of how ill defined it is. Fingers crossed it goes somewhere!

I never thought I would find a way to test the job scheduler but when I broke it and didn’t notice for a day I realized I had better! So I did.

Wrote a unit test to validate all the schedules generated a next time to run successfully. That made me feel quite safe!

So I guess that five minute task actually took a bit longer. ;-)

How dare my family interrupt my coding with trips to beautiful places in Colombia?

Cache invalidation continues to be a bane. The charts don’t change when the day goes on. Ha! But I keep learning as I use my software. Kind of fun!

Finally added time zone support to the app so now my blog is displaying Eastern Time instead of GMT. You’re welcome. 😜

There was one issue with webmention receipt that I found when testing in production. It had to do with using a function that relied on the internal domain/port setup, which was not the right thing to do. Only worked while testing locally. Fun times! Anyway, it should now be working!

It is surprisingly complex to receive webmentions, at least if I want to display some useful information about them on my posts. Have been working on it all day!

So far I can parse some simple microformats2 info and may fall back to open graph if I don’t find anything. Generating a unique ID requires my first use of crypto (for generating hmac hash of a webmention).

Just gotta store them and then build the white / black listing logic. And finally attaching the approved ones to the correct post and rendering them.

Also, cache invalidation is the bane of my existence. There is something to be said about a blanket content cache. Much simpler than what I’m working with. Perhaps in the rewrite of tagging I will switch to that! Not sure.

We have tags!

Sort of.

Ok so I have written some code but not checked it in. This is what I suppose I would call a “spike solution” but with a fun twist that it’s running against a production database. No idea how that will break things if I roll the code back!

I don’t want to roll it all back. But it wasn’t test driven! So I gotta try test driving it so I don’t miss anything. It was a LOT of functionality.

Also I need it to keep me logged in longer on iOS. Not sure why the sessions don’t last as long.

Feels like the language and stack I picked make it want to be a multi tenant thing instead of many small things running independently.

That is if I want to minimize electricity waste! Will need to see how much memory it takes to run this thing and do some thinking.

Aaron has some adorable kitties! This makes me want to be able to upload images to my blog now so I can post some more photos of our babies.

By the way, I need to thank him for his patience as I fumble around with all this microformats stuff!

Sometimes I test in production and things go horribly wrong. Today was one of those days. Thank goodness I was using a bitemporal database! Today, I needed to rewind history on all my blog posts while testing sending of webmentions as I was accidentally overwriting the creation time of a post when setting a flag that I had successfully sent all its webmentions. Lesson learned!

Side benefit -- I now have the ability to show the history of a post and so forth. Sometimes taking off the safety net forces you to garner unexpected benefits. Of course, one must also have made good decisions leading up to the moment of removal of said safety net. 😅

all 351 entries

Work in progress

This site is part of a larger effort to bring more of my digital life "in-house" so to speak. So when something goes wrong I have only myself to blame. Ha!

You can follow along!
No content on this site was generated by AI