summaryrefslogtreecommitdiff
path: root/Biz
AgeCommit message (Collapse)Author
2025-09-05Implement Graceful Shutdown for Worker ProcessBen Sima
This commit adds robust shutdown handling for the PodcastItLater worker process. Key improvements include: - Introduce ShutdownHandler to manage graceful signal handling - Add checkpoints in job processing to support interruption - Reset stale jobs stuck in processing state on startup - Modify systemd service configuration for better process management - Implement interruptible sleep in main loop - Ensure current job can complete or be reset during shutdown
2025-09-05Add Duration Formatting Function with TestsBen Sima
Implement a new `format_duration` function to convert seconds into a human-readable time format. The function handles various duration scenarios, including minutes, hours, and mixed time representations. Added comprehensive test cases to validate the formatting logic, including edge cases and rounding behavior.
2025-09-05Add HTMX periodic updates for dashboard contentBen Sima
Implement periodic dashboard updates using HTMX to refresh queue status and recent episodes. This improves user experience by automatically updating content without full page reloads. Added a new endpoint `/dashboard-updates` to fetch and render updated dashboard components efficiently.
2025-09-05Filter Out Completed Queue Items in Admin ViewBen Sima
Modify the admin queue status view to exclude completed queue items. This change ensures that admins only see active queue items, reducing clutter and focusing on pending tasks. The filtering is done in-memory to maintain the existing database query method.
2025-09-05Refactor Login Flow and Improve User HandlingBen Sima
This fixes a bug where the 'pending' notification didn't show up in the main UI when a new user tried to register.
2025-09-05Refactor Admin view components and improve code organizationBen Sima
2025-09-04Refactor Admin and Database path stuffBen Sima
Moved the Admin related stuff to a separate file. Removed the repetitive `db_path` arg everywhere and replaced it with correct assumptions, similar to whats in other apps.
2025-09-04Add Default Titles for Queue ItemsBen Sima
Implement a migration to add default titles to queue items with NULL titles. This ensures that every queue item has a meaningful title, improving user experience and data consistency. The migration updates items with 'Untitled Article' when no title is present.
2025-09-04Add User Status Management to PodcastItLaterBen Sima
Implement user status tracking with pending, active, and disabled states. This allows administrators to control user access and provides a mechanism for approving new users before granting full system access. Added database migration, admin interface, and authentication checks to support this feature.
2025-09-04Add URL auto-select and clear on successful submitBen Sima
Improve user experience by automatically selecting the URL input when focused and clearing the input field after a successful submission. This reduces manual interaction and provides clearer feedback on successful form submission.
2025-09-04Add Episode Metadata: Author and Original URLBen Sima
Enhance episode tracking by adding support for author and original article URL. This allows users to see more context about each podcast episode, improving the overall user experience and providing additional information about the source material.
2025-09-04Add Job Cancellation Feature for Pending Queue ItemsBen Sima
Implement user-initiated job cancellation for pending queue items. This includes adding a cancel button to pending jobs, creating a new endpoint to handle cancellation, updating the queue status view, and adding comprehensive tests to ensure proper functionality and security.
2025-09-04Add Metadata Extraction for Podcast QueueBen Sima
This commit adds support for extracting title and author metadata from URLs when adding articles to the podcast queue. It includes database schema changes, migration logic, and UI updates to display the extracted metadata.
2025-09-03Add Environment-Aware Database Path HandlingBen Sima
2025-09-03Add Admin Whitelist and Access ControlBen Sima
Implement admin access control by introducing an email whitelist and restricting admin-only pages. Added an `is_admin()` function to check user permissions and modified admin queue status view to only allow whitelisted users. Includes error handling for unauthorized access.
2025-09-03Refactor Admin View for HTMX Auto-UpdateBen Sima
2025-09-03Rename "/queue-status" route to "/admin"Ben Sima
2025-08-28Remove email submission featureBen Sima
This requires either setting up my mailserver or signing up with Mailgun, and honestly I don't need either of those things right now. Just use the web submission, I can add the email submission feature later.
2025-08-28Prototype PodcastItLaterBen Sima
This implements a working prototype of PodcastItLater. It basically just works for a single user currently, but the articles are nice to listen to and this is something that we can start to build with.
2025-08-28Add instructions for PodcastItLaterBen Sima
This is a guiding architecture doc for aider.
2025-05-07Switch Python to unstable and add pydantic-aiBen Sima
Pydantic-ai is an agent framework that seems simple and good: well-typed with pydantic, tool usage is just an `@tool` decorator on a function, and so on. While building these I realized there were some deps they needed that were already in nixpkgs unstable, so I just switched to that instead of trying to backport all the versions and stuff.
2025-04-28Create EmailAgentBen Sima
I intend this to be a utility that agents or other automated jobs can use to send emails. EmailAgent isn't the right name... its really more of an LLM tool, or it could be if the right interface is put on top of it. Anyway, this works for now, I'll think about how to make it better later.
2025-02-06Update nixpkgs and stupid fixesBen Sima
Some things got through the CI system, probably during updates. So I had more stupid little fixes to do. I should really improve bild to the point that these won't happen anymore and builds don't take so long.
2025-02-04Update ollama, llm-ollama, openai-python, llmBen Sima
I couldn't use llm-ollama because it required some package upgrades, so I started going down that rabbit hole and ended up 1) realizing that these packages are way out of date now, and 2) fiddling with overrides to get everything to work. I finally figured it out, the `postPatch` in ollama-python was throwing me off for like half a day. Anyway, one thing to note is that these are changing fast and I need to either move onto nixpkgs unstable for python stuff, or maintain my own builds of all of these. Not sure which is more appropriate right now. Oh and I had to fixup some logging stuff in Biz/Storybook.py because ruff started complaining about something, which is weird because I don't think the version changed? But it was easy enough to change.
2025-01-21Move test runner to Omni/Test.pyBen Sima
Like the previous commit, this matches Omni/Test.hs.
2025-01-21Move Area to Omni/App.pyBen Sima
This matches Omni/App.hs, and I'll use it in future projects.
2025-01-06Remove Python main idiom and add coding conventions to README.mdBen Sima
I realized I don't need this stupid `__main__` convention anymore because my build system always calls Python programs like `python -m main`, so I just need to have a function named `main()`. I also started adding some general coding conventions to the README and fixed a typo.
2025-01-06Use x bit to identify buildable nix targetsBen Sima
This replaces the manually-curated nixTargets list in Bild.hs. Now any nix file that has the executable bit set will be built. I added run.sh shebangs to each of the buildable nix targets as well. When executing these, they will succeed at building, but they have no 'out' metadata, and so when run.sh tries to exec them, it will fail. This is fine for now. How would one go about execing a linux tree anyway? If all of the nix targets output something standard like a qemu image or a container, then I could have a standard wrapper that calls the image and starts the system. That might be the ideal way to have a runnable nix target. But this would require rethinking my infrastructure and how to deploy things, so I can't quite do that yet.
2025-01-02Switch to alejandra for nix formattingBen Sima
I mostly wanted a formatter that would format `inherit` blocks vertically, because otherwise they are super hard to read when diffing or even just editing. Both alejandra and the new nixos/nixfmt format verically like this, but alejandra has slightly better format (I guess) and for some reason nixfmt did not respect my `GLOBIGNORE` setting when doing `nixfmt **/*.nix` so it was trying to format stuff in `_/nix`, and failed. So anyway I went with alejandra. - https://github.com/kamadorueda/alejandra - https://discourse.nixos.org/t/enforcing-nix-formatting-in-nixpkgs/49506
2024-12-21Add shebangs and x bit to executablesBen Sima
With run.sh, we can build and run the file in one go. This means we can also use it as an interpreter in a shebang line and properly use the Unix executable bit. This is pretty cool and gives a few advantages: running any executable file is just `exec file.hs` or even `./file.hs`, finding all executables is `fd -t x`, you don't need to specify or know an `out` name to run something, execution of a program is standardized. There is a hack to get this to work. In C and Common Lisp, `#!` is illegal syntax, so I had to use shell syntax to invoke run.sh, call it on the current file, and then exit the shell script. Meanwhile, run.sh takes the file and evals the whole thing, building and running it. As long as either `//` or `;` is a comment character in the target language, then this works. Maybe a better thing to do would be to pre-process the file and remove the `#!` before passing it to the C compiler, like [ryanmjacobs/c][1] and [tcc][2]? However this won't work in Lisp because then I can't just load the file directly into the repl, so maybe the comment hack needs to stay. [1]: https://github.com/ryanmjacobs/c/tree/master [2]: https://repo.or.cz/tinycc.git/blob/HEAD:/tccrun.c
2024-12-21Build and deploy storybookBen Sima
I put the storybook into a new Biz.nix deploy target. The idea here is that any Biz/* targets should be hosted by this one VM for simplicity. Over time I can grow this as need be, but this should work to host a few services.
2024-12-21Async end-to-end Storybook workingBen Sima
I deleted the tests because they were overspecifying the functionality. My mistake was to try and build out the objects and endpoints before the end-to-end sync thing was fully working. And then I misunderstood how to do async with HTMX, I was overcomplicating it trying to create objects and endpoints for everything instead of just focusing on the HTML that I should be generating. This all just led to a clusterfuck of code doing all the wrong things in the wrong places. So far this is much better architected. And it turns out that using image n-1 with OpenAI's create_variation function doesn't work very well anyway, so I scrapped that too; I'll have to look into different image gen services in the future.
2024-12-21Add some mock tests of the Image endpointBen Sima
These were contributed in part by gptme, thanks!
2024-12-21Manage Storybook ImagesBen Sima
This adds the Images endpoint and related functions for loading and saving images to the filesystem. In the view layer, it also loads the images asynchronously using HTMX, so the images get lazy-loaded only when they are done generating.
2024-12-21Prune unused stuffBen Sima
This was all dead weight, just delete it and move on.
2024-12-21Convert Biz/Storybook.py to LudicBen Sima
This is basically a full rewrite. I ripped out Flask and rearchitected the whole thing to use fully RESTful resources and endpoints using Ludic. The UI was completely redone to use Ludic's components. I added tests for everything that I reasonably could. This is almost ready for an alpha launch. Before shipping it I still need to: 1. generate images using image n-1 applied to `openai.images.create_variation()` 2. write a nix service, get it on a VM somewhere, I'll probably provision a new VM for this 3. replace the `db` thing with a real sqlite database I only need the first one done to show it to Lia and see if she likes it, that should be completed in a day or two. Then the nix service and deployment won't take long at all. Setting up a sqlite database will be annoying, but that I can't see that actually taking more than 2 days. So max 5 days out from launching this to friends and family.
2024-12-21Implement storybook prototypeBen Sima
This paritally used gptme to create a storybook generator. The problem I ran into is that gptme doesn't do any architecting or considerations for maintainable code, or even readable code, so it just wrote a long script. I couldn't test it. Also, it didn't actually generate a 10-page story, it generated 10 separate stories. So, I ended up writing it myself and using gptme to fixup TODOs that I wrote along the way.
2024-12-21Test Python code with bild --testBen Sima
I had forgotten to add this feature, apparently, so bild --test just didn't do the test part.
2024-12-21Re-namespace some stuff to OmniBen Sima
I was getting confused about what is a product and what is internal infrastructure; I think it is good to keep those things separate. So I moved a bunch of stuff to an Omni namespace, actually most stuff went there. Only things that are explicitly external products are still in the Biz namespace.
2024-12-21Add my iPhone keyBen Sima
Hopefully I can use this with gpgme to code remotely.
2024-12-21Use newer ollama in system serviceBen Sima
Ollama releases often, and nixos-24.05 has a very old version, it was preventing me from doing work. Here I'm putting the newer nixos unstable as an overlay into the 24.05 version so I can backpull versions as needed.
2024-12-21Disable nixpertBen Sima
This domain is also expired... dang I really need to cleanup my dead projects.
2024-12-21Remove dragons.dev domain nameBen Sima
Yeah I let it expire... I am basically giving up on the idea but I'll keep the code around for now until I have time to comb through it.
2024-12-21Enable jack and wireplumberBen Sima
Trying to enable reaper and my microphone.
2024-12-21Enable efnet and zeronode irc networksBen Sima
I just wanted to connect to them and needed to fix these configs.
2024-12-21Enable the zsa voyager keyboardBen Sima
The voyager needed some special udev rules, and a program to do the flashing. I also made the barrier port explicit by moving to Ports.nix.
2024-12-21Don't auto-suspend-to-RAMBen Sima
I don't want the machine to suspend after some time period, instead I want to manually turn off the monitors.
2024-12-21Followup changes to ctagsBen Sima
These were just hanging around as I was doing other things. Included in this commit are the following: - Configure it in .ctags.d to only index the languages I use - Add support for sources listed in Sources.json - Fix broken link to inspekt3d repo
2024-12-21Set explicit srcs in hand-written bild buildBen Sima
I'm not sure when `lib.fileset` was introduced, but it allows me to easily create a source that can be unpacked by the `unpackPhase` which also maintains the directory structure. This means I can pass a subset of the whole repo to the builder, and changing an unrelated file (outside of that subset) won't cause a rebuild of bild, which wasn't the case before.
2024-12-21Rewrite mktags.sh to MakeTags.pyBen Sima
This makes tags for all third-party dependencies, and uses universal-ctags instead of fast-tags. It's so nice having tags for /everything/. It's also pretty fast, and caches the result for third-party deps anyway. Oh yeah this also added an explicit list of third-party Python packages. I need to filter the entire pkgset down to just the ones I'm using in order to make tags for them.