Crates.io | modio-localapi |
lib.rs | modio-localapi |
version | 0.4.1 |
source | src |
created_at | 2022-11-02 15:07:27.515782 |
updated_at | 2022-11-02 15:07:27.515782 |
description | modio-localapi, a tls-enabled web-server matching the /v0 modio-api for devices |
homepage | |
repository | https://gitlab.com/ModioAB/modio-localapi/ |
max_upload_size | |
id | 703536 |
size | 167,935 |
The version is checked into git with localapi/Cargo.toml and others, those should be bumped as according to Semver compatibility.
The versions uploaded ( binaries ) are based on the Git tag, which does NOT need to match the cargo versions.
tide seems better suited:
https://github.com/http-rs/tide
tls settings here: https://github.com/http-rs/tide-rustls
If you have problems running the tests or compiling due to modio-logger or loggerdb, try:
SQLX_OFFLINE=true cargo build
SQLX_OFFLINE=true cargo test
the SQLX_OFFLINE
variable makes sqlx tools look in the library itself for the
json data it needs to validate SQL queries.
"cargo run --" can be used instead of calling './target/debug/localapi'
cd localapi
RUST_LOG=debug systemfd --no-pid -s 127.0.0.1:4333 -- \
cargo run -- --server-cert ../examples/fffbeec0ffee.crt \
--server-key ../examples/fffbeec0ffee.key \
--ca-cert ../examples/ca.modio.se.crt
cd localapi
RUST_LOG=debug systemfd --no-pid -s 127.0.0.1:4333 -- \
cargo watch -x \
'run -- --server-cert ../examples/fffbeec1ffee.crt \
--server-key ../examples/fffbeec1ffee.key \
--ca-cert ../examples/ca.modio.se.crt'
curl --cacert ca.modio.se.crt \
--key fffbeec0ffee.key \
--cert fffbeec0ffee.crt \
--resolve fffbeec0ffee:4333:127.0.0.1 -v \
-H 'Content-Type: application/json' \
-d '{"expected":"0", "target":"1", "audit":[]}' \
https://fffbeec0ffee:4333/v0/localhost/12.ADE4A7000000.A/config
curl --cacert ca.modio.se.crt \
--key fffbeec0ffee.key \
--cert fffbeec0ffee.crt \
--resolve fffbeec0ffee:4333:127.0.0.1 -v \
https://fffbeec0ffee:4333/v0/localhost/12.ADE4A7000000.A/history/1/2
curl --cacert ca.modio.se.crt \
--key fffbeec0ffee.key \
--cert fffbeec0ffee.crt \
--resolve fffbeec0ffee:4333:127.0.0.1 -v \
https://fffbeec0ffee:4333/v0/localhost/12.ADE4A7000000.A/history
curl --cacert ca.modio.se.crt \
--key fffbeec0ffee.key \
--cert fffbeec0ffee.crt \
--resolve fffbeec0ffee:4333:127.0.0.1 -v \
https://fffbeec0ffee:4333/v0/localhost/12.ADE4A7000000.A
curl --cacert ca.modio.se.crt \
--key fffbeec0ffee.key \
--cert fffbeec0ffee.crt \
--resolve fffbeec0ffee:4333:127.0.0.1 -v \
https://fffbeec0ffee:4333/v0/localhost
curl --cacert ca.modio.se.crt \
--key fffbeec0ffee.key \
--cert fffbeec0ffee.crt \
--resolve fffbeec0ffee:4333:127.0.0.1 -v \
https://fffbeec0ffee:4333/v0