diff --git a/core/startos/src/bins/startd.rs b/core/startos/src/bins/startd.rs index b7574b7c7..4cf11ba07 100644 --- a/core/startos/src/bins/startd.rs +++ b/core/startos/src/bins/startd.rs @@ -150,7 +150,6 @@ pub fn main(args: impl IntoIterator) { .build() .expect("failed to initialize runtime"); rt.block_on(async { - let addrs = crate::net::utils::all_socket_addrs_for(80).await?; let mut server = WebServer::new(Acceptor::bind_upgradable( SelfContainedNetworkInterfaceListener::bind(80), )); diff --git a/core/startos/src/net/acme.rs b/core/startos/src/net/acme.rs index 9ef2af1f7..7e2dd23de 100644 --- a/core/startos/src/net/acme.rs +++ b/core/startos/src/net/acme.rs @@ -187,7 +187,7 @@ pub fn acme() -> ParentHandler { from_fn_async(remove) .with_metadata("sync_db", Value::Bool(true)) .no_display() - .with_about("Setup ACME certificate acquisition") + .with_about("Remove ACME certificate acquisition configuration") .with_call_remote::(), ) } diff --git a/core/startos/src/net/web_server.rs b/core/startos/src/net/web_server.rs index 641a6f08d..4d48316c0 100644 --- a/core/startos/src/net/web_server.rs +++ b/core/startos/src/net/web_server.rs @@ -265,7 +265,9 @@ impl WebServer { drop(queue_cell.write().unwrap().take()); if !runner.is_empty() { - runner.await; + tokio::time::timeout(Duration::from_secs(60), runner) + .await + .ok(); } })); Self { diff --git a/core/startos/src/net/wifi.rs b/core/startos/src/net/wifi.rs index 9b858aafe..a70fbfc73 100644 --- a/core/startos/src/net/wifi.rs +++ b/core/startos/src/net/wifi.rs @@ -54,8 +54,8 @@ pub fn wifi() -> ParentHandler { .with_call_remote::(), ) .subcommand( - "delete", - from_fn_async(delete) + "remove", + from_fn_async(remove) .no_display() .with_about("Remove a wifi network") .with_call_remote::(), @@ -230,7 +230,7 @@ pub async fn connect(ctx: RpcContext, SsidParams { ssid }: SsidParams) -> Result } #[instrument(skip_all)] -pub async fn delete(ctx: RpcContext, SsidParams { ssid }: SsidParams) -> Result<(), Error> { +pub async fn remove(ctx: RpcContext, SsidParams { ssid }: SsidParams) -> Result<(), Error> { let wifi_manager = wifi_manager(&ctx)?; if !ssid.is_ascii() { return Err(Error::new( diff --git a/core/startos/src/notifications.rs b/core/startos/src/notifications.rs index 19376026d..48444020a 100644 --- a/core/startos/src/notifications.rs +++ b/core/startos/src/notifications.rs @@ -30,15 +30,15 @@ pub fn notification() -> ParentHandler { .with_call_remote::(), ) .subcommand( - "delete", - from_fn_async(delete) + "remove", + from_fn_async(remove) .no_display() .with_about("Delete notification for a given id") .with_call_remote::(), ) .subcommand( - "delete-before", - from_fn_async(delete_before) + "remove-before", + from_fn_async(remove_before) .no_display() .with_about("Delete notifications preceding a given id") .with_call_remote::(), @@ -126,7 +126,7 @@ pub struct DeleteParams { id: u32, } -pub async fn delete(ctx: RpcContext, DeleteParams { id }: DeleteParams) -> Result<(), Error> { +pub async fn remove(ctx: RpcContext, DeleteParams { id }: DeleteParams) -> Result<(), Error> { ctx.db .mutate(|db| { db.as_private_mut().as_notifications_mut().remove(&id)?; @@ -142,7 +142,7 @@ pub struct DeleteBeforeParams { before: u32, } -pub async fn delete_before( +pub async fn remove_before( ctx: RpcContext, DeleteBeforeParams { before }: DeleteBeforeParams, ) -> Result<(), Error> { diff --git a/core/startos/src/ssh.rs b/core/startos/src/ssh.rs index 0c52fa136..301ed8721 100644 --- a/core/startos/src/ssh.rs +++ b/core/startos/src/ssh.rs @@ -99,8 +99,8 @@ pub fn ssh() -> ParentHandler { .with_call_remote::(), ) .subcommand( - "delete", - from_fn_async(delete) + "remove", + from_fn_async(remove) .no_display() .with_about("Remove ssh key") .with_call_remote::(), @@ -159,7 +159,7 @@ pub struct DeleteParams { } #[instrument(skip_all)] -pub async fn delete( +pub async fn remove( ctx: RpcContext, DeleteParams { fingerprint }: DeleteParams, ) -> Result<(), Error> { diff --git a/web/projects/ui/src/app/services/api/api.types.ts b/web/projects/ui/src/app/services/api/api.types.ts index db9b62add..4b6a25eb8 100644 --- a/web/projects/ui/src/app/services/api/api.types.ts +++ b/web/projects/ui/src/app/services/api/api.types.ts @@ -132,10 +132,10 @@ export module RR { } // notification.list export type GetNotificationsRes = ServerNotification[] - export type DeleteNotificationReq = { id: number } // notification.delete + export type DeleteNotificationReq = { id: number } // notification.remove export type DeleteNotificationRes = null - export type DeleteAllNotificationsReq = { before: number } // notification.delete-before + export type DeleteAllNotificationsReq = { before: number } // notification.remove-before export type DeleteAllNotificationsRes = null // wifi @@ -166,7 +166,7 @@ export module RR { export type ConnectWifiReq = { ssid: string } // wifi.connect export type ConnectWifiRes = null - export type DeleteWifiReq = { ssid: string } // wifi.delete + export type DeleteWifiReq = { ssid: string } // wifi.remove export type DeleteWifiRes = null // ssh @@ -177,7 +177,7 @@ export module RR { export type AddSSHKeyReq = { key: string } // ssh.add export type AddSSHKeyRes = SSHKey - export type DeleteSSHKeyReq = { fingerprint: string } // ssh.delete + export type DeleteSSHKeyReq = { fingerprint: string } // ssh.remove export type DeleteSSHKeyRes = null // backup diff --git a/web/projects/ui/src/app/services/api/embassy-live-api.service.ts b/web/projects/ui/src/app/services/api/embassy-live-api.service.ts index 34082c033..a9833f83e 100644 --- a/web/projects/ui/src/app/services/api/embassy-live-api.service.ts +++ b/web/projects/ui/src/app/services/api/embassy-live-api.service.ts @@ -37,7 +37,7 @@ export class LiveApiService extends ApiService { @Inject(PATCH_CACHE) private readonly cache$: Observable>, ) { super() - ; (window as any).rpcClient = this + ;(window as any).rpcClient = this } // for sideloading packages @@ -343,14 +343,14 @@ export class LiveApiService extends ApiService { async deleteNotification( params: RR.DeleteNotificationReq, ): Promise { - return this.rpcRequest({ method: 'notification.delete', params }) + return this.rpcRequest({ method: 'notification.remove', params }) } async deleteAllNotifications( params: RR.DeleteAllNotificationsReq, ): Promise { return this.rpcRequest({ - method: 'notification.delete-before', + method: 'notification.remove-before', params, }) } @@ -379,7 +379,7 @@ export class LiveApiService extends ApiService { } async deleteWifi(params: RR.DeleteWifiReq): Promise { - return this.rpcRequest({ method: 'wifi.delete', params }) + return this.rpcRequest({ method: 'wifi.remove', params }) } // smtp @@ -407,7 +407,7 @@ export class LiveApiService extends ApiService { } async deleteSshKey(params: RR.DeleteSSHKeyReq): Promise { - return this.rpcRequest({ method: 'ssh.delete', params }) + return this.rpcRequest({ method: 'ssh.remove', params }) } // backup @@ -518,7 +518,7 @@ export class LiveApiService extends ApiService { async removeAcme(params: RR.RemoveAcmeReq): Promise { return this.rpcRequest({ - method: 'net.acme.delete', + method: 'net.acme.remove', params, }) }