Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

installer: Make `--no-overwrite-settings` also preserve `zulip.conf`.

Alex Vandiver7f4a2527c0dc
diff --git a/scripts/lib/install b/scripts/lib/install
index 5c56a3c99f5..e4c006ec93a 100755
--- a/scripts/lib/install
+++ b/scripts/lib/install
@@ -255,56 +255,58 @@ fi
# Generate /etc/zulip/zulip.conf .
mkdir -p /etc/zulip
-(
- cat <<EOF
+if [ -z "$NO_OVERWRITE_SETTINGS" ] || ! [ -e "/etc/zulip/zulip.conf" ]; then
+ (
+ cat <<EOF
[machine]
puppet_classes = $PUPPET_CLASSES
deploy_type = $DEPLOYMENT_TYPE
EOF
- # Note: there are four dpkg-query outputs to consider:
- #
- # root@host# dpkg-query --showformat '${Status}\n' -W rabbitmq-server 2>/dev/null
- # root@host# apt install rabbitmq-server
- # root@host# dpkg-query --showformat '${Status}\n' -W rabbitmq-server 2>/dev/null
- # install ok installed
- # root@host# apt remove rabbitmq-server
- # root@host# dpkg-query --showformat '${Status}\n' -W rabbitmq-server 2>/dev/null
- # deinstall ok config-files
- # root@host# apt purge rabbitmq-server
- # root@host# dpkg-query --showformat '${Status}\n' -W rabbitmq-server 2>/dev/null
- # unknown ok not-installed
- #
- # (There are more possibilities in the case of dpkg errors.) Here
- # we are checking for either empty or not-installed.
- if ! dpkg-query --showformat '${Status}\n' -W rabbitmq-server 2>/dev/null | grep -vq ' not-installed$'; then
- cat <<EOF
+ # Note: there are four dpkg-query outputs to consider:
+ #
+ # root@host# dpkg-query --showformat '${Status}\n' -W rabbitmq-server 2>/dev/null
+ # root@host# apt install rabbitmq-server
+ # root@host# dpkg-query --showformat '${Status}\n' -W rabbitmq-server 2>/dev/null
+ # install ok installed
+ # root@host# apt remove rabbitmq-server
+ # root@host# dpkg-query --showformat '${Status}\n' -W rabbitmq-server 2>/dev/null
+ # deinstall ok config-files
+ # root@host# apt purge rabbitmq-server
+ # root@host# dpkg-query --showformat '${Status}\n' -W rabbitmq-server 2>/dev/null
+ # unknown ok not-installed
+ #
+ # (There are more possibilities in the case of dpkg errors.) Here
+ # we are checking for either empty or not-installed.
+ if ! dpkg-query --showformat '${Status}\n' -W rabbitmq-server 2>/dev/null | grep -vq ' not-installed$'; then
+ cat <<EOF
[rabbitmq]
nodename = zulip@localhost
EOF
- fi
+ fi
- if [ -n "$USE_CERTBOT" ]; then
- cat <<EOF
+ if [ -n "$USE_CERTBOT" ]; then
+ cat <<EOF
[certbot]
auto_renew = yes
EOF
- fi
+ fi
- if [ -e "/etc/init.d/postgresql" ]; then
- case " $os_id $os_id_like " in
- *' debian '*)
- cat <<EOF
+ if [ -e "/etc/init.d/postgresql" ]; then
+ case " $os_id $os_id_like " in
+ *' debian '*)
+ cat <<EOF
[postgresql]
version = 12
EOF
- ;;
- esac
- fi
-) > /etc/zulip/zulip.conf
+ ;;
+ esac
+ fi
+ ) > /etc/zulip/zulip.conf
+fi
case ",$PUPPET_CLASSES," in
*,zulip::voyager,* | *,zulip::dockervoyager,* | *,zulip::app_frontend,*)