Skip to content

Commit b224a2e

Browse files
authored
/sys/* route for console system pages (oxidecomputer#1764)
* fix populate alpine script * add temporary /sys/* path for console system routes
1 parent 20f9cd2 commit b224a2e

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

nexus/src/external_api/console_api.rs

+12
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,18 @@ pub async fn console_settings_page(
637637
console_index_or_login_redirect(rqctx).await
638638
}
639639

640+
#[endpoint {
641+
method = GET,
642+
path = "/sys/{path:.*}",
643+
unpublished = true,
644+
}]
645+
pub async fn console_system_page(
646+
rqctx: Arc<RequestContext<Arc<ServerContext>>>,
647+
_path_params: Path<RestPathParam>,
648+
) -> Result<Response<Body>, HttpError> {
649+
console_index_or_login_redirect(rqctx).await
650+
}
651+
640652
#[endpoint {
641653
method = GET,
642654
path = "/",

nexus/src/external_api/http_entrypoints.rs

+1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ pub fn external_api() -> NexusApiDescription {
253253
api.register(console_api::console_page)?;
254254
api.register(console_api::console_root)?;
255255
api.register(console_api::console_settings_page)?;
256+
api.register(console_api::console_system_page)?;
256257
api.register(console_api::asset)?;
257258

258259
api.register(console_api::login)?;

nexus/tests/integration_tests/console_api.rs

+1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ async fn test_console_pages(cptestctx: &ControlPlaneTestContext) {
163163
"/",
164164
"/orgs/irrelevant-path",
165165
"/settings/irrelevant-path",
166+
"/sys/irrelevant-path",
166167
"/device/success",
167168
"/device/verify",
168169
];

tools/populate/populate-alpine.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22
# Simple script to install the alpine image included with propolis.
33

4-
if ! oxide api images > /dev/null; then
5-
echo "Problem detected running the oxide CLI"
4+
if ! oxide api /system/images > /dev/null; then
5+
echo "Problem detected running the oxide CLI"
66
echo "Please install, set path, or setup authorization"
77
exit 1
88
fi

0 commit comments

Comments
 (0)