An API to turn off devices it is deployed on.
turn-me-off
is compatible with any operating system that uses systemd
as its init system,
which is most of linux distributions these days.
To build turn-me-off
, you need to have the Rust toolchain installed on your machine,
if you don't have it, install it using rustup.
To build the executable you can run:
cargo build -r
The turn-me-off
binary should located in target/release/
.
Executing the binary starts the HTTP server, and you should be able to access a Swagger UI documenting the API at the address http://localhost:3000/docs/#/
Note that the port 3000 is the default port, to control the port on which it listens,
you can use the environment variable TMF_PORT
:
TMF_PORT=3001 turn-me-off
By default the server will only log the minimum information (startup, shutdown, ...),
you can enable more logs, for example all connections established with the server, by
setting the env variable RUST_LOG
:
RUST_LOG=trace turn-me-off