Skip to content

Commit 7db4fed

Browse files
author
Paul C
committed
v25.2.44: trim vault secret values + honest compose-editor Save wording
2 parents a3a2c88 + d7a8139 commit 7db4fed

6 files changed

Lines changed: 19 additions & 7 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wolfstack"
3-
version = "25.2.43"
3+
version = "25.2.44"
44
edition = "2024"
55
authors = ["Wolf Software Systems Ltd"]
66
description = "Server management platform for the Wolf software suite"

src/api/mod.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34178,14 +34178,21 @@ async fn secrets_save(
3417834178
let mut secrets = load_secrets();
3417934179
let now = now_iso();
3418034180

34181+
// Trim the value the same way we trim the key. A pasted credential or
34182+
// token almost always carries a trailing newline (copied from a
34183+
// terminal / password manager), which then gets injected into the
34184+
// container verbatim — the value LOOKS correct everywhere it's shown but
34185+
// downstream auth fails with no visible cause. `trim()` only touches
34186+
// leading/trailing whitespace, so internal structure (e.g. multi-line
34187+
// PEM bodies) is preserved.
3418134188
if let Some(existing) = secrets.iter_mut().find(|s| s.key == key) {
34182-
if let Some(ref v) = body.value { existing.value = v.clone(); }
34189+
if let Some(ref v) = body.value { existing.value = v.trim().to_string(); }
3418334190
if let Some(ref d) = body.description { existing.description = d.clone(); }
3418434191
existing.updated = now;
3418534192
} else {
3418634193
secrets.push(SecretEntry {
3418734194
key: key.clone(),
34188-
value: body.value.clone().unwrap_or_default(),
34195+
value: body.value.as_deref().unwrap_or("").trim().to_string(),
3418934196
description: body.description.clone().unwrap_or_default(),
3419034197
created: now.clone(),
3419134198
updated: now,

src/appstore/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,8 @@ fn synthesise_compose_template(app_id: &str, d: &DockerTarget) -> String {
647647
out.push_str("# Auto-generated docker-compose.yml for ");
648648
out.push_str(app_id);
649649
out.push_str(".\n");
650-
out.push_str("# Edit freely — saving re-runs `docker compose up -d`.\n");
650+
out.push_str("# Edit freely. Save writes this file; click \"Up\" in Compose Stacks\n");
651+
out.push_str("# to apply it (`docker compose up -d`) and inject any vault secrets.\n");
651652
out.push_str("services:\n");
652653

653654
// Main service.

web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5152,6 +5152,7 @@ <h3 id="compose-editor-title">Edit Stack</h3>
51525152
</div>
51535153
</div>
51545154
</div>
5155+
<div style="padding:8px 16px 0; font-size:11.5px; color:var(--text-muted); line-height:1.5;">Save writes the compose &amp; <code>.env</code> files. To apply them, click <strong>▶ Up</strong> on the stack — that runs <code>docker compose up -d</code> and injects vault secrets. (Restart does <em>not</em> re-read compose/env changes.)</div>
51555156
<div class="modal-footer" style="display:flex; justify-content:space-between;">
51565157
<div>
51575158
<button class="btn btn-sm" onclick="validateComposeYaml()" style="font-size:12px;">Validate</button>

web/js/app.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61067,7 +61067,10 @@ async function saveComposeFiles() {
6106761067
body: JSON.stringify({ name, content: env }),
6106861068
}),
6106961069
]);
61070-
showToast(`Stack "${name}" saved`, 'success');
61070+
// Saving only writes the files — it does NOT re-run docker
61071+
// compose. Tell the operator to click Up to apply, so a change
61072+
// that references a new vault secret doesn't silently stay stale.
61073+
showToast(`Stack "${name}" saved — click ▶ Up to apply the changes`, 'success', 5000);
6107161074
} else {
6107261075
// Create new stack
6107361076
const name = document.getElementById('compose-create-name').value.trim();
@@ -61085,7 +61088,7 @@ async function saveComposeFiles() {
6108561088
showToast(data.error || 'Failed to create stack', 'error');
6108661089
return;
6108761090
}
61088-
showToast(`Stack "${name}" created`, 'success');
61091+
showToast(`Stack "${name}" created — click ▶ Up to start it`, 'success', 5000);
6108961092
}
6109061093
closeComposeEditor();
6109161094
loadComposeStacks();

0 commit comments

Comments
 (0)