This commit is contained in:
Mario Voigt 2024-12-14 21:54:01 +01:00
parent 8b15acf983
commit 57a0436ca1
5 changed files with 20 additions and 20 deletions

View File

@ -56,7 +56,7 @@ But before you open an issue in this repo for a feature request, please first ch
## Contributing Code ## Contributing Code
To help develop Diflouroborane you will need a Rust toolchain. I heavily recommend installing To help develop Difluoroborane you will need a Rust toolchain. I heavily recommend installing
[rustup](https://rustup.rs) even if your distribution provides a recent enough rustc, simply because [rustup](https://rustup.rs) even if your distribution provides a recent enough rustc, simply because
it allows to easily switch compilers between several versions of both stable and nightly. It also it allows to easily switch compilers between several versions of both stable and nightly. It also
allows you to download the respective stdlib crate, giving you the option of an offline reference. allows you to download the respective stdlib crate, giving you the option of an offline reference.

View File

@ -1,10 +1,10 @@
# Installation # Installation
Currently there are no distribution packages available. Currently there are no distribution packages available.
However installation is reasonably straight-forward, since Diflouroborane compiles into a single However installation is reasonably straight-forward, since Difluoroborane compiles into a single
mostly static binary with few dependencies. mostly static binary with few dependencies.
At the moment only Linux is supported. If you managed to compile Diflouroborane please open an issue At the moment only Linux is supported. If you managed to compile Difluoroborane please open an issue
outlining your steps or add a merge request expanding this part. Thanks! outlining your steps or add a merge request expanding this part. Thanks!
## Requirements ## Requirements
@ -12,7 +12,7 @@ outlining your steps or add a merge request expanding this part. Thanks!
General requirements; scroll down for distribution-specific instructions General requirements; scroll down for distribution-specific instructions
- GNU SASL (libgsasl). - GNU SASL (libgsasl).
* If you want to compile Diflouroborane from source you will potentially also need development * If you want to compile Difluoroborane from source you will potentially also need development
headers headers
- capnproto - capnproto
- rustc stable / nightly >= 1.48 - rustc stable / nightly >= 1.48
@ -26,7 +26,7 @@ $ pacman -S gsasl rust capnproto
## Compiling from source ## Compiling from source
Diflouroborane uses Cargo, so compilation boils down to: Difluoroborane uses Cargo, so compilation boils down to:
```shell ```shell
$ cargo build --release $ cargo build --release

View File

@ -1,6 +1,6 @@
# FabAccess Diflouroborane # FabAccess Difluoroborane
Diflouroborane (shorter: BFFH, the chemical formula for Diflouroborane) is the server part of Difluoroborane (shorter: BFFH, the chemical formula for Difluoroborane) is the server part of
FabAccess. FabAccess.
It provides a server-side implementation of the [FabAccess API](https://gitlab.com/fabinfra/fabaccess/fabaccess-api). It provides a server-side implementation of the [FabAccess API](https://gitlab.com/fabinfra/fabaccess/fabaccess-api).

View File

@ -3,7 +3,7 @@
//#![warn(missing_docs)] //#![warn(missing_docs)]
//#![warn(missing_crate_level_docs)] //#![warn(missing_crate_level_docs)]
//! Diflouroborane //! Difluoroborane
//! //!
//! This is the capnp component of the FabAccess project. //! This is the capnp component of the FabAccess project.
//! The entry point of bffhd can be found in [bin/bffhd/main.rs](../bin/bffhd/main.rs) //! The entry point of bffhd can be found in [bin/bffhd/main.rs](../bin/bffhd/main.rs)
@ -67,7 +67,7 @@ use lightproc::recoverable_handle::RecoverableHandle;
use signal_hook::consts::signal::*; use signal_hook::consts::signal::*;
use tracing::Span; use tracing::Span;
pub struct Diflouroborane { pub struct Difluoroborane {
config: Config, config: Config,
executor: Executor<'static>, executor: Executor<'static>,
pub statedb: StateDB, pub statedb: StateDB,
@ -135,7 +135,7 @@ pub enum BFFHError {
), ),
} }
impl Diflouroborane { impl Difluoroborane {
pub fn setup() {} pub fn setup() {}
pub fn new(config: Config) -> Result<Self, BFFHError> { pub fn new(config: Config) -> Result<Self, BFFHError> {

View File

@ -1,5 +1,5 @@
use clap::{Arg, Command, ValueHint}; use clap::{Arg, Command, ValueHint};
use diflouroborane::{config, Diflouroborane}; use difluoroborane::{config, Difluoroborane};
use std::str::FromStr; use std::str::FromStr;
use std::{env, io, io::Write, path::PathBuf}; use std::{env, io, io::Write, path::PathBuf};
@ -15,12 +15,12 @@ fn main() -> miette::Result<()> {
FabAccess {apiver}\n\ FabAccess {apiver}\n\
\t[{build_kind} build built on {build_time}]\n\ \t[{build_kind} build built on {build_time}]\n\
\t {rustc_version}\n\t {cargo_version}", \t {rustc_version}\n\t {cargo_version}",
version=diflouroborane::env::PKG_VERSION, version=difluoroborane::env::PKG_VERSION,
apiver="0.3", apiver="0.3",
rustc_version=diflouroborane::env::RUST_VERSION, rustc_version=difluoroborane::env::RUST_VERSION,
cargo_version=diflouroborane::env::CARGO_VERSION, cargo_version=difluoroborane::env::CARGO_VERSION,
build_time=diflouroborane::env::BUILD_TIME_3339, build_time=difluoroborane::env::BUILD_TIME_3339,
build_kind=diflouroborane::env::BUILD_RUST_CHANNEL)) build_kind=difluoroborane::env::BUILD_RUST_CHANNEL))
.about(clap::crate_description!()) .about(clap::crate_description!())
.arg(Arg::new("config") .arg(Arg::new("config")
.help("Path to the config file to use") .help("Path to the config file to use")
@ -98,7 +98,7 @@ fn main() -> miette::Result<()> {
let configpath = matches let configpath = matches
.value_of("config") .value_of("config")
.unwrap_or("/etc/diflouroborane.dhall"); .unwrap_or("/etc/difluoroborane.dhall");
// Check for the --print-default option first because we don't need to do anything else in that // Check for the --print-default option first because we don't need to do anything else in that
// case. // case.
@ -140,7 +140,7 @@ fn main() -> miette::Result<()> {
if matches.is_present("dump") { if matches.is_present("dump") {
return Err(miette::miette!("DB Dumping is currently not implemented, except for the users db, using `--dump-users`")); return Err(miette::miette!("DB Dumping is currently not implemented, except for the users db, using `--dump-users`"));
} else if matches.is_present("dump-users") { } else if matches.is_present("dump-users") {
let bffh = Diflouroborane::new(config)?; let bffh = Difluoroborane::new(config)?;
let number = bffh.users.dump_file( let number = bffh.users.dump_file(
matches.value_of("dump-users").unwrap(), matches.value_of("dump-users").unwrap(),
@ -151,7 +151,7 @@ fn main() -> miette::Result<()> {
return Ok(()); return Ok(());
} else if matches.is_present("load") { } else if matches.is_present("load") {
let bffh = Diflouroborane::new(config)?; let bffh = Difluoroborane::new(config)?;
bffh.users.load_file(matches.value_of("load").unwrap())?; bffh.users.load_file(matches.value_of("load").unwrap())?;
@ -179,7 +179,7 @@ fn main() -> miette::Result<()> {
} }
config.logging.format = matches.value_of("log format").unwrap_or("full").to_string(); config.logging.format = matches.value_of("log format").unwrap_or("full").to_string();
let mut bffh = Diflouroborane::new(config)?; let mut bffh = Difluoroborane::new(config)?;
bffh.run()?; bffh.run()?;
} }