fix Bug 61960 - Add authentication for supervisord (#598)

This commit is contained in:
Evgeniy Antonyuk 2023-04-10 13:16:23 +05:00 committed by GitHub
parent f03bc7ec18
commit 09b9a73637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

@ -2,6 +2,8 @@
[inet_http_server] [inet_http_server]
port = 127.0.0.1:9001 port = 127.0.0.1:9001
username = ds
password = supervisorpassword
[supervisord] [supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
@ -16,6 +18,8 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl] [supervisorctl]
serverurl = http://localhost:9001 ; use a unix:// URL for a unix socket serverurl = http://localhost:9001 ; use a unix:// URL for a unix socket
username = ds
password = supervisorpassword
; The [include] section can just contain the "files" setting. This ; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or ; setting can list multiple files (separated by whitespace or

@ -496,6 +496,7 @@ update_supervisor_settings(){
cp ${SYSCONF_TEMPLATES_DIR}/supervisor/supervisor /etc/init.d/ cp ${SYSCONF_TEMPLATES_DIR}/supervisor/supervisor /etc/init.d/
# Copy modified supervisor config # Copy modified supervisor config
cp ${SYSCONF_TEMPLATES_DIR}/supervisor/supervisord.conf /etc/supervisor/supervisord.conf cp ${SYSCONF_TEMPLATES_DIR}/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
sed "s_\(password =\).*_\1 $(pwgen -s 20)_" -i /etc/supervisor/supervisord.conf
sed "s/COMPANY_NAME/${COMPANY_NAME}/g" -i ${SYSCONF_TEMPLATES_DIR}/supervisor/ds/*.conf sed "s/COMPANY_NAME/${COMPANY_NAME}/g" -i ${SYSCONF_TEMPLATES_DIR}/supervisor/ds/*.conf
cp ${SYSCONF_TEMPLATES_DIR}/supervisor/ds/*.conf /etc/supervisor/conf.d/ cp ${SYSCONF_TEMPLATES_DIR}/supervisor/ds/*.conf /etc/supervisor/conf.d/
} }