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.

docs: Describe the process of upgrading settings.py files.

Alex Vandiverbc9d20eaa263
diff --git a/docs/overview/changelog.md b/docs/overview/changelog.md
index 94bbad83b81..3548957812e 100644
--- a/docs/overview/changelog.md
+++ b/docs/overview/changelog.md
@@ -50,13 +50,14 @@ in bursts.
- Consider enabling [smokescreen][smokescreen]
- Private streams can no longer be default streams (i.e. the ones new
users are automatically added to).
-- We rewrote the template for `/etc/zulip/settings.py` to be more
- readable. Installations that have been running for more than a year
- may want to carefully resync the comments from
- `/home/zulip/deployments/current/zproject/prod_settings_template.py`.
+- As this is a major release, we recommend [carefully updating the
+ inline documentation in your
+ `/etc/zulip/settings.py`][update-settings-docs]. Notably, we rewrote the
+ template to be better organized and more readable.
[docker-zulip-manual]: https://github.com/zulip/docker-zulip#manual-configuration
[smokescreen]: ../production/deployment.html#using-an-outgoing-http-proxy
+[update-settings-docs]: ../production/upgrade-or-modify.html#updating-settings-py-inline-documentation
#### Full feature changelog
diff --git a/docs/production/settings.md b/docs/production/settings.md
index 1ea15378498..7c1f6c9fe4e 100644
--- a/docs/production/settings.md
+++ b/docs/production/settings.md
@@ -19,6 +19,22 @@ restart the server with the following command:
su zulip -c '/home/zulip/deployments/current/scripts/restart-server'
```
+Zulip has dozens of settings documented in the comments in
+`/etc/zulip/settings.py`; you can review [the latest version of the
+settings.py template][settings-py-template], and if you've upgraded
+from an old versions of Zulip, we recommend [carefully updating your
+`/etc/zulip/settings.py`][update-settings-docs] to fold in the inline
+comment documentation for new configuration settings after upgrading
+to each new major release.
+
+[update-settings-docs]: ../production/upgrade-or-modify.html#updating-settings-py-inline-documentation
+[settings-py-template]: https://github.com/zulip/zulip/blob/master/zproject/prod_settings_template.py
+
+Since Zulip's settings file is a Python script, there are a number of
+other things that one can configure that are not documented; ask on
+[chat.zulip.org](../contributing/chat-zulip-org.md)
+if there's something you'd like to do but can't figure out how to.
+
## Specific settings
### Domain and email settings
@@ -78,19 +94,6 @@ configuration along with your other Zulip server configuration.
### Miscellaneous server settings
-Zulip has dozens of settings documented in the comments in
-`/etc/zulip/settings.py`; you can review
-[the latest version of the settings.py template][settings-py-template]
-if you've deleted the comments or want to check if new settings have
-been added in more recent versions of Zulip.
-
-Since Zulip's settings file is a Python script, there are a number of
-other things that one can configure that are not documented; ask on
-[chat.zulip.org](../contributing/chat-zulip-org.md)
-if there's something you'd like to do but can't figure out how to.
-
-[settings-py-template]: https://github.com/zulip/zulip/blob/master/zproject/prod_settings_template.py
-
Some popular settings in `/etc/zulip/settings.py` include:
* The Twitter integration, which provides pretty inline previews of
tweets.
diff --git a/docs/production/upgrade-or-modify.md b/docs/production/upgrade-or-modify.md
index 0d13d8e90ec..93b8a57fa7d 100644
--- a/docs/production/upgrade-or-modify.md
+++ b/docs/production/upgrade-or-modify.md
@@ -4,8 +4,9 @@ This page explains how to upgrade, patch, or modify Zulip, including:
- [Upgrading to a release](#upgrading-to-a-release)
- [Upgrading from a Git repository](#upgrading-from-a-git-repository)
+- [Updating `settings.py` inline documentation](#updating-settings-py-inline-documentation)
- [Troubleshooting and rollback](#troubleshooting-and-rollback)
-- [Preserving local changes to configuration files](#preserving-local-changes-to-configuration-files)
+- [Preserving local changes to service configuration files](#preserving-local-changes-to-service-configuration-files)
- [Upgrading the operating system](#upgrading-the-operating-system)
- [Upgrading PostgreSQL](#upgrading-postgresql)
- [Modifying Zulip](#modifying-zulip)
@@ -16,7 +17,7 @@ This page explains how to upgrade, patch, or modify Zulip, including:
Note that there are additional instructions if you're [using
docker-zulip][docker-upgrade], have [patched Zulip](#modifying-zulip),
or have [modified Zulip-managed configuration
-files](#preserving-local-changes-to-configuration-files). To upgrade
+files](#preserving-local-changes-to-service-configuration-files). To upgrade
to a new Zulip release:
1. Read the [upgrade notes](../overview/changelog.html#upgrade-notes)
@@ -102,6 +103,52 @@ git_repo_url = https://github.com/zulip/zulip.git
See also our documentation on [upgrading
docker-zulip](https://github.com/zulip/docker-zulip#upgrading-from-a-git-repository).
+## Updating `settings.py` inline documentation
+
+Zulip installations often upgrade many times over their lifetime, and
+we strive to keep all configuration files backwards-compatible.
+However, our practice of leaving the `/etc/zulip/settings.py`
+unchanged during upgrades means that there may be new features which
+are not documented in that file, since it was based on a template
+provided by an earlier version of Zulip, during the initial install.
+
+After upgrading across major versions of Zulip Server, we recommend
+comparing your `/etc/zulip/settings.py` file to the current settings
+template, which can be found in
+`/home/zulip/deployments/current/zproject/prod_settings_template.py`. We
+suggest using that updated template to update
+`/etc/zulip/settings.py`:
+
+1. Copy the current `settings.py` to make a backup (especially if you
+ do not have a recent [complete backup][backups]), and make a copy
+ of the current template:
+
+ ```
+ cp -a /etc/zulip/settings.py ~/zulip-settings-backup.py
+ cp -a /home/zulip/deployments/current/zproject/prod_settings_template.py /etc/zulip/settings-new.py
+ ```
+
+1. Open both `/etc/zulip/settings.py` and `/etc/zulip/settings-new.py`
+ files in an editor; for each setting set in `settings.py`, find its
+ section in `/etc/zulip/settings-new.py` and copy the setting from
+ `settings.py` into there.
+
+ If there are settings which you cannot find documented in
+ `/etc/zulip/settings-new.py`, check the [changelog][changelog] to see
+ if they have been removed.
+
+1. Overwriting the configuration with the updated file, and restart
+ the server to pick up the new file; this should be a no-op, but it
+ is much better to discover immediately if it is not:
+
+ ```
+ cp -a /etc/zulip/settings-new.py /etc/zulip/settings.py
+ su zulip -c '/home/zulip/deployments/current/scripts/restart-server'
+ ```
+
+[backups]: ../production/export-and-import.html#backups
+[changelog]: ../overview/changelog.md
+
## Troubleshooting and rollback
See also the general Zulip server [troubleshooting
@@ -155,11 +202,11 @@ earlier previous version by running
`restart-server` script stops any running Zulip server, and starts
the version corresponding to the `restart-server` path you call.
-## Preserving local changes to configuration files
+## Preserving local changes to service configuration files
```eval_rst
.. warning::
- If you have modified configuration files installed by
+ If you have modified service configuration files installed by
Zulip (e.g. the nginx configuration), the Zulip upgrade process will
overwrite your configuration when it does the ``puppet apply``.
```
diff --git a/docs/subsystems/settings.md b/docs/subsystems/settings.md
index 36ebe5da044..01fb6335f1a 100644
--- a/docs/subsystems/settings.md
+++ b/docs/subsystems/settings.md
@@ -57,7 +57,12 @@ In a production environment, we have:
secrets (e.g. passwords, secret API keys, cryptographic keys, etc.).
The way we generally do settings that can be controlled with shell
access to a Zulip server is to put a default in
- `zproject/default_settings.py`, and then override it here.
+ `zproject/default_settings.py`, and then override it here. As this
+ is the main documentation for Zulip settings, we recommend that
+ production installations [carefully update `/etc/zulip/settings.py`
+ every major
+ release](../production/upgrade-or-modify.html#updating-settings-py-inline-documentation)
+ to pick up new inline documentation.
* `/etc/zulip/zulip-secrets.conf` (generated by
`scripts/setup/generate_secrets.py` as part of installation)