fix(update): set HOME for Go builds when service user home is not writable

Go toolchain downloads and sumdb checks also use $HOME/go even when
GOMODCACHE is set. Point HOME at the console data directory during
server auto-rebuilds.
This commit is contained in:
UNITRONIX
2026-06-07 00:39:02 +02:00
parent 73e3ae19eb
commit e7e4e359c1
+3
View File
@@ -764,6 +764,9 @@ function buildEnvWithGo(goBinPath) {
const { modCache, buildCache } = ensureGoCacheDirs();
env.GOMODCACHE = modCache;
env.GOCACHE = buildCache;
// betterdesk user's HOME is often /var/lib/betterdesk (root-owned).
// Go also writes toolchain/sumdb state under $HOME/go — redirect HOME.
env.HOME = config.dataDir;
} catch (err) {
console.warn(`[UPDATE] Could not prepare Go cache dirs: ${err.message}`);
}