From d4951678041228a92926d501de866a241734f902 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Tue, 29 Oct 2024 10:33:33 +0100 Subject: [PATCH] Set the correct rights and group during deploying --- deploy.nu | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deploy.nu b/deploy.nu index ae8f52f..fa9b03f 100644 --- a/deploy.nu +++ b/deploy.nu @@ -22,8 +22,16 @@ def main [host: string, destination: string, ssh_key: path] { copy_ssh ./target/($target)/release/mumble_web $destination invoke_ssh [rm -rf $"($destination)/static"] copy_ssh ./static/ $destination + invoke_ssh [chmod gu+x $"($destination)/mumble_web"] - invoke_ssh [chgrp -R www-data $"($destination)/mumble_web"] + + # "|| true" to suppress the possible non-zero return. + invoke_ssh [chgrp -Rf www-data $"($destination)/* || true"] + invoke_ssh [chmod -Rf g+rw $"($destination)/* || true"] + + # Add 'x' right for group (www-data) to all directories. + invoke_ssh [find $"($destination) -type d -exec chmod -f g+x {} + || true"] + invoke_ssh [sudo systemctl start mumble_web] print "Deployment finished" } -- 2.45.2