Closed giorgiga closed 6 days ago
Cool! Thanks for doing that. I think there's also some work being done for nixpgs here: https://github.com/NixOS/nixpkgs/pull/345444
Systems can be defined programmatically in beszel_data/config.yml
:
# Values for port and users are optional.
# Defaults are port 45876 and the first created user.
systems:
- name: thinkpad
host: 192.168.33.5
port: 45876
users:
- name@example.com
But creation of the first user is done in the application. What would be the ideal "nixos way" to do this?
It didn't really occur to me to check if there was already some work in progress at nixpkgs... thanks a bunch: I'll see to coordinate my efforts with the existing ones.
The general idea with nixos is that one can spin up a working machine (minus the data of course) from the nixos config alone and that they can update the machine configuration by the same mean, but that's by no means a rule or requirement and different programs/services have different level of support.
From the nixos module I can generate whatever script to initialize beszel, so there's a lot of flexibility there (eg. the syncthing one uses curl
to configure the service via its API)... I would try and manage the whole configuration if it makes sense (ie. if there's not too much stuff or stuff that you plan to drop in the near future)...
Could you please help with the following questions?
users
and a _admins
table... should I insert/delete into/from both?$2a$
), do you happen to know if I can use stronger schemes, such as sha512crypt ($6$
)? (see wikipedia)beszel_data/config.yml
file seems to actually come from the database... would you recommend I generate the file or update the database directy?--https
, how can I specify the SSL key and certificate?Thanks a bunch!
I don't have a lot of time tonight to go over this but want to give you some quick thoughts.
The API would be a good option for set up. The hub is built on PocketBase. You can check the docs for the API here: https://pocketbase.io/docs/api-records/
PocketBase also has a very active github discussions page with a lot of helpful info.
golang.org/x/crypto/bcrypt
so I think it needs to be bcrypt. Here's the code.config.yml
then that is the single source of truth. Anything that differs in the database will be overwritten on restart. So don't use the file unless you only want to manage systems in the file and not via the DB or web UI.sendmail
by default. It supports a user defined SMTP server, which can be set manually in the PocketBase backend or via the API.--https
issues a Let's Encrypt cert and doesn't support using custom certificates. See here: https://github.com/pocketbase/pocketbase/discussions/3161Thanks @henrygd: that helps a lot!
I'll bother you again if I get stuck, but I should be able to work with that.
No worries. It's not a bother so let me know if you have any other questions.
I am packaging for beszel for NixOs, because I want to use it in my home lab and I guess others too may want to (I do plan contribute my efforts to the official repo once I'm satisfied).
At the moment, I have packaged both the agent and hub and I'm working on the agent's module (you may think of it as an elaborate installation script).
Since things are going well with the agent (I think I'll be done this weekend or the next one), so I took a preliminary look at the hub, but it seems the hub is intended to be configured interactively by a person, while the "nixos way" would be for the nixos module to generate all the needed configuration so that one can materialize a working system.
Is it possible to programmatically configure the hub beyond the two environment variables mentioned in the README?