openvibers/openvibe.live Commits
Restore 'shipped' on the home page, /updates and chat deploy notices: since the release layout (C-76) the release worktree is root-owned, so git refused the service user ('dubious ownership') and all three read nothing; their read-only git calls now pass -c safe.directory=*
Changes
@@@ -37,7 +37,8 @@ const REPLAY_MS = 15 * 60 * 1000;let _live = null; // { payload, until, sent: WeakSet }const git = (args, timeout = 5000) => new Promise((resolve) => {-- execFile('git', args, { cwd: REPO_DIR, encoding: 'utf8', timeout, maxBuffer: 1024 * 1024 }, (err, out) => resolve(err ? '' : String(out || '')));++ // -c safe.directory=*: the release layout's worktrees are root-owned and the service user only reads them.++ execFile('git', ['-c', 'safe.directory=*', ...args], { cwd: REPO_DIR, encoding: 'utf8', timeout, maxBuffer: 1024 * 1024 }, (err, out) => resolve(err ? '' : String(out || '')));});const parseLog = (raw) => raw.trim().split('\n').filter(Boolean).map((line) => {@@@ -413,7 +413,8 @@ function _refreshLatestUpdate() {if (_updateCache.running) return;_updateCache.running = true;require('child_process').execFile(-- 'git', ['--no-pager', 'log', '--pretty=format:%h||%s||%aI', '-1'],++ // -c safe.directory=*: the release layout's worktrees are root-owned; the service user only reads them.++ 'git', ['-c', 'safe.directory=*', '--no-pager', 'log', '--pretty=format:%h||%s||%aI', '-1'],{ cwd: require('path').join(__dirname, '../..'), encoding: 'utf8', timeout: 4000 },(err, stdout) => {_updateCache.running = false;@@@ -815,7 +815,8 @@ function readCommits(limit) {// Coalesce: a burst of first-loads after a deploy must not spawn a git process each.if (_updatesCache.inflight) return _updatesCache.inflight;_updatesCache.inflight = new Promise((resolve) => {-- execFile('git', ['--no-pager', 'log', '--pretty=format:%H||%h||%s||%an||%aI', `-${limit}`],++ // -c safe.directory=*: the release layout's worktrees are root-owned; the service user only reads them.++ execFile('git', ['-c', 'safe.directory=*', '--no-pager', 'log', '--pretty=format:%H||%h||%s||%an||%aI', `-${limit}`],{ cwd: REPO_DIR, encoding: 'utf8', timeout: 5000, maxBuffer: 1024 * 1024 },(err, stdout) => {_updatesCache.inflight = null;
@@ -37,7 +37,8 @@ const REPLAY_MS = 15 * 60 * 1000;
@@ -37,7 +37,8 @@ const REPLAY_MS = 15 * 60 * 1000;
let _live = null; // { payload, until, sent: WeakSet }
let _live = null; // { payload, until, sent: WeakSet }
const git = (args, timeout = 5000) => new Promise((resolve) => {
const git = (args, timeout = 5000) => new Promise((resolve) => {
- execFile('git', args, { cwd: REPO_DIR, encoding: 'utf8', timeout, maxBuffer: 1024 * 1024 }, (err, out) => resolve(err ? '' : String(out || '')));
+ // -c safe.directory=*: the release layout's worktrees are root-owned and the service user only reads them.
+ execFile('git', ['-c', 'safe.directory=*', ...args], { cwd: REPO_DIR, encoding: 'utf8', timeout, maxBuffer: 1024 * 1024 }, (err, out) => resolve(err ? '' : String(out || '')));
});
});
const parseLog = (raw) => raw.trim().split('\n').filter(Boolean).map((line) => {
const parseLog = (raw) => raw.trim().split('\n').filter(Boolean).map((line) => {
@@ -413,7 +413,8 @@ function _refreshLatestUpdate() {
@@ -413,7 +413,8 @@ function _refreshLatestUpdate() {
if (_updateCache.running) return;
if (_updateCache.running) return;
_updateCache.running = true;
_updateCache.running = true;
require('child_process').execFile(
require('child_process').execFile(
- 'git', ['--no-pager', 'log', '--pretty=format:%h||%s||%aI', '-1'],
+ // -c safe.directory=*: the release layout's worktrees are root-owned; the service user only reads them.
+ 'git', ['-c', 'safe.directory=*', '--no-pager', 'log', '--pretty=format:%h||%s||%aI', '-1'],
{ cwd: require('path').join(__dirname, '../..'), encoding: 'utf8', timeout: 4000 },
{ cwd: require('path').join(__dirname, '../..'), encoding: 'utf8', timeout: 4000 },
(err, stdout) => {
(err, stdout) => {
_updateCache.running = false;
_updateCache.running = false;
@@ -815,7 +815,8 @@ function readCommits(limit) {
@@ -815,7 +815,8 @@ function readCommits(limit) {
// Coalesce: a burst of first-loads after a deploy must not spawn a git process each.
// Coalesce: a burst of first-loads after a deploy must not spawn a git process each.
if (_updatesCache.inflight) return _updatesCache.inflight;
if (_updatesCache.inflight) return _updatesCache.inflight;
_updatesCache.inflight = new Promise((resolve) => {
_updatesCache.inflight = new Promise((resolve) => {
- execFile('git', ['--no-pager', 'log', '--pretty=format:%H||%h||%s||%an||%aI', `-${limit}`],
+ // -c safe.directory=*: the release layout's worktrees are root-owned; the service user only reads them.
+ execFile('git', ['-c', 'safe.directory=*', '--no-pager', 'log', '--pretty=format:%H||%h||%s||%an||%aI', `-${limit}`],
{ cwd: REPO_DIR, encoding: 'utf8', timeout: 5000, maxBuffer: 1024 * 1024 },
{ cwd: REPO_DIR, encoding: 'utf8', timeout: 5000, maxBuffer: 1024 * 1024 },
(err, stdout) => {
(err, stdout) => {
_updatesCache.inflight = null;
_updatesCache.inflight = null;