arcana-base-server

Crates.ioarcana-base-server
lib.rsarcana-base-server
version0.6.0
created_at2025-10-21 08:00:11.389595+00
updated_at2025-10-21 08:00:11.389595+00
descriptionLibrary to help create your own arcana activation server
homepage
repositoryhttps://git.dgnum.eu/DGNum/arcana
max_upload_size
id1893413
size63,670
soyouzpanda (soyouzpanda)

documentation

README

How to implement your own custom activation server?

Using the arcana-base-server utility, you only have to write a struct and three functions.

The struct is the state of the activation regarding a host. This struct should be able to parse a uri (passed as an url::Url instance) to have enough information to connect to the targeted host. For example, please look at the arcana-nixos-server/src/host.rs file.

The three functions consists of handler of the requests coming from the arcana client:

  • apply_function is the function which takes apply requests and process it.
  • build_function is the function which takes build requests and process it.
  • copy_closure_function is the function which takes copy closure requests and process it.

Signatures of the function should be:

pub async fn apply(
    target: TargetHost,
    tx: tokio::sync::mpsc::Sender<Result<ApplyResponse, Status>>,
    request: ApplyRequest,
) -> std::io::Result<()>;

pub async fn build(
    target: TargetHost,
    tx: tokio::sync::mpsc::Sender<Result<BuildResponse, Status>>,
    request: BuildRequest,
) -> std::io::Result<()>;

pub async fn copy_closure(
    target: TargetHost,
    tx: tokio::sync::mpsc::Sender<Result<CopyClosureResponse, Status>>,
    request: CopyClosureRequest,
) -> std::io::Result<()>;

where TargetHost is your struct defined earlier.

Functions takes the state and the request and push responses inside the tx channel.

For more example, please take a look to the arcana-nixos-server.

Commit count: 0

cargo fmt