This is an implementation of the SpaceAPI v14 in Rust. It contains following parts
spaceapi-dezentrale
: Serialization and deserialization to/from JSON using Serdespaceapi-dezentrale-client
: Client to access the server via APIspaceapi-dezentrale-server
: Server which provides the API
Supported architectures with static linked binaries with musl libc:
- x86-64
- Aarch64
- ARMv6 + FPU
- ARMv7 + FPU
cargo build --release
Create a config file (see config.sample.yml
) which describes some basic information about the space, see below.
Start the server.
CONFIG_FILE=config.sample.yml RUST_LOG=INFO \
spaceapi-dezentrale-server
The publish
section is a representation of the Status
struct of the SpaceAPI, which will be used as a template for publishing the status.
The server doesn't use much custom logic. See Rocket documentation how to change parts like ports, limits, etc.
The log level can be changed with the default mechanism of RUST_LOG
of env_logger
.
Open the space
SPACEAPI_URL=http://localhost:8000 API_KEY=not-very-secure \
spaceapi-dezentrale-client open
Close the space
SPACEAPI_URL=http://localhost:8000 API_KEY=not-very-secure \
spaceapi-dezentrale-client close
Check if the space is open
SPACEAPI_URL=http://localhost:8000 API_KEY=not-very-secure \
spaceapi-dezentrale-client is-open
Keep open call
SPACEAPI_URL=http://localhost:8000 API_KEY=not-very-secure \
spaceapi-dezentrale-client keep-open
Due the support for static linked binaries the container images are based on the scratch
image so the image only contains the binary.
To build the images for x86-64:
# Build the server image
docker build -f docker/Docker.server -t spaceapi-dezentrale-server .
# Build the client image
docker build -f docker/Docker.client -t spaceapi-dezentrale-client .
To build other configurations and architectures take a look into Dockerfile and the GitHub release workflow.
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.