Tamanu is an open-source patient-level electronic health records system for mobile and desktop.
The Meta service provides:
- a server discovery service for the Tamanu mobile app
- a server list and health check page
- a range of active versions
We have a container image for linux/amd64 and linux/arm64:
ghcr.io/beyondessential/tamanu-meta:2.4.1
Routes marked with 🔐 require authentication, which is achieved by presenting a client TLS certificate.
Get the full list of servers as JSON.
[
{
"id":"8960470f-5282-496e-86f5-21df8cf67d62",
"name":"Dev (main)",
"host":"https://central.main.internal.tamanu.io/",
"rank":"dev"
}
]
Add a server to the list.
Pass a JSON body:
{
"name":"Dev (main)",
"host":"https://central.main.internal.tamanu.io/",
"rank":"dev"
}
Returns the server with its assigned ID:
{
"id":"8960470f-5282-496e-86f5-21df8cf67d62",
"name":"Dev (main)",
"host":"https://central.main.internal.tamanu.io/",
"rank":"dev"
}
Edit a server.
Pass a JSON body, all fields optional except for id
:
{
"id":"8960470f-5282-496e-86f5-21df8cf67d62",
"name":"Test server (main)"
}
Returns the edited server with its assigned ID:
{
"id":"8960470f-5282-496e-86f5-21df8cf67d62",
"name":"Test server (main)",
"host":"https://central.main.internal.tamanu.io/",
"rank":"dev"
}
There's a "hidden" feature in the UI where if you Shift-click a row, it will copy its ID to the clipboard.
Remove a server from the list.
Pass a JSON body with the id
field:
{
"id":"8960470f-5282-496e-86f5-21df8cf67d62"
}
Force a reload of the statuses.
Returns the range of versions being used in production.
{
"min": "2.1.0",
"max": "2.3.4"
}
- Install Rustup, which will install Rust and Cargo.
- Clone the repo via git:
$ git clone git@github.com:beyondessential/tamanu-meta-server.git
- Build the project:
$ cargo check
- Run with:
$ cargo run
- Tests:
$ cargo test
We recommend using Rust Analyzer or Rust Rover for development.
-
Install the diesel CLI tool: https://diesel.rs/guides/getting-started.html#installing-diesel-cli
-
Create a migration
$ diesel migration generate some_name_here
-
Write the migration's
up.sql
anddown.sql
-
Run the pending migrations:
$ diesel migration run
- Test your down:
$ diesel migration redo
- Run formatter:
$ cargo fmt
On the main branch:
$ cargo release --execute minor // or patch, major
Install cargo-release
with:
$ cargo install cargo-release