install: Use crudini for storing value of POSTGRES_MISSING_DICTIONARIES.

This simplifies the RDS installation process to avoid awkwardly
requiring running the installer twice, and also is significantly more
robust in handling issues around rerunning the installer.

Finally, the answer for whether dictionaries are missing is available
to Django for future use in warnings/etc. around full-text search not
being great with this configuration, should they be required.
This commit is contained in:
Vishnu KS
2019-12-13 12:46:55 +05:30
committed by Tim Abbott
parent cd926b8aae
commit 6b9f37dc8f
4 changed files with 7 additions and 10 deletions

View File

@@ -134,14 +134,11 @@ follows:
postgres_password = abcd1234
```
Now complete the installation by running the following command to ask
the Zulip installer to initialize the postgres database. (Note: The
options are different from before).
Now complete the installation by running the following commands.
```
./zulip-server-*/scripts/setup/install --certbot \
--email=YOUR_EMAIL --hostname=YOUR_HOSTNAME \
--remote-postgres --postgres-missing-dictionaries
# Ask Zulip installer to initialize the postgres database.
su zulip -c '/home/zulip/deployments/current/scripts/setup/initialize-database'
# And then generate a realm creation link:
su zulip -c '/home/zulip/deployments/current/manage.py generate_realm_creation_link'

View File

@@ -280,7 +280,7 @@ if [ "$DEPLOYMENT_TYPE" = "dockervoyager" ]; then
fi
if [ -n "$POSTGRES_MISSING_DICTIONARIES" ]; then
export POSTGRES_MISSING_DICTIONARIES="true"
crudini --set /etc/zulip/zulip.conf postgresql missing_dictionaries true
fi
if [ -n "$REMOTE_POSTGRES" ]; then

View File

@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-22 10:22
import os
import bitfield.models
import django.contrib.auth.models
@@ -37,12 +36,11 @@ class Migration(migrations.Migration):
initial = True
zulip_postgres_dictionaries_unavailable = os.getenv("POSTGRES_MISSING_DICTIONARIES", False)
dependencies = [
('auth', '0001_initial'),
]
if zulip_postgres_dictionaries_unavailable:
if settings.POSTGRES_MISSING_DICTIONARIES:
fts_sql = """
CREATE TEXT SEARCH CONFIGURATION zulip.english_us_search (COPY=pg_catalog.english);
"""

View File

@@ -293,6 +293,8 @@ elif REMOTE_POSTGRES_HOST != '':
else:
DATABASES['default']['OPTIONS']['sslmode'] = 'verify-full'
POSTGRES_MISSING_DICTIONARIES = bool(get_config('postgresql', 'missing_dictionaries', None))
########################################################################
# RABBITMQ CONFIGURATION
########################################################################