diff --git a/TODO.md b/TODO.md index c1e0148..7713366 100644 --- a/TODO.md +++ b/TODO.md @@ -1,12 +1,14 @@ # OOTT ToDo list - [ ] Add support for push notifications to the app (iOS and Android) +- [ ] Modify the release script to check that gh is logged in and that frontend tests are run before releasing - [x] README.md - Add section about securing access (reverse proxy, never expose to the internet, etc.) - [x] README.md - Simplify storage section (remove the calculations - just leave the results) ## Release plan for 0.2.0 - [x] Test Android UI on emulator -- [ ] Release 0.1.0 +- [x] Release 0.1.0 +- [ ] Fix bugs and release 0.1.1 - [ ] Install in test server (docker) following documented process - [ ] Install test app on iPhone - [ ] Test in-house for 1 week @@ -20,11 +22,14 @@ ## Backend +- [ ] In notifications, when the vendor is empty put (unknown) - [x] In the active scanners status, it should count the number of distinct devices it saw on the last scan (avoid duplicates) - [ ] Implement the pushover API call directly to support HTML content and review notification text to use it ## Frontend +- [ ] When the user goes to the / URI in a production server redirect him to /web +- [ ] Add a link to the API docs (/api/docs) in the navigation (new window - only visible in wide) - [x] Review the whole codebase for dead code, duplication and simplicity - [x] In the devices list, add an order by type (in the wide version it should be over the icon on the left of the list) - [x] How expensive it is to get the total number of pages and implement a go to last page diff --git a/backend/src/web_server.rs b/backend/src/web_server.rs index cf17498..fc6b7fa 100644 --- a/backend/src/web_server.rs +++ b/backend/src/web_server.rs @@ -13,7 +13,7 @@ use axum::Json; use axum::extract::Request; use axum::http::StatusCode; use axum::middleware::Next; -use axum::response::Response; +use axum::response::{Redirect, Response}; use axum::routing::{delete, get, post, put}; use axum::{Router, http}; use log::{debug, error, info}; @@ -170,8 +170,10 @@ pub async fn serve() -> Result<(), Box> { .layer(ServiceBuilder::new().layer(cors_layer)) .route( "/", - get(|| async { "Go to /web for the UI or to /api for the better UI." }), + get(|| async { "Go to /web for the UI or to /api/docs for the API explorer." }), ) + // The API explorer lives at /api/docs; redirect the bare /api for convenience. + .route("/api", get(|| async { Redirect::temporary("/api/docs") })) .nest_service("/web", static_files) .merge(SwaggerUi::new("/api/docs").url("/api/docs/openapi.json", ApiDoc::openapi())); diff --git a/nix/frontend.nix b/nix/frontend.nix index 8644ed8..34b710b 100644 --- a/nix/frontend.nix +++ b/nix/frontend.nix @@ -18,4 +18,10 @@ in # Build the web bundle (the backend serves these assets). targetFlutterPlatform = "web"; + + # The backend serves these assets under `/web/` (see web_server::serve), so + # the bundle must be built with a matching base href. Without this the built + # index.html keeps the default `` and every asset reference + # resolves to the site root, 404s, and the page renders blank. + flutterBuildFlags = ["--base-href=/web/"]; }