fix entrypoint

This commit is contained in:
vcerenu
2024-04-15 12:12:46 -03:00
parent ff6b7fd5eb
commit 816f822876
3 changed files with 24 additions and 4 deletions
@@ -34,6 +34,7 @@ COPY config/wazuh.yml $INSTALL_DIR/data/wazuh/config/
RUN mkdir -p $INSTALL_DIR/data/wazuh && chmod -R 775 $INSTALL_DIR/data/wazuh
RUN mkdir -p $INSTALL_DIR/data/wazuh/config && chmod -R 775 $INSTALL_DIR/data/wazuh/config
RUN mkdir -p $INSTALL_DIR/data/wazuh/logs && chmod -R 775 $INSTALL_DIR/data/wazuh/logs
RUN mkdir /wazuh-config-mount && chmod -R 775 /wazuh-config-mount
################################################################################
# Build stage 1 (the current Wazuh dashboard image):
@@ -2,6 +2,12 @@
# Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2)
INSTALL_DIR=/usr/share/wazuh-dashboard
WAZUH_CONFIG_MOUNT=/wazuh-config-mount
exec_cmd_stdout() {
eval $1 2>&1 || error_and_exit "$1"
}
DASHBOARD_USERNAME="${DASHBOARD_USERNAME:-kibanaserver}"
DASHBOARD_PASSWORD="${DASHBOARD_PASSWORD:-kibanaserver}"
@@ -186,15 +192,28 @@ function runOpensearchDashboards {
value=${!env_var}
if [[ -n $value ]]; then
longopt="--${opensearch_dashboards_var}=${value}"
longoptfile="--${opensearch_dashboards_var}: ${value}"
longopts+=("${longopt}")
echo $longopt | sed 's/--//' >> $OPENSEARCH_DASHBOARDS_HOME/config/opensearch_dashboards.yml
echo $longoptfile | sed 's/--//' >> $OPENSEARCH_DASHBOARDS_HOME/config/opensearch_dashboards.yml
cat $OPENSEARCH_DASHBOARDS_HOME/config/opensearch_dashboards.yml
fi
done
fi
/usr/share/wazuh-dashboard/bin/opensearch-dashboards -c /usr/share/wazuh-dashboard/config/opensearch_dashboards.yml "${longopts[@]}"
/usr/share/wazuh-dashboard/bin/opensearch-dashboards -c /usr/share/wazuh-dashboard/config/opensearch_dashboards.yml
}
mount_files() {
if [ -e $WAZUH_CONFIG_MOUNT/* ]
then
print "Identified Wazuh cdashboard onfiguration files to mount..."
exec_cmd_stdout "cp --verbose -r $WAZUH_CONFIG_MOUNT/* $INSTALL_DIR"
else
print "No Wazuh dashboard configuration files to mount..."
fi
}
mount_files
runOpensearchDashboards
+2 -2
View File
@@ -100,8 +100,8 @@ services:
- ./config/wazuh_indexer_ssl_certs/wazuh.dashboard.pem:/usr/share/wazuh-dashboard/certs/wazuh-dashboard.pem
- ./config/wazuh_indexer_ssl_certs/wazuh.dashboard-key.pem:/usr/share/wazuh-dashboard/certs/wazuh-dashboard-key.pem
- ./config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-dashboard/certs/root-ca.pem
- ./config/wazuh_dashboard/opensearch_dashboards.yml:/usr/share/wazuh-dashboard/config/opensearch_dashboards.yml
- ./config/wazuh_dashboard/wazuh.yml:/usr/share/wazuh-dashboard/data/wazuh/config/wazuh.yml
- ./config/wazuh_dashboard/opensearch_dashboards.yml:/wazuh-config-mount/config/opensearch_dashboards.yml
- ./config/wazuh_dashboard/wazuh.yml:/wazuh-config-mount/data/wazuh/config/wazuh.yml
- wazuh-dashboard-config:/usr/share/wazuh-dashboard/data/wazuh/config
- wazuh-dashboard-custom:/usr/share/wazuh-dashboard/plugins/wazuh/public/assets/custom
depends_on: