update versions

This commit is contained in:
2025-05-07 18:16:02 +02:00
parent 75079b2a37
commit 23cbe69d3e
6 changed files with 34 additions and 29 deletions

View File

@@ -5,12 +5,12 @@ LABEL io.hass.name="GVM Scanner"
LABEL io.hass.description="un a GVM (OpenVAS) scanner as a Home Assistant add-on." LABEL io.hass.description="un a GVM (OpenVAS) scanner as a Home Assistant add-on."
LABEL io.hass.arch="amd64|aarch64" LABEL io.hass.arch="amd64|aarch64"
LABEL io.hass.type="addon" LABEL io.hass.type="addon"
LABEL io.hass.version="0.0.2-beta" LABEL io.hass.version="0.0.3-beta"
# Set timezone # Set timezone
ENV TZ=Europe/Rome ENV TZ=Europe/Rome
# Install jq for parsing config # Install jq for config parsing
RUN apt-get update && apt-get install -y jq \ RUN apt-get update && apt-get install -y jq \
&& apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get clean && rm -rf /var/lib/apt/lists/*
@@ -18,11 +18,11 @@ RUN apt-get update && apt-get install -y jq \
COPY run.sh /run.sh COPY run.sh /run.sh
RUN chmod +x /run.sh RUN chmod +x /run.sh
# Expose default GVM Web UI port # Expose GVM Web UI port
EXPOSE 9392 EXPOSE 9392
# Optionally persist data # Mountable volume
VOLUME [ "/data" ] VOLUME [ "/data" ]
# Set entrypoint # Entrypoint
CMD [ "/run.sh" ] CMD [ "/run.sh" ]

View File

@@ -1,6 +1,6 @@
{ {
"name": "GVM Scanner", "name": "GVM Scanner",
"version": "0.0.2-beta", "version": "0.0.3-beta",
"slug": "gvm", "slug": "gvm",
"description": "Run a GVM (OpenVAS) scanner as a Home Assistant add-on.", "description": "Run a GVM (OpenVAS) scanner as a Home Assistant add-on.",
"startup": "services", "startup": "services",

View File

@@ -7,7 +7,7 @@ log() {
echo "[GVM ADD-ON] $(date +"%Y-%m-%d %H:%M:%S") - $*" echo "[GVM ADD-ON] $(date +"%Y-%m-%d %H:%M:%S") - $*"
} }
# Load user config passed by Home Assistant (as JSON env vars) # Path to options provided by Home Assistant
CONFIG_PATH="/data/options.json" CONFIG_PATH="/data/options.json"
if [ ! -f "$CONFIG_PATH" ]; then if [ ! -f "$CONFIG_PATH" ]; then
@@ -15,9 +15,13 @@ if [ ! -f "$CONFIG_PATH" ]; then
exit 1 exit 1
fi fi
# Extract variables using jq # Read variables from options.json
USERNAME=$(jq -r '.username' "$CONFIG_PATH") USERNAME=$(jq -r '.username' "$CONFIG_PATH")
PASSWORD=$(jq -r '.password' "$CONFIG_PATH") PASSWORD=$(jq -r '.password' "$CONFIG_PATH")
TZ=$(jq -r '.TZ // empty' "$CONFIG_PATH")
DB_PASSWORD=$(jq -r '.DB_PASSWORD // empty' "$CONFIG_PATH")
HTTPS=$(jq -r '.HTTPS // "false"' "$CONFIG_PATH")
SSHD=$(jq -r '.SSHD // "true"' "$CONFIG_PATH")
# Validate # Validate
if [ -z "$USERNAME" ] || [ -z "$PASSWORD" ]; then if [ -z "$USERNAME" ] || [ -z "$PASSWORD" ]; then
@@ -25,17 +29,20 @@ if [ -z "$USERNAME" ] || [ -z "$PASSWORD" ]; then
exit 1 exit 1
fi fi
# Set them for the environment # Export variables for GVM
export USERNAME export USERNAME
export PASSWORD export PASSWORD
export DB_PASSWORD="$PASSWORD" export DB_PASSWORD
export TZ
export HTTPS
export SSHD
log "INFO: Starting GVM (OpenVAS) add-on as user $USERNAME..." log "INFO: Starting GVM (OpenVAS) add-on as user '$USERNAME'"
# Setup timezone # Set timezone if available
if [ -n "$TZ" ]; then if [ -n "$TZ" ]; then
log "INFO: Setting timezone to $TZ" log "INFO: Setting timezone to $TZ"
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime
echo "$TZ" > /etc/timezone echo "$TZ" > /etc/timezone
fi fi
@@ -47,4 +54,4 @@ if [ ! -d "$DATA_DIR" ]; then
fi fi
log "INFO: Launching GVM service..." log "INFO: Launching GVM service..."
exec /usr/local/bin/dumb-init gvm-start | tee -a "$DATA_DIR/gvm.log" exec gvm-start | tee -a "$DATA_DIR/gvm.log"

View File

@@ -5,7 +5,7 @@ LABEL io.hass.name="SonarQube"
LABEL io.hass.description="SonarQube Server helps you comply with common code security standards, such as the NIST SSDF, OWASP, CWE, STIG, and CASA." LABEL io.hass.description="SonarQube Server helps you comply with common code security standards, such as the NIST SSDF, OWASP, CWE, STIG, and CASA."
LABEL io.hass.arch="amd64|aarch64" LABEL io.hass.arch="amd64|aarch64"
LABEL io.hass.type="addon" LABEL io.hass.type="addon"
LABEL io.hass.version="0.0.2-beta" LABEL io.hass.version="0.0.3-beta"
# Build parameters # Build parameters
ARG SONARQUBE_VERSION=9.9.6.92038 ARG SONARQUBE_VERSION=9.9.6.92038
@@ -36,9 +36,8 @@ RUN curl -L "https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-$
COPY run.sh /usr/local/bin/run.sh COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh RUN chmod +x /usr/local/bin/run.sh
# Expose the internal port (always 9000) # Expose the internal port
EXPOSE 9000 EXPOSE 9000
# Run as the 'sonarqube' user # All setup (timezone, mkdir) runs as root; run.sh will drop to sonarqube
USER sonarqube
ENTRYPOINT ["/usr/local/bin/run.sh"] ENTRYPOINT ["/usr/local/bin/run.sh"]

View File

@@ -1,6 +1,6 @@
{ {
"name": "SonarQube", "name": "SonarQube",
"version": "0.0.2-beta", "version": "0.0.3-beta",
"slug": "sonarqube", "slug": "sonarqube",
"description": "SonarQube Server helps you comply with common code security standards, such as the NIST SSDF, OWASP, CWE, STIG, and CASA.", "description": "SonarQube Server helps you comply with common code security standards, such as the NIST SSDF, OWASP, CWE, STIG, and CASA.",
"arch": ["amd64", "armv7", "aarch64"], "arch": ["amd64", "armv7", "aarch64"],
@@ -11,7 +11,6 @@
"options": { "options": {
"data_path": "/share/sonarqube/data", "data_path": "/share/sonarqube/data",
"extensions_path": "/share/sonarqube/extensions", "extensions_path": "/share/sonarqube/extensions",
"ui_port": 9000,
"jdbc_url": "jdbc:postgresql://sonarqube_db:5432/sonar", "jdbc_url": "jdbc:postgresql://sonarqube_db:5432/sonar",
"jdbc_username": "", "jdbc_username": "",
"jdbc_password": "", "jdbc_password": "",
@@ -20,7 +19,6 @@
"schema": { "schema": {
"data_path": "str", "data_path": "str",
"extensions_path": "str", "extensions_path": "str",
"ui_port": "int",
"jdbc_url": "str", "jdbc_url": "str",
"jdbc_username": "str", "jdbc_username": "str",
"jdbc_password": "str", "jdbc_password": "str",

View File

@@ -12,17 +12,18 @@ set -e
: "${SONAR_JDBC_PASSWORD:?Serve SONAR_JDBC_PASSWORD}" : "${SONAR_JDBC_PASSWORD:?Serve SONAR_JDBC_PASSWORD}"
# --- Imposto timezone a container start --- # --- Imposto timezone a container start ---
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime && echo "${TZ}" > /etc/timezone ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime
echo "${TZ}" > /etc/timezone
# --- Creo e monto le cartelle host in container --- # --- Creo e monto le cartelle host in container ---
mkdir -p "${DATA_PATH}" "${EXT_PATH}" mkdir -p "${DATA_PATH}" "${EXT_PATH}"
cd "${SONARQUBE_HOME}" cd "${SONARQUBE_HOME}"
# sposto le cartelle interne originali (evt. backup) # Sposto le cartelle interne originali (evt. backup)
[ -d data ] && mv data data.orig || true [ -d data ] && mv data data.orig || true
[ -d extensions ]&& mv extensions extensions.orig || true [ -d extensions ] && mv extensions extensions.orig || true
# link simbolici verso le cartelle condivise # Link simbolici verso le cartelle condivise
ln -s "${DATA_PATH}" data ln -s "${DATA_PATH}" data
ln -s "${EXT_PATH}" extensions ln -s "${EXT_PATH}" extensions
@@ -31,5 +32,5 @@ export SONAR_JDBC_URL
export SONAR_JDBC_USERNAME export SONAR_JDBC_USERNAME
export SONAR_JDBC_PASSWORD export SONAR_JDBC_PASSWORD
# --- Avvio SonarQube in foreground --- # --- Avvio SonarQube in foreground come utente non-root ---
exec "${SONARQUBE_BIN}/sonar.sh" console exec su-exec sonarqube "${SONARQUBE_BIN}/sonar.sh" console