From 33f30c491748abef284fac5807ede24ccf3cd321 Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Tue, 2 Dec 2025 09:44:15 +0100 Subject: [PATCH] - Fix phppgadmin config user name, - Run RedPanda Console under apache user and not root. --- Dockerfile | 25 +++++++++++++++++-------- ReleaseNotes.txt | 4 +++- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6bfbb84..ef9c8ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,12 +30,13 @@ ARG REDPANDA_CONSOLE_CONFIG="${REDPANDA_CONSOLE_HOME}/etc/redpanda-console-confi #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ARG TOOLSD='#!/bin/bash \n\ \n\ -mv '${PHPPGADMIN_CONFIG}'.ref '${PHPPGADMIN_CONFIG}' \n\ +cp '${PHPPGADMIN_CONFIG}'.ref '${PHPPGADMIN_CONFIG}' \n\ +chown apache:root '${PHPPGADMIN_CONFIG}' \n\ + \n\ sed -i "s/\t\$conf\[`servers`\]/\t\/\/\ $conf\[`servers`\]/" '${PHPPGADMIN_CONFIG}' \n\ sed -i "s/\$conf\[`extra_login_security`\] = true;/\$conf\[`extra_login_security`\] = false;/" '${PHPPGADMIN_CONFIG}' \n\ sed -i "s/?>//" '${PHPPGADMIN_CONFIG}' \n\ \n\ - \n\ for vars in POSTGRESQL_SERVER_NAME:desc POSTGRESQL_HOST:host POSTGRESQL_PORT:port \n\ do \n\ IFS=":" \n\ @@ -68,10 +69,11 @@ echo "?>" #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ARG REDPANDA_CONSOLED='#!/bin/bash \n\ \n\ -if [[ "${TOOLS_RPC_ENABLED}" != "TRUE" ]] \n\ +cp '${REDPANDA_CONSOLE_CONFIG}'.ref '${REDPANDA_CONSOLE_CONFIG}' \n\ +chown apache:root '${REDPANDA_CONSOLE_CONFIG}' \n\ + \n\ +if [[ "${KAFKA_BROKERS}" != "" ]] \n\ then \n\ - mv /etc/supervisord.d/redpanda_consoled.ini /etc/supervisord.d/redpanda_consoled.ini.disabled \n\ -else \n\ sed -i "s/^ - broker-/ #- broker-/" '${REDPANDA_CONSOLE_CONFIG}' \n\ \n\ for broker in ${KAFKA_BROKERS} \n\ @@ -82,13 +84,20 @@ else sed -i "s/^ #setBasePathFromXForwardedPrefix:/ setBasePathFromXForwardedPrefix:/" '${REDPANDA_CONSOLE_CONFIG}' \n\ sed -i "s/^#server:/server:/" '${REDPANDA_CONSOLE_CONFIG}' \n\ sed -i "s/^ #listenPort: 8080/ listenPort: '${REDPANDA_CONSOLE_PORT}'/" '${REDPANDA_CONSOLE_CONFIG}' \n\ +fi \n\ + \n\ +# RedPanda Console is disabled by default \n\ +if [[ "${TOOLS_RPC_ENABLED}" != "TRUE" ]] \n\ +then \n\ + file_enable /etc/supervisord.d/redpanda_consoled.ini FALSE \n\ fi' #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ARG REDPANDA_CONSOLED_INI='[program:redpanda_consoled] \n\ directory='${REDPANDA_CONSOLE_HOME}' \n\ -command='${REDPANDA_CONSOLE_HOME}'/bin/redpanda-console -config.filepath '${REDPANDA_CONSOLE_CONFIG}'' +command='${REDPANDA_CONSOLE_HOME}'/bin/redpanda-console -config.filepath '${REDPANDA_CONSOLE_CONFIG}' \n\ +user=apache' #------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -104,8 +113,8 @@ RUN urpmi.update -a && ln -s /etc/init.d/toolsd /etc/rcD.d/S40toolsd \ && mkdir -p ${REDPANDA_CONSOLE_HOME}/bin ${REDPANDA_CONSOLE_HOME}/etc \ && wget -q -O- "https://github.com/redpanda-data/console/releases/download/v2.7.2/redpanda_console_2.7.2_linux_amd64.tar.gz" | tar xzf - -C ${REDPANDA_CONSOLE_HOME}/bin \ - && wget -q -O- "https://docs.redpanda.com/24.2/shared/_attachments/redpanda-console-config.yaml" > ${REDPANDA_CONSOLE_CONFIG} \ + && wget -q -O- "https://docs.redpanda.com/24.2/shared/_attachments/redpanda-console-config.yaml" > ${REDPANDA_CONSOLE_CONFIG}.ref \ && echo -e "${REDPANDA_CONSOLED}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/redpanda_consoled \ && chmod a+x /etc/init.d/redpanda_consoled \ && ln -s /etc/init.d/redpanda_consoled /etc/rcD.d/S45redpanda_consoled \ - && echo -e "${REDPANDA_CONSOLED_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/redpanda_consoled.ini + && echo -e "${REDPANDA_CONSOLED_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/redpanda_consoled.ini diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index cce9777..17c37eb 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,8 +1,10 @@ ------------------------------------------------------------------------------------------------------------------------------------ -Rx3-Docker/Tools V 1.2.7 - A. GIBERT - 2025/11/29 +Rx3-Docker/Tools V 1.2.7 - A. GIBERT - 2025/12/02 ------------------------------------------------------------------------------------------------------------------------------------ - Use now the rx3 phpgadmin rpm, +- Fix phppgadmin config user name, +- Run RedPanda Console under apache user and not root, - Use now rx3-docker/php-apache:1.6.0-mga9 image, - Rebuild for updates.