Ephes Blog

Miscellaneous things. Mostly Weeknotes and links I stumbled upon.


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


Weeknotes 2021-10-18

, Jochen

Started a small new project to be able to automatically deploy my podcast hosting infrastructure called fastdeploy. It's a little bit different because I want to be able to try hot and experimental stuff in this project. Therefore I didn't use good old boring django but fastAPI as the backend web framework and Vue.js / Vite for the frontend. I also switched my IDE for this from PyCharm to Visual Studio Code to be able to use it for both python and typescript. For backend dependency management I switched from poetry to pip-tools. So lots of new stuff :).

One of the reasons I chose fastAPI for this project was that it has builtin support for async and websockets. And getting Vue.js and fastAPI to communicate over websockets was easier then expected. Getting vue components to communicate via props and events was a little bit more difficult especially when using <script setup> and typescript, but now it works quite nice.

Adding authentication capabilities to fastAPI was more difficult then expected. Had to refactor the fastdeploy project structure a bit (settings, router) and I feel more comfortable with it.

Things I Looked at Last Week