From 912fdfa49c1d46119e422d02b33909e33c24b7e7 Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 16 Dec 2023 12:23:44 -0500 Subject: [PATCH] use sums --- .gitignore | 1 + app/just_testing.sh | 3 +++ build/install_neato.sh | 20 +++++++++++++++++--- make-installer.sh | 5 +++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0ddca29..89ab23a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ neatoDeploy.phar neato_deploy.tar.gz.self phpstan.neon composer.lock +app/sumfiles.sig build/neatoDeploy.phar.pubkey build/neatoDeploy.phar.sig build/private.pem diff --git a/app/just_testing.sh b/app/just_testing.sh index 7765080..c3bd8da 100755 --- a/app/just_testing.sh +++ b/app/just_testing.sh @@ -2,5 +2,8 @@ if [ ! -L deploy_files ]; then ln -s ../deploy_files . fi +if [ ! -L sumfiles.sig ]; then + ln -s ../build/sumfiles.sig . +fi php -c build/neato_deploy_php_cli.ini -f neato.php $@ diff --git a/build/install_neato.sh b/build/install_neato.sh index 9a39373..03b138a 100755 --- a/build/install_neato.sh +++ b/build/install_neato.sh @@ -1,5 +1,19 @@ #!/bin/bash +MY_GROUP=www-data +# Function to check if a group exists +group_exists() { + if getent group "$1" >/dev/null 2>&1; then + return 0 # Group exists + else + return 1 # Group does not exist + fi +} + +if ! group_exists "$MY_GROUP"; then + groupadd "$MY_GROUP" +fi + PHPCLI='php8.3-cli' PHPMBString='php8.3-mbstring' @@ -36,9 +50,9 @@ pushd /opt/neatoDeployments /usr/bin/dpkg -s $PHPMBString 2>/dev/null >/dev/null || /usr/bin/apt-get install -y $PHPMBString /usr/bin/dpkg -s curl 2>/dev/null >/dev/null || /usr/bin/apt-get install -y curl -/usr/bin/chown www-data:www-data neato* -/usr/bin/chown www-data:www-data make-sums.sh -/usr/bin/chown -R www-data:www-data deploy_files +/usr/bin/chgrp $MY_GROUP neato* +/usr/bin/chgrp $MY_GROUP make-sums.sh +/usr/bin/chgrp -R $MY_GROUP deploy_files /usr/bin/chmod 775 neatoDeploy.phar /usr/bin/chmod 775 neato_deploy.sh diff --git a/make-installer.sh b/make-installer.sh index ca6c47c..798a708 100755 --- a/make-installer.sh +++ b/make-installer.sh @@ -21,6 +21,11 @@ if [ ! -f "sumfiles.sig" ]; then generate_password fi +if ! which "openssl" >/dev/null 2>&1; then + echo "openssl is not installed!" + exit 3 +fi + if [ ! -f "private.pem" ]; then openssl genrsa -out private.pem 4096 openssl rsa -in private.pem -pubout -out neatoDeploy.phar.pubkey