From ebfac8de9250c3af5d3e0e40c3f6e86b7264c85d Mon Sep 17 00:00:00 2001 From: DeNNiiInc Date: Thu, 1 Jan 2026 22:24:31 +1100 Subject: [PATCH] Update install.sh for single-script install capability --- install.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/install.sh b/install.sh index ae6e000..17a291c 100644 --- a/install.sh +++ b/install.sh @@ -505,6 +505,28 @@ echo 'www-data ALL=(ALL) NOPASSWD: /usr/bin/pkill *' >> /etc/sudoers.d/www-data- echo 'www-data ALL=(ALL) NOPASSWD: /usr/bin/rm *' >> /etc/sudoers.d/www-data-sniper chmod 440 /etc/sudoers.d/www-data-sniper +# Configure Git Safe Directory +echo -e "$OKBLUE[*]$RESET Configuring Git permissions... $RESET" +git config --system --add safe.directory /usr/share/sniper 2>/dev/null +git config --global --add safe.directory /usr/share/sniper 2>/dev/null + +# Generate Version File +echo -e "$OKBLUE[*]$RESET Generating version information... $RESET" +cd $INSTALL_DIR +git rev-parse --short HEAD > /var/www/html/ultyscan/.version 2>/dev/null +git rev-parse HEAD >> /var/www/html/ultyscan/.version 2>/dev/null +git rev-parse --abbrev-ref HEAD >> /var/www/html/ultyscan/.version 2>/dev/null +git log -1 --format=%ci >> /var/www/html/ultyscan/.version 2>/dev/null +chown www-data:www-data /var/www/html/ultyscan/.version 2>/dev/null + +# Deploy Secrets +echo -e "$OKBLUE[*]$RESET Deploying secrets configuration... $RESET" +if [ -f "$INSTALL_DIR/secrets.php" ]; then + cp $INSTALL_DIR/secrets.php /var/www/html/secrets.php + chown www-data:www-data /var/www/html/secrets.php + chmod 640 /var/www/html/secrets.php +fi + # Configure Apache Port 8888 echo -e "$OKBLUE[*]$RESET Configuring Apache on port 8888... $RESET" if ! grep -q "Listen 8888" /etc/apache2/ports.conf; then