docs/production/modify.md
Zulip is 100% free and open source software, and you're welcome to modify it! This section explains how to make and maintain modifications in a safe and convenient fashion.
If you do modify Zulip and then report an issue you see in your modified version of Zulip, please be responsible about communicating that fact:
If you're looking to modify Zulip by applying changes developed by the
Zulip core team and merged into main, skip to this
section.
One way to modify Zulip is to just edit files under
/home/zulip/deployments/current and then restart the server. This
can work OK for testing small changes to Python code or shell scripts.
But we don't recommend this approach for maintaining changes because:
Instead, we recommend the following GitHub-based workflow (see our Git guide if you need a primer):
ZULIP_VERSION in
/home/zulip/deployments/current/version.py (we'll use 2.0.4
below). If you apply your changes to the wrong version of Zulip,
it's likely to fail and potentially cause downtime.acme-branch below) containing your changes:cd zulip
git checkout -b acme-branch 2.0.4
git commit -a
# Use `git diff` to verify your changes are what you expect
git diff 2.0.4 acme-branch
# Push the changes to your GitHub fork
git push origin +acme-branch
git_repo_url to point to your fork on GitHub and run it as
upgrade-zulip-from-git acme-branch.This workflow solves all of the problems described above: your change will be compiled and installed correctly (restarting the server), and your changes will be tracked so that it's convenient to maintain them across future Zulip releases.
Eventually, you'll want to upgrade to a new Zulip release. If your
changes were integrated into that Zulip release or are otherwise no
longer needed, you can just upgrade as
usual. If you upgraded to
main; review that section again; new
maintenance releases are likely "older" than your current installation
and you might need to upgrade to main again rather than to the
new maintenance release.
Otherwise, you'll need to update your branch by rebasing your changes (starting from a clone of the zulip/zulip repository). The example below assumes you have a branch off of 2.0.4 and want to upgrade to 2.1.0.
cd zulip
git fetch --tags upstream
git checkout acme-branch
git rebase --onto 2.1.0 2.0.4
# Fix any errors or merge conflicts; see Zulip's Git guide for advice
# Use `git diff` to verify your changes are what you expect
git diff 2.1.0 acme-branch
git push origin +acme-branch
And then use upgrade-zulip-from-git to install your updated branch, as before.
If you are using {doc}our Docker image <docker:index>, there are two
things that are different from the above:
upgrade-zulip-from-git, you will need to use
the {doc}Docker upgrade workflow <docker:how-to/compose-upgrading>
to build a container image based on your modified version of Zulip.mainIf you are experiencing an issue that has already been fixed by the Zulip development community, and you'd like to get the fix now, you have a few options. There are two possible ways you might get those fixes on your local Zulip server without waiting for an official release.
Many bugs have small/simple fixes. In this case, you can use the Git workflow described above, using:
git fetch upstream
git cherry-pick abcd1234
instead of "making changes locally" (where abcd1234 is the commit ID
of the change you'd like).
In general, we can't provide unpaid support for issues caused by
cherry-picking arbitrary commits if the issues don't also affect
main or an official release.
The exception to this rule is when we ask or encourage a user to apply a change to their production system to help verify the fix resolves the issue for them. You can expect the Zulip community to be responsive in debugging any problems caused by a patch we asked you to apply.
Also, consider asking whether a small fix that is important to you can
be added to the current stable release branch (e.g., 2.1.x). In
addition to scheduling that change for Zulip's next bug fix release,
we support changes in stable release branches as though they were
released.
mainMany Zulip servers (including chat.zulip.org and zulip.com) upgrade to
main on a regular basis to get the latest features. Before doing
so, it's important to understand how to happily run a server based on
main.
For background, backporting arbitrary patches from main to an older
version requires some care. Common issues include:
*/migrations/), which includes most new features. We
don't support applying database migrations out of order.While it's possible to backport these sorts of changes, you're unlikely to succeed without help from the core team via a support contract.
If you need an unreleased feature, the best path is usually to
upgrade to Zulip main using upgrade-zulip-from-git. Before
upgrading to main, make sure you understand:
main will always be "newer"
than the latest maintenance release (e.g., 3.1 or 2.1.6) and
"older" than the next major release (e.g., 3.0 or 4.0).main branch is under very active development; dozens of new
changes are integrated into it on most days. The main branch
can have thousands of changes not present in the latest release (all
of which will be included in our next major release). On average
main usually has fewer total bugs than the latest release
(because we fix hundreds of bugs in every major release) but it
might have some bugs that are more severe than we would consider
acceptable for a release.main to chat.zulip.org and zulip.com on a regular
basis (often daily), so it's very important to the project that it
be stable. Most regressions will be minor UX issues or be fixed
quickly, because we need them to be fixed for Zulip Cloud.main, since
they provide us an opportunity to fix that category of issue before
our next major release. (Much more so than we are in helping folks
debug other custom changes). That said, we cannot make any
guarantees about how quickly we'll resolve an issue to folks without
a formal support contract.main to earlier versions, so
if downtime for your Zulip server is unacceptable, make sure you
have a current
backup in case the
upgrade fails.main; so you can get the
security fixes by upgrading to main.main to the next major release when it
comes out, using either upgrade-zulip-from-git or the release
tarball. So there's no risk of upgrading to main resulting in
a system that's not upgradeable back to a normal release.Zulip contains thousands of changes submitted by volunteer contributors like you. If your changes are likely to be of useful to other organizations, consider contributing them.