From 2b048cf4eb8c537351ced869bf6bc2dd2a6e7896 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Sun, 5 Jul 2020 14:26:54 -0400 Subject: [PATCH] fix bug with unattended upgrades causing algo install to fail --- .../resources/ansible/install_local.sh.hbs | 24 ++++++++++++++----- .../post_auth/ResourceMessages.properties | 3 +++ .../packer/roles/common/tasks/main.yml | 4 ---- bubble-web | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/bubble-server/src/main/resources/ansible/install_local.sh.hbs b/bubble-server/src/main/resources/ansible/install_local.sh.hbs index 9533d162..813db84e 100644 --- a/bubble-server/src/main/resources/ansible/install_local.sh.hbs +++ b/bubble-server/src/main/resources/ansible/install_local.sh.hbs @@ -4,6 +4,10 @@ ANSIBLE_USER="{{node.user}}" ANSIBLE_HOME="$(cd ~{{node.user}} && pwd)" LOG="${ANSIBLE_HOME}/.ansible.log" +# Stop unattended upgrades so that apt installs will work +# unattended upgrades are re-enabled at the end of the ansible run +systemctl stop unattended-upgrades + {{#if isNode}} # touch algo log and start tailing it set -m @@ -11,6 +15,15 @@ ALGO_LOG=/tmp/install_algo.log touch ${ALGO_LOG} && tail -f ${ALGO_LOG} & {{/if}} +function kill_bg_jobs { + for j in $(jobs -lr | tr '[]' ' ' | awk '{print $1}') ; do + kill %${j} + done + if [[ ! -z "${ALGO_LOG}" && -f "${ALGO_LOG}" ]] ; then + rm -f ${ALGO_LOG} + fi +} + function log { echo "${1}" >> ${LOG} } @@ -20,8 +33,7 @@ function die { log "install_local: fatal error: ${1}" {{#if isNode}} # stop ALGO_LOG tail job and remove log - kill %1 - rm -f ${ALGO_LOG} + kill_bg_jobs {{/if}} exit 1 } @@ -82,10 +94,10 @@ fi {{#if isNode}} # stop ALGO_LOG tail job and remove log -for j in $(jobs -lr | tr '[]' ' ' | awk '{print $1}') ; do - kill %${j} -done -rm -f ${ALGO_LOG} +kill_bg_jobs {{/if}} +# ansible should have already restarted unattended-upgrades, but just in case +systemctl start unattended-upgrades + exit 0 diff --git a/bubble-server/src/main/resources/message_templates/en_US/server/post_auth/ResourceMessages.properties b/bubble-server/src/main/resources/message_templates/en_US/server/post_auth/ResourceMessages.properties index 5fe57a05..43fcdca2 100644 --- a/bubble-server/src/main/resources/message_templates/en_US/server/post_auth/ResourceMessages.properties +++ b/bubble-server/src/main/resources/message_templates/en_US/server/post_auth/ResourceMessages.properties @@ -223,6 +223,9 @@ button_label_create_new_network=Launch Your Bubble! message_plan_fork_apps=All app templates will be copied to fork message_plan_node_apps=Your Bubble will include these apps: +# Network Page - Connect +message_network_connect=Connect to {{bubbleName}} + # Network Page - Restore Keys link_network_action_request_keys=Request Bubble Restore Key message_network_action_keys_requested=Bubble Restore Key requested diff --git a/bubble-server/src/main/resources/packer/roles/common/tasks/main.yml b/bubble-server/src/main/resources/packer/roles/common/tasks/main.yml index a2d54187..0b2abdec 100644 --- a/bubble-server/src/main/resources/packer/roles/common/tasks/main.yml +++ b/bubble-server/src/main/resources/packer/roles/common/tasks/main.yml @@ -1,10 +1,6 @@ # # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/ # -- name: Disable unattended upgrades (ansible will re-enable them) - shell: systemctl stop unattended-upgrades - become: yes - - name: Update packages apt: update_cache: yes diff --git a/bubble-web b/bubble-web index 411b27f6..a82e4903 160000 --- a/bubble-web +++ b/bubble-web @@ -1 +1 @@ -Subproject commit 411b27f6bae26f9ab4eaaf6bf9c6b60581fd09ed +Subproject commit a82e49035ae54c582f0932b8fabad84d6c45ed4d