From 7691a8bb0358d13ae6a491d12e0cbc02c371bab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 31 Aug 2026 14:22:06 +0200 Subject: [PATCH] fix: adjust deployer config to prevent symlink loop issue with rsync --- deploy.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/deploy.php b/deploy.php index 26005d2..a2e89d6 100644 --- a/deploy.php +++ b/deploy.php @@ -69,6 +69,24 @@ $rsyncOptions = [ 'timeout' => 300, ]; +// The provider's rsync (3.5.0) fails to chdir into a destination whose path traverses +// symlinks, which /home/www/p704161 does: `change_dir#1 ... Too many levels of symbolic +// links (40)`. Verified: the same directory rsyncs fine when addressed relative to $HOME. +// Only contrib/rsync.php hands a path to rsync; every other task goes through the SSH +// shell, which resolves the absolute path without trouble, so deploy_path stays absolute. +set('remote_home', '/home/www/p704161'); + +set('rsync_dest', function () { + $releasePath = get('release_path'); + $home = rtrim(get('remote_home'), '/').'/'; + + if (!str_starts_with($releasePath, $home)) { + return $releasePath; + } + + return substr($releasePath, strlen($home)); +}); + host('prod') ->setHostname('185.243.135.29') ->setRemoteUser('p704161')