Add option to configure proxy using environment vars (#69)

Co-authored-by: Thibault Van Win <thibault.van.win@axsguard.com>
pull/70/head
Thibault Van Win 2024-06-06 12:41:12 +01:00 committed by GitHub
parent d56c893f4d
commit 76fadc5496
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 32 additions and 1 deletions

View File

@ -201,6 +201,21 @@ set_up_aad() {
sudo -u www-data /var/www/MISP/app/Console/cake Admin setSetting -q "Security.require_password_confirmation" false
}
set_up_proxy() {
if [[ "$PROXY_ENABLE" != "true" ]]; then
echo "... Proxy disabled"
return
fi
echo "... configuring proxy settings"
sudo -u www-data /var/www/MISP/app/Console/cake Admin setSetting -q "Proxy.host" "$PROXY_HOST"
sudo -u www-data /var/www/MISP/app/Console/cake Admin setSetting -q "Proxy.port" "$PROXY_PORT"
sudo -u www-data /var/www/MISP/app/Console/cake Admin setSetting -q "Proxy.method" "$PROXY_METHOD"
sudo -u www-data /var/www/MISP/app/Console/cake Admin setSetting -q "Proxy.user" "$PROXY_USER"
sudo -u www-data /var/www/MISP/app/Console/cake Admin setSetting -q "Proxy.password" "$PROXY_PASSWORD"
}
apply_updates() {
# Run updates (strip colors since output might end up in a log)
sudo -u www-data /var/www/MISP/app/Console/cake Admin runUpdates | sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g"
@ -450,5 +465,7 @@ echo "MISP | Set Up LDAP ..." && set_up_ldap
echo "MISP | Set Up AAD ..." && set_up_aad
echo "MISP | Set Up Proxy ..." && set_up_proxy
echo "MISP | Mark instance live"
sudo -u www-data /var/www/MISP/app/Console/cake Admin live 1
sudo -u www-data /var/www/MISP/app/Console/cake Admin live 1

View File

@ -130,6 +130,12 @@ services:
- "AAD_MISP_ORGADMIN=${AAD_MISP_ORGADMIN}"
- "AAD_MISP_SITEADMIN=${AAD_MISP_SITEADMIN}"
- "AAD_CHECK_GROUPS=${AAD_CHECK_GROUPS}"
# Proxy settings
- "PROXY_HOST=${PROXY_HOST}"
- "PROXY_PORT=${PROXY_PORT}"
- "PROXY_METHOD=${PROXY_METHOD}"
- "PROXY_USER=${PROXY_USER}"
- "PROXY_PASSWORD=${PROXY_PASSWORD}"
# sync server settings (see https://www.misp-project.org/openapi/#tag/Servers for more options)
- "SYNCSERVERS=${SYNCSERVERS}"
- |

View File

@ -134,3 +134,11 @@ SYNCSERVERS_1_KEY=
# AAD_MISP_ORGADMIN="Misp Org Admins"
# AAD_MISP_SITEADMIN="Misp Site Admins"
# AAD_CHECK_GROUPS=false
# Enable the use of a Proxy server
# PROXY_ENABLE=true
# PROXY_HOST=
# PROXY_PORT=
# PROXY_METHOD=
# PROXY_USER=
# PROXY_PASSWORD=