Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run component updates in the background #135

Closed
wants to merge 4 commits into from
Closed
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
19 changes: 13 additions & 6 deletions core/files/configure_misp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,18 @@ init_settings() {
}

update_components() {
sudo -u www-data /var/www/MISP/app/Console/cake Admin updateGalaxies
sudo -u www-data /var/www/MISP/app/Console/cake Admin updateTaxonomies
sudo -u www-data /var/www/MISP/app/Console/cake Admin updateWarningLists
sudo -u www-data /var/www/MISP/app/Console/cake Admin updateNoticeLists
sudo -u www-data /var/www/MISP/app/Console/cake Admin updateObjectTemplates "$CRON_USER_ID"
UPDATE_SUDO_CMD="sudo -u www-data"
if [ ! -z "${DB_ALREADY_INITIALISED}" ]; then
if [ ! -z "${BACKGROUND_COMPONENT_UPDATES}" ]; then
echo "... updates will run in the background"
UPDATE_SUDO_CMD="sudo -b -u www-data"
fi
fi
${UPDATE_SUDO_CMD} /var/www/MISP/app/Console/cake Admin updateGalaxies
${UPDATE_SUDO_CMD} /var/www/MISP/app/Console/cake Admin updateTaxonomies
${UPDATE_SUDO_CMD} /var/www/MISP/app/Console/cake Admin updateWarningLists
${UPDATE_SUDO_CMD} /var/www/MISP/app/Console/cake Admin updateNoticeLists
${UPDATE_SUDO_CMD} /var/www/MISP/app/Console/cake Admin updateObjectTemplates "$CRON_USER_ID"
}

update_ca_certificates() {
Expand Down Expand Up @@ -431,7 +438,7 @@ echo "MISP | Init default user and organization ..." && init_user

echo "MISP | Resolve critical issues ..." && apply_critical_fixes

echo "MISP | Update components ..." && update_components
echo "MISP | Start component updates ..." && update_components

echo "MISP | Resolve non-critical issues ..." && apply_optional_fixes

Expand Down
1 change: 1 addition & 0 deletions core/files/entrypoint_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ init_mysql(){

if [ $(isDBinitDone) -eq 0 ]; then
echo "... database has already been initialized"
export DB_ALREADY_INITIALISED=true
else
echo "... database has not been initialized, importing MySQL scheme..."
$MYSQLCMD < /var/www/MISP/INSTALL/MYSQL.sql
Expand Down