Build Log #2 - Refinement
April 28, 2025
🛠️ What I Worked On
These past two weeks efforts have been focused on refining what I already had and making them better here and there, as well as adding some new bigger features too.
📃 Application Logs
This was a pretty straight forward addition, although it still needs a lot of testing. As I'd already added a streaming endpoint to Tugboat, all that was left to do was connect to the endpoint from the frontend and stream them into a div.
It's nothing crazy but it works, I'll probably find some issues with it later on in testing.
⚓ Tugboat Card
I decided that Tugboat should be a separate bit of information on a Server's overview page as it's not just another container but the orchestrator of everything else on a User's server so it got moved to it's own card. Again, I kept it simple by just showing the status and the last heartbeat time from Tugboat.
Additionally, I added a scheduled job that checks for any heartbeats that were over a certain threshold (i.e 3 minutes) and sets those servers to an offline status in the database, further down the line I'll add in notifications here too.
🚀 Start/Stop Tugboat via SSH
This may extend to all containers in the future, however during the build process I've been switching Tugboat on and off manually via SSH'ing into a server and starting the container. Now, if a server is marked as "Offline" due to an expired heartbeat then a "Start" button shows on the Tugboat card that triggers a job to SSH into the server and run "docker start tugboat".
Down the line I'll also separate out Server and Tugboat status from one another as a Server could be online whilst Tugboat isn't etc but currently they're merged into Server's status field.
🔧 New Environment Variables
The environment variables tab of an Application had an overhaul and actually works now. Plus, the addition of some warning text to inform User's that updating an Environment Variable doesn't automatically redeploy an application (something I wish other platforms did too).
✅ Wins
- Tugboat separation from other containers.
- New Environment variables table
- Streaming Application logs to the dashboard
- Automatically updating deployment history
- Deleting containers on a Server
⚠️ Challenges
Figuring out how an Application and a Container work together.
In the code I was using these two both interchangeably so I spent a few days figuring out what data I store on the Application model, and what stays on the Container. It's still a bit messy now in both the dashboard and backend but I think I'm on the right track that won't require any huge rewrites in the future.
💡 What I Learned
- Traefik seems like a good solution for handling exposing a container to the web. More on this next build log.
🔜 Next Up
- Hooking up Github pushes and webhook events to the build job.
- Installing Traefik and managing application ports.