Ephes Blog

Miscellaneous things. Mostly Weeknotes and links I stumbled upon.


Weeknotes 2022-01-17

, Jochen
Lots of PCR-Tests and running around last week. But still being lucky to maintain a positive attitude and negative test results. My streaming schedule is still out of order. Did one stream Tuesday evening and one early on Saturday morning. Displaying chat messages in the stream is now routine - ok, not quite, still have to connect my discord server.

Managed somehow to record and produce a new python podcast episode about htmx, which is not yet released because of reasons, therefore the link is not working yet. For my podcast hosting SaaS, I'm planning to use htmx to show deployment progress to users trying to register a new podcast. I already have a vue app in fastdeploy showing deployment events via a websocket connection, let's see how much worse / better it will be using htmx. To make this possible I had to introduce a new endpoint in fastdeploy making the deployment events of a deployment available using plain http without a websocket and allow authentication via just a service token.


Articles

Software

Twitter

Podcast

Talk


Weeknotes 2022-01-10 Changed Streaming Schedule

, Jochen
During the last week, I switched from starting my programming stream around 10 am to 8-10 pm. I had to configure artificial lighting and broke a lamp on the first evening. My setup still needs some fine-tuning.
 

For my podcast hosting SaaS project, I thought about how to deploy a single new podcast and how to integrate this with fastdeploy. Should the podcast hosting app itself create a the database and configure systemd? Should fastdeploy do it? Usually, you would need to have different service tokens for each new podcast in fastdeploy. This clearly needs some redesign. But I think I'll go for something like that:

  1. User submits desired domain name
  2. Podcast registry starts a deployment for the cast_hosting service providing a config including username, token to update the registry, etc.
  3. After cast_hosting is successfully deployed it sends a register/password change URL back to the registry to let the user in

Articles

Twitter

Podcast

Talk



 

Weeknotes 2022-01-03 fastdeploy

, Jochen
Well, I skipped the last two month's weeknotes because I couldn't bring myself to write them. I'll try to be more consistent doing this in 2022 :).

My little side project fastdeploy is now good enough to use it for my needs, so I'll switch back to other things, mainly building a podcast hosting app on top of django-cast. We also released a new podcast episode about refactoring on new year's eve, which we recorded earlier in December.

Funny Quote: Time flies like an arrow. Fruit flies like a banana.


Small Improvements

  • Switched to delta as a git pager
  • Started to use a brewfile to keep track of my installed packages via homebrew and store it in a dotfile repository
  • Build a service for fastdeploy that installs some command line tools (bat, fd, fzf) and changes the root users shell to fish
 

Articles

 

Software

 

Podcast Episodes


Weeknotes 2021-11-01 FastAPI and Vue

, Jochen
Seems fastdeploy is getting ready soon. At least the backend part :).


Fastdeploy Backend

The backend consists now of four models:
  • User - for users logging in via username/password using the web interface
  • Service - a thing that should be deployed from a source code repository to a running application
  • Deployment - information about an deployment like when and who started it etc..
  • Step - step towards a finished deployment, create user x on machine y, for example creating a user or database

Simplified ER-diagram

Authentication/Authorization

For all things related to showing content in the SPA you need an user token. As a user you can also obtain an service token which is only useful for being able to start a deployment for a specific service. You can use a service token for starting a deployment using the webfrontend or you can take a service token and add it to a github action which then could trigger a deployment after a push to some branch has happened. But you cannot do anything else with a service token but start a deployment for a specific service. The deployment process uses a deployment token which is generated when a deployment starts which allows it to communicate back the deployment task results for a specific deployment to the application server, but nothing else.


Fastdeploy Frontend

It's a vue SPA which get's notified about deployment events / steps via a websocket connection. The client communicating with the application server is a vue plugin and accessible to all components.

Things I Looked at Last Week


Weeknotes 2021-10-25

, Jochen

I predicted fastdeploy to be done in two weeks, but it's not. Seems I have to spend a few more days on that. But all major obstacles are resolved, so I'm still pleased with the progress.

Fastdeploy Backend

Worked on getting database tests running with FastAPI and SQLModel and it was not that easy. What I would have liked to have is that after each test the database is rolled back into the same state it had before the test ran. This is the default behaviour when using pytest-django. But I couldn't get it to work. I ended up dropping and recreating the database after each test (which is not bad as it sounds, because my test database is only a small sqlite file), but this is not an elegant solution, to say the least.


Fastdeploy Frontend

I had to find out, you cannot use an "authorization" hader with an JWT payload for websocket authentication, because you can't set custom headers for websocket connections.  Then I played a little bit around with list transitions in Vue.js and this was quite fun :). Used a vue plugin to make the http client awailable in my vue components. Struggled a little bit with async methods on the client (`this`was available in sync methods but not in async, wtf?). Used a navigation guard from vue router to redirect users to the login component when not authenticated.
 

Things I Looked at Last Week