Commit graph

10 commits

Author SHA1 Message Date
Viktor Torstensson
aabf8b08e9
terminal: remove DevConfig.Validate params
As the `DevConfig.Validate` params are no longer used in the Validate
method, we can remove them from the method signature.
2026-06-08 11:23:58 +02:00
Viktor Torstensson
66e9d3c46d
terminal: move databasebackend option to Config
Move the database backend selection from the `dev` config file into the
main `Config` struct, i.e. into production.

This will enable an sql database backend to be used in production.
2026-06-08 11:23:58 +02:00
Viktor Torstensson
f90f468a32
multi: add dev kvdb to sql code migration
Add the necessary code to trigger the kvdb to sql code migration in dev
builds.
2026-05-14 11:38:35 +02:00
Elle Mouton
89b807c3bb
lit: plug the SQL actions DB into the dev build 2025-05-30 10:57:00 +02:00
Elle Mouton
642a69f1c2
firewalldb: best effort link from actions to accounts
In this commit, we do our best to ensure that at least at the time of
action creation, if the account ID is set, then our bbolt actions store
impl will at least first check that the account really does exist. This
also forces us to update our tests in preparation for the SQL store
which will tightly couple the actions and accounts.
2025-05-21 14:14:13 +02:00
Elle Mouton
297313e9c1
firewalldb: add clock.Clock to firewalldb DB impls
In preparation for using the clock to get an Action's AttemptedAt time
in an upcoming commit, we let both the bbolt and SQL impls of the
firewalldb take a clock.
2025-05-13 08:06:16 +02:00
Elle Mouton
71718e8868
lit: make sure to always close stores on errored start-up
Ensure that if any store init in the `stores` struct creation fails,
then any successful stores are still closed during shutdown.
2025-04-03 16:27:02 +02:00
Elle Mouton
261c547622
firewalldb: add DB struct and Start/Stop methods
In this commit, we add a `DB` struct in the `firewalldb` package. This
struct will be responsible for housing abstract implementations of the
various stores in the `firewalldb`. For now, we start with just the
RulesDB. We also add Start&Stop methods for the struct in preparation
for future additions here - for now, these do nothing.

In the main LiT setup, we move the firewall.BoltDB and the new
firewalldb.DB to the `stores` struct and implement them in the two
`config_` files. For now, both varients create the Bbolt version of the
firewallDB and this is used to init the `firewalldb.DB` struct. This
will be changed in future commits where we will add a sql
implementation.
2025-04-03 09:02:47 +02:00
Elle Mouton
6dbf880341
multi: plug in sessions SQL DB
Let LiTd support a SQL db for the sessions store under the `dev` build
tag. This can be used via itests.
2025-03-25 16:58:02 +02:00
Elle Mouton
7a091fc773
config: introduce the concept of DevConfig
In this commit, we introduce a DevConfig struct which is embedded in the
main lit Config struct. It is defined in two separate files that are
made mutually exclusive using the `dev` build tag. The idea of this
struct is that it allows us to expose additional config options to LiT
if we build in a development environment such as our itests. In other
words, we will be able to start developing features and testing them
before making them available to users via the production build.

As of this commit, both implementations of the struct are the same.
2025-02-21 11:17:21 -03:00