Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions simplerisk-minimal/common/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ set_csrf_secret(){
set_cron(){
# If SIMPLERISK_CRON_SETUP was passed and it is set to disabled
if [[ -n "${SIMPLERISK_CRON_SETUP:-}" && "${SIMPLERISK_CRON_SETUP:-}" = disabled* ]]; then
print_log "SimpleRisk cron setup is disabled."
print_log "cron_setup" "SimpleRisk cron setup is disabled."
else
print_log "SimpleRisk cron setup is enabled."
print_log "cron_setup" "SimpleRisk cron setup is enabled."

CRON_PATH='/tmp/backup-cron'

# Create the cron file
exec_cmd "echo '* * * * * /usr/local/bin/php -f /var/www/simplerisk/cron/cron.php > /dev/null 2>&1' >> $CRON_PATH"
exec_cmd "chmod 0644 $CRON_PATH"
exec_cmd "crontab $CRON_PATH"
exec_cmd "echo '* * * * * /usr/local/bin/php -f /var/www/simplerisk/cron/cron.php > /dev/null 2>&1' >> $CRON_PATH" "Failed to write cron file. Exiting."
exec_cmd "chmod 0644 $CRON_PATH" "Failed to chmod cron file. Exiting."
exec_cmd_nobail "crontab $CRON_PATH" || print_log "cron_setup:warn" "crontab installation failed — cron may not run. Set SIMPLERISK_CRON_SETUP=disabled if cron is managed externally."
fi
}

Expand All @@ -113,6 +113,7 @@ apply_mail_setting(){
-p"$SIMPLERISK_DB_PASSWORD" \
-h "$SIMPLERISK_DB_HOSTNAME" \
-P "$SIMPLERISK_DB_PORT" \
--ssl-mode=REQUIRED \
"$SIMPLERISK_DB_DATABASE" \
-e "UPDATE settings SET value='${escaped}' WHERE name='${db_key}';" \
|| print_log "mail_settings:warn" "Failed to update ${db_key}"
Expand Down
15 changes: 10 additions & 5 deletions simplerisk-minimal/common/etc/supervisor/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ file=/tmp/supervisor.sock ; (the path to the socket file)
chmod=0700

[supervisord]
childlogdir=/var/log/supervisor
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
childlogdir=/tmp
logfile=/dev/stdout ; (log to stdout for container-native logging)
logfile_maxbytes=0 ; (disable rotation — stdout is not seekable)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/var/run/supervisor/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
pidfile=/tmp/supervisord.pid ; (use /tmp — always writable in containers)
nodaemon=true ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
Expand All @@ -22,11 +21,17 @@ serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
[program:apache2]
command=/usr/sbin/apache2ctl -D FOREGROUND
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=true

[program:rsyslog]
command=/usr/sbin/rsyslogd -n
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=true
priority=10

Expand Down
Loading