mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 09:35:39 +00:00
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:
@@ -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}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user