Update 3 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 8s

This commit is contained in:
j
2026-01-26 22:01:44 +13:00
parent e994b992b4
commit 20e8e40ee6
3 changed files with 18 additions and 12 deletions

View File

@@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
source "${AGENT_PATH}/common.sh" source "${AGENT_PATH}/common.sh"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
_check_required_env_vars "CONTAINER_NAME" "GRAYLOG_PASSWORD_SECRET" "GRAYLOG_ROOT_PASSWORD" _check_required_env_vars "CONTAINER_NAME" "GRAYLOG_PASSWORD_SECRET" "GRAYLOG_ROOT_PASSWORD"
# Convert plain text password to SHA256 for Graylog # Convert plain text password to SHA256 for Graylog
export GRAYLOG_ROOT_PASSWORD_SHA2=$(echo -n "${GRAYLOG_ROOT_PASSWORD}" | sha256sum | cut -d' ' -f1) GRAYLOG_ROOT_PASSWORD_SHA2=$(echo -n "${GRAYLOG_ROOT_PASSWORD}" | sha256sum | cut -d' ' -f1)
export GRAYLOG_ROOT_PASSWORD_SHA2
# Check Docker # Check Docker
_check_docker_installed || _die "Docker test failed" _check_docker_installed || _die "Docker test failed"

View File

@@ -7,7 +7,8 @@ _check_required_env_vars "CONTAINER_NAME" "GRAYLOG_ROOT_PASSWORD"
# It is used to start the service on the server. # It is used to start the service on the server.
# Convert plain text password to SHA256 for Graylog # Convert plain text password to SHA256 for Graylog
export GRAYLOG_ROOT_PASSWORD_SHA2=$(echo -n "${GRAYLOG_ROOT_PASSWORD}" | sha256sum | cut -d' ' -f1) GRAYLOG_ROOT_PASSWORD_SHA2=$(echo -n "${GRAYLOG_ROOT_PASSWORD}" | sha256sum | cut -d' ' -f1)
export GRAYLOG_ROOT_PASSWORD_SHA2
docker compose -p "${CONTAINER_NAME}" up -d || _die "Failed to start Graylog stack" docker compose -p "${CONTAINER_NAME}" up -d || _die "Failed to start Graylog stack"

View File

@@ -49,6 +49,8 @@ fi
if [ -z "$SYSTEM_TYPE" ]; then if [ -z "$SYSTEM_TYPE" ]; then
echo " Could not auto-detect system type." echo " Could not auto-detect system type."
# Check if running interactively
if [ -t 0 ]; then
echo " Please select your system:" echo " Please select your system:"
echo " 1) Raspberry Pi" echo " 1) Raspberry Pi"
echo " 2) Ubuntu (x86_64/Mac Mini)" echo " 2) Ubuntu (x86_64/Mac Mini)"
@@ -58,6 +60,9 @@ if [ -z "$SYSTEM_TYPE" ]; then
2) SYSTEM_TYPE="ubuntu" ;; 2) SYSTEM_TYPE="ubuntu" ;;
*) _die "Invalid choice. Installation cancelled." ;; *) _die "Invalid choice. Installation cancelled." ;;
esac esac
else
_die "Could not auto-detect system type. Set SYSTEM_TYPE=rpi or SYSTEM_TYPE=ubuntu in service.env"
fi
fi fi
echo "" echo ""