File tree Expand file tree Collapse file tree
experimental/podman-systemd Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -301,6 +301,11 @@ Set the Redis password:
301301REDIS_PASSWORD=
302302```
303303
304+ Enable passwordless Redis connection (defaults to false for security):
305+ ``` bash
306+ ENABLE_REDIS_EMPTY_PASSWORD=false
307+ ```
308+
304309Set the base URL:
305310``` bash
306311BASE_URL=https://< IP> :10443
Original file line number Diff line number Diff line change @@ -15,7 +15,15 @@ export MYSQL_DATABASE=${MYSQL_DATABASE:-misp}
1515export MYSQL_CMD=" mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -P $MYSQL_PORT -h $MYSQL_HOST -r -N $MYSQL_DATABASE "
1616export REDIS_HOST=${REDIS_HOST:- redis}
1717export REDIS_PORT=${REDIS_PORT:- 6379}
18- export REDIS_PASSWORD=${REDIS_PASSWORD:- redispassword}
18+ export ENABLE_REDIS_EMPTY_PASSWORD=${ENABLE_REDIS_EMPTY_PASSWORD:- false}
19+
20+ # Set Redis password based on ENABLE_REDIS_EMPTY_PASSWORD setting
21+ if [ " $ENABLE_REDIS_EMPTY_PASSWORD " = " true" ]; then
22+ # This still need to be set to empty string to ensure all places where it's used got the correct value
23+ export REDIS_PASSWORD=" "
24+ else
25+ export REDIS_PASSWORD=${REDIS_PASSWORD:- redispassword}
26+ fi
1927export BASE_URL=${BASE_URL:- https:// localhost}
2028export DISABLE_IPV6=${DISABLE_IPV6:- false}
2129export DISABLE_SSL_REDIRECT=${DISABLE_SSL_REDIRECT:- false}
Original file line number Diff line number Diff line change @@ -26,8 +26,16 @@ change_php_vars() {
2626 echo " Configure PHP | Setting 'max_input_time = ${PHP_MAX_INPUT_TIME} '"
2727 sed -i " s/max_input_time = .*/max_input_time = ${PHP_MAX_INPUT_TIME} /" " $FILE "
2828 sed -i " s/session.save_handler = .*/session.save_handler = redis/" " $FILE "
29- echo " Configure PHP | Setting 'session.save_path = '$( echo $REDIS_HOST | grep -E ' ^\w+://' || echo tcp://$REDIS_HOST ) :$REDIS_PORT ?auth=${ESCAPED} '"
30- sed -i " s|.*session.save_path = .*|session.save_path = '$( echo $REDIS_HOST | grep -E ' ^\w+://' || echo tcp://$REDIS_HOST ) :$REDIS_PORT ?auth=${ESCAPED} '|" " $FILE "
29+ if [[ " $ENABLE_REDIS_EMPTY_PASSWORD " = " true" ]]; then
30+ echo " Configure PHP | Setting 'session.save_path = '$( echo $REDIS_HOST | grep -E ' ^\w+://' || echo tcp://$REDIS_HOST ) :$REDIS_PORT ' (passwordless)"
31+ sed -i " s|.*session.save_path = .*|session.save_path = '$( echo $REDIS_HOST | grep -E ' ^\w+://' || echo tcp://$REDIS_HOST ) :$REDIS_PORT '|" " $FILE "
32+ elif [[ -n " $REDIS_PASSWORD " ]]; then
33+ echo " Configure PHP | Setting 'session.save_path = '$( echo $REDIS_HOST | grep -E ' ^\w+://' || echo tcp://$REDIS_HOST ) :$REDIS_PORT ?auth=${ESCAPED} '"
34+ sed -i " s|.*session.save_path = .*|session.save_path = '$( echo $REDIS_HOST | grep -E ' ^\w+://' || echo tcp://$REDIS_HOST ) :$REDIS_PORT ?auth=${ESCAPED} '|" " $FILE "
35+ else
36+ echo " ERROR: REDIS_PASSWORD is not set but ENABLE_REDIS_EMPTY_PASSWORD is false. Please set REDIS_PASSWORD or enable ENABLE_REDIS_EMPTY_PASSWORD=true for passwordless Redis."
37+ exit 1
38+ fi
3139 sed -i " s/session.sid_length = .*/session.sid_length = 64/" " $FILE "
3240 sed -i " s/session.use_strict_mode = .*/session.use_strict_mode = 1/" " $FILE "
3341 echo " Configure PHP | Setting 'date.timezone = ${PHP_TIMEZONE} '"
Original file line number Diff line number Diff line change @@ -12,9 +12,26 @@ services:
1212
1313 redis :
1414 image : valkey/valkey:7.2
15- command : " --requirepass '${REDIS_PASSWORD:-redispassword}'"
15+ command : |
16+ sh -c '
17+ if [ "$${ENABLE_REDIS_EMPTY_PASSWORD:-false}" = "true" ]; then
18+ exec valkey-server
19+ else
20+ exec valkey-server --requirepass "$${REDIS_PASSWORD:-redispassword}"
21+ fi
22+ '
23+ environment :
24+ - " ENABLE_REDIS_EMPTY_PASSWORD=${ENABLE_REDIS_EMPTY_PASSWORD:-false}"
25+ - " REDIS_PASSWORD=${REDIS_PASSWORD:-redispassword}"
1626 healthcheck :
17- test : " valkey-cli -a '${REDIS_PASSWORD:-redispassword}' -p ${REDIS_PORT:-6379} ping | grep -q PONG || exit 1"
27+ test : |
28+ sh -c '
29+ if [ "$${ENABLE_REDIS_EMPTY_PASSWORD:-false}" = "true" ]; then
30+ valkey-cli -p $${REDIS_PORT:-6379} ping | grep -q PONG || exit 1
31+ else
32+ valkey-cli -a "$${REDIS_PASSWORD:-redispassword}" -p $${REDIS_PORT:-6379} ping | grep -q PONG || exit 1
33+ fi
34+ '
1835 interval : 2s
1936 timeout : 1s
2037 retries : 3
@@ -220,6 +237,7 @@ services:
220237 - " REDIS_HOST=${REDIS_HOST:-redis}"
221238 - " REDIS_PORT=${REDIS_PORT:-6379}"
222239 - " REDIS_PASSWORD=${REDIS_PASSWORD:-redispassword}"
240+ - " ENABLE_REDIS_EMPTY_PASSWORD=${ENABLE_REDIS_EMPTY_PASSWORD:-false}"
223241 # debug setting
224242 - " DEBUG=${DEBUG}"
225243 # SMTP setting
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ Image=docker.io/valkey/valkey:7.2
1111Network =misp-net
1212Volume =redis_data:/data
1313PodmanArgs =--network-alias redis
14- Exec =-- requirepass ${REDIS_PASSWORD}
15- HealthCmd =valkey-cli -a ${REDIS_PASSWORD} ping
14+ Exec =sh -c ' if [ "${ENABLE_REDIS_EMPTY_PASSWORD:-false}" = "true" ]; then exec valkey-server; else exec valkey-server -- requirepass " ${REDIS_PASSWORD}"; fi '
15+ HealthCmd =sh -c ' if [ "${ENABLE_REDIS_EMPTY_PASSWORD:-false}" = "true" ]; then valkey-cli ping; else valkey-cli -a " ${REDIS_PASSWORD}" ping; fi '
1616HealthInterval =2s
1717HealthTimeout =1s
1818HealthRetries =3
Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ SYNCSERVERS_1_PULL_RULES=
110110# REDIS_PORT=
111111# remember to escape special character '$', e.g., 'test1%<$1323>' becomes 'test1%<$$1323>'
112112# REDIS_PASSWORD=
113+ # Enable passwordless Redis connection (defaults to false for security)
114+ # ENABLE_REDIS_EMPTY_PASSWORD=false
113115
114116# These variables allows overriding some MISP email values.
115117# They all default to ADMIN_EMAIL.
You can’t perform that action at this time.
0 commit comments