Misc frontend fixes (#2974)

* fix dependency input warning and extra comma

* clean up buttons during install in marketplace preview

* chore: grayscale and closing action-bar

* fix prerelease precedence

* fix duplicate url for addSsl on ssl proto

* no warning for soft uninstall

* fix: stop logs from repeating disconnected status and add 1 second delay between reconnection attempts

* fix stop on reactivation of critical task

* fix: fix disconnected toast

* fix: updates styles

* fix: updates styles

* misc fixes

* beta.33

* fix updates badge and initialization of marketplace preview controls

---------

Co-authored-by: waterplea <alexander@inkin.ru>
Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
Matt Hill
2025-07-08 12:08:27 -06:00
committed by GitHub
parent 340775a593
commit 7ba66c419a
32 changed files with 203 additions and 158 deletions

View File

@@ -394,7 +394,9 @@ impl RpcContext {
if let Some(service) = self.services.get(&package_id).await.as_ref() {
if let Some(input) = service
.get_action_input(procedure_id.clone(), action_id.clone())
.await?
.await
.log_err()
.flatten()
.and_then(|i| i.value)
{
action_input

View File

@@ -38,7 +38,7 @@ use crate::rpc_continuations::{Guid, RpcContinuation};
use crate::s9pk::v2::pack::{CONTAINER_DATADIR, CONTAINER_TOOL};
use crate::ssh::SSH_DIR;
use crate::system::{get_mem_info, sync_kiosk};
use crate::util::io::{create_file, IOHook};
use crate::util::io::{create_file, open_file, IOHook};
use crate::util::lshw::lshw;
use crate::util::net::WebSocketExt;
use crate::util::{cpupower, Invoke};
@@ -399,6 +399,11 @@ pub async fn init(
.invoke(crate::ErrorKind::Journald)
.await?;
mount_logs.complete();
tokio::io::copy(
&mut open_file("/run/startos/init.log").await?,
&mut tokio::io::stderr(),
)
.await?;
tracing::info!("Mounted Logs");
load_ca_cert.start();

View File

@@ -89,8 +89,13 @@ impl LxcManager {
log_mount: Option<&Path>,
config: LxcConfig,
) -> Result<LxcContainer, Error> {
let container = LxcContainer::new(self, log_mount, config).await?;
let mut guard = self.containers.lock().await;
let container = tokio::time::timeout(
Duration::from_secs(30),
LxcContainer::new(self, log_mount, config),
)
.await
.with_kind(ErrorKind::Timeout)??;
*guard = std::mem::take(&mut *guard)
.into_iter()
.filter(|g| g.strong_count() > 0)
@@ -223,6 +228,17 @@ impl LxcContainer {
.arg(&log_mount_point)
.invoke(crate::ErrorKind::Filesystem)
.await?;
match Command::new("chattr")
.arg("-R")
.arg("+C")
.arg(&log_mount_point)
.invoke(ErrorKind::Filesystem)
.await
{
Ok(_) => Ok(()),
Err(e) if e.source.to_string().contains("Operation not supported") => Ok(()),
Err(e) => Err(e),
}?;
Some(log_mount)
} else {
None

View File

@@ -62,12 +62,14 @@ impl BindInfo {
pub fn new(available_ports: &mut AvailablePorts, options: BindOptions) -> Result<Self, Error> {
let mut assigned_port = None;
let mut assigned_ssl_port = None;
if options.secure.is_some() {
assigned_port = Some(available_ports.alloc()?);
}
if options.add_ssl.is_some() {
assigned_ssl_port = Some(available_ports.alloc()?);
}
if let Some(secure) = options.secure {
if !secure.ssl || !options.add_ssl.is_some() {
assigned_port = Some(available_ports.alloc()?);
}
}
Ok(Self {
enabled: true,
options,

View File

@@ -176,29 +176,44 @@ impl Handler<RunAction> for ServiceActor {
)
.await
.with_kind(ErrorKind::Action)?;
if self
let package_id = package_id.clone();
for to_stop in self
.0
.ctx
.db
.mutate(|db| {
let mut critical_activated = false;
for (_, pde) in db.as_public_mut().as_package_data_mut().as_entries_mut()? {
critical_activated |= pde.as_tasks_mut().mutate(|tasks| {
Ok(update_tasks(tasks, package_id, action_id, &input, true))
})?;
let mut to_stop = Vec::new();
for (id, pde) in db.as_public_mut().as_package_data_mut().as_entries_mut()? {
if pde.as_tasks_mut().mutate(|tasks| {
Ok(update_tasks(tasks, &package_id, action_id, &input, true))
})? {
to_stop.push(id)
}
}
Ok(critical_activated)
Ok(to_stop)
})
.await
.result?
{
<Self as Handler<super::control::Stop>>::handle(
self,
id,
super::control::Stop { wait: false },
jobs,
)
.await;
if to_stop == package_id {
<Self as Handler<super::control::Stop>>::handle(
self,
id.clone(),
super::control::Stop { wait: false },
jobs,
)
.await;
} else {
self.0
.ctx
.services
.get(&to_stop)
.await
.as_ref()
.or_not_found(&to_stop)?
.stop(id.clone(), false)
.await?;
}
}
Ok(result)
}