Menu
#Ferrite Viewer
ferrite_viewer is a desktop app for browsing and editing a ferrite_db server, a bit like MongoDB Compass. MongoDB Compass itself cannot connect, because the wire format is not BSON. The viewer speaks ferrite's own protocol.
It is version 0.1.0. It is built with Tauri 2: the Rust side opens the connection, does TLS and the login, and sends requests, and the interface is plain HTML, CSS and JavaScript in the system webview. It does not need a server change.
#Install
On Linux it needs the Tauri system libraries (webkit2gtk and friends). From a checkout of the ferrite_viewer repository:
./install.shThis builds a release and installs it for your user, with no root needed: the binary goes to ~/.local/bin/ferrite_viewer, with a desktop entry and an icon. Run it again after changes.
A .deb can be built with the Tauri CLI:
cargo install tauri-cli --version "^2" --locked # once
cd src-tauri && cargo tauri build --bundles debThat gives target/release/bundle/deb/Ferrite Viewer_0.1.0_amd64.deb, which depends on libwebkit2gtk-4.1-0 and libgtk-3-0. There is no AppImage. To run it from source:
cargo run -p ferrite_viewer#Connecting
A connection is a connection string, for example:
ferrite://user:password@host:7878/shop?tls=trueThe path is the database. Without one, the app asks the server for the databases and lets you pick. token=, tls=true, caFile=, certFile=, keyFile=, tlsInsecure= and format=binary all work.
The connections screen has a "test connection" button.
#Saved connections
The list of saved connections, a name and a string each, is a JSON file in the app's data folder. The password or token is cut out of the string before it is written, and kept in the system keychain instead (Secret Service on Linux, Keychain on macOS, Credential Manager on Windows), under the id of the connection. A copy of the file alone is no use to anyone.
If there is no keychain, such as a Linux machine without Secret Service, the app says so, saves without the secret, and asks for the password each time. It does not fall back to writing the secret to the file.
#Browsing and editing
- A sidebar lists the databases and the collections of the selected one. A collection exists on the server only while it holds a document, so the sidebar keeps the one on screen, and an Add box takes the name of a new one.
- A database picker, a New database box and a Drop database button.
- Documents are shown as a collapsible tree for nested values, with a filter, sort, skip and limit. Every find sends a
limitand acount, because the server refuses to reply over 64 MiB, and the viewer pages withskip. - Insert, edit and delete documents, with a confirmation for deletes. Editing a document is a JSON editor, and saving sends a
replacefiltered on_id. - Ints and floats stay different (
1and1.0), and ids and dates keep their own display and are kept when a document is edited. Documents go from the page to Rust as text and are parsed there, so a number stays what you typed.
#Indexes
List, create and drop indexes of a collection. See indexes.
#Aggregate
An editor for aggregate pipelines on the selected collection. A very large aggregate result is not handled well. See aggregation.
#Users and grants
A Users page lists the server's users and edits their grants per database. It needs a login with an admin grant on *, or the token. There is also a Compact button in the sidebar, which needs an admin login and asks for confirmation. See authentication.
#Notes
- Errors show the server's
code. See errors. - The binary client was not checked against the regex value type (tag 10).
- Small layout nits remain, for example the Edit and Delete buttons wrap at 720x480.