As long as putting a change online means logging in to the server and typing a series of commands, it gets put off, forgotten or botched. We wanted a plain code push to be enough to update a service, and we wanted that code to stay on our own infrastructure. Here is how those two wishes came together, and what they taught us.
Update of 28 November 2026.
A security audit on 23 November put its finger on the risk that the end of this article hints at. The runner was running under an account that could do anything on the server, so a single malicious push would have been enough to take it over. It now runs under a dedicated account with no administrator rights, with one exception: a single deployment command whose destinations are fixed in advance. The repository supplies it with content, never a path, a command or an option. The main branches of our repositories are protected, and a push that would rewrite their history is refused.
A new check workflow, which deploys nothing, runs on every push and launches only the relevant parts. It looks for secrets in the commits, checks that dependencies are pinned to an exact version, runs the server tests and the Cube firmware tests on a PC, and checks the inventory of software components (the SBOM, or software bill of materials). The sentence in the closing box saying that no firmware tests run in our workflows is therefore no longer true. These inventories prepare for the obligations that come with placing a product on the market, discussed in the article on moving from prototype to production, and server monitoring, tightened up after the same audit, is described in Watching over our own server. The firmware itself is signed outside these workflows, as the article on signed updates explains.
The problem: deploying by hand
In spring 2026 the platform already had several services online: the website, a console for the Cube, a network map and an API. Each one was deployed by hand, which meant building, copying, restarting, then checking that everything still responded. That works very well on day one and much less well on day thirty, because by then the procedure lives in the head of whoever did it last.
The standard answer is continuous deployment: a machine watches the code repository and, on every change, runs the procedure itself. Most projects hand this job to a forge hosted by a third party, that is, an online service that stores the code, keeps its history and runs this automation. It is convenient and the tooling is excellent, but it means that the code, and the machine allowed to deploy, live on someone else’s infrastructure.
Why host your own forge
Our forge was in place from the first days of the project, on the same European server as everything else. It runs Forgejo, a free-software project started in late 2022 by former Gitea maintainers and placed under the stewardship of Codeberg e.V., a German non-profit association. The reason recorded in our dependency review fits in one sentence: “the code never leaves the controlled infrastructure”.
This choice follows from a rule we set ourselves at the start, which is to prefer free software hosted in the European Union. There is also a more down-to-earth reason. The repository of a connected-device platform contains the firmware, the deployment diagrams and the description of the server: more or less everything needed to understand how it holds together. Since the rest was already self-hosted, it seemed only consistent to keep this in-house too.
What we set up
On 1 May 2026 we enabled Forgejo Actions, the automation system built into the forge. The principle is simple: a file kept in the repository describes a sequence of steps, called a workflow, and a program called a runner executes them on every push. That day’s commit message sums up the intention plainly: “no more manual deployments”.
Three decisions shaped the result.
- One workflow per service, triggered by its own folder alone. All our code lives in a single repository, so fixing a comma on the website must not restart the network map. Each workflow runs only if its own service’s files have changed.
- Tests first. For the API, the workflow runs the test suite against a throwaway database before anything else. If a test fails, nothing is deployed and the old version keeps running.
- A check afterwards. Most workflows end with a smoke test, that is, a very simple request that makes sure the service responds. A deployment that “passes” but leaves a service silent is therefore flagged straight away. Two workflows are exceptions: the simulator’s merely prints its logs, and the map server’s does not fail when the request goes unanswered.
The services themselves run in containers started by Podman without administrator privileges, as we describe in the article on hosting. So the workflow only has to rebuild an image and restart the corresponding service.
What it changes day to day
The first effect is so unobtrusive as to be almost disappointing: we no longer think about it. Fixing a sentence on the website or a rule on the server means pushing the code, then watching the workflow go green. The second effect goes deeper, because the deployment procedure is now written, reviewed and versioned like everything else. When it changes, we can see who changed it and why.
The third effect concerns tests. A test suite that is run “when we think of it” always ends up falling behind, whereas a suite that gates deployment is kept up to date out of necessity. The server’s suite had 108 tests in mid-October, and it has already blocked a deployment we thought was ready.
What it costs, and our missteps
Running your own forge means one more service to maintain, back up and monitor, and it would be dishonest to gloss over that. A forge hosted by a third party offers more features and needs no upkeep: for many projects it is the right choice, and we do use one for code that we publish.
Automation also has a way of getting things wrong that is all its own: quickly and without hesitation. On the very day it went into service, the website workflow synchronised its destination folder a little too zealously and, in passing, wiped the user interface of another service that lived in the same place. They were only interface files, which their own workflow can put back, but we took a rule from it: a workflow that deletes whatever is “extraneous” must state explicitly what it spares.
Finally, a runner is by nature a program that executes whatever it is sent. The Forgejo documentation says so bluntly and sets out the precautions to take. That is one of the reasons our forge is closed: only trusted people push code to it.
The lesson learned later: secrets have no place in a repository
A workflow needs passwords and keys to start a service, and the path of least resistance is to write them where they are needed. It is the wrong path, for a simple reason: a repository keeps everything, including what was later deleted, and every copy of the repository carries that history with it. The principle is long established. The Twelve-Factor App manifesto calls for a strict separation between code and configuration, and OWASP devotes an entire guide to it.
We knew the rule, and yet it took us time to apply it rigorously. Since November 2026 our workflows no longer carry any secrets: they rebuild the image and restart the service, while the secrets stay on the server, placed there by hand and outside the repository. A workflow will in fact refuse to deploy if it does not find them there. The deployment file is once again what it should always have been: a recipe that can be shown to anyone.
Where we stand.
The forge and continuous deployment are in service: the website, the console, the map and the server are updated by a plain code push. Not everything is there yet. No test bench for the Cube firmware runs in these workflows, and the online demonstration is still deployed by hand. The project is at the demonstrator stage, and so is its deployment chain.
Sources
- Forgejo, the website of the free-software forge project.
- Announcement of the creation of Forgejo, December 2022: the origin of the project and its governance.
- What is Codeberg?, an introduction to the Codeberg e.V. association and its link with Forgejo.
- Forgejo Actions, user guide: workflows, triggers and runners.
- Forgejo Actions, deployment security: what a self-hosted runner implies.
- Podman, a daemonless container engine.
- The Twelve-Factor App, III. Config: the separation between code and configuration.
- OWASP, Secrets Management Cheat Sheet: good practice for managing secrets.
A question, an objection? contact@ops-devices.eu, or on Bluesky.