From: Greg Burri Date: Tue, 29 Oct 2024 09:33:33 +0000 (+0100) Subject: Set the correct rights and group during deploying X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=mumble_web.git Set the correct rights and group during deploying --- 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" }