updating a compose file over the API now saves it, not just deploys it

This commit is contained in:
jarek committed 2026-08-13 10:20:29 +02:00
1 parent 16ee5d82b9
commit cc0d50913a
2 files changed
+40 -17

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
/**
* The ONE formula for a stack's folder under a base dir on a host: `<base>/<stack>`.
* Deploy staging (write) and backup (read) share it so they can't diverge (#1383 / #1240).
* Pure + dependency-free, so both sides can import it.
*/
/** Trim + drop trailing slashes: `/data/stacks/` -> `/data/stacks`. */
export function normalizeBaseDir(base: string): string {
return base.trim().replace(/\/+$/, '');
}
/** `<normalized base>/<stackName>`. Name is used verbatim - do NOT slugify (both sides use it raw). */
export function stackDirIn(base: string, stackName: string): string {
return `${normalizeBaseDir(base)}/${stackName}`;
}