mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
misc fixes
This commit is contained in:
committed by
Aiden McClelland
parent
4de560c342
commit
824bccda0e
@@ -117,7 +117,7 @@ pub async fn login(
|
|||||||
res.headers.insert(
|
res.headers.insert(
|
||||||
"set-cookie",
|
"set-cookie",
|
||||||
HeaderValue::from_str(&format!(
|
HeaderValue::from_str(&format!(
|
||||||
"session={}; SameSite=Strict; Expires=Fri, 31 Dec 9999 23:59:59 GMT;",
|
"session={}; SameSite=Lax; Expires=Fri, 31 Dec 9999 23:59:59 GMT;",
|
||||||
token
|
token
|
||||||
))
|
))
|
||||||
.with_kind(crate::ErrorKind::Unknown)?, // Should be impossible, but don't want to panic
|
.with_kind(crate::ErrorKind::Unknown)?, // Should be impossible, but don't want to panic
|
||||||
|
|||||||
@@ -171,6 +171,6 @@ pub async fn ui(
|
|||||||
let ptr = "/ui".parse::<JsonPointer>()? + &pointer;
|
let ptr = "/ui".parse::<JsonPointer>()? + &pointer;
|
||||||
Ok(WithRevision {
|
Ok(WithRevision {
|
||||||
response: (),
|
response: (),
|
||||||
revision: ctx.db.put(&ptr, &value, None).await?,
|
revision: Some(ctx.db.put(&ptr, &value, None).await?),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,9 +147,9 @@ impl StaticFiles {
|
|||||||
}
|
}
|
||||||
pub fn remote(id: &PackageId, version: &Version, icon_type: &str) -> Self {
|
pub fn remote(id: &PackageId, version: &Version, icon_type: &str) -> Self {
|
||||||
StaticFiles {
|
StaticFiles {
|
||||||
license: format!("/registry/packages/{}/{}/LICENSE.md", id, version),
|
license: format!("/marketplace/package/{}/{}/LICENSE.md", id, version),
|
||||||
instructions: format!("/registry/packages/{}/{}/INSTRUCTIONS.md", id, version),
|
instructions: format!("/marketplace/package/{}/{}/INSTRUCTIONS.md", id, version),
|
||||||
icon: format!("/registry/packages/{}/{}/icon.{}", id, version, icon_type),
|
icon: format!("/marketplace/package/{}/{}/icon.{}", id, version, icon_type),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
pub struct WithRevision<T> {
|
pub struct WithRevision<T> {
|
||||||
pub response: T,
|
pub response: T,
|
||||||
pub revision: Arc<Revision>,
|
pub revision: Option<Arc<Revision>>,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ pub async fn download_install_s9pk(
|
|||||||
let mut tx = handle.begin().await?;
|
let mut tx = handle.begin().await?;
|
||||||
|
|
||||||
if let Err(e) = cleanup_failed(&ctx, &mut tx, pkg_id, version).await {
|
if let Err(e) = cleanup_failed(&ctx, &mut tx, pkg_id, version).await {
|
||||||
|
let mut tx = handle.begin().await?;
|
||||||
log::error!(
|
log::error!(
|
||||||
"Failed to clean up {}@{}: {}: Adding to broken packages",
|
"Failed to clean up {}@{}: {}: Adding to broken packages",
|
||||||
pkg_id,
|
pkg_id,
|
||||||
@@ -312,10 +313,13 @@ pub async fn download_install_s9pk(
|
|||||||
);
|
);
|
||||||
let mut broken = crate::db::DatabaseModel::new()
|
let mut broken = crate::db::DatabaseModel::new()
|
||||||
.broken_packages()
|
.broken_packages()
|
||||||
.get_mut(&mut handle)
|
.get_mut(&mut tx)
|
||||||
.await?;
|
.await?;
|
||||||
broken.push(pkg_id.clone());
|
broken.push(pkg_id.clone());
|
||||||
broken.save(&mut handle).await?;
|
broken.save(&mut tx).await?;
|
||||||
|
tx.commit(None).await?;
|
||||||
|
} else {
|
||||||
|
tx.commit(None).await?;
|
||||||
}
|
}
|
||||||
Err(e)
|
Err(e)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user