Compare commits

..

1 Commits

Author SHA1 Message Date
avigailo
c62966d1f5 fix attachment web response enum 2025-11-23 09:48:51 +02:00
2 changed files with 14 additions and 25 deletions

View File

@@ -15,28 +15,13 @@ var_mode=
var_token=
var_ignore=
init=
active_watchdog_pid=
cleanup() {
local signal="$1"
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Signal ${signal} was received, exiting gracefully..." >&2
if [ -n "${active_watchdog_pid}" ] && ps -p ${active_watchdog_pid} > /dev/null 2>&1; then
kill -TERM ${active_watchdog_pid} 2>/dev/null || true
wait ${active_watchdog_pid} 2>/dev/null || true
fi
echo "Cleanup completed. Exiting now." >&2
exit 0
}
trap 'cleanup SIGTERM' SIGTERM
trap 'cleanup SIGINT' SIGINT
if [ ! -f /nano-service-installers/$ORCHESTRATION_INSTALLATION_SCRIPT ]; then
echo "Error: agent installation package doesn't exist."
exit 1
fi
if [ -z "$1" ]; then
if [ -z $1 ]; then
var_mode="--hybrid_mode"
fi
@@ -60,30 +45,30 @@ while true; do
shift
done
if [ -z "$var_token" ] && [ "$var_mode" != "--hybrid_mode" ]; then
if [ -z $var_token ] && [ $var_mode != "--hybrid_mode" ]; then
var_token=$(env | grep 'AGENT_TOKEN=' | cut -d'=' -f2-)
if [ -z "$var_token" ]; then
if [ -z $var_token ]; then
echo "Error: Token was not provided as input argument."
exit 1
fi
fi
orchestration_service_installation_flags="--container_mode --skip_registration"
if [ -n "$var_token" ]; then
if [ ! -z $var_token ]; then
export AGENT_TOKEN="$var_token"
orchestration_service_installation_flags="$orchestration_service_installation_flags --token $var_token"
fi
if [ -n "$var_fog_address" ]; then
if [ ! -z $var_fog_address ]; then
orchestration_service_installation_flags="$orchestration_service_installation_flags --fog $var_fog_address"
fi
if [ -n "$var_proxy" ]; then
if [ ! -z $var_proxy ]; then
orchestration_service_installation_flags="$orchestration_service_installation_flags --proxy $var_proxy"
fi
if [ -n "$var_mode" ]; then
if [ ! -z $var_mode ]; then
orchestration_service_installation_flags="$orchestration_service_installation_flags $var_mode"
fi
if [ -n "$var_ignore" ]; then
if [ ! -z "$var_ignore" ]; then
orchestration_service_installation_flags="$orchestration_service_installation_flags $var_ignore"
fi
@@ -114,7 +99,7 @@ fi
# use advanced model if exist as data for agent
FILE=/advanced-model/open-appsec-advanced-model.tgz
if [ -f "$FILE" ]; then
tar -xzvf "$FILE" -C /etc/cp/conf/waap
tar -xzvf $FILE -C /etc/cp/conf/waap
fi
touch /etc/cp/watchdog/wd.startup

View File

@@ -227,7 +227,11 @@ typedef enum ngx_web_response_type
#endif
{
CUSTOM_WEB_RESPONSE,
REDIRECT_WEB_RESPONSE
CUSTOM_WEB_BLOCK_PAGE_RESPONSE,
RESPONSE_CODE_ONLY,
REDIRECT_WEB_RESPONSE,
NO_WEB_RESPONSE
} ngx_web_response_type_e;
typedef struct __attribute__((__packed__)) ngx_http_cp_inject_data {