mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-27 14:30:44 -07:00
fix(offload): resolve rsync permission errors and refine remote ownership
This commit is contained in:
@@ -54,8 +54,8 @@ export async function runOrchestrator(args: string[], env: NodeJS.ProcessEnv = p
|
||||
|
||||
if (check.status !== 0) {
|
||||
console.log(' - Provisioning isolated git worktree...');
|
||||
// Fix permissions first
|
||||
await provider.exec(`sudo docker exec -u root maintainer-worker chown -R node:node ${containerHome}/dev`);
|
||||
// Only re-own the worktrees directory, NOT the entire home dir or scripts
|
||||
await provider.exec(`sudo docker exec -u root maintainer-worker mkdir -p ${containerHome}/dev/worktrees && sudo docker exec -u root maintainer-worker chown -R node:node ${containerHome}/dev/worktrees`);
|
||||
|
||||
const setupCmd = `
|
||||
git config --global --add safe.directory ${remoteWorkDir} && \
|
||||
|
||||
@@ -56,7 +56,9 @@ export class GceConnectionManager {
|
||||
|
||||
sync(localPath: string, remotePath: string, options: { delete?: boolean; exclude?: string[] } = {}): number {
|
||||
const fullRemote = this.getMagicRemote();
|
||||
const rsyncArgs = ['-avz', '--quiet'];
|
||||
// We use --no-t and --no-perms to avoid "Operation not permitted" errors
|
||||
// when syncing to volumes that might have UID mismatches with the container.
|
||||
const rsyncArgs = ['-rvz', '--quiet', '--no-t', '--no-perms', '--no-owner', '--no-group'];
|
||||
if (options.delete) rsyncArgs.push('--delete');
|
||||
if (options.exclude) options.exclude.forEach(ex => rsyncArgs.push(`--exclude="${ex}"`));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user