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.

install: Rename postgres options to postgresql.

Alex Vandiver5eb8064a1aae
diff --git a/docs/production/deployment.md b/docs/production/deployment.md
index c2db2131402..5191685947c 100644
--- a/docs/production/deployment.md
+++ b/docs/production/deployment.md
@@ -100,7 +100,7 @@ flag, e.g.:
sudo -s # If not already root
./zulip-server-*/scripts/setup/install --certbot \
--email=YOUR_EMAIL --hostname=YOUR_HOSTNAME \
- --no-init-db --postgres-missing-dictionaries
+ --no-init-db --postgresql-missing-dictionaries
```
The script also installs and starts PostgreSQL on the server by
diff --git a/docs/production/install-existing-server.md b/docs/production/install-existing-server.md
index 0e7fc15fe05..60ff45c58de 100644
--- a/docs/production/install-existing-server.md
+++ b/docs/production/install-existing-server.md
@@ -67,9 +67,10 @@ $ sudo service puppet stop
Zulip expects to install PostgreSQL 12, and find that listening on
port 5432; any other version of PostgreSQL that is detected at install
time will cause the install to abort. If you already have PostgreSQL
-installed, you can pass `--postgres-version=` to the installer to have
-it use that version. It will replace the package with the latest from
-the PostgreSQL apt repository, but existing data will be retained.
+installed, you can pass `--postgresql-version=` to the installer to
+have it use that version. It will replace the package with the latest
+from the PostgreSQL apt repository, but existing data will be
+retained.
If you have an existing PostgreSQL database, note that Zulip will use
the default `main` as its database name; make sure you're not using
diff --git a/scripts/lib/install b/scripts/lib/install
index 824b3f0753c..f3bf15e6e9a 100755
--- a/scripts/lib/install
+++ b/scripts/lib/install
@@ -28,9 +28,9 @@ Options:
install process; used when this command is run once in a highly-controlled
environment to produce an image which is used elsewhere. Uncommon.
- --postgres-version=12
+ --postgresql-version=12
Sets the version of PostgreSQL that will be installed.
- --postgres-missing-dictionaries
+ --postgresql-missing-dictionaries
Set postgresql.missing_dictionaries, which alters the initial database. Use with
cloud managed databases like RDS. Conflicts with --no-overwrite-settings.
--no-init-db
@@ -47,7 +47,7 @@ EOF
# Shell option parsing. Over time, we'll want to move some of the
# environment variables below into this self-documenting system.
-args="$(getopt -o '' --long help,hostname:,email:,certbot,self-signed-cert,cacert:,postgres-version:,postgres-missing-dictionaries,no-init-db,no-overwrite-settings,no-dist-upgrade -n "$0" -- "$@")"
+args="$(getopt -o '' --long help,hostname:,email:,certbot,self-signed-cert,cacert:,postgresql-version:,postgresql-missing-dictionaries,no-init-db,no-overwrite-settings,no-dist-upgrade -n "$0" -- "$@")"
eval "set -- $args"
while true; do
case "$1" in
@@ -81,13 +81,13 @@ while true; do
shift
;;
- --postgres-version)
- POSTGRES_VERSION="$2"
+ --postgresql-version)
+ POSTGRESQL_VERSION="$2"
shift
shift
;;
- --postgres-missing-dictionaries)
- POSTGRES_MISSING_DICTIONARIES=1
+ --postgresql-missing-dictionaries)
+ POSTGRESQL_MISSING_DICTIONARIES=1
shift
;;
--no-init-db)
@@ -127,7 +127,7 @@ read -r -a ADDITIONAL_PACKAGES <<<"${ADDITIONAL_PACKAGES:-}"
# e.g. zulip::profile::app_frontend for a Zulip frontend server.
PUPPET_CLASSES="${PUPPET_CLASSES:-zulip::profile::standalone}"
VIRTUALENV_NEEDED="${VIRTUALENV_NEEDED:-yes}"
-POSTGRES_VERSION="${POSTGRES_VERSION:-12}"
+POSTGRESQL_VERSION="${POSTGRESQL_VERSION:-12}"
if [ -n "$SELF_SIGNED_CERT" ] && [ -n "$USE_CERTBOT" ]; then
set +x
@@ -137,9 +137,9 @@ if [ -n "$SELF_SIGNED_CERT" ] && [ -n "$USE_CERTBOT" ]; then
exit 1
fi
-if [ -n "$POSTGRES_MISSING_DICTIONARIES" ] && [ -n "$NO_OVERWRITE_SETTINGS" ]; then
+if [ -n "$POSTGRESQL_MISSING_DICTIONARIES" ] && [ -n "$NO_OVERWRITE_SETTINGS" ]; then
set +x
- echo "error: --postgres-missing-dictionaries and --no-overwrite-settings are incompatible" >&2
+ echo "error: --postgresql-missing-dictionaries and --no-overwrite-settings are incompatible" >&2
echo >&2
usage >&2
exit 1
@@ -239,7 +239,7 @@ case ",$PUPPET_CLASSES," in
# repository; this may conflict with the existing PostgreSQL.
OTHER_PG="$(dpkg --get-selections \
| grep -E '^postgresql-[0-9]+\s+install$' \
- | grep -v "^postgresql-$POSTGRES_VERSION\b" \
+ | grep -v "^postgresql-$POSTGRESQL_VERSION\b" \
| cut -f 1)" || true
if [ -n "$OTHER_PG" ]; then
INDENTED="${OTHER_PG//$'\n'/$'\n' }"
@@ -250,7 +250,7 @@ The following PostgreSQL servers were found to already be installed:
$INDENTED
-Zulip needs to install PostgreSQL $POSTGRES_VERSION, but does not wish
+Zulip needs to install PostgreSQL $POSTGRESQL_VERSION, but does not wish
to uninstall existing databases in order to do so. Remove all other
PostgreSQL servers manually before running the installer:
@@ -390,14 +390,14 @@ puppet_classes = $PUPPET_CLASSES
deploy_type = production
[postgresql]
-version = $POSTGRES_VERSION
+version = $POSTGRESQL_VERSION
EOF
if [ -n "$USE_CERTBOT" ]; then
crudini --set /etc/zulip/zulip.conf certbot auto_renew yes
fi
- if [ -n "$POSTGRES_MISSING_DICTIONARIES" ]; then
+ if [ -n "$POSTGRESQL_MISSING_DICTIONARIES" ]; then
crudini --set /etc/zulip/zulip.conf postgresql missing_dictionaries true
fi
diff --git a/tools/ci/production-install b/tools/ci/production-install
index 72013e6cb3c..fc56358b220 100755
--- a/tools/ci/production-install
+++ b/tools/ci/production-install
@@ -28,7 +28,7 @@ fi
# Pin to PostgreSQL 10 on Bionic, so we can test upgrading it
if [ "$os_version_codename" = "bionic" ]; then
- export POSTGRES_VERSION=10
+ export POSTGRESQL_VERSION=10
fi
# Install Zulip
diff --git a/zerver/migrations/0001_initial.py b/zerver/migrations/0001_initial.py
index 1c0456009db..2bd608be4d9 100644
--- a/zerver/migrations/0001_initial.py
+++ b/zerver/migrations/0001_initial.py
@@ -39,7 +39,7 @@ class Migration(migrations.Migration):
('auth', '0001_initial'),
]
- if settings.POSTGRES_MISSING_DICTIONARIES:
+ if settings.POSTGRESQL_MISSING_DICTIONARIES:
fts_sql = """
CREATE TEXT SEARCH CONFIGURATION zulip.english_us_search (COPY=pg_catalog.english);
"""
diff --git a/zproject/computed_settings.py b/zproject/computed_settings.py
index 7c287917518..aede21e4374 100644
--- a/zproject/computed_settings.py
+++ b/zproject/computed_settings.py
@@ -317,7 +317,7 @@ elif REMOTE_POSTGRES_HOST != '':
else:
DATABASES['default']['OPTIONS']['sslmode'] = 'verify-full'
-POSTGRES_MISSING_DICTIONARIES = bool(get_config('postgresql', 'missing_dictionaries', None))
+POSTGRESQL_MISSING_DICTIONARIES = bool(get_config('postgresql', 'missing_dictionaries', None))
########################################################################
# RABBITMQ CONFIGURATION