Hello,
I am working on an open source Rust program, that is meant to help people with home labs or older devices administrate thos devices.
The project is composed out of two parts, a frontend (React) and the backend written in Rust.
Due to this being a program some people may depend on, I would be happy if somebody would take a look over my code.
I added documentation, that can be viewed using cargo doc.
The project only runs on Linux machines. I am currently trying to get it on crates.io, to make using it easier. Nonetheless, you can build it your self using the build instructions or use the pre-built version (this is only done for aarch64 devices yet).
Repostory Link: GitHub - Wervice/zentrox: Home server admin with batteries included
If you have any questions, please ask me
Have a nice day
Wervice
The first thing that caught my eye is that you roll a lot of own code for already solved problems.
Instead of calling e.g. df
in a subprocess and parsing its output, you could use sysinfo,
instead of using println!()
and eprintln!()
you could use log, etc.
Then you do a lot of assumptions on the installed systems.
To escalate privileges, you assume sudo
to be configured, but a user might prefer doas
.
Also ufw
is not the only firewall frontend out there. Some even don't use any. I for one use nftables
directly.
The package manager API is quite unidiomatic. You could use Rust's language features better here. E.g. you could have an enum with distros and an enum with package managers, that can be converted from the distros enum. The package manager enum then can implement a package manager trait to expose a common API across all supported package managers.
Keep in mind, that you also don't need to call the package managers in subprocesses either here. You can use e.g. alpm for pacman, though I did not find any crates for dpkg or RPM.
Thank you! I will fix these issues, as soon as I have sorted out how to get the project on crates.io.
One reason why I do not use crates like log or sysinfo, is to keep the dependencies of the project low.
I may be a bit to sensitive about this, because I write my project on a old laptop, but I do not want that Zentrox becomes a bottleneck for the devices it controls.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.