Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
docs: Apply sentence single-spacing from Prettier.
Anders Kaseorg35c1c8d41b93
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex c717bc46004..9b3dac8674f 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -75,7 +75,7 @@ to help.and do the Git tutorial (coming soon) if you are unfamiliar withGit, getting help in[#git help](https://chat.zulip.org/#narrow/stream/44-git-help) if- you run into any troubles. Be sure to check out the+ you run into any troubles. Be sure to check out the[extremely useful Zulip-specific tools page](https://zulip.readthedocs.io/en/latest/git/zulip-tools.html).### Picking an issue@@ -96,7 +96,7 @@ on.- For the main server and web repository, we recommend browsingrecently opened issues to look for issues you are confident you canfix correctly in a way that clearly communicates why your changes- are the correct fix. Our GitHub workflow bot, zulipbot, limits+ are the correct fix. Our GitHub workflow bot, zulipbot, limitsusers who have 0 commits merged to claiming a single issue labeledwith "good first issue" or "help wanted".- We also partition all of our issues in the main repo into areas like@@ -127,9 +127,9 @@ Other notes:[good first issue](https://github.com/zulip/zulip/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)and[help wanted](https://github.com/zulip/zulip/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)- labels. Avoid issues with the "difficult" label unless you+ labels. Avoid issues with the "difficult" label unless youunderstand why it is difficult and are confident you can resolve the- issue correctly and completely. Issues without one of these labels+ issue correctly and completely. Issues without one of these labelsare fair game if Tim has written a clear technical design proposalin the issue, or it is a bug that you can reproduce and you areconfident you can fix the issue correctly.@@ -172,7 +172,7 @@ labels.## What makes a great Zulip contributor?-Zulip has a lot of experience working with new contributors. In our+Zulip has a lot of experience working with new contributors. In ourexperience, these are the best predictors of success:- Posting good questions. This generally means explaining your current@@ -216,7 +216,7 @@ if appropriate.**Reporting security issues**. Please do not report security issuespublicly, including on public streams on chat.zulip.org. You can- email [email protected]. We create a CVE for every security+ email [email protected]. We create a CVE for every securityissue in our released software.## User feedback@@ -257,7 +257,7 @@ mind:publicly viewable patches you can link to from your resume, regardless ofwhether you are selected.- To apply, you'll have to submit at least one pull request to a Zulip- repository. Most students accepted to one of our programs have+ repository. Most students accepted to one of our programs haveseveral merged pull requests (including at least one larger PR) bythe time of the application deadline.- The main criteria we use is quality of your best contributions, and@@ -274,7 +274,7 @@ important parts of the project. We hope you apply!### Google Summer of CodeThe largest outreach program Zulip participates in is GSoC (14-students in 2017; 11 in 2018; 17 in 2019; 18 in 2020). While we don't control how+students in 2017; 11 in 2018; 17 in 2019; 18 in 2020). While we don't control howmany slots Google allocates to Zulip, we hope to mentor a similarnumber of students in future summers.@@ -282,9 +282,9 @@ If you're reading this well before the application deadline and wantto make your application strong, we recommend getting involved in thecommunity and fixing issues in Zulip now. Having good contributionsand building a reputation for doing good work is the best way to have-a strong application. About half of Zulip's GSoC students for Summer+a strong application. About half of Zulip's GSoC students for Summer2017 had made significant contributions to the project by February-2017, and about half had not. Our+2017, and about half had not. Our[GSoC project ideas page][gsoc-guide] has lots more details on howZulip does GSoC, as well as project ideas (though the project idealist is maintained only during the GSoC application period, so if@@ -293,9 +293,9 @@ out-of-date).We also have in some past years run a Zulip Summer of Code (ZSoC)program for students who we didn't have enough slots to accept for-GSoC but were able to find funding for. Student expectations are the+GSoC but were able to find funding for. Student expectations are thesame as with GSoC, and it has no separate application process; your-GSoC application is your ZSoC application. If we'd like to select you+GSoC application is your ZSoC application. If we'd like to select youfor ZSoC, we'll contact you when the GSoC results are announced.[gsoc-guide]: https://zulip.readthedocs.io/en/latest/contributing/gsoc-ideas.htmldiff --git a/README.md b/README.mdindex 3aad21b35c2..b400956a3c6 100644--- a/README.md+++ b/README.md@@ -32,7 +32,7 @@ You might be interested in:- **Contributing code**. Check out our[guide for new contributors](https://zulip.readthedocs.io/en/latest/overview/contributing.html)- to get started. Zulip prides itself on maintaining a clean and+ to get started. Zulip prides itself on maintaining a clean andwell-tested codebase, and a stock of hundreds of[beginner-friendly issues][beginner-friendly].diff --git a/SECURITY.md b/SECURITY.mdindex 3411b57b441..91d853aea25 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -8,7 +8,7 @@ so you should subscribe if you are running Zulip in production.We love responsible reports of (potential) security issues in Zulip,whether in the latest release or our development branch.-Our security contact is [email protected]. Reporters should expect a+Our security contact is [email protected]. Reporters should expect aresponse within 24 hours.Please include details on the issue and how you'd like to be crediteddiff --git a/docs/contributing/accessibility.md b/docs/contributing/accessibility.mdindex 783f43d7914..98862505831 100644--- a/docs/contributing/accessibility.md+++ b/docs/contributing/accessibility.md@@ -3,7 +3,7 @@## GuidelinesIn order to accommodate all users, Zulip strives to implement accessibility-best practices in its user interface. There are many aspects to accessibility;+best practices in its user interface. There are many aspects to accessibility;here are some of the more important ones to keep in mind.- All images should have alternative text attributes for the benefit of users@@ -20,7 +20,7 @@ here are some of the more important ones to keep in mind.There are many different standards for accessibility, but the most relevantone for Zulip is the W3C's [WCAG](https://www.w3.org/TR/WCAG20/) (Web Content-Accessibility Guidelines), currently at version 2.0. Whenever practical, we+Accessibility Guidelines), currently at version 2.0. Whenever practical, weshould strive for compliance with the AA level of this specification.(The W3C itself[recommends not trying](https://www.w3.org/TR/UNDERSTANDING-WCAG20/conformance.html#uc-conf-req1-head)@@ -30,11 +30,11 @@ as it is not possible for some content.)## ToolsThere are tools available to automatically audit a web page for compliance-with many of the WCAG guidelines. Here are some of the more useful ones:+with many of the WCAG guidelines. Here are some of the more useful ones:- [Accessibility Developer Tools][chrome-webstore]This open source Chrome extension from Google adds an accessibility audit to- the "Audits" tab of the Chrome Developer Tools. The audit is performed+ the "Audits" tab of the Chrome Developer Tools. The audit is performedagainst the page's DOM via JavaScript, allowing it to identify some issuesthat a static HTML inspector would miss.- [aXe](https://www.deque.com/products/axe/) An open source Chrome and Firefox@@ -42,14 +42,14 @@ with many of the WCAG guidelines. Here are some of the more useful ones:extension.- [Wave](https://wave.webaim.org/) This web application takes a URL and loadsit in a frame, reporting on all the issues it finds with links to more- information. Has the advantage of not requiring installation, but requires+ information. Has the advantage of not requiring installation, but requiresa URL which can be directly accessed by an external site.- [Web Developer](https://chrispederick.com/work/web-developer/) This browserextension has many useful features, including a convenient link for openingthe current URL in Wave to get an accessibility report.Note that these tools cannot catch all possible accessibility problems, and-sometimes report false positives as well. They are a useful aid in quickly+sometimes report false positives as well. They are a useful aid in quicklyidentifying potential problems and checking for regressions, but theirrecommendations should not be blindly obeyed.@@ -57,7 +57,7 @@ recommendations should not be blindly obeyed.Problems with Zulip's accessibility should be reported as[GitHub issues](https://github.com/zulip/zulip/issues) with the "accessibility"-label. This label can be added by entering the following text in a separate+label. This label can be added by entering the following text in a separatecomment on the issue:> @zulipbot add "area: accessibility"diff --git a/docs/contributing/code-reviewing.md b/docs/contributing/code-reviewing.mdindex 8813943c917..f21a33921e7 100644--- a/docs/contributing/code-reviewing.md+++ b/docs/contributing/code-reviewing.md@@ -1,8 +1,8 @@# Reviewing Zulip code-Code review is a key part of how Zulip does development! If you've+Code review is a key part of how Zulip does development! If you'vebeen contributing to Zulip's code, we'd love for you to do reviews.-This is a guide to how. (With some thoughts for writing code too.)+This is a guide to how. (With some thoughts for writing code too.)## Protocol for authors@@ -26,7 +26,7 @@ to dive right into reviewing the PR's core functionality.### Responding to a review feedbackOnce you've received a review and resolved any feedback, it's critical-to update the GitHub thread to reflect that. Best practices are to:+to update the GitHub thread to reflect that. Best practices are to:- Make sure that CI passes and the PR is rebased onto recent `main`.- Post comments on each feedback thread explaining at least how you@@ -38,7 +38,7 @@ to update the GitHub thread to reflect that. Best practices are to:- Post a summary comment in the main feed for the PR, explaining thatthis is ready for another review, and summarizing any changes fromthe previous version, details on how you tested the changes, new- screenshots/etc. More detail is better than less, as long as you+ screenshots/etc. More detail is better than less, as long as youtake the time to write clearly.If you resolve the feedback, but the PR has merge conflicts, CI@@ -48,7 +48,7 @@ will assume it isn't ready for review and move on to other work.If you need help or think an open discussion topic requires morefeedback or a more complex discussion, move the discussion to a topic-in the Zulip development community server. Be sure to provide links+in the Zulip development community server. Be sure to provide linksfrom the GitHub PR to the conversation (and vice versa) so that it'sconvenient to read both conversations together.@@ -74,7 +74,7 @@ those are really helpful contributions.Doing code reviews is an important part of making the project grow.It's also an important skill to develop for participating in-open-source projects and working in the industry in general. If+open-source projects and working in the industry in general. Ifyou're contributing to Zulip and have been working in our code for alittle while, we would love for some of your time contributing to comein the form of doing code reviews!@@ -86,7 +86,7 @@ the first couple of weeks as you're getting going) doing code reviews.### Fast replies are keyFor the author of a PR, getting feedback quickly is really important-for making progress quickly and staying productive. That means that+for making progress quickly and staying productive. That means thatif you get @-mentioned on a PR with a request for you to review it,it helps the author a lot if you reply promptly.@@ -99,9 +99,9 @@ review the PR.People in the Zulip project live and work in many timezones, and codereviewers also need focused chunks of time to write code and do other-things, so an immediate reply isn't always possible. But a good+things, so an immediate reply isn't always possible. But a goodbenchmark is to try to always reply **within one workday**, at least-with a short initial reply, if you're working regularly on Zulip. And+with a short initial reply, if you're working regularly on Zulip. Andsooner is better.## Things to look for@@ -123,25 +123,25 @@ sooner is better.- *Technical design.* There are a lot of considerations here:security, migration paths/backwards compatibility, cost of newdependencies, interactions with features, speed of performance, API- changes. Security is especially important and worth thinking about+ changes. Security is especially important and worth thinking aboutcarefully with any changes to security-sensitive code like views.- *User interface and visual design.* If frontend changes areinvolved, the reviewer will check out the code, play with the newUI, and verify it for both quality and consistency with the rest of- the Zulip UI. We highly encourage posting screenshots to save+ the Zulip UI. We highly encourage posting screenshots to savereviewers time in getting a feel for what the feature looks like --you'll get a quicker response that way.- *Error handling.* The code should always check for invalid user- input. User-facing error messages should be clear and when possible+ input. User-facing error messages should be clear and when possiblebe actionable (it should be obvious to the user what they need to doin order to correct the problem).- *Testing.* The tests should validate that the feature workscorrectly, and specifically test for common error conditions, baduser input, and potential bugs that are likely for the type of- change being made. Tests that exclude whole classes of potential+ change being made. Tests that exclude whole classes of potentialbugs are preferred when possible (e.g., the common test suite`test_markdown.py` between the Zulip server's [frontend and backendMarkdown processors](../subsystems/markdown.md), or the `GetEventsTest` test for@@ -158,7 +158,7 @@ sooner is better.- *Duplicated code.* Code duplication is a huge source of bugs inlarge projects and makes the codebase difficult to understand, so we- avoid significant code duplication wherever possible. Sometimes+ avoid significant code duplication wherever possible. Sometimesavoiding code duplication involves some refactoring of existingcode; if so, that should usually be done as its own series ofcommits (not squashed into other changes or left as a thing to do@@ -170,11 +170,11 @@ sooner is better.discussion for the feature itself.- *Completeness.* For refactorings, verify that the changes are- complete. Usually one can check that efficiently using `git grep`,+ complete. Usually one can check that efficiently using `git grep`,and it's worth it, as we very frequently find issues by doing so.-- *Documentation updates.* If this changes how something works, does it- update the documentation in a corresponding way? If it's a new+- *Documentation updates.* If this changes how something works, does it+ update the documentation in a corresponding way? If it's a newfeature, is it documented, and documented in the right place?- *Good comments.* It's often worth thinking about whether explanation@@ -185,7 +185,7 @@ sooner is better.lots of clever tricks.- *Coding style.* See the Zulip [code-style] documentation for- details. Our goal is to have as much of this as possible verified+ details. Our goal is to have as much of this as possible verifiedvia the linters and tests, but there's always going to be unusualforms of Python/JavaScript style that our tools don't check for.@@ -202,11 +202,11 @@ Some points specific to the Zulip server codebase:the various error conditions.- *Testing -- Frontend.* If the feature involves frontend changes,- there should be frontend tests. See the [test+ there should be frontend tests. See the [testwriting][test-writing] documentation for more details.- *mypy annotations.* New functions should be annotated using [mypy]- and existing annotations should be updated. Use of `Any`, `ignore`,+ and existing annotations should be updated. Use of `Any`, `ignore`,and unparameterized containers should be limited to cases where amore precise type cannot be specified.diff --git a/docs/contributing/code-style.md b/docs/contributing/code-style.mdindex 83d7b66682f..48aa63fe4d5 100644--- a/docs/contributing/code-style.md+++ b/docs/contributing/code-style.md@@ -2,7 +2,7 @@One can summarize Zulip's coding philosophy as a relentless focus onmaking the codebase easy to understand and difficult to make dangerous-mistakes in. The majority of work in any large software development+mistakes in. The majority of work in any large software developmentproject is understanding the existing code so one can debug or modifyit, and investments in code readability usually end up paying forthemselves when someone inevitably needs to debug or improve the code.@@ -15,10 +15,10 @@ comments/docstrings, and commit messages (roughly in order of prioritybetter than writing a comment explaining how the bad interface works).This page documents code style policies that every Zulip developer-should understand. We aim for this document to be short and focused+should understand. We aim for this document to be short and focusedonly on details that cannot be easily enforced another way (e.g.through linters, automated tests, subsystem design that makes classes-of mistakes unlikely, etc.). This approach minimizes the cognitive+of mistakes unlikely, etc.). This approach minimizes the cognitiveload of ensuring a consistent coding style for both contributors andmaintainers.@@ -86,8 +86,8 @@ for bar in bars:# Make use of foo```-...which makes a database query for every Bar. While this may be fast-locally in development, it may be quite slow in production! Instead,+...which makes a database query for every Bar. While this may be fast+locally in development, it may be quite slow in production! Instead,tell Django's [QuerySetAPI](https://docs.djangoproject.com/en/dev/ref/models/querysets/) to_prefetch_ the data in the initial query:@@ -263,9 +263,9 @@ code a lot uglier, in which case it's fine to go up to 120 or so.### JavaScript and TypeScriptOur JavaScript and TypeScript code is formatted with-[Prettier](https://prettier.io/). You can ask Prettier to reformat+[Prettier](https://prettier.io/). You can ask Prettier to reformatall code via our [linter tool](../testing/linters.md) with-`tools/lint --only=prettier --fix`. You can also [integrate it with your+`tools/lint --only=prettier --fix`. You can also [integrate it with youreditor](https://prettier.io/docs/en/editors.html).Combine adjacent on-ready functions, if they are logically related.@@ -306,7 +306,7 @@ call a helper function instead.### HTML / CSS-Our CSS is formatted with [Prettier](https://prettier.io/). You can+Our CSS is formatted with [Prettier](https://prettier.io/). You canask Prettier to reformat all code via our [lintertool](../testing/linters.md) with `tools/lint --only=prettier --fix`.You can also [integrate it with your@@ -324,10 +324,10 @@ type changes in the future.- Our Python code is formatted with[Black](https://github.com/psf/black) and- [isort](https://pycqa.github.io/isort/). The [linter+ [isort](https://pycqa.github.io/isort/). The [lintertool](../testing/linters.md) enforces this by running Black andisort in check mode, or in write mode with- `tools/lint --only=black,isort --fix`. You may find it helpful to+ `tools/lint --only=black,isort --fix`. You may find it helpful to[integrateBlack](https://black.readthedocs.io/en/stable/editor_integration.html)and@@ -355,7 +355,7 @@ type changes in the future.Clear, readable code is important for [tests](../testing/testing.md);familiarize yourself with our testing frameworks so that you can write-clean, readable tests. Comments about anything subtle about what is+clean, readable tests. Comments about anything subtle about what isbeing verified are appreciated.### Third party codediff --git a/docs/contributing/gsoc-ideas.md b/docs/contributing/gsoc-ideas.mdindex d3df1f08946..daf3fc3d2bb 100644--- a/docs/contributing/gsoc-ideas.md+++ b/docs/contributing/gsoc-ideas.md@@ -10,7 +10,7 @@ integrations, all open source.Zulip has gained a considerable amount of traction since it was[released as open source software][oss-release] in late 2015, withcode contributions from [over 700 people](https://zulip.com/team)-from all around the world. Thousands of people use Zulip every single+from all around the world. Thousands of people use Zulip every singleday, and your work on Zulip will have impact on the daily experiencesof a large and rapidly growing number of people.@@ -19,7 +19,7 @@ of a large and rapidly growing number of people.As an organization, we value high-quality, responsive mentorship andmaking sure our product quality is extremely high -- you can expect toexperience disciplined code reviews by highly experienced-engineers. Since Zulip is a team chat product, your GSoC experience+engineers. Since Zulip is a team chat product, your GSoC experiencewith the Zulip project will be highly interactive.As part of that commitment, Zulip has over 160,000 words of@@ -31,17 +31,17 @@ the way that it does.### Our history with Google Open Source ProgramsZulip has been a GSoC mentoring organization since 2016, and we aim-for 15-20 GSoC students each summer. We have some of the highest+for 15-20 GSoC students each summer. We have some of the higheststandards of any GSoC organization; successful applications generallyhave dozens of commits integrated into Zulip or other open source-projects by the time we review their application. See [our+projects by the time we review their application. See [ourcontributing guide](../overview/contributing.md) for details ongetting involved with GSoC.Zulip participated in GSoC 2016 and mentored three successful studentsofficially (plus 4 more who did their proposed projects unofficially).We had 14 (+3) students in 2017, 10 (+3) students in 2018, 17 (+1) in-2019, and 18 in 2020. We've also mentored five Outreachy interns and+2019, and 18 in 2020. We've also mentored five Outreachy interns andhundreds of Google Code-In participants (several of who are majorcontributors to the project today).@@ -55,7 +55,7 @@ the summer).[Our guide for having a great summer with Zulip](../contributing/summer-with-zulip.md)is focused on what one should know once doing a summer project with-Zulip. But it has a lot of useful advice on how we expect students to+Zulip. But it has a lot of useful advice on how we expect students tointeract, above and beyond what is discussed in Google's materials.[What makes a great Zulip contributor](../overview/contributing.html#what-makes-a-great-zulip-contributor)@@ -69,7 +69,7 @@ We also recommend reviewingFinally, keep your eye on[the GSoC timeline](https://developers.google.com/open-source/gsoc/timeline). The-student application deadline is April 13, 2021. However, as is+student application deadline is April 13, 2021. However, as isdiscussed in detail later in this document, we recommend againstworking on a proposal until 2 weeks before the deadline.@@ -114,7 +114,7 @@ Your application should include the following:We expect applicants to either have experience with the technologiesrelevant to their project or have strong general programming-experience. We also expect applicants to be excited about learning+experience. We also expect applicants to be excited about learninghow to do disciplined, professional software engineering, where theycan demonstrate through reasoning and automated tests that their codeis correct.@@ -166,19 +166,19 @@ post.](https://www.harihareswara.net/sumana/2016/10/12/0)## MentorsZulip has dozens of longtime contributors who sign up to mentoring-projects. We usually decide who will mentor which projects based in+projects. We usually decide who will mentor which projects based inpart on who is a good fit for the needs of each student as well astechnical expertise as well as who has available time during the-summer. You can reach us via+summer. You can reach us via[#GSoC](https://chat.zulip.org/#narrow/stream/14-GSoC) on [the Zulipdevelopment community server](https://zulip.com/developer-community/),(compose a new stream message with your name as the topic).-Zulip operates under group mentorship. That means you should+Zulip operates under group mentorship. That means you shouldgenerally post in public streams on chat.zulip.org, not send private-messages, for assistance. Our preferred approach is to just post in+messages, for assistance. Our preferred approach is to just post inan appropriate public stream on chat.zulip.org and someone will help-you. We list the Zulip contributors who are experts for various+you. We list the Zulip contributors who are experts for variousprojects by name below; they will likely be able to provide you withthe best feedback on your proposal (feel free to @-mention them inyour Zulip post). In practice, this allows project leadership to@@ -188,11 +188,11 @@ However, the first and most important thing to do for building astrong application is to show your skills by contributing to a largeopen source project like Zulip, to show that you can work effectivelyin a large codebase (it doesn't matter what part of Zulip, and we're-happy to consider work in other open source projects). The quality of+happy to consider work in other open source projects). The quality ofyour best work is more important to us than the quantity; so be sureto test your work before submitting it for review and follow ourcoding guidelines (and don't worry if you make mistakes in your first-few contributions! Everyone makes mistakes getting started. Just+few contributions! Everyone makes mistakes getting started. Justmake sure you don't make the same mistakes next time).Once you have several PRs merged (or at least one significant PR@@ -206,8 +206,8 @@ online.These are the seeds of ideas; you will need to do research on theZulip codebase, read issues on GitHub, and talk with developers to put-together a complete project proposal. It's also fine for you to come-up with your own project ideas. As you'll see below, you can put+together a complete project proposal. It's also fine for you to come+up with your own project ideas. As you'll see below, you can puttogether a great project around one of the[area labels](https://github.com/zulip/zulip/labels) on GitHub; eachhas a cluster of problems in one part of the Zulip project that we'd@@ -217,13 +217,13 @@ We don't believe in labeling projects by difficulty (e.g. a projectthat involves writing a lot of documentation will be hard for somegreat programmers, and a UI design project might be hard for a greatbackend programmer, while a great writer might have trouble doing-performance work). To help you find a great project, we list the+performance work). To help you find a great project, we list theskills needed, and try to emphasize where strong skills withparticular tools are likely to be important for a given project.For all of our projects, an important skill to develop is a goodcommand of Git; read [our Git guide](../git/overview.md) in full to-learn how to use it well. Of particular importance is mastering using+learn how to use it well. Of particular importance is mastering usingGit rebase so that you can construct commits that are clearly correctand explain why they are correct. We highly recommend investing inlearning a [graphical Git client](../git/setup.md) and learning to@@ -246,13 +246,13 @@ set of 8 issues may not be the right ones to invest in.For 2021, we are particularly interested in GSoC students who havestrong skills at visual design, HTML/CSS, mobile development,-performance optimization, or Electron. So if you're a student with+performance optimization, or Electron. So if you're a student withthose skills and are looking for an organization to join, we'd love totalk to you!The Zulip project has a huge surface area, so even when we're focusedon something, a huge amount of essential work goes into other parts of-the project. Every area of Zulip could benefit from the work of a+the project. Every area of Zulip could benefit from the work of astudent with strong programming skills; so don't feel discouraged ifthe areas mentioned above are not your main strength.@@ -273,12 +273,12 @@ CSS](https://github.com/zulip/zulip/).Zulip has a [nice framework](../documentation/api.md) for writingAPI documentation built by past GSoC students based on the OpenAPIstandard with built-in automated tests of the data both the Python- and curl examples. However, the documentation isn't yet what we're+ and curl examples. However, the documentation isn't yet what we'rehoping for: there are a few dozen endpoints that are missing,several of which are quite important, the visual design isn'tperfect (especially for e.g. `GET /events`), many template could be- deleted with a bit of framework effort, etc. See the [API docs area- label][api-docs-area] for many specific projects in the area. Our+ deleted with a bit of framework effort, etc. See the [API docs area+ label][api-docs-area] for many specific projects in the area. Ourgoal for the summer is for 1-2 students to resolve all open issuesrelated to the REST API documentation.@@ -288,46 +288,46 @@ CSS](https://github.com/zulip/zulip/).Zulip, including [default streamgroups](https://github.com/zulip/zulip/issues/13670), [MuteUser](https://github.com/zulip/zulip/issues/168), and [public- access](https://github.com/zulip/zulip/issues/13172). Expert: Tim- Abbott. Many of these issues have open PRs with substantial work+ access](https://github.com/zulip/zulip/issues/13172). Expert: Tim+ Abbott. Many of these issues have open PRs with substantial worktowards the goal, but each of them is likely to have dozens ofadjacent or follow-up tasks.- Fill in gaps, fix bugs, and improve the framework for Zulip's- library of native integrations. We have about 100 integrations, but- there are a handful of important integrations that are missing. The+ library of native integrations. We have about 100 integrations, but+ there are a handful of important integrations that are missing. The[the integrations label onGitHub](https://github.com/zulip/zulip/labels/area%3A%20integrations)lists some of the priorities here (many of which are greatpreparatory projects); once those are cleared, we'll likely have- many more. **Skills required**: Strong Python experience, will to- do careful manual testing of third-party products. Fluent English,+ many more. **Skills required**: Strong Python experience, will to+ do careful manual testing of third-party products. Fluent English,usability sense and/or technical writing skills are all pluses.Expert: Eeshan Garg.- Optimize performance and scalability, either for the web frontend or- the server. Zulip is already one of the faster web apps out there,+ the server. Zulip is already one of the faster web apps out there,but there are a bunch of ideas for how to make it substantially- faster. This is likely a particularly challenging project to do+ faster. This is likely a particularly challenging project to dowell, since there are a lot of subtle interactions to understand.**Skill recommended**: Strong debugging, communication, and code- reading skills are most important here. JavaScript experience; some+ reading skills are most important here. JavaScript experience; somePython/Django experience, some skill with CSS, ideally experienceusing the Chrome Timeline profiling tools (but you can pick this up- as you go) can be useful depending on what profiling shows. Our+ as you go) can be useful depending on what profiling shows. Our[backend scalability design doc](../subsystems/performance.md) andthe [production issue label][prod-label] (whereperformance/scalability issues tend to be filed) may be helpful- reading for the backend part of this. Expert: Steve Howell.+ reading for the backend part of this. Expert: Steve Howell.[prod-label]: https://github.com/zulip/zulip/issues?q=is%3Aopen+is%3Aissue+label%3A%22area%3A+production%22- Extract JavaScript logic modules from the Zulip web app that we'd- like to be able to share with the Zulip web app. This work can have+ like to be able to share with the Zulip web app. This work can havebig benefits it terms of avoiding code duplication for complex- logic. We have prototyped for a few modules by migrating them to+ logic. We have prototyped for a few modules by migrating them to`static/shared/`; this project will involve closely collaborating- with the mobile team to prioritize the modules to migrate. **Skills+ with the mobile team to prioritize the modules to migrate. **Skillsrecommended**: JavaScript experience, careful refactoring, APIdesign, React.@@ -338,12 +338,12 @@ CSS](https://github.com/zulip/zulip/).permissions (and implementing the enforcement logic), adding anOAuth system for presenting those controls to users, as well asmaking the /integrations page UI have buttons to create a bot,- rather than sending users to the administration page. **Skills+ rather than sending users to the administration page. **Skillsrecommended**: Strong Python/Django; JavaScript, CSS, and design- sense helpful. Understanding of implementing OAuth providers,+ sense helpful. Understanding of implementing OAuth providers,e.g. having built a prototype with[the Django OAuth toolkit](https://django-oauth-toolkit.readthedocs.io/en/latest/)- would be great to demonstrate as part of an application. The+ would be great to demonstrate as part of an application. The[Zulip integration writing guide](../documentation/integrations.md)and[integration documentation](https://zulip.com/integrations/)@@ -351,69 +351,69 @@ CSS](https://github.com/zulip/zulip/).and[the integrations label on GitHub](https://github.com/zulip/zulip/labels/area%3A%20integrations)has a bunch of good starter issues to demonstrate your skills if- you're interested in this area. Expert: Eeshan Garg.+ you're interested in this area. Expert: Eeshan Garg.- Extend Zulip's meta-integration that converts the Slack incoming webhookAPI to post messages into Zulip. Zulip has several dozen nativeintegrations (https://zulip.com/integrations/), but Slack has a- ton more. We should build an interface to make all of Slack’s+ ton more. We should build an interface to make all of Slack’snumerous third-party integrations work with Zulip as well, bybasically building a Zulip incoming webhook interface that acceptsthe Slack API (if you just put in a Zulip server URL as your "Slack- server"). **Skills required**: Strong Python experience; experience- with the Slack API a plus. Work should include documenting the- system and advertising it. Expert: Tim Abbott.+ server"). **Skills required**: Strong Python experience; experience+ with the Slack API a plus. Work should include documenting the+ system and advertising it. Expert: Tim Abbott.- Visual and user experience design work on the core Zulip web UI.We're particularly excited about students who are interested inmaking our CSS clean and readable as part of working on the UI.**Skills required**: Design, HTML and CSS skills; JavaScript and- illustration experience are helpful. A great application would+ illustration experience are helpful. A great application wouldinclude PRs making small, clean improvements to the Zulip UI- (whether logged-in or logged-out pages). Expert: Aman Agrawal.+ (whether logged-in or logged-out pages). Expert: Aman Agrawal.- Build support for outgoing webhooks and slash commands into Zulip to- improve its chat-ops capabilities. There's an existing+ improve its chat-ops capabilities. There's an existing[pull request](https://github.com/zulip/zulip/pull/1393) with a lotof work on the outgoing webhooks piece of this feature that wouldneed to be cleaned up and finished, and then we need to build support for slashcommands, some example integrations, and a full set of- documentation and tests. Recommended reading includes Slack's+ documentation and tests. Recommended reading includes Slack'sdocumentation for these features, the Zulip message sending codepath, and the linked pull request. **Skills required**: Strong- Python/Django skills. Expert: Steve Howell.+ Python/Django skills. Expert: Steve Howell.- Build a system for managing Zulip bots entirely on the web.Right now, there's a somewhat cumbersome process where you downloadthe API bindings, create a bot with an API key, put it in- configuration files, etc. We'd like to move to a model where a bot+ configuration files, etc. We'd like to move to a model where a botcould easily progress from being a quick prototype to being a third-party extension to- being built into Zulip. And then for built-in bots, one should be able to click a few+ being built into Zulip. And then for built-in bots, one should be able to click a fewbuttons of configuration on the web to set them up and include them in- your organization. We've developed a number of example bots+ your organization. We've developed a number of example botsin the [`zulip_bots`](https://github.com/zulip/python-zulip-api/tree/main/zulip_bots)PyPI package.**Skills recommended**: Python and JavaScript/CSS, plus devopsskills (Linux deployment, Docker, Puppet etc.) are all useful here.Experience writing tools using various popular APIs is helpful for- being able to make good choices. Expert: Steve Howell.+ being able to make good choices. Expert: Steve Howell.- Improve the UI and visual design of the existing Zulip settings and- administration pages while fixing bugs and adding new settings. The+ administration pages while fixing bugs and adding new settings. Thepages have improved a great deal during recent GSoCs, but because- they have a ton of surface area, there's a lot to do. You can get a+ they have a ton of surface area, there's a lot to do. You can get agreat sense of what needs to be done by playing with thesettings/administration/streams overlays in a development- environment. You can get experience working on the subsystem by+ environment. You can get experience working on the subsystem byworking on some of [our open settings/adminissues](https://github.com/zulip/zulip/labels/area%3A%20admin).**Skills recommended**: JavaScript, HTML, CSS, and an eye for visual- design. Expert: Shubham Dhama.+ design. Expert: Shubham Dhama.- Build out the administration pages for Zulip to add new permissionsand other settings more features that will make Zulip better for- larger organizations. We get constant requests for these kinds of- features from Zulip users. The Zulip bug tracker has plentiful open+ larger organizations. We get constant requests for these kinds of+ features from Zulip users. The Zulip bug tracker has plentiful openissues( [settings(admin/org)](https://github.com/zulip/zulip/labels/area%3A%20settings%20%28admin%2Forg%29),[settings@@ -422,32 +422,32 @@ CSS](https://github.com/zulip/zulip/).(user)](https://github.com/zulip/zulip/labels/area%3A%20settings%20%28user%29),[streamsettings](https://github.com/zulip/zulip/labels/area%3A%20stream%20settings)- ) in the space of improving the Zulip administrative UI. Many are+ ) in the space of improving the Zulip administrative UI. Many arelittle bite-size fixes in those pages, which are great for getting afeel for things, but a solid project here would be implementing 5-10of the major missing features as full-stack development projects.The first part of this project will be refactoring the admin UIinterfaces to require writing less semi-duplicate code for eachfeature. **Skills recommended**: A good mix of Python/Django and- HTML/CSS/JavaScript skill is ideal. The system for adding new+ HTML/CSS/JavaScript skill is ideal. The system for adding newfeatures is [well documented](../tutorials/new-feature-tutorial.md).Expert: Shubham Dhama.-- Write cool new features for Zulip. Play around with the software,+- Write cool new features for Zulip. Play around with the software,browse Zulip's issues for things that seem important, and suggest- something you’d like to build! A great project can combine 3-5- significant features. Experts: Depends on the features!+ something you’d like to build! A great project can combine 3-5+ significant features. Experts: Depends on the features!-- Work on Zulip's development and testing infrastructure. Zulip is a+- Work on Zulip's development and testing infrastructure. Zulip is aproject that takes great pride in building great tools fordevelopment, but there's always more to do to make the experience- delightful. Significantly, a full 10% of Zulip's open issues are+ delightful. Significantly, a full 10% of Zulip's open issues areideas for how to improve the project, and are[in](https://github.com/zulip/zulip/labels/area%3A%20tooling)[these](https://github.com/zulip/zulip/labels/area%3A%20testing-coverage)[four](https://github.com/zulip/zulip/labels/area%3A%20testing-infrastructure)[labels](https://github.com/zulip/zulip/labels/area%3A%20provision)- for tooling improvements. A good place to start is+ for tooling improvements. A good place to start is[backend test coverage](https://github.com/zulip/zulip/issues/7089).This is a somewhat unusual project, in that it would likely consist@@ -459,14 +459,14 @@ CSS](https://github.com/zulip/zulip/).A possible specific larger project in this space is working onadding [mypy](../testing/mypy.md) stubs- for Django in mypy to make our type checking more powerful. Read+ for Django in mypy to make our type checking more powerful. Read[our mypy blog post](https://blog.zulip.org/2016/10/13/static-types-in-python-oh-mypy/)- for details on how mypy works and is integrated into Zulip. This+ for details on how mypy works and is integrated into Zulip. Thisspecific project is ideal for a strong contributor interested intype systems.**Skills required**: Python, some DevOps, and a passion for checking- your work carefully. A strong applicant for this will have+ your work carefully. A strong applicant for this will havecompleted several projects in these areas.Experts: Anders Kaseorg (provision, testing), Steve Howell (tooling, testing).@@ -476,12 +476,12 @@ CSS](https://github.com/zulip/zulip/).[python](https://github.com/zulip/python-zulip-api),[JavaScript](https://github.com/zulip/zulip-js),[PHP](https://packagist.org/packages/mrferos/zulip-php), and- [Haskell](https://hackage.haskell.org/package/hzulip)). The+ [Haskell](https://hackage.haskell.org/package/hzulip)). TheJavaScript bindings are a particularly high priority, since they area project that hasn't gotten a lot of attention since being adoptedfrom its original author, and we'd like to convert them to- Typescript. **Skills required**: Experience with the target- language and API design. Expert: Depends on language.+ Typescript. **Skills required**: Experience with the target+ language and API design. Expert: Depends on language.- Develop [**@zulipbot**](https://github.com/zulip/zulipbot), the GitHubworkflow bot for the Zulip organization and its repositories. By utilizing the@@ -505,12 +505,12 @@ Experts: Greg Price, Chris Bobbe.The highest priority for the Zulip project overall is improving theZulip React Native mobile app.-- Work on issues and polish for the app. You can see the open issues- [here](https://github.com/zulip/zulip-mobile/issues). There are a+- Work on issues and polish for the app. You can see the open issues+ [here](https://github.com/zulip/zulip-mobile/issues). There are afew hundred open issues across the project, and likely many moreproblems that nobody has found yet; in the short term, it needs- polish, bug finding/squashing, and debugging. So browse the open- issues, play with the app, and get involved! Goals include parity+ polish, bug finding/squashing, and debugging. So browse the open+ issues, play with the app, and get involved! Goals include paritywith the web app (in terms of what you can do), parity with Slack (interms of the visuals), world-class scrolling and narrowingperformance, and a great codebase.@@ -518,15 +518,15 @@ Zulip React Native mobile app.A good project proposal here will bundle together a few focus areasthat you want to make really great (e.g. the message composing,editing, and reacting experience), that you can work on over the-summer. We'd love to have multiple students working on this area if+summer. We'd love to have multiple students working on this area ifwe have enough strong applicants.**Skills required**: Strong programming experience, especially inreading the documentation of unfamiliar projects and communicating- what you learned. JavaScript and React experience are great pluses,+ what you learned. JavaScript and React experience are great pluses,as are iOS or Android development/design experience is useful as- well. You'll need to learn React Native as part of getting- involved. There's tons of good online tutorials, courses, etc.+ well. You'll need to learn React Native as part of getting+ involved. There's tons of good online tutorials, courses, etc.### Electron desktop app@@ -535,13 +535,13 @@ Code:Experts: Anders Kaseorg, Akash Nimare, Abhighyan Khaund.- Contribute to our [Electron-based desktop client- application](https://github.com/zulip/zulip-desktop). There's+ application](https://github.com/zulip/zulip-desktop). There'splenty of feature/UI work to do, but focus areas for us includethings to (1) improve the release process for the app, using- automated testing, TypeScript, etc. and (2) polish the UI. Browse+ automated testing, TypeScript, etc. and (2) polish the UI. Browsethe open issues and get involved!-**Skills required**: JavaScript experience, Electron experience. You+**Skills required**: JavaScript experience, Electron experience. Youcan learn electron as part of your application!Good preparation for desktop app projects is to (1) try out the app@@ -556,10 +556,10 @@ Experts: Aman Agrawal, Neil Pilgrim.- Work on Zulip Terminal, the official terminal client for Zulip.zulip-terminal is already a basic usable client, but it needs a lot- of work to approach the web app's quality level. We would be happy- to accept multiple strong students to work on this project. Our+ of work to approach the web app's quality level. We would be happy+ to accept multiple strong students to work on this project. Ourgoal for this summer is to improve its quality enough that we can- upgrade it from an alpha to an advertised feature. **Skills+ upgrade it from an alpha to an advertised feature. **Skillsrequired**: Python 3 development skills, good communication andproject management skills, good at reading code and testing.@@ -569,7 +569,7 @@ Code: [zulip-archive](https://github.com/zulip/zulip-archive)Experts: Rein Zustand, Steve Howell- Work on zulip-archive, which provides a Google-indexable read-only- archive of Zulip conversations. The issue tracker for the project+ archive of Zulip conversations. The issue tracker for the projecthas a great set of introductory/small projects; the overall goal isto make the project super convenient to use for our OSS communities.**Skills useful**: Python 3, reading feedback from users, CSS,@@ -584,16 +584,16 @@ two before the application deadline. That way, the whole developercommunity -- not just the mentors and administrators -- have a chanceto give you feedback and help you improve your proposal.-Where should you publish your draft? We prefer Dropbox Paper or+Where should you publish your draft? We prefer Dropbox Paper orGoogle Docs, since those platforms allow people to look at the textwithout having to log in or download a particular app, and you can-update the draft as you improve your idea. In either case, you should+update the draft as you improve your idea. In either case, you shouldpost the draft for feedback in chat.zulip.org.Rough is fine! The ideal first draft to get feedback from thecommunity on should include primarily (1) links to your contributionsto Zulip (or other projects) and (2) a paragraph or two explaining-what you plan to work on. Your friends are likely better able to help+what you plan to work on. Your friends are likely better able to helpyou improve the sections of your application explaining who you are,and this helps the community focus feedback on the areas you can mostimprove (e.g. either doing more contributions or adjusting the projectdiff --git a/docs/contributing/summer-with-zulip.md b/docs/contributing/summer-with-zulip.mdindex 3e01d8185ef..ff0e592830e 100644--- a/docs/contributing/summer-with-zulip.md+++ b/docs/contributing/summer-with-zulip.md@@ -88,14 +88,14 @@ materials](https://developers.google.com/open-source/gsoc/resources/manual).- If you work in one a smaller Zulip project(e.g. `zulip-terminal`), follow the project on GitHub so you can- keep track of what's happening there. For folks working in+ keep track of what's happening there. For folks working in`zulip/zulip`, doing that will send you too many notifications.So instead, we recommend that you join Zulip's GitHub teams thatrelate to your projects and/or interests, so that you see new- issues and PRs coming in that are relevant to your work. When we+ issues and PRs coming in that are relevant to your work. When welabel an issue or PR with one of our area labels, `zulipbot` willautomatically mention the relevant teams for that area,- subscribing you to those issues/PR threads. You can browse the+ subscribing you to those issues/PR threads. You can browse thearea teams here: https://github.com/orgs/zulip/teams (You need tobe a member of the Zulip organization to see them;ask Tim for an invite if needed).diff --git a/docs/contributing/version-control.md b/docs/contributing/version-control.mdindex 2d5fa63f7b1..b37198016c4 100644--- a/docs/contributing/version-control.md+++ b/docs/contributing/version-control.md@@ -58,21 +58,21 @@ Other considerations:tests" commit on top of it.Zulip expects you to structure the commits in your pull requests to form-a clean history before we will merge them. It's best to write your+a clean history before we will merge them. It's best to write yourcommits following these guidelines in the first place, but if you don't,you can always fix your history using `git rebase -i` (more on that[here](../git/fixing-commits.md)).Never mix multiple changes together in a single commit, but it's greatto include several related changes, each in their own commit, in a-single pull request. If you notice an issue that is only somewhat+single pull request. If you notice an issue that is only somewhatrelated to what you were working on, but you feel that it's too minorto create a dedicated pull request, feel free to append it as anadditional commit in the pull request for your main project (thatcommit should have a clear explanation of the bug in its commit-message). This way, the bug gets fixed, but this independent change-is highlighted for reviewers. Or just create a dedicated pull request-for it. Whatever you do, don't squash unrelated changes together in a+message). This way, the bug gets fixed, but this independent change+is highlighted for reviewers. Or just create a dedicated pull request+for it. Whatever you do, don't squash unrelated changes together in asingle commit; the reviewer will ask you to split the changes out intotheir own commits.@@ -100,8 +100,8 @@ The first line of the commit message is the **summary**. The summary:### Good summaries:-Below is an example of a good commit summary line. It starts with the-prefix "provision:", using lowercase "**p**". Next, "Improve performance of+Below is an example of a good commit summary line. It starts with the+prefix "provision:", using lowercase "**p**". Next, "Improve performance ofinstall npm." starts with a capital "**I**", uses imperative tense,and ends with a period.diff --git a/docs/contributing/zulipbot-usage.md b/docs/contributing/zulipbot-usage.mdindex d3df0d56575..85b80eaaa01 100644--- a/docs/contributing/zulipbot-usage.md+++ b/docs/contributing/zulipbot-usage.md@@ -6,7 +6,7 @@ repositories in order to create a better workflow for Zulip contributors.Its purpose is to work around various limitations in GitHub'spermissions and notifications systems to make it possible to have a-much more democractic workflow for our contributors. It allows anyone+much more democractic workflow for our contributors. It allows anyoneto self-assign or label an issue, not just the core contributorstrusted with full write access to the repository (which is the onlymodel GitHub supports).@@ -59,14 +59,14 @@ issues and pull requests within your fields of expertise on thethe Zulip server[area label teams](https://github.com/orgs/zulip/teams?utf8=✓&query=Server)(Note: this link only works for members of the Zulip organization;-we'll happily add you if you're interested). These teams correspond+we'll happily add you if you're interested). These teams correspondto the repository's[area labels](https://github.com/zulip/zulip/labels), although someteams are associated with multiple labels; for example, the **area:message-editing** and **area: message view** labels are both relatedto the[Server message view](https://github.com/orgs/zulip/teams/server-message-view)-team. Feel free to join as many area label teams as as you'd like!+team. Feel free to join as many area label teams as as you'd like!After your request to join an area label team is approved, you'll receivenotifications for any issues labeled with the team's corresponding areadiff --git a/docs/development/authentication.md b/docs/development/authentication.mdindex 28014302c9e..86fa7733f09 100644--- a/docs/development/authentication.md+++ b/docs/development/authentication.md@@ -14,9 +14,9 @@ through the real flow.The steps to do this are a variation of the steps discussed in theproduction documentation, including the comments in-`zproject/prod_settings_template.py`. The differences here are driven+`zproject/prod_settings_template.py`. The differences here are drivenby the fact that `dev_settings.py` is in Git, so it is inconvenient-for local [settings configuration](../subsystems/settings.md). As a+for local [settings configuration](../subsystems/settings.md). As aresult, in the development environment, we allow setting certainsettings in the untracked file `zproject/dev-secrets.conf` (which isalso serves as `/etc/zulip/zulip-secrets.conf`).@@ -28,7 +28,7 @@ methods supported by Zulip.Zulip's default EmailAuthBackend authenticates users by verifyingcontrol over their email address, and then allowing them to set a-password for their account. There are two development environment+password for their account. There are two development environmentdetails worth understanding:- All of our authentication flows in the development environment have@@ -40,7 +40,7 @@ details worth understanding:`manage.py print_initial_password [email protected]`, that printsout **default** passwords for the development environment users.Note that if you change a user's password in the development- environment, those passwords will no longer work. It also prints+ environment, those passwords will no longer work. It also printsout the user's **current** API key.@@ -51,9 +51,9 @@ console](https://console.developers.google.com) and navigate to "APIsto your dev environment.- Navigate to "APIs & services" > "Library", and find the "Identity- Toolkit API". Choose "Enable".+ Toolkit API". Choose "Enable".-- Return to "Credentials", and select "Create credentials". Choose+- Return to "Credentials", and select "Create credentials". Choose"OAuth client ID", and follow prompts to create a consent screen, etc.For "Authorized redirect URIs", fill in`http://zulipdev.com:9991/complete/google/` .@@ -70,7 +70,7 @@ to your dev environment.Specify `http://zulipdev.com:9991/complete/github/` as the callback URL.- You should get a page with settings for your new application,- showing a client ID and a client secret. In `dev-secrets.conf`, set+ showing a client ID and a client secret. In `dev-secrets.conf`, set`social_auth_github_key` to the client ID and `social_auth_github_secret`to the client secret.@@ -81,7 +81,7 @@ to your dev environment.Specify `http://zulipdev.com:9991/complete/gitlab` as the callback URL.- You should get a page containing the Application ID and Secret for- your new application. In `dev-secrets.conf`, enter the Application+ your new application. In `dev-secrets.conf`, enter the ApplicationID as `social_auth_gitlab_key` and the Secret as`social_auth_gitlab_secret`.@@ -137,7 +137,7 @@ to your dev environment.Some OAuth providers (such as Facebook) require HTTPS on the callbackURL they post back to, which isn't supported directly by the Zulip-development environment. If you run a+development environment. If you run a[remote Zulip development server](../development/remote.md), we haveinstructions for[an nginx reverse proxy with SSL](../development/remote.html#using-an-nginx-reverse-proxy)@@ -148,18 +148,18 @@ that you can use for your development efforts.Before Zulip 2.0, one of the more common classes of bug reports withZulip's authentication was users having trouble getting [LDAPauthentication](../production/authentication-methods.html#ldap-including-active-directory)-working. The root cause was because setting up a local LDAP server+working. The root cause was because setting up a local LDAP serverfor development was difficult, which meant most developers were unableto work on fixing even simple issues with it.We solved this problem for our unit tests long ago by using the-popular [fakeldap](https://github.com/zulip/fakeldap) library. And in+popular [fakeldap](https://github.com/zulip/fakeldap) library. And in2018, we added convenient support for using fakeldap in the Zulipdevelopment environment as well, so that you can go through all theactual flows for LDAP configuration.- To enable fakeldap, set `FAKE_LDAP_MODE` in-`zproject/dev_settings.py` to one of the following options. For more+`zproject/dev_settings.py` to one of the following options. For moreinformation on these modes, refer to[our production docs](../production/authentication-methods.html#ldap-including-active-directory):- `a`: If users' email addresses are in LDAP and used as username.@@ -185,7 +185,7 @@ contain data one might want to sync, including avatars and customprofile fields.We also have configured `AUTH_LDAP_USER_ATTR_MAP` in-`zproject/dev_settings.py` to sync several of those fields. For+`zproject/dev_settings.py` to sync several of those fields. Forexample:- Modes `a` and `b` will set the user's avatar on account creation and@@ -203,7 +203,7 @@ example:For our automated tests, we generally configure custom LDAP data foreach individual test, because that generally means one can understandexactly what data is being used in the test without looking at other-resources. It also gives us more freedom to edit the development+resources. It also gives us more freedom to edit the developmentenvironment directory without worrying about tests.## Two factor authentication@@ -213,13 +213,13 @@ Zulip uses [django-two-factor-auth][0] as a beta 2FA integration.To enable 2FA, set `TWO_FACTOR_AUTHENTICATION_ENABLED` in settings to`True`, then log in to Zulip and add an OTP device from the settingspage. Once the device is added, password based authentication will ask-for a one-time-password. In the development environment, this+for a one-time-password. In the development environment, thisone-time-password will be printed to the console when you try to-log in. Just copy-paste it into the form field to continue.+log in. Just copy-paste it into the form field to continue.Direct development logins don't prompt for 2FA one-time-passwords, soto test 2FA in development, make sure that you log in using a-password. You can get the passwords for the default test users using+password. You can get the passwords for the default test users using`./manage.py print_initial_password`.## Password form implementation@@ -227,7 +227,7 @@ password. You can get the passwords for the default test users usingBy default, Zulip uses `autocomplete=off` for password fields where weenter the current password, and `autocomplete="new-password"` forpassword fields where we create a new account or change the existing-password. This prevents the browser from auto-filling the existing+password. This prevents the browser from auto-filling the existingpassword.Visit <https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete> for more details.diff --git a/docs/development/remote.md b/docs/development/remote.mdindex b57b84d2784..9a09e9e5f5d 100644--- a/docs/development/remote.md+++ b/docs/development/remote.md@@ -32,14 +32,14 @@ networks.## Setting up user accountsYou will need a non-root user account with sudo privileges to set up-the Zulip development environment. If you have one already, continue+the Zulip development environment. If you have one already, continueto the next section.You can create a new user with sudo privileges by running thefollowing commands as root:- You can create a `zulipdev` user by running the command`adduser zulipdev`. Run through the prompts to assign a password and-user information. (You can pick any username you like for this user+user information. (You can pick any username you like for this useraccount.)- You can add the user to the sudo group by running the command`usermod -aG sudo zulipdev`.@@ -93,7 +93,7 @@ developing on your laptop).To properly secure your remote development environment, you can[port forward](https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding)using ssh instead of running the development environment on an exposed-interface. For example, if you're running Zulip on a remote server+interface. For example, if you're running Zulip on a remote serversuch as a DigitalOcean Droplet or an AWS EC2 instance, you can set upport-forwarding to access Zulip by running the following command inyour terminal:@@ -282,7 +282,7 @@ Next, read the following to learn more about developing for Zulip:For some applications (e.g. developing an OAuth2 integration forFacebook), you may need your Zulip development to have a valid SSL-certificate. While `run-dev.py` doesn't support that, you can do this+certificate. While `run-dev.py` doesn't support that, you can do thiswith an `nginx` reverse proxy sitting in front of `run-dev.py.`.The following instructions assume you have a Zulip Droplet working anddiff --git a/docs/development/setup-advanced.md b/docs/development/setup-advanced.mdindex ca9a3ab2cae..fa7db6f1d1d 100644--- a/docs/development/setup-advanced.md+++ b/docs/development/setup-advanced.md@@ -28,7 +28,7 @@ the:::{warning}There is no supported uninstallation process with this-method. If you want that, use the Vagrant environment, where you can+method. If you want that, use the Vagrant environment, where you canjust do `vagrant destroy` to clean up the development environment.:::@@ -130,7 +130,7 @@ installation method described here.1. [Visual Studio Code Remote - WSL](https://code.visualstudio.com/docs/remote/wsl) isrecommended for editing files when developing with WSL.-1. You're done! You can pick up the [documentation on using the+1. You're done! You can pick up the [documentation on using theZulip developmentenvironment](../development/setup-vagrant.html#step-4-developing),ignoring the parts about `vagrant` (since you're not using it).@@ -250,7 +250,7 @@ expected.1. If you get the error `Hyper-V could not initialize memory`, this islikely because your system has insufficient free memory to start- the virtual machine. You can generally work around this error by+ the virtual machine. You can generally work around this error byclosing all other running programs and running`vagrant up --provider=hyperv` again. You can reopen the otherprograms after the provisioning is completed. If it still isn't@@ -273,7 +273,7 @@ these platforms reliably and easily, so we no longer maintain manualinstallation instructions for these platforms.If `tools/provision` doesn't yet support a newer release of Debian or-Ubuntu that you're using, we'd love to add support for it. It's+Ubuntu that you're using, we'd love to add support for it. It'slikely only a few lines of changes to `tools/lib/provision.py` and`scripts/lib/setup-apt-repo` if you'd like to do it yourself andsubmit a pull request, or you can ask for help in@@ -288,7 +288,7 @@ that lets you write, run, and debug your code with just a browser. Itincludes a code editor, debugger, and terminal.This section documents how to set up the Zulip development environment-in a Cloud9 workspace. If you don't have an existing Cloud9 account,+in a Cloud9 workspace. If you don't have an existing Cloud9 account,you can sign up [here](https://aws.amazon.com/cloud9/).- Create a Workspace, and select the blank template.@@ -310,7 +310,7 @@ There's a NPM package, `zulip-cloud9`, that provides a wrapper aroundthe Zulip development server for use in the Cloud9 environment.Note: `npm i -g zulip-cloud9` does not work in zulip's virtual-environment. Although by default, any packages installed in workspace+environment. Although by default, any packages installed in workspacefolder (i.e. the top level folder) are added to `$PATH`.```bash@@ -323,7 +323,7 @@ If you get error of the form `bash: cannot find command zulip-dev`,you need to start a new terminal.Your development server would be running at-`https://<workspace-name>-<username>.c9users.io` on port 8080. You+`https://<workspace-name>-<username>.c9users.io` on port 8080. Youdont need to add `:8080` to your URL, since the Cloud9 proxy shouldautomatically forward the connection. You might want to visit[zulip-cloud9 repo](https://github.com/cPhost/zulip-cloud9) and it'sdiff --git a/docs/development/setup-vagrant.md b/docs/development/setup-vagrant.mdindex 090c161a4ba..88a4097cc4e 100644--- a/docs/development/setup-vagrant.md+++ b/docs/development/setup-vagrant.md@@ -65,7 +65,7 @@ to GitHub working on your machine.Follow our [Git guide][set-up-git] in order to install Git, set up aGitHub account, create an SSH key to access code on GitHub-efficiently, etc. Be sure to create an SSH key and add it to your+efficiently, etc. Be sure to create an SSH key and add it to yourGitHub account using[these instructions](https://help.github.com/en/articles/generating-an-ssh-key).@@ -117,7 +117,7 @@ Adding user christie to group dockerDone.```-You will need to reboot for this change to take effect. If it worked,+You will need to reboot for this change to take effect. If it worked,you will see `docker` in your list of groups:```console@@ -132,7 +132,7 @@ If you had previously installed and removed an older version ofDocker, an [Ubuntubug](https://bugs.launchpad.net/ubuntu/+source/docker.io/+bug/1844894)may prevent Docker from being automatically enabled and started after-installation. You can check using the following:+installation. You can check using the following:```console$ systemctl status docker@@ -236,7 +236,7 @@ Now you are ready for [Step 2: Get Zulip code](#step-2-get-zulip-code).(Note: The **GitHub Desktop client** for Windows has a bug where itwill automatically set `git config core.symlink false` on a repositoryif you use it to clone a repository, which will break the Zulip-development environment, because we use symbolic links. For that+development environment, because we use symbolic links. For thatreason, we recommend avoiding using GitHub Desktop client to cloneprojects and to instead follow these instructions exactly.)@@ -305,24 +305,24 @@ does the following:- runs the `tools/provision` script inside the virtual machine/container, whichdownloads all required dependencies, sets up the python environment forthe Zulip development server, and initializes a default test- database. We call this process "provisioning", and it is documented+ database. We call this process "provisioning", and it is documentedin some detail in our [dependencies documentation](../subsystems/dependencies.md).You will need an active internet connection during the entireprocess. (See [Specifying a proxy](#specifying-a-proxy) if you need aproxy to access the internet.) `vagrant up` can fail while-provisioning if your Internet connection is unreliable. To retry, you+provisioning if your Internet connection is unreliable. To retry, youcan use `vagrant provision` (`vagrant up` will just boot the guest-without provisioning after the first time). Other common issues are+without provisioning after the first time). Other common issues aredocumented in the[Troubleshooting and common errors](#troubleshooting-and-common-errors)-section. If that doesn't help, please visit+section. If that doesn't help, please visit[#provision help](https://chat.zulip.org/#narrow/stream/21-provision-help)in the [Zulip development community server](https://zulip.com/developer-community/) forreal-time help.On Windows, you will see the message-`The system cannot find the path specified.` several times. This is+`The system cannot find the path specified.` several times. This isnormal and is not a problem.Once `vagrant up` has completed, connect to the development@@ -342,7 +342,7 @@ Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-54-generic x86_64)Congrats, you're now inside the Zulip development environment!You can confirm this by looking at the command prompt, which starts-with `(zulip-py3-venv)vagrant@`. If it just starts with `vagrant@`, your+with `(zulip-py3-venv)vagrant@`. If it just starts with `vagrant@`, yourprovisioning failed and you should look at the[troubleshooting section](#troubleshooting-and-common-errors).@@ -417,7 +417,7 @@ development environment on the virtual machine/container.Each component of the Zulip development server will automaticallyrestart itself or reload data appropriately when you make changes. So,to see your changes, all you usually have to do is reload your-browser. More details on how this works are available below.+browser. More details on how this works are available below.Zulip's whitespace rules are all enforced by linters, so be sure torun `tools/lint` often to make sure you're following our coding style@@ -446,10 +446,10 @@ guide][rtd-git-guide].If after rebasing onto a new version of the Zulip server, you receivenew errors while starting the Zulip server or running tests, this is-probably not because Zulip's `main` branch is broken. Instead, this+probably not because Zulip's `main` branch is broken. Instead, thisis likely because we've recently merged changes to the developmentenvironment provisioning process that you need to apply to your-development environment. To update your environment, you'll need to+development environment. To update your environment, you'll need tore-provision your vagrant machine using `vagrant provision` (this justruns `tools/provision` from your Zulip checkout inside the Vagrantguest); this should complete in about a minute.@@ -468,16 +468,16 @@ help.If you ever want to recreate your development environment again fromscratch (e.g. to test a change you've made to the provisioningprocess, or because you think something is broken), you can do so-using `vagrant destroy` and then `vagrant up`. This will usually be+using `vagrant destroy` and then `vagrant up`. This will usually bemuch faster than the original `vagrant up` since the base image isalready cached on your machine (it takes about 5 minutes to run with afast Internet connection).Any additional programs (e.g. Zsh, emacs, etc.) or configuration thatyou may have installed in the development environment will be lost-when you recreate it. To address this, you can create a script called+when you recreate it. To address this, you can create a script called`tools/custom_provision` in your Zulip Git checkout; and place any-extra setup commands there. Vagrant will run `tools/custom_provision`+extra setup commands there. Vagrant will run `tools/custom_provision`every time you run `vagrant provision` (or create a Vagrant guest via`vagrant up`).@@ -549,7 +549,7 @@ which can help you optimize your development workflow).### Troubleshooting and common errors-Below you'll find a list of common errors and their solutions. Most+Below you'll find a list of common errors and their solutions. Mostissues are resolved by just provisioning again (by running`./tools/provision` (from `/srv/zulip`) inside the Vagrant guest orequivalently `vagrant provision` from outside).@@ -567,7 +567,7 @@ When reporting your issue, please include the following information:- installation method (Vagrant or direct)- whether or not you are using a proxy- a copy of Zulip's `vagrant` provisioning logs, available in- `/var/log/provision.log` on your virtual machine. If you choose to+ `/var/log/provision.log` on your virtual machine. If you choose topost just the error output, please include the **beginning of theerror output**, not just the last few lines.@@ -576,7 +576,7 @@ usually helpful.#### Vagrant guest doesn't show (zulip-py3-venv) at start of prompt-This is caused by provisioning failing to complete successfully. You+This is caused by provisioning failing to complete successfully. Youcan see the errors in `var/log/provision.log`; it should end withsomething like this:@@ -616,7 +616,7 @@ vagrant haltvagrant up```-to reboot the guest. After this, you can do `vagrant provision` and+to reboot the guest. After this, you can do `vagrant provision` and`vagrant ssh`.#### ssl read error@@ -655,7 +655,7 @@ ssh_exchange_identification: Connection closed by remote host```It usually means the Vagrant guest is not running, which is usually-solved by rebooting the Vagrant guest via `vagrant halt; vagrant up`. See+solved by rebooting the Vagrant guest via `vagrant halt; vagrant up`. See[Vagrant was unable to communicate with the guest machine](#vagrant-was-unable-to-communicate-with-the-guest-machine)for more details.@@ -677,9 +677,9 @@ Then Vagrant was not able to create a symbolic link.First, if you are using Windows, **make sure you have run Git BASH (orCygwin) as an administrator**. By default, only administrators can-create symbolic links on Windows. Additionally [UAC][windows-uac], a+create symbolic links on Windows. Additionally [UAC][windows-uac], aWindows feature intended to limit the impact of malware, can prevent-even administrator accounts from creating symlinks. [Turning off+even administrator accounts from creating symlinks. [Turning offUAC][disable-uac] will allow you to create symlinks. You can also trysome of the solutions mentioned[here](https://superuser.com/questions/124679/how-do-i-create-a-link-in-windows-7-home-premium-as-a-regular-user).@@ -689,7 +689,7 @@ some of the solutions mentionedIf you ran Git BASH as administrator but you already had VirtualBoxrunning, you might still get this error because VirtualBox is not-running as administrator. In that case: close the Zulip VM with+running as administrator. In that case: close the Zulip VM with`vagrant halt`; close any other VirtualBox VMs that may be running;exit VirtualBox; and try again with `vagrant up --provision` from aGit BASH running as administrator.@@ -735,7 +735,7 @@ The virtual machine needs to be shut down when you run this command.If you get an error message on Windows about lack of Windows Homesupport for Hyper-V when running `vagrant up`, the problem is thatWindows is incorrectly attempting to use Hyper-V rather than-Virtualbox as the virtualization provider. You can fix this by+Virtualbox as the virtualization provider. You can fix this byexplicitly passing the virtualbox provider to `vagrant up`:```console@@ -790,7 +790,7 @@ the timeout ("config.vm.boot_timeout") value.```This has a range of possible causes, that usually amount to a bug in-Virtualbox or Vagrant. If you see this error, you usually can fix it+Virtualbox or Vagrant. If you see this error, you usually can fix itby rebooting the guest via `vagrant halt; vagrant up`.#### Vagrant up fails with subprocess.CalledProcessError@@ -800,14 +800,14 @@ The `vagrant up` command basically does the following:- Downloads an Ubuntu image and starts it using a Vagrant provider.- Uses `vagrant ssh` to connect to that Ubuntu guest, and then runs`tools/provision`, which has a lot of subcommands that are- executed via Python's `subprocess` module. These errors mean that+ executed via Python's `subprocess` module. These errors mean thatone of those subcommands failed.To debug such errors, you can log in to the Vagrant guest machine byrunning `vagrant ssh`, which should present you with a standard shell-prompt. You can debug interactively by using e.g.+prompt. You can debug interactively by using e.g.`cd zulip && ./tools/provision`, and then running the individual-subcommands that failed. Once you've resolved the problem, you can+subcommands that failed. Once you've resolved the problem, you canrerun `tools/provision` to proceed; the provisioning system isdesigned to recover well from failures.@@ -824,11 +824,11 @@ Zulip development environment setup succeeded!If the `(zulip-py3-venv)` part is missing, this is because yourinstallation failed the first time before the Zulip virtualenv was-created. You can fix this by just closing the shell and running+created. You can fix this by just closing the shell and running`vagrant ssh` again, or using `source /srv/zulip-py3-venv/bin/activate`.Finally, if you encounter any issues that weren't caused by your-Internet connection, please report them! We try hard to keep Zulip+Internet connection, please report them! We try hard to keep Zulipdevelopment environment provisioning free of bugs.##### `pip install` fails during `vagrant up` on Ubuntu@@ -883,9 +883,9 @@ First, ensure that hardware virtualization support (VT-x or AMD-V) isenabled in your BIOS.If the error persists, you may have run into an incompatibility-between VirtualBox and Hyper-V on Windows. To disable Hyper-V, open+between VirtualBox and Hyper-V on Windows. To disable Hyper-V, opencommand prompt as administrator, run-`bcdedit /set hypervisorlaunchtype off`, and reboot. If you need to+`bcdedit /set hypervisorlaunchtype off`, and reboot. If you need toenable it later, run `bcdedit /deletevalue hypervisorlaunchtype`, andreboot.@@ -901,7 +901,7 @@ default: OSError: [Errno 26] Text file busy: 'baremetrics'This error is caused by a[bug](https://www.virtualbox.org/ticket/19004) in recent versions of-the VirtualBox Guest Additions for Linux on Windows hosts. You can+the VirtualBox Guest Additions for Linux on Windows hosts. You cancheck the running version of VirtualBox Guest Additions with thiscommand:@@ -911,7 +911,7 @@ vagrant ssh -- 'modinfo -F version vboxsf'The bug has not been fixed upstream as of this writing, but you may beable to work around it by downgrading VirtualBox Guest Additions to-6.0.4. To do this, create a `~/.zulip-vagrant-config` file and add+6.0.4. To do this, create a `~/.zulip-vagrant-config` file and addthis line:```text@@ -929,10 +929,10 @@ vagrant reload --provision### Specifying an Ubuntu mirrorBringing up a development environment for the first time involves-downloading many packages from the Ubuntu archive. The Ubuntu cloud+downloading many packages from the Ubuntu archive. The Ubuntu cloudimages use the global mirror `http://archive.ubuntu.com/ubuntu/` bydefault, but you may find that you can speed up the download by using-a local mirror closer to your location. To do this, create+a local mirror closer to your location. To do this, create`~/.zulip-vagrant-config` and add a line like this, replacing the URLas appropriate:@@ -969,7 +969,7 @@ NO_PROXY localhost,127.0.0.1,.example.com,.zulipdev.com```You'll want to **double-check** your work for mistakes (a common one-is using `https://` when your proxy expects `http://`). Invalid proxy+is using `https://` when your proxy expects `http://`). Invalid proxyconfiguration can cause confusing/weird exceptions; if you're using aproxy and get an error, the first thing you should investigate iswhether you entered your proxy configuration correctly.@@ -985,7 +985,7 @@ then do a `vagrant reload`.### Using a different port for VagrantYou can also change the port on the host machine that Vagrant uses by-adding to your `~/.zulip-vagrant-config` file. E.g. if you set:+adding to your `~/.zulip-vagrant-config` file. E.g. if you set:```textHOST_PORT 9971@@ -1016,7 +1016,7 @@ described here are ignored).Our default Vagrant settings allocate 2 cpus with 2GiB of memory forthe guest, which is sufficient to run everything in the development-environment. If your host system has more CPUs, or you have enough+environment. If your host system has more CPUs, or you have enoughRAM that you'd like to allocate more than 2GiB to the guest, you canimprove performance of the Zulip development environment by allocatingmore resources.diff --git a/docs/development/test-install.md b/docs/development/test-install.mdindex 91e9cac4fec..9a4dee80087 100644--- a/docs/development/test-install.md+++ b/docs/development/test-install.md@@ -12,7 +12,7 @@ the installation process in a clean environment each time.## ConfiguringUsing the test installer framework requires a Linux operating system;-it will not work on WSL, for instance. It requires at least 3G of+it will not work on WSL, for instance. It requires at least 3G ofRAM, in order to accommodate the VMs and the steps which build therelease assets.@@ -43,7 +43,7 @@ as the last step; for example,Next, unpack that file into a local directory; we will make anychanges we want in our source checkout and copy them into thisdirectory. The test installer needs the release directory to be named-`zulip-server`, so we rename it and move it appropriately. In the+`zulip-server`, so we rename it and move it appropriately. In thefirst line, you'll need to substitute the actual path that you got forthe tarball, above:```bashdiff --git a/docs/development/using.md b/docs/development/using.mdindex 74cd9fd8b9b..97e48b85e6c 100644--- a/docs/development/using.md+++ b/docs/development/using.md@@ -2,9 +2,9 @@ Using the development environment=================================This page describes the basic edit/refresh workflows for working with-the Zulip development environment. Generally, the development+the Zulip development environment. Generally, the developmentenvironment will automatically update as soon as you save changes-using your editor. Details for work on the [server](#server),+using your editor. Details for work on the [server](#server),[web app](#web), and [mobile apps](#mobile) are below.If you're working on authentication methods or need to use the [Zulip@@ -23,7 +23,7 @@ the development environment][authentication-dev-server].if no changes are required.- After making changes, you'll often want to run the[linters](../testing/linters.md) and relevant [test- suites](../testing/testing.md). Consider using our [Git pre-commit+ suites](../testing/testing.md). Consider using our [Git pre-commithook](../git/zulip-tools.html#set-up-git-repo-script) toautomatically lint whenever you make a commit.- All of our test suites are designed to support quickly testing just@@ -43,7 +43,7 @@ the development environment][authentication-dev-server].- The main Django/Tornado server processes are run on top ofDjango's [manage.py runserver][django-runserver], which willautomatically restart them when you save changes to Python code- they use. You can watch this happen in the `run-dev.py` console+ they use. You can watch this happen in the `run-dev.py` consoleto make sure the backend has reloaded.- The Python queue workers will also automatically restart when yousave changes, as long as they haven't crashed (which can happen if@@ -73,7 +73,7 @@ the development environment][authentication-dev-server].something other than the login process.- You can test the login or registration process by clicking thelinks for the normal login page.-- Most changes will take effect automatically. Details:+- Most changes will take effect automatically. Details:- If you change CSS files, your changes will appear immediately viawebpack hot module replacement.- If you change JavaScript code (`static/js`) or Handlebarsdiff --git a/docs/documentation/api.md b/docs/documentation/api.mdindex b3536b50ec5..48b778885c3 100644--- a/docs/documentation/api.md+++ b/docs/documentation/api.md@@ -4,7 +4,7 @@ This document explains the system for documenting [Zulip's RESTAPI](https://zulip.com/api/rest).Zulip's API documentation is an essential resource both for users and-for the developers of Zulip's mobile and terminal apps. Our vision is+for the developers of Zulip's mobile and terminal apps. Our vision isfor the documentation to be sufficiently good that developers ofZulip's apps should never need to look at the server's implementationto answer questions about the API's semantics.@@ -15,13 +15,13 @@ and remains so as Zulip's API evolves.In particular, the top goal for this system is that all mistakes inverifiable content (i.e. not the English explanations) should cause-the Zulip test suite to fail. This is incredibly important, because+the Zulip test suite to fail. This is incredibly important, becauseonce you notice one error in API documentation, you no longer trust itto be correct, which ends up wasting the time of its users.Since it's very difficult to not make little mistakes when writing anyuntested code, the only good solution to this is a way to test-the documentation. We found dozens of errors in the process of adding+the documentation. We found dozens of errors in the process of addingthe validation Zulip has today.Our API documentation is defined by a few sets of files:@@ -41,13 +41,13 @@ Our API documentation is defined by a few sets of files:- We have an extensive set of tests designed to validate that the datain the OpenAPI file matching the implementation. Specifically,`zerver/tests/test_openapi.py` compares every endpoint's accepted- parameters in `views` code with those declared in `zulip.yaml`. And+ parameters in `views` code with those declared in `zulip.yaml`. Andthe [backend test suite](../testing/testing-with-django.md) checksthat every API response served during our extensive backend testsuite matches one the declared OpenAPI schema for that endpoint.- The text for the Python examples comes from a test suite for thePython API documentation (`zerver/openapi/python_examples.py`; run via- `tools/test-api`). The `generate_code_example` macro will magically+ `tools/test-api`). The `generate_code_example` macro will magicallyread content from that test suite and render it as the code example.This structure ensures that Zulip's API documentation is robust to awide range of possible typos and other bugs in the API@@ -99,11 +99,11 @@ relevant feature in `/help/`.### Usage examplesWe display usage examples in three languages: Python, JavaScript and-`curl`; we may add more in the future. Every endpoint should have+`curl`; we may add more in the future. Every endpoint should havePython and `curl` documentation; `JavaScript` is optional as we don't-consider that API library to be fully supported. The examples are+consider that API library to be fully supported. The examples aredefined using a special Markdown extension-(`zerver/openapi/markdown_extension.py`). To use this extension, one+(`zerver/openapi/markdown_extension.py`). To use this extension, onewrites a Markdown file block that looks something like this:```md@@ -131,7 +131,7 @@ parameter.For the Python examples, you'll write the example in`zerver/openapi/python_examples.py`, and it'll be run and verified-automatically in Zulip's automated test suite. The code there will+automatically in Zulip's automated test suite. The code there willlook something like this:``` python@@ -149,14 +149,14 @@ def render_message(client: Client) -> None:```This is an actual Python function which will be run as part of the-`tools/test-api` test suite. The `validate_against_opanapi_schema`+`tools/test-api` test suite. The `validate_against_opanapi_schema`function will verify that the result of that request is as defined inthe examples in `zerver/openapi/zulip.yaml`.To run as part of the test suite, the `render_message` function needsto be called from `test_messages` (or one of the other functions at-the bottom of the file). The final function, `test_the_api`, is what-actually runs the tests. Tests with the `openapi_test_function`+the bottom of the file). The final function, `test_the_api`, is what+actually runs the tests. Tests with the `openapi_test_function`decorator that are not called will fail tests, as will new endpointsthat are not covered by an `openapi_test_function`-decorated test.@@ -179,7 +179,7 @@ wherever that string appears in the API documentation.### ParametersWe have a separate Markdown extension to document the parameters that-an API endpoint supports. You'll see this in files like+an API endpoint supports. You'll see this in files like`templates/zerver/api/render-message.md` via the following Markdowndirective (implemented in`zerver/lib/markdown/api_arguments_table_generator.py`):@@ -215,17 +215,17 @@ in the OpenAPI definition.## Step by step guideThis section offers a step-by-step process for adding documentation-for a new API endpoint. It assumes you've read and understood the+for a new API endpoint. It assumes you've read and understood theabove.1. Start by adding [OpenAPI format](../documentation/openapi.md)- data to `zerver/openapi/zulip.yaml` for the endpoint. If you+ data to `zerver/openapi/zulip.yaml` for the endpoint. If youcopy-paste (which is helpful to get the indentation structureright), be sure to update all the content that you copied tocorrectly describe your endpoint!In order to do this, you need to figure out how the endpoint in- question works by reading the code! To understand how arguments+ question works by reading the code! To understand how argumentsare specified in Zulip backend endpoints, read our [REST APItutorial][rest-api-tutorial], paying special attention to thedetails of `REQ` and `has_request_variables`.@@ -243,7 +243,7 @@ above.mistakes in how arguments are declared.- `test-backend`: The full Zulip backend test suite will fail ifany actual API responses generated by the tests don't match your- defined OpenAPI schema. Use `test-backend --rerun` for a fast+ defined OpenAPI schema. Use `test-backend --rerun` for a fastedit/refresh cycle when debugging.[rest-api-tutorial]: ../tutorials/writing-views.html#writing-api-rest-endpoints@@ -251,7 +251,7 @@ above.1. Add a function for the endpoint you'd like to document to`zerver/openapi/python_examples.py`, decorated with`@openapi_test_function`. `render_message` is a good example to- follow. There are generally two key pieces to your test: (1) doing+ follow. There are generally two key pieces to your test: (1) doingan API query and (2) verifying its result has the expected formatusing `validate_against_openapi_schema`.@@ -270,11 +270,11 @@ above.function will be called when running `test-api`.1. Capture the JSON response returned by the API call (the test- "fixture"). The easiest way to do this is add an appropriate print+ "fixture"). The easiest way to do this is add an appropriate printstatement (usually `json.dumps(result, indent=4, sort_keys=True)`),- and then run `tools/test-api`. You can also use+ and then run `tools/test-api`. You can also use<https://jsonformatter.curiousconcept.com/> to format the JSON- fixtures. Add the fixture to the `example` subsection of the+ fixtures. Add the fixture to the `example` subsection of the`responses` section for the endpoint in`zerver/openapi/zulip.yaml`.@@ -302,7 +302,7 @@ above.1. Test your endpoint, pretending to be a new user in a hurry, byvisiting it via the links on `http://localhost:9991/api` (the APIdocs are rendered from the Markdown source files on page load, so- just reload to see an updated version as you edit). You should+ just reload to see an updated version as you edit). You shouldmake sure that copy-pasting the code in your examples works, andpost an example of the output in the pull request.@@ -318,7 +318,7 @@ above.Given that our documentation is written in large part using theOpenAPI format, why maintain a custom Markdown system for displaying-it? There's several major benefits to this system:+it? There's several major benefits to this system:- It is extremely common for API documentation to become out of dateas an API evolves; this automated testing system helps make itdiff --git a/docs/documentation/integrations.md b/docs/documentation/integrations.mdindex d7bf9295d09..09371f0cdea 100644--- a/docs/documentation/integrations.md+++ b/docs/documentation/integrations.md@@ -20,7 +20,7 @@ Usually, this involves a few steps:- Make sure you've added your integration to`zerver/lib/integrations.py` in both the `WEBHOOK_INTEGRATIONS`section (or `INTEGRATIONS` if not a webhook), and the- `DOC_SCREENSHOT_CONFIG` sections. These registries configure your+ `DOC_SCREENSHOT_CONFIG` sections. These registries configure yourintegration to appear on the `/integrations` page and make itpossible to automatically generate the screenshot of a samplemessage (which is important for the screenshots to be updated as@@ -88,7 +88,7 @@ Here are a few common macros used to document Zulip's integrations:required to set up the URL and you can't use this macro, be sure to use the`{{ api_url }}` template variable, so that your integrationdocumentation will provide the correct URL for whatever server it is- deployed on. If special configuration is required to set the `SITE`+ deployed on. If special configuration is required to set the `SITE`variable, you should document that too.- `{!append-stream-name.md!}` macro - Recommends appending `&stream=stream_name`diff --git a/docs/documentation/openapi.md b/docs/documentation/openapi.mdindex 22a195a4ca3..2d9cd189734 100644--- a/docs/documentation/openapi.md+++ b/docs/documentation/openapi.md@@ -1,14 +1,14 @@# OpenAPI configuration-[OpenAPI][openapi-spec] is a popular format for describing an API. An+[OpenAPI][openapi-spec] is a popular format for describing an API. AnOpenAPI file can be used by various tools to generate documentationfor the API or even basic client-side bindings for dozens ofprogramming languages.-Zulip's API is described in `zerver/openapi/zulip.yaml`. Our aim is+Zulip's API is described in `zerver/openapi/zulip.yaml`. Our aim isfor that file to fully describe every endpoint in the Zulip API, andfor the Zulip test suite to fail should the API every change without a-corresponding adjustment to the documentation. In particular,+corresponding adjustment to the documentation. In particular,essentially all content in Zulip's [REST APIdocumentation](../documentation/api.md) is generated from our OpenAPIfile.@@ -116,7 +116,7 @@ The[Definitions Object](https://swagger.io/specification/#definitionsObject)contains schemas referenced by other objects. For example,`MessageResponse`, the response from the `/messages` endpoint,-contains three required parameters. Two are strings, and one is an+contains three required parameters. Two are strings, and one is aninteger.```yaml@@ -151,7 +151,7 @@ should be organized here:You can edit YAML files in any text editor. Indentation definesblocks, so whitespace is important (as it is in Python.) TAB-characters are not permitted. If your editor has an option to replace+characters are not permitted. If your editor has an option to replacetabs with spaces, this is helpful.You can also use the@@ -176,8 +176,8 @@ correct.headings.- A single `|` (pipe) character begins a multi-line description on the- next line. Single spaced lines (one newline at the end of each) are- joined. Use an extra blank line for a paragraph break. We prefer+ next line. Single spaced lines (one newline at the end of each) are+ joined. Use an extra blank line for a paragraph break. We preferto use this format for all descriptions because it doesn't requireextra effort to expand.diff --git a/docs/documentation/overview.md b/docs/documentation/overview.mdindex ceda49ffb6d..4f7426d5e29 100644--- a/docs/documentation/overview.md+++ b/docs/documentation/overview.md@@ -8,14 +8,14 @@ Zulip has three major documentation systems:- Core website documentation: Complete webpages for complex topics,written in HTML, JavaScript, and CSS (using the Django templating- system). These roughly correspond to the documentation someone- might look at when deciding whether to use Zulip. We don't expect+ system). These roughly correspond to the documentation someone+ might look at when deciding whether to use Zulip. We don't expectto ever have more than about 10 pages written using this system.- User-facing documentation: Our scalable system for documentingZulip's huge collection of specific features without a lot of- overhead or duplicated code/syntax, written in Markdown. We have- several hundred pages written using this system. There are 3+ overhead or duplicated code/syntax, written in Markdown. We have+ several hundred pages written using this system. There are 3branches of this documentation:- User documentation (with a target audience of individual Zulipusers),@@ -30,10 +30,10 @@ These three systems are documented in detail.What you are reading right now is part of the collection ofdocumentation targeted at developers and people running their own-Zulip servers. These docs are written in+Zulip servers. These docs are written in[CommonMark Markdown](https://commonmark.org/) with a small bit of rST.We've chosen Markdown because it is-[easy to write](https://commonmark.org/help/). The source for Zulip's+[easy to write](https://commonmark.org/help/). The source for Zulip'sdeveloper documentation is at `docs/` in the Zulip Git repository, andthey are served in production at[zulip.readthedocs.io](https://zulip.readthedocs.io/en/latest/).@@ -56,7 +56,7 @@ documentation using:```and then opening `http://127.0.0.1:9991/docs/index.html` in your-browser. The raw files are available at+browser. The raw files are available at`file:///path/to/zulip/docs/_build/html/index.html` in your browser(so you can also use e.g. `firefox docs/_build/html/index.html` fromthe root of your Zulip checkout).@@ -81,10 +81,10 @@ dependencies).Zulip has around 10 HTML documentation pages under `templates/zerver`for specific major topics, like the features list, client apps,-integrations, hotkeys, API bindings, etc. These documents often have+integrations, hotkeys, API bindings, etc. These documents often havesomewhat complex HTML and JavaScript, without a great deal of commonpatterns between them other than inheriting from the `portico.html`-template. We generally avoid adding new pages to this collection+template. We generally avoid adding new pages to this collectionunless there's a good reason, but we don't intend to migrate them,either, since this system gives us the flexibility to express theseimportant elements of the product clearly.@@ -99,16 +99,16 @@ to do the things one does a lot in each type of documentation.### General user documentationZulip's [help center](https://zulip.com/help/) documentation is-designed to explain how the product works to end users. We aim for+designed to explain how the product works to end users. We aim forthis to be clear, concise, correct, and readable to nontechnical-audiences where possible. See our guide on [writing user+audiences where possible. See our guide on [writing userdocumentation](user.md).### Integrations documentationZulip's [integrations documentation](https://zulip.com/integrations)is user-facing documentation explaining to end users how to setup each-of Zulip's more than 100 integrations. There is a detailed [guide on+of Zulip's more than 100 integrations. There is a detailed [guide ondocumenting integrations](integrations.md), including style guidelinesto ensure that the documentation is high quality and consistent.@@ -119,7 +119,7 @@ guide](https://zulip.com/api/integrations-overview).Zulip's [API documentation](https://zulip.com/api/) is intended to makeit easy for a technical user to write automation tools that interact-with Zulip. This documentation also serves as our main mechanism for+with Zulip. This documentation also serves as our main mechanism forZulip server developers to communicate with client developers abouthow the Zulip API works.@@ -145,17 +145,17 @@ There's an exclude list for the link testing at this horrible path:which is relevant for flaky links.- The API docs are tested by `tools/test-api`, which does some basic-payload verification. Note that this test does not check for broken+payload verification. Note that this test does not check for brokenlinks (those are checked by `test-help-documentation`).- `tools/test-help-documentation` checks `/help/`, `/api/`,`/integrations/`, and the core website ("portico") documentation for- broken links. Note that the "portico" documentation check has a+ broken links. Note that the "portico" documentation check has amanually maintained whitelist of pages, so if you add a new page tothis site, you will need to edit `PorticoDocumentationSpider` to add it.- `tools/test-backend test_docs.py` tests various internal details of- the variable substitution logic, as well as rendering. It's+ the variable substitution logic, as well as rendering. It'sessential when editing the documentation framework, but notsomething you'll usually need to interact with when editingdocumentation.diff --git a/docs/documentation/user.md b/docs/documentation/user.mdindex e9847afc212..b1ceff918af 100644--- a/docs/documentation/user.md+++ b/docs/documentation/user.md@@ -40,7 +40,7 @@ are usually linked from `static/images/help/`.This means that you can contribute to the Zulip user documentation by justadding to or editing the collection of Markdown files under-`templates/zerver/help`. If you have the Zulip development environment+`templates/zerver/help`. If you have the Zulip development environmentset up, you simply need to reload your browser on`http://localhost:9991/help/foo` to see the latest version of `foo.md`rendered.@@ -115,7 +115,7 @@ documentation.Images and screenshots should be included in user documentation onlyif they will help guide the user in how to do something (e.g. if theimage will make it much clearer which element on the page the user-should interact with). For instance, an image of an element should+should interact with). For instance, an image of an element shouldnot be included if the element the user needs to interact with is theonly thing on the page, but images can be included to show the endresult of an interaction with the UI.@@ -126,7 +126,7 @@ instructions for something simple look long and complicated.When taking screenshots, the image should never include the wholeZulip browser window in a screenshot; instead, it should only show-relevant parts of the app. In addition, the screenshot should always+relevant parts of the app. In addition, the screenshot should alwayscome *after* the text that describes it, never before.Images are often a part of a numbered step and must be indented four@@ -235,7 +235,7 @@ should be formatted as a continuation of a numbered step.Our Markdown processor supports easily creating a tab switcher widgetdesign to easily show the instructions for different[platforms](https://zulip.com/help/logging-out) in user docs,-languages in API docs, etc. To create a tab switcher, write:+languages in API docs, etc. To create a tab switcher, write:```md{start_tabs}diff --git a/docs/git/cloning.md b/docs/git/cloning.mdindex ff276260202..50c875077ac 100644--- a/docs/git/cloning.md+++ b/docs/git/cloning.md@@ -32,10 +32,10 @@ Checking connectivity... done.```(The `--config pull.rebase` option configures Git so that `git pull`-will behave like `git pull --rebase` by default. Using+will behave like `git pull --rebase` by default. Using`git pull --rebase` to update your changes to resolve merge conflictsis expected by essentially all of open source projects, including-Zulip. You can also set that option after cloning using+Zulip. You can also set that option after cloning using`git config --add pull.rebase true`, or just be careful to always run`git pull --rebase`, never `git pull`).@@ -115,13 +115,13 @@ will run tests for new refs you push to GitHub and email you the outcomeRunning CI against your fork can help save both your and theZulip maintainers time by making it easy to test a change fully before-submitting a pull request. We generally recommend a workflow where as+submitting a pull request. We generally recommend a workflow where asyou make changes, you use a fast edit-refresh cycle running individual-tests locally until your changes work. But then once you've gotten+tests locally until your changes work. But then once you've gottenthe tests you'd expect to be relevant to your changes working, push abranch to run the full test suite in GitHub Actions before-you create a pull request. While you wait for GitHub Actions jobs-to run, you can start working on your next task. When the tests finish,+you create a pull request. While you wait for GitHub Actions jobs+to run, you can start working on your next task. When the tests finish,you can create a pull request that you already know passes the tests.GitHub Actions will run all the jobs by default on your forked repository.diff --git a/docs/git/fixing-commits.md b/docs/git/fixing-commits.mdindex a2c789ddbf9..c4f46d388b4 100644--- a/docs/git/fixing-commits.md+++ b/docs/git/fixing-commits.md@@ -32,4 +32,4 @@ Sometimes, you want to make one commit out of a bunch of commits. To do this,2. Reorder the lines containing the commits and save## Pushing commits after tidying them-1. `git push origin +my-feature-branch` (Note the `+` there and substitute your actual branch name.)+1. `git push origin +my-feature-branch` (Note the `+` there and substitute your actual branch name.)diff --git a/docs/git/overview.md b/docs/git/overview.mdindex b7a935149f2..a3c4d8eed42 100644--- a/docs/git/overview.md+++ b/docs/git/overview.md@@ -22,7 +22,7 @@ with these details in mind:We use this strategy in order to avoid the extra commits that appearwhen another branch is merged, that clutter the commit history (it's- popular with other large projects such as Django). This makes+ popular with other large projects such as Django). This makesZulip's commit history more readable, but a side effect is that manypull requests we merge will be reported by GitHub's UI as *closed*instead of *merged*, since GitHub has poor support fordiff --git a/docs/git/pull-requests.md b/docs/git/pull-requests.mdindex 9a8edd2eb74..183275660b2 100644--- a/docs/git/pull-requests.md+++ b/docs/git/pull-requests.md@@ -20,7 +20,7 @@ requests early and often. This allows you to share your code to makeit easier to get feedback and help with your changes. Prefix thetitles of work-in-progress pull requests with **[WIP]**, which in ourproject means that you don't think your pull request is ready to be-merged (e.g. it might not work or pass tests). This sets expectations+merged (e.g. it might not work or pass tests). This sets expectationscorrectly for any feedback from other developers, and prevents yourwork from being merged before you're confident in it.@@ -30,7 +30,7 @@ work from being merged before you're confident in it.It is important to [work on a featurebranch](using.html#work-on-a-feature-branch) when creating a pull-request. Your new pull request will be inextricably linked with your+request. Your new pull request will be inextricably linked with yourbranch while it is open, so you will need to reserve your branch onlyfor changes related to your issue, and avoid introducing extraneouschanges for other issues or from upstream.diff --git a/docs/git/setup.md b/docs/git/setup.mdindex 8fd57e572b4..a0f198c90a1 100644--- a/docs/git/setup.md+++ b/docs/git/setup.md@@ -15,14 +15,14 @@ You'll also need a GitHub account, which you can sign up for[here][github-join].We highly recommend you create an SSH key if you don't already have-one and [add it to your GitHub account][github-help-add-ssh-key]. If+one and [add it to your GitHub account][github-help-add-ssh-key]. Ifyou don't, you'll have to type your GitHub username and password everytime you interact with GitHub, which is usually several times a day.We also highly recommend the following:- [Configure Git][gitbook-config] with your name and email and- [aliases][gitbook-aliases] for commands you'll use often. We+ [aliases][gitbook-aliases] for commands you'll use often. Werecommend using your full name (not just your first name), sincethat's what we'll use to give credit to your work in places like theZulip release notes.diff --git a/docs/git/using.md b/docs/git/using.mdindex 5e23b009e30..8c9f0907149 100644--- a/docs/git/using.md+++ b/docs/git/using.md@@ -324,7 +324,7 @@ messages][github-help-closing-issues] for details.Note in particular that GitHub's regular expressions for this featureare sloppy, so phrases like `Partially fixes #1234` will automatically-close the issue. Phrases like `Fixes part of #1234` are a good+close the issue. Phrases like `Fixes part of #1234` are a goodalternative.Make as many commits as you need to to address the issue or implement your feature.diff --git a/docs/git/working-copies.md b/docs/git/working-copies.mdindex 5c42a03228c..ba7b8826f85 100644--- a/docs/git/working-copies.md+++ b/docs/git/working-copies.md@@ -3,8 +3,8 @@When you work on Zulip code, there are three copies of the Zulip Gitrepository that you are generally concerned with:-- The `upstream` remote. This is the [official Zulip- repository](https://github.com/zulip/zulip) on GitHub. You probably+- The `upstream` remote. This is the [official Zulip+ repository](https://github.com/zulip/zulip) on GitHub. You probablydon't have write access to this repository.- The **origin** remote: Your personal remote repository on GitHub.You'll use this to share your code and create [pull requests](../git/pull-requests.md).@@ -44,7 +44,7 @@ working copies:- `git push`: This pushes code from your local repository to one of the remotes.- `git remote`: This helps you configure short names for remotes.- `git pull`: This pulls code, but by default creates a merge commit- (which you definitely don't want). However, if you've followed our+ (which you definitely don't want). However, if you've followed our[cloning documentation](../git/cloning.md), this will do`git pull --rebase` instead, which is the only mode you'll want touse when working on Zulip.diff --git a/docs/git/zulip-tools.md b/docs/git/zulip-tools.mdindex 95023dc5cc3..2e5a2172f3e 100644--- a/docs/git/zulip-tools.md+++ b/docs/git/zulip-tools.md@@ -5,7 +5,7 @@ time when working with Git on the Zulip project.## Set up Git repo script-**Extremely useful**. In the `tools` directory of+**Extremely useful**. In the `tools` directory of[zulip/zulip][github-zulip-zulip] you'll find a bash script`setup-git-repo`. This script installs a pre-commit hook, which willrun each time you `git commit` to automatically run@@ -41,7 +41,7 @@ described above in that it does not create a branch for the pull requestcheckout.**This tool checks for uncommitted changes, but it will move the- current branch using `git reset --hard`. Use with caution.**+ current branch using `git reset --hard`. Use with caution.**First, make sure you are working in a branch you want to move (in thisexample, we'll use the local `main` branch). Then run the script@@ -118,10 +118,10 @@ HEAD is now at 5a1e982 tools: Update clean-branches to clean review branches.## Push to a pull request`tools/push-to-pull-request` is primarily useful for maintainers who-are merging other users' commits into a Zulip repository. After doing+are merging other users' commits into a Zulip repository. After doing`reset-to-pull-request` or `fetch-pull-request` and making somechanges, you can push a branch back to a pull request with e.g.-`tools/push-to-pull-request 1234`. This is useful for a few things:+`tools/push-to-pull-request 1234`. This is useful for a few things:- Getting CI to run and enabling you to use the GitHub "Merge" buttonsto merge a PR after you make some corrections to a PR, without@@ -139,7 +139,7 @@ next batch of changes.Note that in order to do this you need permission to do such a push,which GitHub offers by default to users with write access to the-repository. For multiple developers collaborating on a PR, you can+repository. For multiple developers collaborating on a PR, you canachieve this by granting other users permission to write to your fork.## Delete unimportant branchesdiff --git a/docs/index.md b/docs/index.mdindex 4a81bcb6c19..a07167033c5 100644--- a/docs/index.md+++ b/docs/index.md@@ -14,7 +14,7 @@ Welcome! Zulip's documentation is split into four parts:Zulip has well over 150,000 words of documentation. If you can't findwhat you're looking for, please [let us-know](https://zulip.com/developer-community/)! Further information on+know](https://zulip.com/developer-community/)! Further information onthe Zulip project and its features can be found at<https://zulip.com>.diff --git a/docs/overview/architecture-overview.md b/docs/overview/architecture-overview.mdindex 99f0cd913fe..477a89b21a3 100644--- a/docs/overview/architecture-overview.md+++ b/docs/overview/architecture-overview.md@@ -4,7 +4,7 @@ Zulip architectural overviewKey codebases--------------The main Zulip codebase is at <https://github.com/zulip/zulip>. It+The main Zulip codebase is at <https://github.com/zulip/zulip>. Itcontains the Zulip backend (written in Python 3.x and Django), theweb app (written in JavaScript and TypeScript) and our library ofincoming webhook [integrations](https://zulip.com/integrations)@@ -43,7 +43,7 @@ Usage assumptions and conceptsZulip is a real-time team chat application meant to provide a greatexperience for a wide range of organizations, from companies tovolunteer projects to groups of friends, ranging in size from a small-team to 10,000s of users. It has [hundreds of+team to 10,000s of users. It has [hundreds offeatures](https://zulip.com/features) both larger and small, andsupports dedicated apps for iOS, Android, Linux, Windows, and macOS,all modern web browsers, several cross-protocol chat clients, and@@ -51,8 +51,8 @@ numerous dedicated [Zulip API](https://zulip.com/api) clients(e.g. bots).A server can host multiple Zulip *realms* (organizations), each on its-own (sub)domain. While most installations host only one organization, some-such as zulip.com host thousands. Each organization is a private+own (sub)domain. While most installations host only one organization, some+such as zulip.com host thousands. Each organization is a privatechamber with its own users, streams, customizations, and so on. Thismeans that one person might be a user of multiple Zulip realms. Theadministrators of an organization have a great deal of control over@@ -69,7 +69,7 @@ Components### Django and TornadoZulip is primarily implemented in the-[Django](https://www.djangoproject.com/) Python web framework. We+[Django](https://www.djangoproject.com/) Python web framework. Wealso make use of [Tornado](https://www.tornadoweb.org) for thereal-time push system.@@ -86,10 +86,10 @@ connection from every running client. For this reason, it'sresponsible for event (message) delivery, but not much else. We try toavoid any blocking calls in Tornado because we don't want to delaydelivery to thousands of other connections (as this would make Zulip-very much not real-time). For instance, we avoid doing cache or+very much not real-time). For instance, we avoid doing cache ordatabase queries inside the Tornado code paths, since those blockingrequests carry a very high performance penalty for a single-threaded,-asynchronous server system. (In principle, we could do non-blocking+asynchronous server system. (In principle, we could do non-blockingrequests to those services, but the Django-based database libraries weuse in most of our codebase using don't support that, and in any case,our architecture doesn't require Tornado to do that).@@ -142,7 +142,7 @@ from outside.`uWSGI` via `unix:/home/zulip/deployments/uwsgi-socket`.- By default (i.e. if `LOCAL_UPLOADS_DIR` is set), nginx will serveuser-uploaded content like avatars, custom emoji, and uploaded- files. However, one can configure Zulip to store these in a cloud+ files. However, one can configure Zulip to store these in a cloudstorage service like Amazon S3 instead.Note that we do not use `nginx` in the development environment, opting@@ -168,7 +168,7 @@ memcached is used to cache database modelobjects. `zerver/lib/cache.py` and `zerver/lib/cache_helpers.py`manage putting things into memcached, and invalidating the cache whenvalues change. The memcached configuration is in-`puppet/zulip/files/memcached.conf`. See our+`puppet/zulip/files/memcached.conf`. See our[caching guide](../subsystems/caching.md) to learn how this works indetail.@@ -191,7 +191,7 @@ replace RabbitMQ with Redis, with some loss of functionality).The answer is likely yes, but it wouldn't improve Zulip.Operationally, our current setup is likely easier to develop and run-in production than a pure Redis system would be. Meanwhile, the+in production than a pure Redis system would be. Meanwhile, theperceived benefit for using Redis is usually to reduce memoryconsumption by running fewer services, and no such benefit wouldmaterialize:@@ -221,7 +221,7 @@ and the Tornado push system.Two simple wrappers around `pika` (the Python RabbitMQ client) are in`zulip/zerver/lib/queue.py`. There's an asynchronous client for use in-Tornado and a more general client for use elsewhere. Most of the+Tornado and a more general client for use elsewhere. Most of theprocesses started by Supervisor are queue processors that continuallypull things out of a RabbitMQ queue and handle them; they are definedin `zerver/worker/queue_processors.py`.@@ -243,7 +243,7 @@ list of stopwords used by a PostgreSQL extension.In a development environment, configuration of that PostgreSQLextension is handled by `tools/postgresql-init-dev-db` (invoked by-`tools/provision`). That file also manages setting up the+`tools/provision`). That file also manages setting up thedevelopment PostgreSQL user.`tools/provision` also invokes `tools/rebuild-dev-database`@@ -267,13 +267,13 @@ component of the Zulip server (e.g.## GlossaryThis section gives names for some of the elements in the Zulip UI used-in Zulip development conversations. In general, our goal is to+in Zulip development conversations. In general, our goal is tominimize the set of terminology listed here by giving elementsself-explanatory names.- **bankruptcy**: When a user has been off Zulip for several days andhas hundreds of unread messages, they are prompted for whether- they want to mark all their unread messages as read. This is+ they want to mark all their unread messages as read. This iscalled "declaring bankruptcy" (in reference to the concept infinance).diff --git a/docs/overview/changelog.md b/docs/overview/changelog.mdindex 764811e6fe9..17fbbf2a011 100644--- a/docs/overview/changelog.md+++ b/docs/overview/changelog.md@@ -1,6 +1,6 @@# Version history-This page the release history for the Zulip server. See also the+This page the release history for the Zulip server. See also the[Zulip release lifecycle](../overview/release-lifecycle.md).## Zulip 5.x series@@ -8,7 +8,7 @@ This page the release history for the Zulip server. See also the### 5.0 -- unreleasedThis section is an incomplete draft of the release notes for the next-major release, and is only updated occasionally. See the [commit+major release, and is only updated occasionally. See the [commitlog][commit-log] for an up-to-date list of raw changes.#### Highlights@@ -205,7 +205,7 @@ log][commit-log] for an up-to-date list of raw changes.composing messages, and is now the default view. The previousdefault view, "All messages", is still available, and the defaultview can now be configured via "Display settings".-- Completed API documentation for Zulip's real-time events system. It+- Completed API documentation for Zulip's real-time events system. Itis now possible to write a decent Zulip client with minimalinteraction with the Zulip server development team.- Added new organization settings: wildcard mention policy.@@ -216,7 +216,7 @@ log][commit-log] for an up-to-date list of raw changes.- This release contains more than 30 independent changes to the [ZulipAPI](https://zulip.com/api/changelog), largely to support newfeatures or make the API (and thus its documentation) clearer and- easier for clients to implement. Other new API features support+ easier for clients to implement. Other new API features supportbetter error handling for the mobile and terminal apps.- The frontend internationalization library was switched from i18nextto FormatJS.@@ -231,7 +231,7 @@ log][commit-log] for an up-to-date list of raw changes.- Changed the Tornado service to use 127.0.0.1:9800 instead of127.0.0.1:9993 as its default network address, to simplify support- for multiple Tornado processes. Since Tornado only listens on+ for multiple Tornado processes. Since Tornado only listens onlocalhost, this change should have no visible effect unless anotherservice is using port 9800.- Zulip's top-level puppet classes have been renamed, largely from@@ -250,14 +250,14 @@ log][commit-log] for an up-to-date list of raw changes.one no longer needs to use `supervisorctl` directly for these tasks.- As this is a major release, we recommend [carefully updating theinline documentation in your- `/etc/zulip/settings.py`][update-settings-docs]. Notably, we rewrote the+ `/etc/zulip/settings.py`][update-settings-docs]. Notably, we rewrote thetemplate to be better organized and more readable in this release.- The web app will now display a warning in the UI if the Zulip serverhas not been upgraded in more than 18 months.template to be better organized and more readable.- The next time users log in to Zulip with their password afterupgrading to this release, they will be logged out of all active- browser sessions (i.e. the web and desktop apps). This is a side+ browser sessions (i.e. the web and desktop apps). This is a sideeffect of improved security settings (increasing the minimum entropyused when salting passwords from 71 bits to 128 bits).- We've removed the partial Thumbor integration from Zulip. The@@ -416,7 +416,7 @@ log][commit-log] for an up-to-date list of raw changes.### 3.3 -- December 1, 2020- Guest users should not be allowed to post to streams marked “Only- organization full members can post.” This flaw has existed since+ organization full members can post.” This flaw has existed sincethe feature was added in Zulip Server 3.0.- Permit outgoing mail from postfix; this resolves a bug introduced inZulip Server 3.2 which prevented Zulip from sending outgoing mail if@@ -455,7 +455,7 @@ log][commit-log] for an up-to-date list of raw changes.### 3.1 -- July 30, 2020-- Removed unused `short_name` field from the User model. This field+- Removed unused `short_name` field from the User model. This fieldhad no purpose and could leak the local part of email addresseswhen email address visibility was restricted.- Fixed a bug where loading spinners would sometimes not be displayed.@@ -469,7 +469,7 @@ log][commit-log] for an up-to-date list of raw changes.releases to fail.- Added a Thinkst Canary integration (and renamed the old one, whichwas actually an integration for canarytokens.org).-- Reformatted the frontend codebase using prettier. This change was+- Reformatted the frontend codebase using prettier. This change wasincluded in this maintenance release to ensure backporting patchesfrom `main` remains easy.@@ -477,18 +477,18 @@ log][commit-log] for an up-to-date list of raw changes.#### Highlights-- Added support for Ubuntu 20.04 Focal. This release drops support+- Added support for Ubuntu 20.04 Focal. This release drops supportfor Ubuntu 16.04 Xenial and Debian 9 Stretch.- Redesigned the top navbar/search area to be much cleaner and showuseful data like subscriber counts and stream descriptions indefault views.- Added a new "recent topics" widget, which lets one browse recent- and ongoing conversations at a glance. We expect this widget to+ and ongoing conversations at a glance. We expect this widget toreplace "All messages" as the default view in Zulip in thenext major release.- Redesigned "Notification settings" to have an intuitive tableformat and display any individual streams with non-default settings.-- Added support for moving topics between streams. This was by far+- Added support for moving topics between streams. This was by farZulip's most-requested feature.- Added automatic theme detection using prefers-color-scheme.- Added support for GitLab and Sign in with Apple authentication.@@ -523,8 +523,8 @@ log][commit-log] for an up-to-date list of raw changes.those in past major releases.- Previous versions had a rare bug that made it possible to create twouser accounts with the same email address, preventing either from- logging in. A migration in this release adds a database constraint- that will fix this bug. The new migration will fail if any such+ logging in. A migration in this release adds a database constraint+ that will fix this bug. The new migration will fail if any suchduplicate accounts already exist; you can check whether this willhappen be running the following in a [management shell][manage-shell]:```python@@ -533,23 +533,23 @@ log][commit-log] for an up-to-date list of raw changes..values('realm_id', 'email_lower').annotate(Count('id')).filter(id__count__gte=2)```If the command returns any accounts, you need to address the- duplicate accounts before upgrading. Zulip Cloud only had two+ duplicate accounts before upgrading. Zulip Cloud only had twoaccounts affected by this bug, so we expect the vast majority ofinstallations will have none.- This release switches Zulip to install PostgreSQL 12 from the upstreamPostgreSQL repository by default, rather than using the default- PostgreSQL version included with the operating system. Existing Zulip+ PostgreSQL version included with the operating system. Existing Zulipinstallations will continue to work with PostgreSQL 10; this detail is- configured in `/etc/zulip/zulip.conf`. We have no concrete plans to+ configured in `/etc/zulip/zulip.conf`. We have no concrete plans tostart requiring PostgreSQL 12, though we do expect it to improve- performance. Installations that would like to upgrade can follow+ performance. Installations that would like to upgrade can follow[our new PostgreSQL upgrade guide][postgresql-upgrade].- The format of the `JWT_AUTH_KEYS` setting has changed to include an[algorithms](https://pyjwt.readthedocs.io/en/latest/algorithms.html)list: `{"subdomain": "key"}` becomes`{"subdomain": {"key": "key", "algorithms": ["HS256"]}}`.- Added a new organization owner permission above the previous- organization administrator. All existing organization+ organization administrator. All existing organizationadministrators are automatically converted into organization owners.Certain sensitive administrative settings are now onlyeditable by organization owners.@@ -610,7 +610,7 @@ log][commit-log] for an up-to-date list of raw changes.- Improved left sidebar popovers to clearly identify administrative actions.- Rewrote substantial parts of the Zulip installer to be more robust.- Replaced the chevron menu indicators in sidebars with vertical ellipses.-- Removed the right sidebar "Group PMs" widget. It's functionality is+- Removed the right sidebar "Group PMs" widget. It's functionality isavailable in the left sidebar "Private messages" widget.- Removed the Google Hangouts integration, due to Google's support forit being discontinued.@@ -658,7 +658,7 @@ log][commit-log] for an up-to-date list of raw changes.- Added webhook support for AnsibleTower 9.x.y.- Essentially rewrote our API documentation using the OpenAPI format,with extensive validation to ensure its accuracy as we modify the API.-- Removed New User Bot and Feedback Bot. Messages they had sent are+- Removed New User Bot and Feedback Bot. Messages they had sent aremigrated to have been sent by Notification Bot.- Removed the "pointer" message ID from Zulip, a legacy concept datingto 2012 that predated tracking unread messages in Zulip and has@@ -690,7 +690,7 @@ log][commit-log] for an up-to-date list of raw changes.- Replaced our CasperJS frontend integration test system with Puppeteer.- Extracted the typeahead and Markdown libraries for reuse in themobile apps.-- Removed the legacy websockets-based system for sending messages. This+- Removed the legacy websockets-based system for sending messages. Thissystem was always a hack, was only ever used for one endpoint, anddid not provide a measureable latency benefit over HTTP/2.@@ -739,7 +739,7 @@ Administrators of servers originally installed with Zulip 1.9 or oldershould audit for unexpected [organizationadministrators][audit-org-admin] following this upgrade, as it ispossible CVE-2020-14215 caused a user to incorrectly join as an-organization administrator in the past. See the release blog post for+organization administrator in the past. See the release blog post fordetails.[audit-org-admin]: https://zulip.com/help/change-a-users-role@@ -752,7 +752,7 @@ details.an exception restoring backups on fresh Zulip servers that had beengenerated on systems that had been upgraded from older Zulip releases.- Removed fetching GitHub contributor data from static asset build- process. This makes `upgrade-zulip-from-git` much more reliable.+ process. This makes `upgrade-zulip-from-git` much more reliable.- Updated translation data from Transifex.- Support for Ubuntu 16.04 Xenial and Debian 9 Stretch is now deprecated.@@ -761,7 +761,7 @@ details.- CVE-2020-9444: Prevent reverse tabnapping attacks.- CVE-2020-9445: Remove unused and insecure modal_link feature.- CVE-2020-10935: Fix XSS vulnerability in local link rewriting.-- Blocked access from Zulip Desktop versions below 5.0.0. This+- Blocked access from Zulip Desktop versions below 5.0.0. Thisbehavior can be adjusted by editing `DESKTOP_*_VERSION`in `/home/zulip/deployments/current/version.py`.- Restructured server initialization to simplify initialization of@@ -823,56 +823,56 @@ details.#### Highlights-- Added support for Debian buster. Removed support for EOL Ubuntu Trusty.+- Added support for Debian buster. Removed support for EOL Ubuntu Trusty.- Added support for SAML authentication.- Removed our dependency on `tsearch_extras`, making it possible torun a production Zulip server against any PostgreSQL database(including those where one cannot install extensions, like Amazon RDS).- Significantly improved the email->Zulip gateway, and added [nice- setup documentation](../production/email-gateway.md). It now+ setup documentation](../production/email-gateway.md). It nowshould be possible to subscribe a Zulip stream to an email list andhave a good experience.- Added an option for hiding access to user email addresses from- other users. While counterproductive for most corporate+ other users. While counterproductive for most corporatecommunities, for open source projects and other volunteerorganizations, this can be a critical anti-spam feature.- Added a new setting controlling which unread messages are counted inthe favicon, title, and desktop app.- Support for showing inline previews of linked webpages has moved- from alpha to beta. See the upgrade notes below for some changes in+ from alpha to beta. See the upgrade notes below for some changes inhow it is configured.- Added support for importing an organization from Mattermost (similar- to existing Slack/HipChat/Gitter import tools). Slack import now+ to existing Slack/HipChat/Gitter import tools). Slack import nowsupports importing data only included in corporate exports,including private messages and shared channels.- Added Markdown support and typeahead for mentioning topics.- Email notifications have been completely redesigned with a minimal,readable style inspired by GitHub's email notifications.- We merged significant preparatory work for supporting RHEL/CentOS in- production. We're now interested in beta testers for this feature.+ production. We're now interested in beta testers for this feature.- Reorganized Zulip's documentation for sysadmins, and added [newdocumentation](../production/upgrade-or-modify.html#modifying-zulip)on maintaining a fork of Zulip.- Added new `streams:public` search operator that searches the publichistory of all streams in the organization (even before you joined).- Added support for sending email and mobile push notifications for- wildcard mentions (@all and @everyone). Previously, they only+ wildcard mentions (@all and @everyone). Previously, they onlytriggered desktop notifications; now, that's configurable.#### Upgrade notes for 2.1.0- The defaults for Zulip's now beta inline URL preview setting have changed.Previously, the server-level `INLINE_URL_EMBED_PREVIEW` setting was-disabled, and organization-level setting was enabled. Now, the+disabled, and organization-level setting was enabled. Now, theserver-level setting is enabled by default, and the organization-level-setting is disabled. As a result, organization administrators can-configure this feature entirely in the UI. However, servers that had+setting is disabled. As a result, organization administrators can+configure this feature entirely in the UI. However, servers that hadpreviously [enabled previews of linkedwebsites](https://zulip.com/help/allow-image-link-previews) willlose the setting and need to re-enable it.- We rewrote the Google authentication backend to use the`python-social-auth` system we use for other third-party- authentication systems. For this release, the old variable names+ authentication systems. For this release, the old variable namesstill work, but users should update the following setting names intheir configuration as we will desupport the old names in a futurerelease:@@ -888,20 +888,20 @@ lose the setting and need to re-enable it.`AUTH_LDAP_REVERSE_EMAIL_SEARCH` and `AUTH_LDAP_USERNAME_ATTR`. Seethe [LDAP configurationinstructions](../production/authentication-methods.html#ldap-including-active-directory)- for details. You can use the usual `manage.py query_ldap` method to+ for details. You can use the usual `manage.py query_ldap` method toverify whether your configuration is working correctly.- The Zulip web and desktop apps have been converted to directly countall unread messages, replacing an old system that just counted the- (recent) messages fully fetched by the web app. This one-time+ (recent) messages fully fetched by the web app. This one-timetransition may cause some users to notice old messages that were- sent months or years ago "just became unread". What actually+ sent months or years ago "just became unread". What actuallyhappened is the user never read these messages, and the Zulip web app- was not displaying that. Generally, the fix is for users to simply+ was not displaying that. Generally, the fix is for users to simplymark those messages as read as usual.- Previous versions of Zulip's installer would generate the secrets- `local_database_password` and `initial_password_salt`. These+ `local_database_password` and `initial_password_salt`. Thesesecrets don't do anything, as they only modify behavior of a Zulip- development environment. We recommend deleting those lines from+ development environment. We recommend deleting those lines from`/etc/zulip/zulip-secrets.conf` when you upgrade to avoid confusion.- This release has a particularly expensive database migration,changing the `UserMessage.id` field from an `int` to a `bigint` to@@ -913,7 +913,7 @@ lose the setting and need to re-enable it.number of rows for your server with `UserMessage.objects.count()`.We expect that most Zulip servers can happily just use the normal- upgrade process with a few minutes of downtime. Zulip servers with+ upgrade process with a few minutes of downtime. Zulip servers withover 1M messages may want to first upgrade to [thiscommit](https://github.com/zulip/zulip/commit/b008515d63841e1c0a16ad868d3d67be3bfc20ca)using `upgrade-zulip-from-git`, following the instructions to avoid@@ -1007,12 +1007,12 @@ lose the setting and need to re-enable it.- Fixed numbered list handling of blank lines between blocks.- Fixed performance issues that made users soft-deactivated for over ayear unable to return to the app.-- Fixed missing -X GET/POST parameters in API docs curl examples. The+- Fixed missing -X GET/POST parameters in API docs curl examples. TheAPI documentation for curl examples is now automatically generatedwith automated tests for the examples to prevent future similar bugs.- Fixed multi-line /me messages only working for the sender.- Fixed password strength meter not updating on paste.-- Fixed numerous errors and omissions in the API documentation. Added+- Fixed numerous errors and omissions in the API documentation. Addeda test suite comparing the API documentation to the implementation.- Fixed copy/paste of blocks of messages in Firefox.- Fixed problems with exception reporting when memcached is down.@@ -1133,7 +1133,7 @@ lose the setting and need to re-enable it.status" messages.- Added a built-in /poll slash command for lightweight polls.- Added experimental support for using Zoom as the video chat- provider. We now support Jitsi, Google Hangouts, and Zoom.+ provider. We now support Jitsi, Google Hangouts, and Zoom.- Added support for branding the top-left corner of the logged in appwith an organization's logo.- Zulip's "Guest users" feature is no longer experimental.@@ -1141,7 +1141,7 @@ lose the setting and need to re-enable it.Our HipChat and Slack import tools are now well-tested with millionsof messages, 10,000s of users, and 100,000s of uploaded files.- Added a built-in tool for backups and restoration.-- Deprecated support for Ubuntu Trusty. Zulip 2.0.x will continue to+- Deprecated support for Ubuntu Trusty. Zulip 2.0.x will continue tosupport Ubuntu Trusty, but Zulip 2.1.0 will remove support forinstalling on Trusty.@@ -1157,7 +1157,7 @@ and is enabled by default in that case. To disable it, set#### Full feature changelog- Added support for CentOS 7 in the development environment- provisioning process. This is an important step towards production+ provisioning process. This is an important step towards productionCentOS/RHEL 7 support.- Added a new invitation workflow with reusable links.- Added a new Azure Active Directory authentication integration.@@ -1191,7 +1191,7 @@ and is enabled by default in that case. To disable it, set- Added "silent mentions" syntax (`@_**Tim Abbott**`), which showvisually, but don't trigger a notification to the target user.- Added support for using lightbox in compose preview.-- Changes in date no longer force a repeated recipient bar. This+- Changes in date no longer force a repeated recipient bar. Thisfixes a common source of confusion for new users.- Suppressed notifications when quoting a message mentioning yourself.- Message editing now has the compose widgets for emoji, video calls, etc.@@ -1229,7 +1229,7 @@ and is enabled by default in that case. To disable it, setThis release migrates Zulip off a deprecated Google+ API (necessaryfor Google authentication to continue working past March 7), and-contains a few bug fixes for the installer and Slack import. It has+contains a few bug fixes for the installer and Slack import. It hasminimal changes for existing servers not using Google authentication.- Updated the Google auth integration to stop using a deprecated and@@ -1258,10 +1258,10 @@ Zulip installations; it has minimal changes for existing servers.#### Highlights- Support for Ubuntu bionic and Debian stretch (our first non-Ubuntu- platform!). We expect to deprecate support for installing a new+ platform!). We expect to deprecate support for installing a newZulip server on Ubuntu Trusty in the coming months, in preparationfor Trusty’s end-of-life in April 2019.-- New data import tools for HipChat and Gitter. The Slack importer+- New data import tools for HipChat and Gitter. The Slack importeris now out of beta.- Zulip Python process startup time is about 30% faster; this effortresulted in upstream contributions to fix significant performance@@ -1285,18 +1285,18 @@ Zulip installations; it has minimal changes for existing servers.Netlify, and Zabbix; Zulip now has over 100 native integrations (inaddition to hundreds more available via Zapier and IFTTT).- New translations for Ukrainian, Portuguese, Indonesian, Dutch, and- Finnish. Zulip now has complete or nearly-complete translations+ Finnish. Zulip now has complete or nearly-complete translationsfor German, Spanish, French, Portuguese, Russian, Ukrainian,- Czech, Finnish, and Turkish. Partial translations for Chinese,+ Czech, Finnish, and Turkish. Partial translations for Chinese,Dutch, Korean, Polish, Japanese, and Indonesian cover the majorityof the total strings in the project.#### Upgrade notes for 1.9.0- Zulip 1.9 contains a significant database migration that can take- several minutes to run. The upgrade process automatically minimizes+ several minutes to run. The upgrade process automatically minimizesdisruption by running this migration first, before beginning the- user-facing downtime. However, if you'd like to watch the downtime+ user-facing downtime. However, if you'd like to watch the downtimephase of the upgrade closely, we recommend[running them first manually](../production/expensive-migrations.md)and as well as the usual trick of@@ -1311,7 +1311,7 @@ Zulip installations; it has minimal changes for existing servers.- Added the new `SOCIAL_AUTH_SUBDOMAIN` setting, which all servers usingboth GitHub authentication and hosting multiple Zulip organizationsshould set (see [the docs for details](../production/multiple-organizations.html#authentication)).-- Added automatic thumbnailing of images, powered by thumbor. The new+- Added automatic thumbnailing of images, powered by thumbor. The newTHUMBOR_URL setting controls this feature; it is disabled by defaultin this release, because the mobile apps don't support it yet.- Added documentation on alternative production deployment options.@@ -1370,13 +1370,13 @@ Zulip installations; it has minimal changes for existing servers.user accounts on a server.- Emails and several other onboarding strings are now tagged fortranslation.-- Optimized the performance of importing Zulip by about 30%. This+- Optimized the performance of importing Zulip by about 30%. Thissignificantly decreases the load spike when restarting a Zulip server.- Optimized the performance of development provisioning; a no-opprovision now completes in about 3.5s.- Migrated our static asset pipeline to webpack.- Our steady work on codebase quality and our automated test suite- continues. Backend test coverage is now an incredible 98%.+ continues. Backend test coverage is now an incredible 98%.## Zulip 1.8.x series@@ -1411,9 +1411,9 @@ Zulip installations; it has minimal changes for existing servers.**Security and privacy:**- Several important security fixes since 1.7.0, which were releasedalready in 1.7.1 and 1.7.2.-- The security model for private streams has changed. Now+- The security model for private streams has changed. Noworganization administrators can remove users, edit descriptions, and- rename private streams they are not subscribed to. See Zulip's+ rename private streams they are not subscribed to. See Zulip'ssecurity model documentation for details.- On Xenial, the local uploads backend now does the same securitychecks that the S3 backend did before serving files to users.@@ -1491,7 +1491,7 @@ Zulip installations; it has minimal changes for existing servers.- Improved handling of browser undo in compose.- Improved saved drafts system to garbage-collect old drafts and sortby last modification, not creation.-- Removed the legacy "Zulip labs" autoscroll_forever setting. It was+- Removed the legacy "Zulip labs" autoscroll_forever setting. It wasenabled mostly by accident.- Removed some long-deprecated Markdown syntax for mentions.- Added support for clicking on a mention to see a user's profile.@@ -1525,7 +1525,7 @@ Zulip installations; it has minimal changes for existing servers.- Fixed numerous issues in the "stream settings" UI.- Fixed numerous subtle bugs with the stream creation UI.- Changes the URL scheme for stream narrows to encode the stream ID,- so that they can be robust to streams being renamed. The change is+ so that they can be robust to streams being renamed. The change isbackwards-compatible; existing narrow URLs still work.@@ -1595,13 +1595,13 @@ This major release has no special upgrade notes.### 1.7.2 -- 2018-04-12This is a security release, with a handful of cherry-picked changes-since 1.7.1. All Zulip server admins are encouraged to upgrade+since 1.7.1. All Zulip server admins are encouraged to upgradepromptly.- CVE-2018-9986: Fix XSS issues with frontend Markdown processor.- CVE-2018-9987: Fix XSS issue with muting notifications.- CVE-2018-9990: Fix XSS issue with stream names in topic typeahead.-- CVE-2018-9999: Fix XSS issue with user uploads. The fix for this+- CVE-2018-9999: Fix XSS issue with user uploads. The fix for thisadds a Content-Security-Policy for the `LOCAL_UPLOADS_DIR` storagebackend for user-uploaded files.@@ -1611,7 +1611,7 @@ reporting CVE-2018-9986 and CVE-2018-9990.### 1.7.1 -- 2017-11-21This is a security release, with a handful of cherry-picked changes-since 1.7.0. All Zulip server admins are encouraged to upgrade+since 1.7.0. All Zulip server admins are encouraged to upgradepromptly.This release includes fixes for the upgrade process, so server admins@@ -1621,7 +1621,7 @@ running a version from before 1.7 should upgrade directly to 1.7.1.the invitation system allowed an authorized user of one realm tocreate an account on any other realm.- The Korean translation is now complete, a huge advance from almost- nothing in 1.7.0. The French translation is now nearly complete,+ nothing in 1.7.0. The French translation is now nearly complete,and several other languages have smaller updates.- The installer now sets LC_ALL to a known locale, working around anissue where some dependencies fail to install in some locales.@@ -1667,8 +1667,8 @@ running a version from before 1.7 should upgrade directly to 1.7.1.**Backend and scaling**-- Zulip now runs exclusively on Python 3. This is the culmination of- an 18-month migration effort. We are very excited about this!+- Zulip now runs exclusively on Python 3. This is the culmination of+ an 18-month migration effort. We are very excited about this!- We’ve added an automatic "soft deactivation" process, whichdramatically improves performance for organizations with a largenumber of inactive users, without any impact on those users’@@ -1682,9 +1682,9 @@ running a version from before 1.7 should upgrade directly to 1.7.1.#### Upgrade notes for 1.7.0- Zulip 1.7 contains some significant database migrations that can- take several minutes to run. The upgrade process automatically+ take several minutes to run. The upgrade process automaticallyminimizes disruption by running these first, before beginning the- user-facing downtime. However, if you'd like to watch the downtime+ user-facing downtime. However, if you'd like to watch the downtimephase of the upgrade closely, we recommend[running them first manually](../production/expensive-migrations.md) and as wellas the usual trick of@@ -1696,12 +1696,12 @@ running a version from before 1.7 should upgrade directly to 1.7.1.to have its own subdomain.This change should have no effect for the vast majority of Zulip- servers that only have one organization. If you manage a server+ servers that only have one organization. If you manage a serverthat hosts multiple organizations, you'll want to read [our guide onmultiple organizations](../production/multiple-organizations.md).- We simplified the configuration for our password strength checker to- be much more intuitive. If you were using the+ be much more intuitive. If you were using the`PASSWORD_MIN_ZXCVBN_QUALITY` setting,[it has been replaced](https://github.com/zulip/zulip/commit/a116303604e362796afa54b5d923ea5312b2ea23) bythe more intuitive `PASSWORD_MIN_GUESSES`.@@ -1882,10 +1882,10 @@ Zulip apps.- Added support for users deleting realm emoji they themselves uploaded.- Added support for organization administrators deleting messages.- Extended data available to mobile apps to cover the entire API.-- Redesigned bots UI. Now can change owners and reactivate bots.+- Redesigned bots UI. Now can change owners and reactivate bots.- Redesigned the visuals of code blocks to be prettier.- Changed right sidebar presence UI to only show recently active users- in large organizations. This has a huge performance benefit.+ in large organizations. This has a huge performance benefit.- Changed color for private messages to look better.- Converted realm emoji to be uploaded, not links, for better robustness.- Switched the default password hasher for new passwords to Argon2.@@ -1927,13 +1927,13 @@ Zulip apps.- Trailing whitespace is now stripped in code blocks, avoidingunnecessary scrollbars.- Most API payloads now refer to users primarily by user ID, with- email available for backwards-compatibility. In the future, we may+ email available for backwards-compatibility. In the future, we mayremove email support.-- Cleaned up Zulip's supervisord configuration. A side effect is the+- Cleaned up Zulip's supervisord configuration. A side effect is thenames of the log files have changed for all the queue workers.- Refactored various endpoints to use a single code path for securityhardening.-- Removed support for the `MANDRILL_CLIENT` setting. It hadn't been+- Removed support for the `MANDRILL_CLIENT` setting. It hadn't beenused in years.- Changed `NOREPLY_EMAIL_ADDRESS` setting to `Name <[email protected]>`format.@@ -2001,7 +2001,7 @@ Zulip apps.- Added a configuration option to disable websockets.- Added support for removing one's own Zulip account.- Added support for realm admins which auth backends are supported.-- Added new organization type concept. This will be used to control+- Added new organization type concept. This will be used to controlwhether Zulip is optimized around protecting user privacyvs. administrative control.- Added #**streamName** syntax for linking to a stream.@@ -2080,9 +2080,9 @@ Zulip apps.### 1.4.0 - 2016-08-25- Migrated Zulip's python dependencies to be installed via a virtualenv,- instead of the via apt. This is a major change to how Zulip+ instead of the via apt. This is a major change to how Zulipis installed that we expect will simplify upgrades in the future.-- Fixed unnecessary loading of zxcvbn password strength checker. This+- Fixed unnecessary loading of zxcvbn password strength checker. Thissaves a huge fraction of the uncached network transfer for loadingZulip.- Added support for using Ubuntu Xenial in production.@@ -2099,7 +2099,7 @@ Zulip apps.- Added support for pinning streams to the top of the left sidebar.- Added search box for filtering user list when creating a new stream.- Added realm setting to disable message editing.-- Added realm setting to time-limit message editing. Default is 10m.+- Added realm setting to time-limit message editing. Default is 10m.- Added realm setting for default language.- Added year to timestamps in message interstitials for old messages.- Added GitHub authentication (and integrated python-social-auth, so it's@@ -2112,7 +2112,7 @@ Zulip apps.- Added automatic configuration of PostgreSQL/memcached settings basedon the server's available RAM.- Added scripts/upgrade-zulip-from-git for upgrading Zulip from a Git repo.-- Added preliminary support for Python 3. All of Zulip's test suites now+- Added preliminary support for Python 3. All of Zulip's test suites nowpass using Python 3.4.- Added support for `Name <[email protected]>` format when inviting users.- Added numerous special-purpose settings options.@@ -2123,10 +2123,10 @@ Zulip apps.- Improved error messages for various empty narrows.- Improved missed message emails to better support directly replying.- Increased backend test coverage of Python code to 85.5%.-- Increased mypy static type coverage of Python code to 95%. Also+- Increased mypy static type coverage of Python code to 95%. Alsofixed many string annotations to properly handle Unicode.- Fixed major i18n-related frontend performance regression on- /#subscriptions page. Saves several seconds of load time with 1k+ /#subscriptions page. Saves several seconds of load time with 1kstreams.- Fixed Jinja2 migration bug when trying to register an email thatalready has an account.diff --git a/docs/overview/directory-structure.md b/docs/overview/directory-structure.mdindex d04f1706fb1..611293ff28d 100644--- a/docs/overview/directory-structure.md+++ b/docs/overview/directory-structure.md@@ -19,12 +19,12 @@ paths will be familiar to Django developers.- `zerver/models.py` Main[Django models](https://docs.djangoproject.com/en/1.8/topics/db/models/)- file. Defines Zulip's database tables.+ file. Defines Zulip's database tables.- `zerver/lib/*.py` Most library code.- `zerver/lib/actions.py` Most code doing writes to user-facing- database tables lives here. In particular, we have a policy that+ database tables lives here. In particular, we have a policy thatall code calling `send_event` to trigger [pushing data toclients](../subsystems/events-system.md) must live here.@@ -121,7 +121,7 @@ Django context (i.e. with database access).the development environment setup process.- `tools/ci/` Subdirectory of `tools/` for things only used to- set up and run our tests in CI. Actual test suites should+ set up and run our tests in CI. Actual test suites shouldgo in `tools/`.---------------------------------------------------------@@ -155,11 +155,11 @@ This is used to deploy essentially all configuration in production.- `analytics` Analytics for the Zulip server administrator (needs work tobe useful to normal Zulip sites).-- `corporate` The old Zulip.com website. Not included in production+- `corporate` The old Zulip.com website. Not included in productiondistribution.- `zilencer` Primarily used to hold management commands that aren't- used in production. Not included in production distribution.+ used in production. Not included in production distribution.-----------------------------------------------------------------------@@ -177,7 +177,7 @@ This is used to deploy essentially all configuration in production.### Documentation-- `docs/` Source for this documentation.+- `docs/` Source for this documentation.--------------------------------------------------------------diff --git a/docs/overview/release-lifecycle.md b/docs/overview/release-lifecycle.mdindex f7977626214..bd5d3776581 100644--- a/docs/overview/release-lifecycle.md+++ b/docs/overview/release-lifecycle.md@@ -31,7 +31,7 @@ server repository][zulip-server].- Zulip Server **stable releases**, such as Zulip 4.5.Organizations self-hosting Zulip primarily use stable releases.- The numbering scheme is simple: the first digit indicates the major- release series (which we'll refer to as "4.x"). (Before Zulip 3.0,+ release series (which we'll refer to as "4.x"). (Before Zulip 3.0,Zulip versions had another digit, e.g. 1.9.2 was a bug fix releasein the Zulip 1.9.x major release series).- [New major releases][blog-major-releases], like Zulip 4.0, are@@ -45,7 +45,7 @@ server repository][zulip-server].you use the latest version of the upgrade code.Starting with Zulip 4.0, the Zulip web app displays the current server-version in the gear menu. With older releases, the server version is+version in the gear menu. With older releases, the server version isavailable [via the API](https://zulip.com/api/get-server-settings).This ReadTheDocs documentation has a widget in the lower-left corner@@ -68,11 +68,11 @@ in a stable release.userbase.- [chat.zulip.org][chat-zulip-org], the bleeding-edge server for theZulip development community, is upgraded to `main` several times- every week. We also often "test deploy" changes not yet in `main`+ every week. We also often "test deploy" changes not yet in `main`to chat.zulip.org to facilitate design feedback.- We maintain Git branches with names like `4.x` containing backportedcommits from `main` that we plan to include in the next maintenance- release. Self hosters can [upgrade][upgrade-from-git] to these+ release. Self hosters can [upgrade][upgrade-from-git] to thesestable release branches to get bug fixes staged for the next stablerelease (which is very useful when you reported a bug whose fix wechoose to backport). We support these branches as though they were a@@ -89,10 +89,10 @@ for self-hosters, has no regressions, and that the [Zulip upgradeprocess](../production/upgrade-or-modify.md) Just Works.The Zulip server and clients apps are all carefully engineered to-ensure compatibility with old versions. In particular:+ensure compatibility with old versions. In particular:- The Zulip mobile and desktop apps maintain backwards-compatibility- code to support any Zulip server since 2.1.0. (They may also work+ code to support any Zulip server since 2.1.0. (They may also workwith older versions, with a degraded experience).- Zulip maintains an [API changelog](https://zulip.com/api/changelog)detailing all changes to the API to make it easy for client@@ -147,7 +147,7 @@ You can adjust the deadline for your installation by setting e.g.For platforms we support, like Debian and Ubuntu, Zulip aims tosupport all versions of the upstream operating systems that are fully-supported by the vendor. We document how to correctly [upgrade the+supported by the vendor. We document how to correctly [upgrade theoperating system][os-upgrade] for a Zulip server, including how tocorrectly chain upgrades when the latest Zulip release no longersupports your OS.@@ -177,7 +177,7 @@ aggregate, just as important as the big things. Most resolved issuesdo not have any of these priority labels.We welcome participation from our user community in influencing the-Zulip roadmap. If a bug or missing feature is causing significant+Zulip roadmap. If a bug or missing feature is causing significantpain for you, we'd love to hear from you, either in[chat.zulip.org](https://zulip.com/developer-community/) or on the relevantGitHub issue. Please an include an explanation of your use case: suchdiff --git a/docs/production/authentication-methods.md b/docs/production/authentication-methods.mdindex d0cd180802b..b09871b89af 100644--- a/docs/production/authentication-methods.md+++ b/docs/production/authentication-methods.md@@ -1,6 +1,6 @@# Authentication methods-Zulip supports a wide variety of authentication methods. Some of them+Zulip supports a wide variety of authentication methods. Some of themrequire configuration to set up.To configure or disable authentication methods on your Zulip server,@@ -19,7 +19,7 @@ Users set a password with the Zulip server, and log in with theiremail and password.When first setting up your Zulip server, this method must be used for-creating the initial realm and user. You can disable it after that.+creating the initial realm and user. You can disable it after that.## Plug-and-play SSO (Google, GitHub, GitLab)@@ -32,7 +32,7 @@ authentication providers:- Microsoft Azure Active Directory, with `AzureADAuthBackend`Each of these requires one to a handful of lines of configuration in-`settings.py`, as well as a secret in `zulip-secrets.conf`. Details+`settings.py`, as well as a secret in `zulip-secrets.conf`. Detailsare documented in your `settings.py`.(ldap)=@@ -44,7 +44,7 @@ optionally using LDAP as an authentication mechanism.In either configuration, you will need to do the following:1. These instructions assume you have an installed Zulip server and- are logged into a shell there. You can have created an+ are logged into a shell there. You can have created anorganization already using EmailAuthBackend, or plan to create theorganization using LDAP authentication.@@ -53,17 +53,17 @@ In either configuration, you will need to do the following:integration, part 1: Connecting to the LDAP server".- If a password is required, put it in`/etc/zulip/zulip-secrets.conf` by setting- `auth_ldap_bind_password`. For example:+ `auth_ldap_bind_password`. For example:`auth_ldap_bind_password = abcd1234`.1. Decide how you want to map the information in your LDAP database to- users' account data in Zulip. For each Zulip user, two closely+ users' account data in Zulip. For each Zulip user, two closelyrelated concepts are:- - their **email address**. Zulip needs this in order to send, for+ - their **email address**. Zulip needs this in order to send, forexample, a notification when they're offline and another usersends a PM.- - their **Zulip username**. This means the name the user types into the- Zulip login form. You might choose for this to be the user's+ - their **Zulip username**. This means the name the user types into the+ Zulip login form. You might choose for this to be the user'semail address (`[email protected]`), or look like a traditional"username" (`sam`), or be something else entirely, depending onyour environment.@@ -72,7 +72,7 @@ In either configuration, you will need to do the following:in your LDAP database.1. Tell Zulip how to map the user information in your LDAP database to- the form it needs for authentication. There are three supported+ the form it needs for authentication. There are three supportedways to set up the username and/or email mapping:(A) Using email addresses as Zulip usernames, if LDAP has each@@ -95,7 +95,7 @@ In either configuration, you will need to do the following:- Set `LDAP_EMAIL_ATTR = "mail"`.- Set `AUTH_LDAP_REVERSE_EMAIL_SEARCH` to a query that will findan LDAP user given their email address (i.e. a search by- `LDAP_EMAIL_ATTR`). For example:+ `LDAP_EMAIL_ATTR`). For example:```pythonAUTH_LDAP_REVERSE_EMAIL_SEARCH = LDAPSearch("ou=users,dc=example,dc=com",ldap.SCOPE_SUBTREE, "(mail=%(email)s)")@@ -109,7 +109,7 @@ You can quickly test whether your configuration works by running:/home/zulip/deployments/current/manage.py query_ldap username```-from the root of your Zulip installation. If your configuration is+from the root of your Zulip installation. If your configuration isworking, that will output the full name for your user (and that user'semail address, if it isn't the same as the "Zulip username").@@ -136,14 +136,14 @@ of the following configurations:**If you are using LDAP for authentication**: you will need to enablethe `zproject.backends.ZulipLDAPAuthBackend` auth backend, in-`AUTHENTICATION_BACKENDS` in `/etc/zulip/settings.py`. After doing so+`AUTHENTICATION_BACKENDS` in `/etc/zulip/settings.py`. After doing so(and as always [restarting the Zulip server](settings.md) to ensureyour settings changes take effect), you should be able to log in toZulip by entering your email address and LDAP password on the Zuliplogin form.You may also want to configure Zulip's settings for [inviting new-users](https://zulip.com/help/invite-new-users). If LDAP is the+users](https://zulip.com/help/invite-new-users). If LDAP is theonly enabled authentication method, the main use case for Zulip'sinvitation feature is selecting the initial streams for invited users(invited users will still need to use their LDAP password to create an@@ -194,10 +194,10 @@ or `jpegPhoto` attribute in LDAP) by configuring the `avatar` key inStarting with Zulip 2.0, Zulip supports syncing[custom profile fields][custom-profile-fields] from LDAP / Active-Directory. To configure this, you first need to+Directory. To configure this, you first need to[configure some custom profile fields][custom-profile-fields] for your-Zulip organization. Then, define a mapping from the fields you'd like-to sync from LDAP to the corresponding LDAP attributes. For example,+Zulip organization. Then, define a mapping from the fields you'd like+to sync from LDAP to the corresponding LDAP attributes. For example,if you have a custom profile field `LinkedIn Profile` and thecorresponding LDAP attribute is `linkedinProfile` then you just needto add `'custom_profile_field__linkedin_profile': 'linkedinProfile'`@@ -206,22 +206,22 @@ to the `AUTH_LDAP_USER_ATTR_MAP`.#### Automatically deactivating users with Active DirectoryStarting with Zulip 2.0, Zulip supports synchronizing the-disabled/deactivated status of users from Active Directory. You can+disabled/deactivated status of users from Active Directory. You canconfigure this by uncommenting the sample line`"userAccountControl": "userAccountControl",` in-`AUTH_LDAP_USER_ATTR_MAP` (and restarting the Zulip server). Zulip+`AUTH_LDAP_USER_ATTR_MAP` (and restarting the Zulip server). Zulipwill then treat users that are disabled via the "Disable Account"feature in Active Directory as deactivated in Zulip.Users disabled in active directory will be immediately unable to log into Zulip, since Zulip queries the LDAP/Active Directory server on-every login attempt. The user will be fully deactivated the next time+every login attempt. The user will be fully deactivated the next timeyour `manage.py sync_ldap_user_data` cron job runs (at which pointthey will be forcefully logged out from all active browser sessions,appear as deactivated in the Zulip UI, etc.).This feature works by checking for the `ACCOUNTDISABLE` flag on the-`userAccountControl` field in Active Directory. See+`userAccountControl` field in Active Directory. See[this handy resource](https://jackstromberg.com/2013/01/useraccountcontrol-attributeflag-values/)for details on the various `userAccountControl` flags.@@ -230,11 +230,11 @@ for details on the various `userAccountControl` flags.Starting with Zulip 2.0, Zulip supports automatically deactivatingusers if they are not found by the `AUTH_LDAP_USER_SEARCH` query(either because the user is no longer in LDAP/Active Directory, or-because the user no longer matches the query). This feature is+because the user no longer matches the query). This feature isenabled by default if LDAP is the only authentication backend-configured on the Zulip server. Otherwise, you can enable this+configured on the Zulip server. Otherwise, you can enable thisfeature by setting `LDAP_DEACTIVATE_NON_MATCHING_USERS` to `True` in-`/etc/zulip/settings.py`. Nonmatching users will be fully deactivated+`/etc/zulip/settings.py`. Nonmatching users will be fully deactivatedthe next time your `manage.py sync_ldap_user_data` cron job runs.#### Other fields@@ -242,7 +242,7 @@ the next time your `manage.py sync_ldap_user_data` cron job runs.Other fields you may want to sync from LDAP include:- Boolean flags; `is_realm_admin` (the organization's administrator- permission) is the main one. You can use the+ permission) is the main one. You can use the[AUTH_LDAP_USER_FLAGS_BY_GROUP][django-auth-booleans] feature of`django-auth-ldap` to configure a group to get this permissions.(We don't recommend using this flags feature for managing@@ -261,7 +261,7 @@ the fields that would be useful to sync from your LDAP databases.### Multiple LDAP searches-To do the union of multiple LDAP searches, use `LDAPSearchUnion`. For example:+To do the union of multiple LDAP searches, use `LDAPSearchUnion`. For example:```pythonAUTH_LDAP_USER_SEARCH = LDAPSearchUnion(LDAPSearch("ou=users,dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)"),@@ -273,7 +273,7 @@ AUTH_LDAP_USER_SEARCH = LDAPSearchUnion(You can restrict access to your Zulip server to a set of LDAP groupsusing the `AUTH_LDAP_REQUIRE_GROUP` and `AUTH_LDAP_DENY_GROUP`-settings in `/etc/zulip/settings.py`. See the+settings in `/etc/zulip/settings.py`. See the[upstream django-auth-ldap documentation][upstream-ldap-groups] fordetails.@@ -284,7 +284,7 @@ details.If you're hosting multiple Zulip organizations, you can restrict whichusers have access to which organizations.This is done by setting `org_membership` in `AUTH_LDAP_USER_ATTR_MAP` to the name of-the LDAP attribute which will contain a list of subdomains that the+the LDAP attribute which will contain a list of subdomains that theuser should be allowed to access.For the root subdomain, `www` in the list will work, or any other of@@ -300,7 +300,7 @@ department: www```More complex access control rules are possible via the-`AUTH_LDAP_ADVANCED_REALM_ACCESS_CONTROL` setting. Note that+`AUTH_LDAP_ADVANCED_REALM_ACCESS_CONTROL` setting. Note that`org_membership` takes precedence over`AUTH_LDAP_ADVANCED_REALM_ACCESS_CONTROL`:@@ -308,7 +308,7 @@ More complex access control rules are possible via the2. If `org_membership` is not set or does not allow access,`AUTH_LDAP_ADVANCED_REALM_ACCESS_CONTROL` will control access.-This contains a map keyed by the organization's subdomain. The+This contains a map keyed by the organization's subdomain. Theorganization list with multiple maps, that contain a map with an attribute, and a requiredvalue for that attribute. If for any of the attribute maps, all user'sLDAP attributes match what is configured, access is granted.@@ -322,7 +322,7 @@ authentication backends that are enabled for the organization.### TroubleshootingMost issues with LDAP authentication are caused by misconfigurations of-the user and email search settings. Some things you can try to get to+the user and email search settings. Some things you can try to get tothe bottom of the problem:- Review the instructions for the LDAP configuration type you're@@ -331,7 +331,7 @@ the bottom of the problem:instructions for that configuration type.- Use the `manage.py query_ldap` tool to verify your configuration.The output of the command will usually indicate the cause of any- configuration problem. For the LDAP integration to work, this+ configuration problem. For the LDAP integration to work, thiscommand should be able to successfully fetch a complete, correct setof data for the queried user.- You can find LDAP-specific logs in `/var/log/zulip/ldap.log`. If@@ -342,7 +342,7 @@ the bottom of the problem:## SAMLZulip 2.1 and later supports SAML authentication, used by Okta,-OneLogin, and many other IdPs (identity providers). You can configure+OneLogin, and many other IdPs (identity providers). You can configureit as follows:1. These instructions assume you have an installed Zulip server; if@@ -363,12 +363,12 @@ it as follows:`/home/zulip/deployments/current/scripts/get-django-setting SOCIAL_AUTH_SAML_SP_ENTITY_ID`.- **SSO URL**:- `https://yourzulipdomain.example.com/complete/saml/`. This is+ `https://yourzulipdomain.example.com/complete/saml/`. This isthe "SAML ACS url" in SAML terminology.If you're[hosting multiple organizations](../production/multiple-organizations.html#authentication),- you need to use `SOCIAL_AUTH_SUBDOMAIN`. For example,+ you need to use `SOCIAL_AUTH_SUBDOMAIN`. For example,if `SOCIAL_AUTH_SUBDOMAIN="auth"` and `EXTERNAL_HOST=zulip.example.com`,this should be `https://auth.zulip.example.com/complete/saml/`.@@ -379,14 +379,14 @@ it as follows:organization name (`displayname` may appear in the IdP'sauthentication flow; `name` won't be displayed to humans).- Fill out `SOCIAL_AUTH_SAML_ENABLED_IDPS` with data provided by- your identity provider. You may find [the python-social-auth+ your identity provider. You may find [the python-social-authSAMLdocs](https://python-social-auth.readthedocs.io/en/latest/backends/saml.html)- helpful. You'll need to obtain several values from your IdP's+ helpful. You'll need to obtain several values from your IdP'smetadata and enter them on the right-hand side of thisPython dictionary:1. Set the outer `idp_name` key to be an identifier for your IdP,- e.g. `testshib` or `okta`. This field appears in URLs for+ e.g. `testshib` or `okta`. This field appears in URLs forparts of your Zulip server's SAML authentication flow.2. The IdP should provide the `url` and `entity_id` values.3. Save the `x509cert` value to a file; you'll use it in the@@ -394,7 +394,7 @@ it as follows:4. The values needed in the `attr_` fields are often configurablein your IdP's interface when setting up SAML authentication(referred to as "Attribute Statements" with Okta, or- "Attribute Mapping" with GSuite). You'll want to connect+ "Attribute Mapping" with GSuite). You'll want to connectthese so that Zulip gets the email address (used as a uniqueuser ID) and name for the user.5. The `display_name` and `display_icon` fields are used to@@ -402,13 +402,13 @@ it as follows:6. The `auto_signup` field determines how Zulip should handlelogin attempts by users who don't have an account yet.-1. Install the certificate(s) required for SAML authentication. You- will definitely need the public certificate of your IdP. Some IdP+1. Install the certificate(s) required for SAML authentication. You+ will definitely need the public certificate of your IdP. Some IdPproviders also support the Zulip server (Service Provider) having- a certificate used for encryption and signing. We detail these+ a certificate used for encryption and signing. We detail thesesteps as optional below, because they aren't required for basicsetup, and some IdPs like Okta don't fully support Service- Provider certificates. You should install them as follows:+ Provider certificates. You should install them as follows:1. On your Zulip server, `mkdir -p /etc/zulip/saml/idps/`2. Put the IDP public certificate in `/etc/zulip/saml/idps/{idp_name}.crt`@@ -433,7 +433,7 @@ it as follows:certificates above, you can enable the additional setting`"authnRequestsSigned": True` in `SOCIAL_AUTH_SAML_SECURITY_CONFIG`to have the SAMLRequests the server will be issuing to the IdP- signed using those certificates. Additionally, if the IdP supports+ signed using those certificates. Additionally, if the IdP supportsit, you can upload the public certificate to enable encryption ofassertions in the SAMLResponses the IdP will send aboutauthenticated users.@@ -461,7 +461,7 @@ it as follows:consider this [a bug](https://github.com/zulip/zulip/issues/18746).1. [Restart the Zulip server](../production/settings.md) to ensure-your settings changes take effect. The Zulip login page should now+your settings changes take effect. The Zulip login page should nowhave a button for SAML authentication that you can use to log in orcreate an account (including when creating a new organization).@@ -476,7 +476,7 @@ IdP.The above configuration is sufficient for Service Provider initializedSSO, i.e. you can visit the Zulip web app and click "Sign in with-{IdP}" and it'll correctly start the authentication flow. If you are+{IdP}" and it'll correctly start the authentication flow. If you arenot hosting multiple organizations, with Zulip 3.0+, the aboveconfiguration is also sufficient for Identity Provider initiated SSO,i.e. clicking a "Sign in to Zulip" button on the IdP's website can@@ -487,7 +487,7 @@ If you're hosting multiple organizations and thus using the`RelayState` in your IdP of the form`{"subdomain": "yourzuliporganization"}` to let Zulip know whichorganization to authenticate the user to when they visit your SSO URL-from the IdP. (If the organization is on the root domain, use the+from the IdP. (If the organization is on the root domain, use theempty string: `{"subdomain": ""}`.).### Restricting access to specific organizations@@ -548,7 +548,7 @@ straightforward way to deploy that SSO solution with Zulip.4. To configure our SSO integration, edit a copy of`/etc/apache2/sites-available/zulip-sso.example`, saving the result- as `/etc/apache2/sites-available/zulip-sso.conf`. The example sets+ as `/etc/apache2/sites-available/zulip-sso.conf`. The example setsup HTTP basic auth, with an `htpasswd` file; you'll want to replacethat with configuration for your SSO solution to authenticate theuser and set `REMOTE_USER`.@@ -556,7 +556,7 @@ straightforward way to deploy that SSO solution with Zulip.For testing, you may want to move ahead with the rest of the setupusing the `htpasswd` example configuration and demonstrate thatworking end-to-end, before returning later to configure your SSO- solution. You can do that with the following steps:+ solution. You can do that with the following steps:```bash/home/zulip/deployments/current/scripts/restart-servercd /etc/apache2/sites-available/@@ -566,7 +566,7 @@ straightforward way to deploy that SSO solution with Zulip.5. Run `a2ensite zulip-sso` to enable the SSO integration within Apache.-6. Run `service apache2 reload` to use your new configuration. If+6. Run `service apache2 reload` to use your new configuration. IfApache isn't already running, you may need to run`service apache2 start` instead.@@ -576,7 +576,7 @@ at `https://zulip.example.com/`) and log in via the SSO solution.### Troubleshooting Apache-based SSOMost issues with this setup tend to be subtle issues with the-hostname/DNS side of the configuration. Suggestions for how to+hostname/DNS side of the configuration. Suggestions for how toimprove this SSO setup documentation are very welcome!- For example, common issues have to do with `/etc/hosts` not mapping@@ -609,7 +609,7 @@ to debug.- Since you've configured `/etc/zulip/settings.py` to only define the`zproject.backends.ZulipRemoteUserBackend`,`zproject/computed_settings.py` configures `/accounts/login/sso/` as- `HOME_NOT_LOGGED_IN`. This makes `https://zulip.example.com/`+ `HOME_NOT_LOGGED_IN`. This makes `https://zulip.example.com/`(a.k.a. the homepage for the main Zulip Django app running behindnginx) redirect to `/accounts/login/sso/` for a user that isn'tlogged in.@@ -621,14 +621,14 @@ to debug.- The Apache `zulip-sso` site which you've enabled listens on`localhost:8888` and (in the example config) presents the `htpasswd`- dialogue. (In a real configuration, it takes the user through- whatever more complex interaction your SSO solution performs.) The+ dialogue. (In a real configuration, it takes the user through+ whatever more complex interaction your SSO solution performs.) Theuser provides correct login information, and the request reaches asecond Zulip Django app instance, running behind Apache, with- `REMOTE_USER` set. That request is served by+ `REMOTE_USER` set. That request is served by`zerver.views.remote_user_sso`, which just checks the `REMOTE_USER`variable and either logs the user in or, if they don't have an- account already, registers them. The login sets a cookie.+ account already, registers them. The login sets a cookie.- After succeeding, that redirects the user back to `/` on port 443.This request is sent by nginx to the main Zulip Django app, which@@ -638,7 +638,7 @@ to debug.## Sign in with AppleZulip supports using the web flow for Sign in with Apple on-self-hosted servers. To do so, you'll need to do the following:+self-hosted servers. To do so, you'll need to do the following:1. Visit [the Apple Developer site][apple-developer] and [Create aServices ID.][apple-create-services-id]. When prompted for a "Return@@ -648,7 +648,7 @@ domain for your server).1. Create a [Sign in with Apple private key][apple-create-private-key].1. Store the resulting private key at- `/etc/zulip/apple-auth-key.p8`. Be sure to set+ `/etc/zulip/apple-auth-key.p8`. Be sure to setpermissions correctly:```bash@@ -665,16 +665,16 @@ domain for your server).app that you used in step 1 to configure your Services ID.This might look like "com.example.app".- `SOCIAL_AUTH_APPLE_KEY`: Despite the name this is not a key, but- rather the Key ID of the key you created in step 2. This looks+ rather the Key ID of the key you created in step 2. This lookslike "F6G7H8I9J0".- `AUTHENTICATION_BACKENDS`: Uncomment (or add) a line like`'zproject.backends.AppleAuthBackend',` to enable Apple authusing the created configuration.1. Register with Apple the email addresses or domains your Zulip- server sends email to users from. For instructions and background,+ server sends email to users from. For instructions and background,see the "Email Relay Service" subsection of- [this page][apple-get-started]. For details on what email+ [this page][apple-get-started]. For details on what emailaddresses Zulip sends from, see our[outgoing email documentation][outgoing-email].@@ -687,7 +687,7 @@ domain for your server).## OpenID ConnectStarting with Zulip 5.0, Zulip can be integrated with any OpenID-Connect (OIDC) authentication provider. You can configure it by+Connect (OIDC) authentication provider. You can configure it byenabling `zproject.backends.GenericOpenIdConnectBackend` in`AUTHENTICATION_BACKENDS` and following the steps outlined in thecomment documentation in `/etc/zulip/settings.py`.@@ -722,7 +722,7 @@ bit of code, and pull requests to add new backends are welcome.For example, the[Azure Active Directory integration](https://github.com/zulip/zulip/commit/49dbd85a8985b12666087f9ea36acb6f7da0aa4f)was about 30 lines of code, plus some documentation and an-[automatically generated migration][schema-migrations]. We also have+[automatically generated migration][schema-migrations]. We also havehelpful developer documentation on[testing auth backends](../development/authentication.md).@@ -732,7 +732,7 @@ helpful developer documentation on## Development onlyThe `DevAuthBackend` method is used only in development, to allow-passwordless login as any user in a development environment. It's+passwordless login as any user in a development environment. It'smentioned on this page only for completeness.[custom-profile-fields]: https://zulip.com/help/add-custom-profile-fieldsdiff --git a/docs/production/deployment.md b/docs/production/deployment.mdindex 68ded967f01..18306d160ad 100644--- a/docs/production/deployment.md+++ b/docs/production/deployment.md@@ -4,7 +4,7 @@ The default Zulip installation instructions will install a completeZulip server, with all of the services it needs, on a single machine.For production deployment, however, it's common to want to do-something more complicated. This page documents the options for doing so.+something more complicated. This page documents the options for doing so.## Installing Zulip from Git@@ -23,7 +23,7 @@ You can also [upgrade Zulip from Git](../production/upgrade-or-modify.html#upgraThe most common use case for this is upgrading to `main` to get afeature that hasn't made it into an official release yet (often-support for a new base OS release). See [upgrading to+support for a new base OS release). See [upgrading tomain][upgrade-to-main] for notes on how `main` works and thesupport story for it, and [upgrading to futurereleases][upgrade-to-future-release] for notes on upgrading Zulip@@ -39,7 +39,7 @@ our next major release has a reliable install experience.## Zulip in DockerZulip has an officially supported, experimental-[docker image](https://github.com/zulip/docker-zulip). Please note+[docker image](https://github.com/zulip/docker-zulip). Please notethat Zulip's [normal installer](../production/install.md) has beenextremely reliable for years, whereas the Docker image is new and hasrough edges, so we recommend the normal installer unless you have a@@ -52,7 +52,7 @@ as well as those mentioned in the[install](../production/install.html#installer-options) documentation:- `--postgresql-version`: Sets the version of PostgreSQL that will be- installed. We currently support PostgreSQL 10, 11, 12, and 13.+ installed. We currently support PostgreSQL 10, 11, 12, and 13.- `--postgresql-database-name=exampledbname`: With this option, youcan customize the default database name. If you do not set this. The@@ -108,11 +108,11 @@ env PUPPET_CLASSES=zulip::profile::redis ./scripts/setup/install```All puppet modules under `zulip::profile` are allowed to be configured-stand-alone on a host. You can see most likely manifests you might+stand-alone on a host. You can see most likely manifests you mightwant to choose in the list of includes in [the main manifest for thedefault all-in-one Zulip server][standalone.pp], though it's alsopossible to subclass some of the lower-level manifests defined in that-directory if you want to customize. A good example of doing this is+directory if you want to customize. A good example of doing this isin the [zulip_ops Puppet configuration][zulipchat-puppet] that we useas part of managing chat.zulip.org and zulip.com.@@ -133,7 +133,7 @@ below.#### Step 1: Set up ZulipFollow the [standard instructions](../production/install.md), with one-change. When running the installer, pass the `--no-init-db`+change. When running the installer, pass the `--no-init-db`flag, e.g.:```bash@@ -174,7 +174,7 @@ database provider for the available options.In `/etc/zulip/settings.py` on your Zulip server, configure thefollowing settings with details for how to connect to your PostgreSQL-server. Your database provider should provide these details.+server. Your database provider should provide these details.- `REMOTE_POSTGRES_HOST`: Name or IP address of the PostgreSQL server.- `REMOTE_POSTGRES_PORT`: Port on the PostgreSQL server.@@ -214,7 +214,7 @@ configure that as follows:```1. As root, run- `/home/zulip/deployments/current/scripts/zulip-puppet-apply`. This+ `/home/zulip/deployments/current/scripts/zulip-puppet-apply`. Thiswill convert Zulip's main `nginx` configuration file to use your newport.@@ -228,14 +228,14 @@ behind reverse proxies.Zulip supports routing all of its outgoing HTTP and HTTPS trafficthrough an HTTP `CONNECT` proxy, such as [Smokescreen][smokescreen];this includes outgoing webhooks, image and website previews, and-mobile push notifications. You may wish to enable this feature to+mobile push notifications. You may wish to enable this feature toprovide a consistent egress point, or enforce access control on URLsto prevent [SSRF][ssrf] against internal resources.To use Smokescreen:1. Add `, zulip::profile::smokescreen` to the list of `puppet_classes`- in `/etc/zulip/zulip.conf`. A typical value after this change is:+ in `/etc/zulip/zulip.conf`. A typical value after this change is:```inipuppet_classes = zulip::profile::standalone, zulip::profile::smokescreen```@@ -255,12 +255,12 @@ To use Smokescreen:```1. If you intend to also make the Smokescreen install available to- other hosts, set `listen_address` in the same block. Note that you+ other hosts, set `listen_address` in the same block. Note that youmust control access to the Smokescreen port if you do this, asfailing to do so opens a public HTTP proxy!1. As root, run- `/home/zulip/deployments/current/scripts/zulip-puppet-apply`. This+ `/home/zulip/deployments/current/scripts/zulip-puppet-apply`. Thiswill compile and install Smokescreen, reconfigure services to useit, and restart Zulip.@@ -303,7 +303,7 @@ HTTP as follows:```1. As root, run-`/home/zulip/deployments/current/scripts/zulip-puppet-apply`. This+`/home/zulip/deployments/current/scripts/zulip-puppet-apply`. Thiswill convert Zulip's main `nginx` configuration file to allow HTTPinstead of HTTPS.@@ -313,12 +313,12 @@ instead of HTTPS.### nginx configurationFor `nginx` configuration, there's two things you need to set up:-- The root `nginx.conf` file. We recommend using+- The root `nginx.conf` file. We recommend using`/etc/nginx/nginx.conf` from your Zulip server for our recommended- settings. E.g. if you don't set `client_max_body_size`, it won't be+ settings. E.g. if you don't set `client_max_body_size`, it won't bepossible to upload large files to your Zulip server.- The `nginx` site-specific configuration (in- `/etc/nginx/sites-available`) for the Zulip app. The following+ `/etc/nginx/sites-available`) for the Zulip app. The followingexample is a good starting point:```nginx@@ -368,7 +368,7 @@ make the following changes in two configuration files.3. Restart your Zulip server with `/home/zulip/deployments/current/scripts/restart-server`.4. Create an Apache2 virtual host configuration file, similar to the- following. Place it the appropriate path for your Apache2+ following. Place it the appropriate path for your Apache2installation and enable it (E.g. if you use Debian or Ubuntu, thenplace it in `/etc/apache2/sites-available/zulip.example.com.conf`and then run@@ -434,28 +434,28 @@ things you need to be careful about when configuring it:1. Configure your reverse proxy (or proxies) to correctly maintain the`X-Forwarded-For` HTTP header, which is supposed to contain the series-of IP addresses the request was forwarded through. You can verify+of IP addresses the request was forwarded through. You can verifyyour work by looking at `/var/log/zulip/server.log` and checking ithas the actual IP addresses of clients, not the IP address of theproxy server.2. Ensure your proxy doesn't interfere with Zulip's use oflong-polling for real-time push from the server to your users'-browsers. This [nginx code snippet][nginx-proxy-longpolling-config]+browsers. This [nginx code snippet][nginx-proxy-longpolling-config]does this.The key configuration options are, for the `/json/events` and`/api/1/events` endpoints:-- `proxy_read_timeout 1200;`. It's critical that this be+- `proxy_read_timeout 1200;`. It's critical that this besignificantly above 60s, but the precise value isn't important.-- `proxy_buffering off`. If you don't do this, your `nginx` proxy may+- `proxy_buffering off`. If you don't do this, your `nginx` proxy mayreturn occasional 502 errors to clients using Zulip's events API.3. The other tricky failure mode we've seen with `nginx` reverseproxies is that they can load-balance between the IPv4 and IPv6-addresses for a given hostname. This can result in mysterious errors-that can be quite difficult to debug. Be sure to declare your+addresses for a given hostname. This can result in mysterious errors+that can be quite difficult to debug. Be sure to declare your`upstreams` equivalent in a way that won't do load-balancingunexpectedly (e.g. pointing to a DNS name that you haven't configuredwith multiple IPs for your Zulip machine; sometimes this happens with@@ -466,7 +466,7 @@ IPv6 configuration).The file `/etc/zulip/zulip.conf` is used to configure properties ofthe system and deployment; `/etc/zulip/settings.py` is used to-configure the application itself. The `zulip.conf` sections and+configure the application itself. The `zulip.conf` sections andsettings are described below.### `[machine]`@@ -501,11 +501,11 @@ extension](../subsystems/full-text-search.html#multi-language-full-text-search).#### `deploy_options`Options passed by `upgrade-zulip` and `upgrade-zulip-from-git` into-`upgrade-zulip-stage-2`. These might be any of:+`upgrade-zulip-stage-2`. These might be any of:- - **`--skip-puppet`** skips doing Puppet/apt upgrades. The user will need+ - **`--skip-puppet`** skips doing Puppet/apt upgrades. The user will needto run `zulip-puppet-apply` manually after the upgrade.- - **`--skip-migrations`** skips running database migrations. The+ - **`--skip-migrations`** skips running database migrations. Theuser will need to run `./manage.py migrate` manually after the upgrade.- **`--skip-purge-old-deployments`** skips purging old deployments;without it, only deployments with the last two weeks are kept.@@ -552,7 +552,7 @@ mode). The calculation is based on whether the system has enoughmemory (currently 3.5GiB) to run a single-server Zulip installation inthe multiprocess mode.-Set to `true` or `false` to override the automatic calculation. This+Set to `true` or `false` to override the automatic calculation. Thisoverride is useful both Docker systems (where the above algorithmmight see the host's memory, not the container's) and/or when usingremote servers for postgres, memcached, redis, and RabbitMQ.@@ -577,7 +577,7 @@ more than 3.5GiB of RAM, 4 on hosts with less.#### `auto_renew`If set to the string `yes`, [Certbot will attempt to automatically-renew its certificate](../production/ssl-certificates.html#certbot-recommended). Do+renew its certificate](../production/ssl-certificates.html#certbot-recommended). Dono set by hand; use `scripts/setup/setup-certbot` to configure this.@@ -629,7 +629,7 @@ connections.#### `version`-The version of PostgreSQL that is in use. Do not set by hand; use the+The version of PostgreSQL that is in use. Do not set by hand; use the[PostgreSQL upgrade tool](../production/upgrade-or-modify.html#upgrading-postgresql).diff --git a/docs/production/email-gateway.md b/docs/production/email-gateway.mdindex af6b14329d3..fd479faccfb 100644--- a/docs/production/email-gateway.md+++ b/docs/production/email-gateway.md@@ -1,19 +1,19 @@# Incoming email integrationZulip's incoming email gateway integration makes it possible to send-messages into Zulip by sending an email. It's highly recommended+messages into Zulip by sending an email. It's highly recommendedbecause it enables:- When users reply to one of Zulip's message notification emailsfrom their email client, the reply can go directlyinto Zulip.- Integrating third-party services that can send email notifications- into Zulip. See the [integration+ into Zulip. See the [integrationdocumentation](https://zulip.com/integrations/doc/email) fordetails.Once this integration is configured, each stream will have a special-email address displayed on the stream settings page. Emails sent to+email address displayed on the stream settings page. Emails sent tothat address will be delivered into the stream.There are two ways to configure Zulip's email gateway:@@ -24,7 +24,7 @@ There are two ways to configure Zulip's email gateway:inbox (`[email protected]`) every minute for new emails.The local delivery configuration is preferred for production because-it supports nicer looking email addresses and has no cron delay. The+it supports nicer looking email addresses and has no cron delay. Thepolling option is convenient for testing/developing this featurebecause it doesn't require a public IP address or setting up MXrecords in DNS.@@ -45,7 +45,7 @@ integration; you just need to enable and configure it as follows.The main decision you need to make is what email domain you want touse for the gateway; for this discussion we'll use-`emaildomain.example.com`. The email addresses used by the gateway+`emaildomain.example.com`. The email addresses used by the gatewaywill look like `[email protected]`, so we recommend using`EXTERNAL_HOST` here.@@ -55,7 +55,7 @@ using an [HTTP reverse proxy][reverse-proxy]).1. Using your DNS provider, create a DNS MX (mail exchange) recordconfiguring email for `emaildomain.example.com` to be processed by- `hostname.example.com`. You can check your work using this command:+ `hostname.example.com`. You can check your work using this command:```console$ dig +short emaildomain.example.com -t MX@@ -65,7 +65,7 @@ using an [HTTP reverse proxy][reverse-proxy]).1. Log in to your Zulip server; the remaining steps all happen there.1. Add `, zulip::postfix_localmail` to `puppet_classes` in- `/etc/zulip/zulip.conf`. A typical value after this change is:+ `/etc/zulip/zulip.conf`. A typical value after this change is:```inipuppet_classes = zulip::profile::standalone, zulip::postfix_localmail```@@ -93,15 +93,15 @@ using an [HTTP reverse proxy][reverse-proxy]).1. Restart your Zulip server with`/home/zulip/deployments/current/scripts/restart-server`.-Congratulations! The integration should be fully operational.+Congratulations! The integration should be fully operational.[reverse-proxy]: ../production/deployment.html#putting-the-zulip-application-behind-a-reverse-proxy## Polling setup1. Create an email account dedicated to Zulip's email gateway- messages. We assume the address is of the form- `[email protected]`. The email provider needs to support the+ messages. We assume the address is of the form+ `[email protected]`. The email provider needs to support thestandard model of delivering emails sent to`[email protected]` to the `[email protected]` inbox.@@ -122,4 +122,4 @@ Congratulations! The integration should be fully operational.sudo cp puppet/zulip/files/cron.d/email-mirror /etc/cron.d/```-Congratulations! The integration should be fully operational.+Congratulations! The integration should be fully operational.diff --git a/docs/production/email.md b/docs/production/email.mdindex a56a0da1d49..26b08d03ec8 100644--- a/docs/production/email.md+++ b/docs/production/email.md@@ -6,13 +6,13 @@ email addresses and send notifications.## How to configure1. Identify an outgoing email (SMTP) account where you can have Zulip- send mail. If you don't already have one you want to use, see+ send mail. If you don't already have one you want to use, see[Email services](#email-services) below.1. Fill out the section of `/etc/zulip/settings.py` headed "Outgoing- email (SMTP) settings". This includes the hostname and typically+ email (SMTP) settings". This includes the hostname and typicallythe port to reach your SMTP provider, and the username to log in to- it. You'll also want to fill out the noreply email section.+ it. You'll also want to fill out the noreply email section.1. Put the password for the SMTP user account in`/etc/zulip/zulip-secrets.conf` by setting `email_password`. For@@ -57,7 +57,7 @@ the best documentation).If you don't have an existing outgoing SMTP provider, don't worry!Each of the options we recommend above (as well as dozens of other-services) have free options. Once you've signed up, you'll want to+services) have free options. Once you've signed up, you'll want tofind the service's provided "SMTP credentials", and configure Zulip asfollows:@@ -88,7 +88,7 @@ EMAIL_HOST_USER = ""We should emphasize that because modern spam filtering is veryaggressive, you should make sure your downstream email system isconfigured to properly sign outgoing email sent by your Zulip server-(or check your spam folder) when using this configuration. See+(or check your spam folder) when using this configuration. See[documentation on using Django with a local postfix server][postfix-email]for additional advice.@@ -97,7 +97,7 @@ for additional advice.### Using Gmail for outgoing emailWe don't recommend using an inbox product like Gmail for outgoing-email, because Gmail's anti-spam measures make this annoying. But if+email, because Gmail's anti-spam measures make this annoying. But ifyou want to use a Gmail account to send outgoing email anyway, here'show to make it work:- Create a totally new Gmail account for your Zulip server; you don't@@ -111,13 +111,13 @@ how to make it work:Gmail doesn't allow servers to send outgoing email by default.- Note also that the rate limits for Gmail are also quite low(e.g. 100 / day), so it's easy to get rate-limited if your server- has significant traffic. For more active servers, we recommend+ has significant traffic. For more active servers, we recommendmoving to a free account on a transactional email service.### Logging outgoing email to a file for prototypingFor prototyping, you might want to proceed without setting up an email-provider. If you want to see the emails Zulip would have sent, you+provider. If you want to see the emails Zulip would have sent, youcan log them to a file instead.To do so, add these lines to `/etc/zulip/settings.py`:@@ -142,14 +142,14 @@ su zulip -c '/home/zulip/deployments/current/manage.py send_test_email user@exam```If it doesn't throw an error, it probably worked; you can confirm by-checking your email. You should get two emails: One sent by the+checking your email. You should get two emails: One sent by thedefault From address for your Zulip server, and one sent by the"noreply" From address.If it doesn't work, check these common failure causes:- Your hosting provider may block outgoing SMTP traffic in its default- firewall rules. Check whether the port `EMAIL_PORT` is blocked in+ firewall rules. Check whether the port `EMAIL_PORT` is blocked inyour hosting provider's firewall.- Your SMTP server's permissions might not allow the email account@@ -162,11 +162,11 @@ If it doesn't work, check these common failure causes:If necessary, you can set `ADD_TOKENS_TO_NOREPLY_ADDRESS` to `False`in `/etc/zulip/settings.py` (which will cause these confirmation- emails to be sent from a consistent `noreply@` address). Disabling+ emails to be sent from a consistent `noreply@` address). Disabling`ADD_TOKENS_TO_NOREPLY_ADDRESS` is generally safe if you are notusing Zulip's feature that allows anyone to create an account inyour Zulip organization if they have access to an email address in a- certain domain. See [this article][helpdesk-attack] for details on+ certain domain. See [this article][helpdesk-attack] for details onthe security issue with helpdesk software that`ADD_TOKENS_TO_NOREPLY_ADDRESS` helps protect against.@@ -192,7 +192,7 @@ aren't receiving emails from Zulip:- Starting with Zulip 1.7, Zulip logs an entry in`/var/log/zulip/send_email.log` whenever it attempts to send an- email. The log entry includes whether the request succeeded or failed.+ email. The log entry includes whether the request succeeded or failed.- If attempting to send an email throws an exception, a tracebackshould be in `/var/log/zulip/errors.log`, along with any other@@ -205,14 +205,14 @@ aren't receiving emails from Zulip:- Zulip's email sending configuration is based on the standard Django[SMTP backend](https://docs.djangoproject.com/en/2.0/topics/email/#smtp-backend)- configuration. So if you're having trouble getting your email+ configuration. So if you're having trouble getting your emailprovider working, you may want to search for documentation relatedto using your email provider with Django.The one thing we've changed from the Django defaults is that we readthe email password from the `email_password` entry in the Zulipsecrets file, as part of our policy of not having any secret- information in the `/etc/zulip/settings.py` file. In other words,+ information in the `/etc/zulip/settings.py` file. In other words,if Django documentation references setting `EMAIL_HOST_PASSWORD`,you should instead set `email_password` in`/etc/zulip/zulip-secrets.conf`.diff --git a/docs/production/expensive-migrations.md b/docs/production/expensive-migrations.mdindex 822cfc3ac24..d8587a4e0f4 100644--- a/docs/production/expensive-migrations.md+++ b/docs/production/expensive-migrations.md@@ -8,14 +8,14 @@ Zulip 1.7 and 1.9 each contain some significant database migrationsthat can take several minutes to run.The upgrade process automatically minimizes disruption by running-these first, before beginning the user-facing downtime. However, if+these first, before beginning the user-facing downtime. However, ifyou'd like to watch the downtime phase of the upgrade closely, youcan run them manually before starting the upgrade:1. Log in to your Zulip server as the `zulip` user (or as `root` andthen run `su zulip` to drop privileges), and`cd /home/zulip/deployments/current`-2. Run `./manage.py dbshell`. This will open a shell connected to the+2. Run `./manage.py dbshell`. This will open a shell connected to thePostgreSQL database.3. In the PostgreSQL shell, run the following commands:@@ -61,12 +61,12 @@ can run them manually before starting the upgrade:```These will take some time to run, during which the server will-continue to serve user traffic as usual with no disruption. Once they+continue to serve user traffic as usual with no disruption. Once theyfinish, you can proceed with installing Zulip 1.7.To help you estimate how long these will take on your server: countthe number of UserMessage rows, with `select COUNT(*) from zerver_usermessage;`-at the `./manage.py dbshell` prompt. At the time these migrations+at the `./manage.py dbshell` prompt. At the time these migrationswere run on chat.zulip.org, it had 75M UserMessage rows; the first 5indexes took about 1 minute each to create, and the final,"unread_message" index took more like 10 minutes.diff --git a/docs/production/export-and-import.md b/docs/production/export-and-import.mdindex 72f0685322f..d78aae7ef6a 100644--- a/docs/production/export-and-import.md+++ b/docs/production/export-and-import.md@@ -7,7 +7,7 @@ service (or back):- The [Backup](#backups) tool is designed for exact restoration of aZulip server's state, for disaster recovery, testing with production- data, or hardware migration. This tool has a few limitations:+ data, or hardware migration. This tool has a few limitations:- Backups must be restored on a server running the same Zulipversion (most precisely, one where `manage.py showmigrations` has@@ -20,13 +20,13 @@ service (or back):We highly recommend this tool in situations where it is applicable,because it is highly optimized and highly stable, since the hard- work is done by the built-in backup feature of PostgreSQL. We also+ work is done by the built-in backup feature of PostgreSQL. We alsodocument [backup details](#backup-details) for users managingbackups manually.- The logical [Data export](#data-export) tool is designed formigrating data between Zulip Cloud and other Zulip servers, as well- as various auditing purposes. The logical export tool produces a+ as various auditing purposes. The logical export tool produces a`.tar.gz` archive with most of the Zulip database data encoded inJSON files–a format shared by our [dataimport](#import-into-a-new-zulip-server) tools for third-party@@ -34,10 +34,10 @@ service (or back):[Slack](https://zulip.com/help/import-from-slack).Like the backup tool, logical data exports must be imported on a- Zulip server running the same version. However, logical data+ Zulip server running the same version. However, logical dataexports can be imported on Zulip servers running a differentPostgreSQL version or hosting a different set of Zulip- organizations. We recommend this tool in cases where the backup+ organizations. We recommend this tool in cases where the backuptool isn't applicable, including situations where an easilymachine-parsable export format is desired.@@ -66,9 +66,9 @@ su zulip -c '/home/zulip/deployments/current/manage.py backup'The backup tool provides the following options:- `--output=/tmp/backup.tar.gz`: Filename to write the backup tarball- to (default: write to a file in `/tmp`). On success, the+ to (default: write to a file in `/tmp`). On success, theconsole output will show the path to the output tarball.-- `--skip-db`: Skip backup of the database. Useful if you're using a+- `--skip-db`: Skip backup of the database. Useful if you're using aremote PostgreSQL host with its own backup system and just need toback up non-database state.- `--skip-uploads`: If `LOCAL_UPLOADS_DIR` is set, user-uploaded files@@ -82,7 +82,7 @@ server's state on another machine perfectly.First, [install a new Zulip server through Step 3][install-server]with the same version of both the base OS and Zulip from your previous-installation. Then, run as root:+installation. Then, run as root:```bash/home/zulip/deployments/current/scripts/setup/restore-backup /path/to/backup@@ -109,7 +109,7 @@ errors when trying to access it via `zuliptest.example.com`.If you're not sure what versions were in use when a given backup wascreated, you can get that information via the files in the backup-tarball: `postgres-version`, `os-version`, and `zulip-version`. The+tarball: `postgres-version`, `os-version`, and `zulip-version`. Thefollowing command may be useful for viewing these files withoutextracting the entire archive.@@ -128,27 +128,27 @@ server, including the database, settings, secrets fromThe following data is not included in these backup archives,and you may want to back up separately:-- The server access/error logs from `/var/log/zulip`. The Zulip+- The server access/error logs from `/var/log/zulip`. The Zulipserver only appends to logs, and they can be very large compared tothe rest of the data for a Zulip server.- Files uploaded with the Zulip- [S3 file upload backend](../production/upload-backends.md). We+ [S3 file upload backend](../production/upload-backends.md). Wedon't include these for two reasons. First, the uploaded file datain S3 can easily be many times larger than the rest of the backup,and downloading it all to a server doing a backup could easily- exceed its disk capacity. Additionally, S3 is a reliable persistent+ exceed its disk capacity. Additionally, S3 is a reliable persistentstorage system with its own high-quality tools for doing backups.-- SSL certificates. These are not included because they are+- SSL certificates. These are not included because they areparticularly security-sensitive and are either trivially replaced(if generated via Certbot) or provided by the system administrator.For completeness, Zulip's backups do not include certain highly-transient state that Zulip doesn't store in a database. For example,+transient state that Zulip doesn't store in a database. For example,typing status data, API rate-limiting counters, and RabbitMQ queuesthat are essentially always empty in a healthy server (like outgoing-emails to send). You can check whether these queues are empty using+emails to send). You can check whether these queues are empty using`rabbitmqctl list_queues`.#### Backup details@@ -156,14 +156,14 @@ emails to send). You can check whether these queues are empty usingThis section is primarily for users managing backups themselves(E.g. if they're using a remote PostgreSQL database with an existingbackup strategy), and also serves as documentation for what is-included in the backups generated by Zulip's standard tools. The+included in the backups generated by Zulip's standard tools. Thedata includes:-- The PostgreSQL database. You can back this up with any standard-database export or backup tool. Zulip has built-in support for taking+- The PostgreSQL database. You can back this up with any standard+database export or backup tool. Zulip has built-in support for takingdaily incremental backups using[wal-g](https://github.com/wal-g/wal-g); these backups are stored for-30 days in S3. If you have an Amazon S3 bucket you wish to store for+30 days in S3. If you have an Amazon S3 bucket you wish to store forstoring the backups, edit `/etc/zulip/zulip-secrets.conf` on thePostgreSQL server to add:@@ -174,12 +174,12 @@ PostgreSQL server to add:```After adding the secrets, run- `/home/zulip/deployments/current/scripts/zulip-puppet-apply`. You+ `/home/zulip/deployments/current/scripts/zulip-puppet-apply`. Youcan (and should) monitor that backups are running regularly viathe Nagios plugin installed into`/usr/lib/nagios/plugins/zulip_postgresql_backups/check_postgresql_backup`.-- Any user-uploaded files. If you're using S3 as storage for file+- Any user-uploaded files. If you're using S3 as storage for fileuploads, this is backed up in S3. But if you have instead set`LOCAL_UPLOADS_DIR`, any files uploaded by users (including avatars)will be stored in that directory and you'll want to back it up.@@ -237,7 +237,7 @@ replication. You can see the configuration in these files:- `puppet/zulip_ops/files/postgresql/*`We use this configuration for Zulip Cloud, and it works well in-production, but it's not fully generic. Contributions to make it a+production, but it's not fully generic. Contributions to make it asupported and documented option for other installations areappreciated.@@ -254,16 +254,16 @@ backups.### Preventing changes during the exportFor best results, you'll want to shut down access to the organization-before exporting; so that nobody can send new messages (etc.) while-you're exporting data. There are two ways to do this:+before exporting; so that nobody can send new messages (etc.) while+you're exporting data. There are two ways to do this:-1. `./scripts/stop-server`, which stops the whole server. This is+1. `./scripts/stop-server`, which stops the whole server. This ispreferred if you're not hosting multiple organizations, because it hasno side effects other than disabling the Zulip server for theduration.1. Pass `--deactivate` to `./manage export`, which first deactivatesthe target organization, logging out all active login sessions and-preventing all accounts from logging in or accessing the API. This is+preventing all accounts from logging in or accessing the API. This ispreferred for environments like Zulip Cloud where you might want toexport a single organization without disrupting any other users, andthe intent is to move hosting of the organization (and forcing users@@ -271,7 +271,7 @@ to re-log in would be required as part of the hosting migrationanyway).We include both options in the instructions below, commented out so-that neither runs (using the `# ` at the start of the lines). If+that neither runs (using the `# ` at the start of the lines). Ifyou'd like to use one of these options, remove the `# ` at the startof the lines for the appropriate option.@@ -291,7 +291,7 @@ cd /home/zulip/deployments/currentthe default organization hosted at the Zulip server's root domain.)This will generate a tarred archive with a name like-`/tmp/zulip-export-zcmpxfm6.tar.gz`. The archive contains several+`/tmp/zulip-export-zcmpxfm6.tar.gz`. The archive contains severalJSON files (containing the Zulip organization's data) as well as anarchive of all the organization's uploaded files.@@ -323,25 +323,25 @@ archive of all the organization's uploaded files.2. If your new Zulip server is meant to fully replace a previous Zulipserver, you may want to copy some settings from `/etc/zulip` to yournew server to reuse the server-level configuration and secret keys-from your old server. There are a few important details to understand+from your old server. There are a few important details to understandabout doing so:- Copying `/etc/zulip/settings.py` and `/etc/zulip/zulip.conf` is- safe and recommended. Care is required when copying secrets from+ safe and recommended. Care is required when copying secrets from`/etc/zulip/zulip-secrets.conf` (details below).- If you copy `zulip_org_id` and `zulip_org_key` (the credentialsfor the [mobile push notificationsservice](../production/mobile-push-notifications.md)), you shouldbe very careful to make sure the no users had their IDsrenumbered during the import process (this can be checked using- `manage.py shell` with some care). The push notifications+ `manage.py shell` with some care). The push notificationsservice has a mapping of which `user_id` values are associatedwith which devices for a given Zulip server (represented by the- `zulip_org_id` registration). This means that if any `user_id`+ `zulip_org_id` registration). This means that if any `user_id`values were renumbered during the import and you don't register anew `zulip_org_id`, push notifications meant for the user who nowhas ID 15 may be sent to devices registered by the user who had- user ID 15 before the data export (yikes!). The solution is+ user ID 15 before the data export (yikes!). The solution issimply to not copy these settings and re-register your server formobile push notifications if any users had their IDs renumberedduring the logical export/import process.@@ -354,7 +354,7 @@ about doing so:authentication and email delivery so that those work on your newserver.- Copying `avatar_salt` is not recommended, due to similar issues- to the mobile push notifications service. Zulip will+ to the mobile push notifications service. Zulip willautomatically rewrite avatars at URLs appropriate for the newuser IDs, and using the same avatar salt (and same server URL)post import could result in issues with browsers caching the@@ -400,7 +400,7 @@ Your users will need to either authenticate using something likeGoogle auth or start by resetting their passwords.You can use the `./manage.py send_password_reset_email` command to-send password reset emails to your users. We+send password reset emails to your users. Werecommend starting with sending one to yourself for testing:```bash@@ -418,7 +418,7 @@ and then once you're ready, you can email them to everyone using e.g.If you did a test import of a Zulip organization, you may want todelete the test import data from your Zulip server before doing a-final import. You can **permanently delete** all data from a Zulip+final import. You can **permanently delete** all data from a Zuliporganization using the following procedure:- Start a [Zulip management shell](../production/management-commands.html#manage-py-shell)diff --git a/docs/production/giphy-gif-integration.md b/docs/production/giphy-gif-integration.mdindex a1f12c8a30e..55dcf7e73b4 100644--- a/docs/production/giphy-gif-integration.md+++ b/docs/production/giphy-gif-integration.md@@ -17,12 +17,12 @@ To enable this integration, you need to get a production API key from1. Choose **SDK** as product type and click **Next Step**.1. Enter a name and a description for your app and click on **Create- New App**. The hostname for your Zulip server is a fine name.+ New App**. The hostname for your Zulip server is a fine name.1. You will receive a beta API key.1. Apply for a production API key by following the steps mentioned by- GIPHY on the same page. Note that when submitting a screenshot to+ GIPHY on the same page. Note that when submitting a screenshot torequest a production API key, GIPHY expects the screenshot to showthe full page (including URL).@@ -40,9 +40,9 @@ follows:1. Restart the Zulip server with`/home/zulip/deployments/current/scripts/restart-server`.-Congratulations! You've configured the GIPHY integration for your-Zulip server. Your users can now use the integration as described in-[the help center article][help-center-giphy]. (A browser reload may+Congratulations! You've configured the GIPHY integration for your+Zulip server. Your users can now use the integration as described in+[the help center article][help-center-giphy]. (A browser reload maybe required).diff --git a/docs/production/install-existing-server.md b/docs/production/install-existing-server.mdindex deb18c15fb0..c043afb3fd4 100644--- a/docs/production/install-existing-server.md+++ b/docs/production/install-existing-server.md@@ -16,7 +16,7 @@ recommended, and you may break your server. Make sure you have backupsand a provisioning script ready to go to wipe and restore yourexisting services if (when) your server goes down.-These instructions are only for experts. If you're not an experienced+These instructions are only for experts. If you're not an experiencedLinux sysadmin, you will have a much better experience if you get adedicated VM to install Zulip on instead (or [usezulip.com](https://zulip.com)).@@ -36,7 +36,7 @@ sudo meld /etc/nginx/nginx.conf /etc/nginx/nginx.conf.zulip # be sure to mergeSince the file in Zulip is an [ERB Puppettemplate](https://puppet.com/docs/puppet/7/lang_template_erb.html),you will also need to replace any `<%= ... %>` sections with-appropriate content. For instance `<%= @ca_crt %>` should be replaced+appropriate content. For instance `<%= @ca_crt %>` should be replacedwith `/etc/ssl/certs/ca-certificates.crt` on Debian and Ubuntuinstalls.@@ -49,7 +49,7 @@ $ sudo service nginx restart```Zulip's Puppet configuration will change the ownership of-`/var/log/nginx` so that the `zulip` user can access it. Depending on+`/var/log/nginx` so that the `zulip` user can access it. Depending onyour configuration, this may or may not cause problems.### Puppet@@ -73,9 +73,9 @@ $ sudo service puppet stopZulip expects to install PostgreSQL 12, and find that listening onport 5432; any other version of PostgreSQL that is detected at install-time will cause the install to abort. If you already have PostgreSQL+time will cause the install to abort. If you already have PostgreSQLinstalled, you can pass `--postgresql-version=` to the installer to-have it use that version. It will replace the package with the latest+have it use that version. It will replace the package with the latestfrom the PostgreSQL apt repository, but existing data will beretained.@@ -85,7 +85,7 @@ that.### Memcached, Redis, and RabbitMQ-Zulip will, by default, configure these services for its use. The+Zulip will, by default, configure these services for its use. Theconfiguration we use is pretty basic, but if you're using them forsomething else, you'll want to make sure the configurations arecompatible.@@ -97,6 +97,6 @@ We don't provide a convenient way to uninstall a Zulip server.## No support, but contributions welcome!Most of the limitations are things we'd accept a pull request to fix;-we welcome contributions to shrink this list of gotchas. Chat with us+we welcome contributions to shrink this list of gotchas. Chat with usin the [chat.zulip.org community](https://zulip.com/developer-community/) if you'reinterested in helping!diff --git a/docs/production/install.md b/docs/production/install.mdindex 0b5048b89e5..13aed76da79 100644--- a/docs/production/install.md+++ b/docs/production/install.md@@ -59,7 +59,7 @@ If the script gives an error, consult [Troubleshooting](#troubleshooting) below.settings.- `--self-signed-cert`: With this option, the Zulip installer- generates a self-signed SSL certificate for the server. This isn't+ generates a self-signed SSL certificate for the server. This isn'tsuitable for production use, but may be convenient for testing.- `--certbot`: With this option, the Zulip installer automatically@@ -77,7 +77,7 @@ documentation.## Step 3: Create a Zulip organization, and log in-On success, the install script prints a link. If you're [restoring a+On success, the install script prints a link. If you're [restoring abackup][zulip-backups] or importing your data from [Slack][slack-import],or another Zulip server, you should stop hereand return to the import instructions.@@ -85,13 +85,13 @@ and return to the import instructions.[slack-import]: https://zulip.com/help/import-from-slack[zulip-backups]: ../production/export-and-import.html#backups-Otherwise, open the link in a browser. Follow the prompts to set up+Otherwise, open the link in a browser. Follow the prompts to set upyour organization, and your own user account as an administrator.Then, log in!-The link is a secure one-time-use link. If you need another+The link is a secure one-time-use link. If you need anotherlater, you can generate a new one by running-`manage.py generate_realm_creation_link` on the server. See also our+`manage.py generate_realm_creation_link` on the server. See also ourdoc on running [multiple organizations on the sameserver](multiple-organizations.md) if that's what you're planning todo.@@ -109,7 +109,7 @@ Learning more:- Subscribe to the [Zulip announcements emaillist](https://groups.google.com/forum/#!forum/zulip-announce) for-server administrators. This extremely low-traffic list is for+server administrators. This extremely low-traffic list is forimportant announcements, including [newreleases](../overview/release-lifecycle.md) and security issues. Youcan also use the [RSS@@ -128,7 +128,7 @@ server.The install script does several things:- Creates the `zulip` user, which the various Zulip servers will run as.- Creates `/home/zulip/deployments/`, which the Zulip code for this-deployment (and future deployments when you upgrade) goes into. At the+deployment (and future deployments when you upgrade) goes into. At thevery end of the install process, the script moves the Zulip code treeit's running from (which you unpacked from a tarball above) to adirectory there, and makes `/home/zulip/deployments/current` as a@@ -144,20 +144,20 @@ machines, check out our [deployment options documentation](deployment.md).## Troubleshooting**Install script.**-The Zulip install script is designed to be idempotent. This means+The Zulip install script is designed to be idempotent. This meansthat if it fails, then once you've corrected the cause of the failure,you can just rerun the script.The install script automatically logs a transcript to-`/var/log/zulip/install.log`. In case of failure, you might find the-log handy for resolving the issue. Please include a copy of this log+`/var/log/zulip/install.log`. In case of failure, you might find the+log handy for resolving the issue. Please include a copy of this logfile in any bug reports.**The `zulip` user's password.**By default, the `zulip` user doesn'thave a password, and is intended to be accessed by `su zulip` from the`root` user (or via SSH keys or a password, if you want to set those-up, but that's up to you as the system administrator). Most people+up, but that's up to you as the system administrator). Most peoplewho are prompted for a password when running `su zulip` turn out toalready have switched to the `zulip` user earlier in their session,and can just skip that step.@@ -171,7 +171,7 @@ how to debug.**Community.** If the tips above don't help, please visit [#productionhelp][production-help] in the [Zulip development communityserver][chat-zulip-org] for realtime help, and we'll try to help you-out! Please provide details like the full traceback from the bottom+out! Please provide details like the full traceback from the bottomof `/var/log/zulip/errors.log` in your report (ideally in a [codeblock][code-block]).diff --git a/docs/production/management-commands.md b/docs/production/management-commands.mdindex e464ef29b92..af1a800badf 100644--- a/docs/production/management-commands.md+++ b/docs/production/management-commands.md@@ -1,13 +1,13 @@# Management commandsSometimes, you need to modify or inspect Zulip data from the command-line. To help with this, Zulip ships with over 100 command-line tools+line. To help with this, Zulip ships with over 100 command-line toolsimplemented using the [Django management commandsframework][django-management].## Running management commands-Start by logging in as the `zulip` user on the Zulip server. Then run+Start by logging in as the `zulip` user on the Zulip server. Then runthem as follows:```bash@@ -25,7 +25,7 @@ primarily want to use those in the `[zerver]` section as those are theones specifically built for Zulip.As a warning, some of them are designed for specific use cases and may-cause problems if run in other situations. If you're not sure, it's+cause problems if run in other situations. If you're not sure, it'sworth reading the documentation (or the code, usually available at`zerver/management/commands/`; they're generally very simple programs).@@ -54,14 +54,14 @@ unlikely to ever need to interact with that realm.)Unless you are[hosting multiple organizations on your Zulip server](../production/multiple-organizations.md),your single Zulip organization on the root domain will have the empty-string (`''`) as its `string_id`. So you can run e.g.:+string (`''`) as its `string_id`. So you can run e.g.:```consolezulip@zulip:~$ /home/zulip/deployments/current/manage.py show_admins -r ''```Otherwise, the `string_id` will correspond to the organization's-subdomain. E.g. on `it.zulip.example.com`, use+subdomain. E.g. on `it.zulip.example.com`, use`/home/zulip/deployments/current/manage.py show_admins -r it`.## manage.py shell@@ -86,11 +86,11 @@ formatting data from Zulip's tables for inspection; Zulip's ownyou understand how the codebase is organized.We recommend against directly editing objects and saving them using-Django's `object.save()`. While this will save your changes to the+Django's `object.save()`. While this will save your changes to thedatabase, for most objects, in addition to saving the changes to thedatabase, one may also need to flush caches, notify the apps and openbrowser windows, and record the change in Zulip's `RealmAuditLog`-audit history table. For almost any data change you want to do, there+audit history table. For almost any data change you want to do, thereis already a function in `zerver.lib.actions.py` with a name like`do_change_full_name` that updates that field and notifies clientscorrectly.@@ -102,16 +102,16 @@ access other functions, you'll need to import them yourself.## Other useful manage.py commandsThere are dozens of useful management commands under-`zerver/management/commands/`. We detail a few here:+`zerver/management/commands/`. We detail a few here:- `./manage.py help`: Lists all available management commands.- `./manage.py dbshell`: If you're more comfortable with raw SQL thanPython, this will open a PostgreSQL SQL shell connected to the Zulip- server's database. Beware of changing data; editing data directly+ server's database. Beware of changing data; editing data directlywith SQL will often not behave correctly because PostgreSQL doesn'tknow to flush Zulip's caches or notify browsers of changes.- `./manage.py send_custom_email`: Can be used to send an email to a set- of users. The `--help` documents how to run it from a+ of users. The `--help` documents how to run it from a`manage.py shell` for use with more complex programmaticallycomputed sets of users.- `./manage.py send_password_reset_email`: Sends password reset email(s)@@ -154,7 +154,7 @@ self-hosted Zulip server:Custom management commands are Python 3 programs that run insideZulip's context, so that they can access its libraries, database, and-code freely. They can be the best choice when you want to run custom+code freely. They can be the best choice when you want to run customcode that is not permitted by Zulip's security model (and thus can'tbe done more easily using the [REST API][zulip-api]) and that youmight want to run often (and so the interactive `manage.py shell` isdiff --git a/docs/production/mobile-push-notifications.md b/docs/production/mobile-push-notifications.mdindex 7b7b767b35e..ad787c66e50 100644--- a/docs/production/mobile-push-notifications.md+++ b/docs/production/mobile-push-notifications.md@@ -2,13 +2,13 @@Zulip's iOS and Android mobile apps support receiving pushnotifications from Zulip servers to let users know when new messages-have arrived. This is an important feature to having a great+have arrived. This is an important feature to having a greatexperience using the Zulip mobile apps.For technical reasons (explained below), in order to deliver mobilepush notifications in the app store versions of our mobile apps, youwill need to register your Zulip server with the Zulip mobile push-notification service. This service will forward push notifications+notification service. This service will forward push notificationsgenerated by your server to the Zulip mobile app automatically.@@ -17,7 +17,7 @@ generated by your server to the Zulip mobile app automatically.Starting with Zulip 1.6 for both Android and iOS, Zulip serverssupport forwarding push notifications to a central push notification-forwarding service. Accessing this service requires outgoing HTTPS+forwarding service. Accessing this service requires outgoing HTTPSaccess to the public Internet; if that is restricted by a proxy, youwill need to [configure Zulip to use your outgoing HTTPproxy](../production/deployment.html#using-an-outgoing-http-proxy)@@ -29,7 +29,7 @@ You can enable this for your Zulip server as follows:`PUSH_NOTIFICATION_BOUNCER_URL = 'https://push.zulipchat.com'` linein your `/etc/zulip/settings.py` file (i.e. remove the `#` at thestart of the line), and [restart your Zulip- server](../production/settings.html#making-changes). If you+ server](../production/settings.html#making-changes). If youinstalled your Zulip server with a version older than 1.6, you'llneed to add the line (it won't be there to uncomment).@@ -53,10 +53,10 @@ You can enable this for your Zulip server as follows:you'll each need to log out and log back in again in order to startgetting push notifications.-Congratulations! You've successfully set up the service.+Congratulations! You've successfully set up the service.If you'd like to verify that everything is working, you can do the-following. Please follow the instructions carefully:+following. Please follow the instructions carefully:- [Configure mobile push notifications to always be sent][mobile-notifications-always](normally they're only sent if you're idle, which isn't ideal for@@ -69,7 +69,7 @@ notifications on login.- Hit the home button, so Zulip is running in the background, and thenhave **another user** send you a **private message** (By default,Zulip only sends push notifications for private messages sent by other-users and messages mentioning you). A push notification should appear+users and messages mentioning you). A push notification should appearin the Android notification area.[mobile-notifications-always]: https://zulip.com/help/test-mobile-notifications@@ -79,7 +79,7 @@ in the Android notification area.Your server's registration includes the server's hostname and contactemail address (from `EXTERNAL_HOST` and `ZULIP_ADMINISTRATOR` in`/etc/zulip/settings.py`, aka the `--hostname` and `--email` options-in the installer). You can update your server's registration data by+in the installer). You can update your server's registration data byrunning `manage.py register_server` again.If you'd like to rotate your server's API key for this service@@ -92,10 +92,10 @@ generate a new `zulip_org_key` and store that new key inBoth Google's and Apple's push notification services have a securitymodel that does not support mutually untrusted self-hosted servers-sending push notifications to the same app. In particular, when an+sending push notifications to the same app. In particular, when anapp is published to their respective app stores, one must compile intothe app a secret corresponding to the server that will be able to-publish push notifications for the app. This means that it is+publish push notifications for the app. This means that it isimpossible for a single app in their stores to receive pushnotifications from multiple, mutually untrusted, servers.@@ -138,7 +138,7 @@ and privacy in mind:There's a `PUSH_NOTIFICATION_REDACT_CONTENT` setting available todisable any message content being sent via the push notificationbouncer (i.e. message content will be replaced with- `***REDACTED***`). Note that this setting makes push notifications+ `***REDACTED***`). Note that this setting makes push notificationssignificantly less usable.We plan to@@ -197,18 +197,18 @@ Zulip mobile apps.We don't recommend this path -- patching and shipping a productionmobile app can take dozens of hours to set up even for an experienced-developer, and even more time to maintain. And it doesn't provide+developer, and even more time to maintain. And it doesn't providematerial privacy benefits -- your organization's push notificationdata would still go through Apple/Google's servers, just not Kandra-Labs'. Our view is the correct way to optimize for privacy is-end-to-end encryption of push notifications. But in the interest of+Labs'. Our view is the correct way to optimize for privacy is+end-to-end encryption of push notifications. But in the interest oftransparency, we document in this section roughly what's involved indoing so.As we discussed above, it is impossible for a single app in theirstores to receive push notifications from multiple, mutually-untrusted, servers. The Mobile Push Notification Service is one of-the possible solutions to this problem. The other possible solution+untrusted, servers. The Mobile Push Notification Service is one of+the possible solutions to this problem. The other possible solutionis for an individual Zulip server's administrators to build anddistribute their own copy of the Zulip mobile apps, hardcoding a keythat they possess.@@ -219,8 +219,8 @@ the Zulip mobile apps (and there's nothing the Zulip team can do toeliminate this onerous requirement).The main work is distributing your own copies of the Zulip mobile apps-configured to use APNS/FCM keys that you generate. This is not for-the faint of heart! If you haven't done this before, be warned that+configured to use APNS/FCM keys that you generate. This is not for+the faint of heart! If you haven't done this before, be warned thatone can easily spend hundreds of dollars (on things like a DUNS numberregistration) and a week struggling through the hoops Apple requiresto build and distribute an app through the Apple app store, even if@@ -237,7 +237,7 @@ push notifications through the new app is quite straightforward:`/etc/zulip/zulip-secrets.conf` to that key.- Register for a[mobile push notification certificate][apple-docs]- from Apple's developer console. Set `APNS_SANDBOX=False` and+ from Apple's developer console. Set `APNS_SANDBOX=False` and`APNS_CERT_FILE` to be the path of your APNS certificate file in`/etc/zulip/settings.py`.- Set the `APNS_TOPIC` and `ZULIP_IOS_APP_ID` settings to the ID fordiff --git a/docs/production/multiple-organizations.md b/docs/production/multiple-organizations.mdindex 9834ca75bd7..2f08dd27016 100644--- a/docs/production/multiple-organizations.md+++ b/docs/production/multiple-organizations.md@@ -5,12 +5,12 @@# Hosting multiple organizationsThe vast majority of Zulip servers host just a single organization (or-"realm", as the Zulip code calls organizations). This article+"realm", as the Zulip code calls organizations). This articledocuments what's involved in hosting multiple Zulip organizations on asingle server.Throughout this article, we'll assume you're working on a Zulip server-with hostname `zulip.example.com`. You may also find the more+with hostname `zulip.example.com`. You may also find the more[technically focused article on realms](../subsystems/realms.md) to be usefulreading.@@ -18,7 +18,7 @@ reading.Zulip's approach for supporting multiple organizations on a singleZulip server is for each organization to be hosted on its own-subdomain. E.g. you'd have `org1.zulip.example.com` and+subdomain. E.g. you'd have `org1.zulip.example.com` and`org2.zulip.example.com`.Web security standards mean that one subdomain per organization is@@ -30,15 +30,15 @@ things:- If you're using Zulip older than 1.7, you'll need to set`REALMS_HAVE_SUBDOMAINS=True` in your `/etc/zulip/settings.py`- file. That setting is the default in 1.7 and later.+ file. That setting is the default in 1.7 and later.- Make sure you have SSL certificates for all of the subdomains you're- going to use. If you're using+ going to use. If you're using[our Let's Encrypt instructions](ssl-certificates.md), it's easy tojust specify multiple subdomains in your certificate request.- If necessary, modify your `nginx` configuration to use your newcertificates.- Use `./manage.py generate_realm_creation_link` again to create your- new organization. Review+ new organization. Review[the install instructions](install.md) if you need arefresher on how this works.- If you're planning on using GitHub auth or another social@@ -53,11 +53,11 @@ the homepage for the server is a copy of the Zulip homepage.### SSL certificatesYou'll need to install an SSL certificate valid for all the-(sub)domains you're using your Zulip server with. You can get an SSL+(sub)domains you're using your Zulip server with. You can get an SSLcertificate covering several domains for free by using[our Certbot wrapper tool](../production/ssl-certificates.html#after-zulip-is-already-installed),though if you're going to host a large number of organizations, you-may want to get a wildcard certificate. You can also get a wildcard+may want to get a wildcard certificate. You can also get a wildcardcertificate for[free using Certbot](https://community.letsencrypt.org/t/getting-wildcard-certificates-with-certbot/56285),but because of the stricter security checks for acquiring a wildcard@@ -86,7 +86,7 @@ into the database.### The root domainMost Zulip servers host a single Zulip organization on the root domain-(e.g. `zulip.example.com`). The way this is implemented internally+(e.g. `zulip.example.com`). The way this is implemented internallyinvolves the organization having the empty string (`''`) as its"subdomain".@@ -95,7 +95,7 @@ on subdomains (e.g. `subdivision.zulip.example.com`), but this onlyworks well if there are no users in common between the twoorganizations, because the auth cookies for the root domain arevisible to the subdomain (so it's not possible for a single-browser/client to be logged into both). So we don't recommend that+browser/client to be logged into both). So we don't recommend thatconfiguration.### Authentication@@ -103,7 +103,7 @@ configuration.Many of Zulip's supported authentication methods (Google, GitHub,SAML, etc.) can require providing the third-party authenticationprovider with a whitelist of callback URLs to your Zulip server (or-even a single URL). For those vendors that support a whitelist, you+even a single URL). For those vendors that support a whitelist, youcan provide the callback URLs for each of your Zulip organizations.The cleaner solution is to register a special subdomain, e.g.@@ -118,10 +118,10 @@ avoid confusion as to why there's an extra realm when inspecting theZulip database.Every Zulip server comes with 1 realm that isn't created by users: the-`zulipinternal` realm. By default, this realm only contains the Zulip "system-bots". You can get a list of these on your system via+`zulipinternal` realm. By default, this realm only contains the Zulip "system+bots". You can get a list of these on your system via`./scripts/get-django-setting INTERNAL_BOTS`, but this is where bots-like "Notification Bot", "Welcome Bot", etc. exist. In the future,+like "Notification Bot", "Welcome Bot", etc. exist. In the future,we're considering moving these bots to exist in every realm, so thatwe wouldn't need the system realm anymore.diff --git a/docs/production/password-strength.md b/docs/production/password-strength.mdindex c6b7d05a790..debeb85a0ce 100644--- a/docs/production/password-strength.md+++ b/docs/production/password-strength.md@@ -8,10 +8,10 @@ When a user tries to set a password, we use [zxcvbn][zxcvbn] to checkthat it isn't a weak one.See discussion in [our main docs for server-admins](../production/security-model.html#passwords). This doc explains in more+admins](../production/security-model.html#passwords). This doc explains in moredetail how we set the default threshold (`PASSWORD_MIN_GUESSES`) we use.-First, read the doc section there. (It's short.)+First, read the doc section there. (It's short.)Then, the CACM article ["Passwords and the Evolution of ImperfectAuthentication"][BHOS15] is comprehensive, educational, and readable,@@ -19,7 +19,7 @@ and is especially recommended.The CACM article is convincing that password requirements should beset to make passwords withstand an online attack, but not an offline-one. Offline attacks are much less common, and there is a wide gap in+one. Offline attacks are much less common, and there is a wide gap inthe level of password strength required to beat them vs that foronline attacks -- and therefore in the level of user frustration thatsuch a requirement would cause.@@ -38,7 +38,7 @@ just after 10k guesses, and grows steadily thereafter.Moreover, the [Yahoo study][Bon12] shows that resistance to even 1Mguesses is more than nearly half of users accomplish with a freely-chosen password, and 100k is too much for about 20%. (See Figure 6.)+chosen password, and 100k is too much for about 20%. (See Figure 6.)It doesn't make sense for a Zulip server to try to educate or push somany users far beyond the security practices they're accustomed to; inthe few environments where users can be expected to work much harder@@ -49,7 +49,7 @@ auth in Zulip entirely in favor of using that.Our threshold of 10k guesses provides significant protection againstonline attacks, and quite strong protection with appropriate-rate-limiting. On the other hand it stays within the range where+rate-limiting. On the other hand it stays within the range wherezxcvbn rarely underestimates the strength of a password too severely,and only about 10% of users do worse than this without prompting.diff --git a/docs/production/postgresql.md b/docs/production/postgresql.mdindex 3fab9893bfd..7e4d984d620 100644--- a/docs/production/postgresql.md+++ b/docs/production/postgresql.md@@ -2,12 +2,12 @@ PostgreSQL database details=========================Starting with Zulip 3.0, Zulip supports a range of PostgreSQL-versions. PostgreSQL 13 is the current default for new installations;+versions. PostgreSQL 13 is the current default for new installations;PostgreSQL 10, 11, and 12 are all supported.Previous versions of Zulip used whatever version of PostgreSQL wasincluded with the base operating system (E.g. PostgreSQL 12 on Ubuntu-Focal, 10 on Ubuntu Bionic, and 9.6 on Ubuntu Xenial). We recommend+Focal, 10 on Ubuntu Bionic, and 9.6 on Ubuntu Xenial). We recommendthat installations currently using older PostgreSQL releases [upgradeto PostgreSQL 13][upgrade-postgresql], as we may drop support forolder PostgreSQL in a future release.@@ -89,7 +89,7 @@ To stop a runaway query, you can run`SELECT pg_terminate_backend(pid int)` as the 'postgres' user. Theformer cancels the backend's current query and the latter terminatesthe backend process. They are implemented by sending SIGINT and-SIGTERM to the processes, respectively. We recommend against sending+SIGTERM to the processes, respectively. We recommend against sendinga PostgreSQL process SIGKILL. Doing so will cause the database to killall current connections, roll back any pending transactions, and enterrecovery mode.@@ -144,9 +144,9 @@ pg_ctlcluster does.#### PostgreSQL vacuuming alertsThe `autovac_freeze` PostgreSQL alert from `check_postgres` is-particularly important. This alert indicates that the age (in terms+particularly important. This alert indicates that the age (in termsof number of transactions) of the oldest transaction id (XID) is-getting close to the `autovacuum_freeze_max_age` setting. When the+getting close to the `autovacuum_freeze_max_age` setting. When theoldest XID hits that age, PostgreSQL will force a VACUUM operation,which can often lead to sudden downtime until the operation finishes.If it did not do this and the age of the oldest XID reached 2 billion,diff --git a/docs/production/requirements.md b/docs/production/requirements.mdindex 5e2c382da62..a71ad64beea 100644--- a/docs/production/requirements.md+++ b/docs/production/requirements.md@@ -19,9 +19,9 @@ For details on each of these requirements, see below.The installer expects Zulip to be the **only thing** running on thesystem; it will install system packages with `apt` (like Nginx,-PostgreSQL, and Redis) and configure them for its own use. We+PostgreSQL, and Redis) and configure them for its own use. Westrongly recommend using either a fresh machine instance in a cloud-provider, a fresh VM, or a dedicated machine. If you decide to+provider, a fresh VM, or a dedicated machine. If you decide todisregard our advice and use a server that hosts other services, wecan't support you, but[we do have some notes on issues you'll encounter](install-existing-server.md).@@ -29,7 +29,7 @@ can't support you, but#### Operating systemUbuntu 20.04 Focal, 18.04 Bionic, and Debian 10 Buster are supported-for running Zulip in production. 64-bit is recommended. We recommend+for running Zulip in production. 64-bit is recommended. We recommendinstalling on the newest supported OS release you're comfortable with,to save a bit of future work [upgrading the operatingsystem][upgrade-os].@@ -54,12 +54,12 @@ https://help.ubuntu.com/community/Repositories/Ubuntuminimum of **2 CPUs** and **4GB RAM**. For installations with fewerusers, 1 CPU and 2GB RAM is sufficient. We strongly recommend againstinstalling with less than 2GB of RAM, as you will likely experience- out of memory issues installing dependencies. We recommend against+ out of memory issues installing dependencies. We recommend againstusing highly CPU-limited servers like the AWS `t2` style instancesfor organizations with hundreds of users (active or no).- Disk space: You'll need at least 10GB of free disk space for a- server with dozens of users. We recommend using an SSD and avoiding+ server with dozens of users. We recommend using an SSD and avoidingcloud storage backends that limit the IOPS per second, since thedisk is primarily used for the Zulip database.@@ -72,19 +72,19 @@ on hardware requirements for larger organizations.[configurable](../production/deployment.html#using-an-alternate-port))from the networks where your users are (usually, the publicInternet).-- Incoming port 80 access (optional). Zulip only serves content over+- Incoming port 80 access (optional). Zulip only serves content overHTTPS, and will redirect HTTP requests to HTTPS.- Incoming port 25 if you plan to enable Zulip's [incoming emailintegration](../production/email-gateway.md).- Outgoing HTTP(S) access (ports 80 and 443) to the public Internet sothat Zulip can properly manage image and website previews and mobile- push notifications. Outgoing Internet access is not required if you+ push notifications. Outgoing Internet access is not required if you[disable thosefeatures](https://zulip.com/help/allow-image-link-previews).- Outgoing SMTP access (usually port 587) to your [SMTPserver](../production/email.md) so that Zulip can send emails.- A domain name (e.g. `zulip.example.com`) that your users will use to- access the Zulip server. In order to generate valid SSL+ access the Zulip server. In order to generate valid SSLcertificates [with Certbot][doc-certbot], and to enable otherservices such as Google authentication, public DNS name is simpler,but Zulip can be configured to use a non-public domain or even an IP@@ -106,7 +106,7 @@ on hardware requirements for larger organizations.#### SSL certificateYour Zulip server will need an SSL certificate for the domain name it-uses. For most Zulip servers, the recommended (and simplest) way to+uses. For most Zulip servers, the recommended (and simplest) way toget this is to just [use the `--certbot` option][doc-certbot] in theZulip installer, which will automatically get a certificate for youand keep it renewed.@@ -126,7 +126,7 @@ certificate documentation](ssl-certificates.md).- Outgoing email (SMTP) credentials that Zulip can use to sendoutgoing emails to users (e.g. email address confirmation emailsduring the signup process, message notification emails, password- reset, etc.). If you don't have an existing outgoing SMTP solution,+ reset, etc.). If you don't have an existing outgoing SMTP solution,read about[free outgoing SMTP options and options for prototyping](email.html#free-outgoing-email-services).@@ -139,7 +139,7 @@ Zulip in production](../production/install.md).This section details some basic guidelines for running a Zulip serverfor larger organizations (especially >1000 users or 500+ daily active-users). Zulip's resource needs depend mainly on 3 parameters:+users). Zulip's resource needs depend mainly on 3 parameters:- daily active users (e.g. number of employees if everyone's anemployee)- total user accounts (can be much larger)@@ -147,15 +147,15 @@ employee)In the following, we discuss a configuration with at most two types ofservers: application servers (running Django, Tornado, RabbitMQ,-Redis, Memcached, etc.) and database servers. Of the application-server services, Django dominates the resource requirements. One can+Redis, Memcached, etc.) and database servers. Of the application+server services, Django dominates the resource requirements. One canrun every service on its own system (as[docker-zulip](https://github.com/zulip/docker-zulip) does) but for-most use cases, there's little scalability benefit to doing so. See+most use cases, there's little scalability benefit to doing so. See[deployment options](../production/deployment.md) for details oninstalling Zulip with a dedicated database server.-- **Dedicated database**. For installations with hundreds of daily+- **Dedicated database**. For installations with hundreds of dailyactive users, we recommend using a [remote PostgreSQLdatabase](postgresql.md), but it's not required.@@ -170,23 +170,23 @@ installing Zulip with a dedicated database server.- **CPU:** The Zulip application server's CPU usage is heavilyoptimized due to extensive work on optimizing the performance of- requests for latency reasons. Because most servers with sufficient+ requests for latency reasons. Because most servers with sufficientRAM have sufficient CPU resources, CPU requirements are rarely an- issue. For larger installations with a dedicated database, we+ issue. For larger installations with a dedicated database, werecommend high-CPU instances for the application server and adatabase-optimized (usually low CPU, high memory) instance for thedatabase.- **Disk for application server:** We recommend using [the S3 file- uploads backend][s3-uploads] to store uploaded files at scale. With+ uploads backend][s3-uploads] to store uploaded files at scale. Withthe S3 backend configuration, we recommend 50GB of disk for the OS,- Zulip software, logs and scratch/free space. Disk needs when+ Zulip software, logs and scratch/free space. Disk needs whenstoring uploads locally-- **Disk for database:** SSD disk is highly recommended. For+- **Disk for database:** SSD disk is highly recommended. Forinstallations where most messages have <100 recipients, 10GB per 1Mmessages of history is sufficient plus 1GB per 1000 users is- sufficient. If most messages are to public streams with 10K+ users+ sufficient. If most messages are to public streams with 10K+ userssubscribed (like on chat.zulip.org), add 20GB per (1000 useraccounts) per (1M messages to public streams).@@ -199,7 +199,7 @@ installing Zulip with a dedicated database server.- **Disaster recovery:** One can easily run a hot spare applicationserver and a hot spare database (using [PostgreSQL streaming- replication][streaming-replication]). Make sure the hot spare+ replication][streaming-replication]). Make sure the hot spareapplication server has copies of `/etc/zulip` and you're eithersyncing `LOCAL_UPLOADS_DIR` or using the [S3 file uploadsbackend][s3-uploads].@@ -207,7 +207,7 @@ installing Zulip with a dedicated database server.- **Sharding:** Zulip releases do not fully support dividing Tornadotraffic for a single Zulip realm/organization between multipleapplication servers, which is why we recommend a hot spare over- load-balancing. We don't have an easily deployed configuration for+ load-balancing. We don't have an easily deployed configuration forload-balancing Tornado within a single organization, and as a resultcan't currently offer this model outside of enterprise supportcontracts.diff --git a/docs/production/security-model.md b/docs/production/security-model.mdindex e5557909c9f..77c4e2600fd 100644--- a/docs/production/security-model.md+++ b/docs/production/security-model.md@@ -1,6 +1,6 @@# Security model-This section attempts to document the Zulip security model. It likely+This section attempts to document the Zulip security model. It likelydoes not cover every issue; if there are details you're curious about,please feel free to ask questions in [#productionhelp](https://chat.zulip.org/#narrow/stream/31-production-help) on the@@ -19,7 +19,7 @@ announcement).or Zulip database server, or with access to the `zulip` user on aZulip application server, has complete control over the Zulipinstallation and all of its data (so they can read messages, modify- history, etc.). It would be difficult or impossible to avoid this,+ history, etc.). It would be difficult or impossible to avoid this,because the server needs access to the data to support featuresexpected of a group chat system like the ability to search theentire message history, and thus someone with control over the@@ -28,7 +28,7 @@ announcement).## Encryption and authentication- Traffic between clients (web, desktop and mobile) and the Zulip- server is encrypted using HTTPS. By default, all Zulip services+ server is encrypted using HTTPS. By default, all Zulip servicestalk to each other either via a localhost connection or using anencrypted SSL connection.@@ -37,20 +37,20 @@ announcement).- The preferred way to log in to Zulip is using an SSO solution likeGoogle auth, LDAP, or similar, but Zulip also supports password- authentication. See+ authentication. See[the authentication methods documentation](../production/authentication-methods.md)for details on Zulip's available authentication methods.### PasswordsZulip stores user passwords using the standard Argon2 and PBKDF2-algorithms. Argon2 is used for all new and changed passwords as of+algorithms. Argon2 is used for all new and changed passwords as ofZulip Server 1.6.0, but legacy PBKDF2 passwords that were last changedbefore the 1.6.0 upgrade are still supported.When the user is choosing a password, Zulip checks the password's-strength using the popular [zxcvbn][zxcvbn] library. Weak passwords-are rejected, and strong passwords encouraged. The minimum password+strength using the popular [zxcvbn][zxcvbn] library. Weak passwords+are rejected, and strong passwords encouraged. The minimum passwordstrength allowed is controlled by two settings in`/etc/zulip/settings.py`:@@ -74,7 +74,7 @@ strength allowed is controlled by two settings inimpossible to efficiently do perfectly. For background or whenconsidering an alternate value for this setting, the article["Passwords and the Evolution of Imperfect Authentication"][BHOS15]- is recommended. The [2016 zxcvbn paper][zxcvbn-paper] adds useful+ is recommended. The [2016 zxcvbn paper][zxcvbn-paper] adds usefulinformation about the performance of zxcvbn, and [a large 2012 studyof Yahoo users][Bon12] is informative about the strength of thepasswords users choose.@@ -102,7 +102,7 @@ strength allowed is controlled by two settings in- Zulip supports both public streams and private streams.- Any non-guest user can join any public stream in the organization,and can view the complete message history of any public stream- without joining the stream. Guests can only access streams that+ without joining the stream. Guests can only access streams thatanother user adds them to.- Organization owners and administrators can see and modify most@@ -162,13 +162,13 @@ strength allowed is controlled by two settings in- Every Zulip user has an API key, available on the settings page.This API key can be used to do essentially everything the user can- do; for that reason, users should keep their API key safe. Users+ do; for that reason, users should keep their API key safe. Userscan rotate their own API key if it is accidentally compromised.- To properly remove a user's access to a Zulip team, it does notsuffice to change their password or deactivate their account in aSSO system, since neither of those prevents authenticating with the- user's API key or those of bots the user has created. Instead, you+ user's API key or those of bots the user has created. Instead, youshould[deactivate the user's account](https://zulip.com/help/deactivate-or-reactivate-a-user)via Zulip's "Organization settings" interface.@@ -191,7 +191,7 @@ strength allowed is controlled by two settings innotifications, or create other bots).- Bots with the `can_forge_sender` permission can send messages that appear to have been sent byanother user. They also have the ability to see the names of all- streams, including private streams. This is important for implementing+ streams, including private streams. This is important for implementingintegrations like the Jabber, IRC, and Zephyr mirrors.These bots cannot be created by Zulip users, including@@ -200,14 +200,14 @@ strength allowed is controlled by two settings in## User-uploaded content and user-generated requests-- Zulip supports user-uploaded files. Ideally they should be hosted+- Zulip supports user-uploaded files. Ideally they should be hostedfrom a separate domain from the main Zulip server to protect againstvarious same-domain attacks (e.g. zulip-user-content.example.com).We support two ways of hosting them: the basic `LOCAL_UPLOADS_DIR`file storage backend, where they are stored in a directory on theZulip server's filesystem, and the S3 backend, where the files are- stored in Amazon S3. It would not be difficult to add additional+ stored in Amazon S3. It would not be difficult to add additionalsupported backends should there be a need; see`zerver/lib/upload.py` for the full interface.@@ -224,11 +224,11 @@ strength allowed is controlled by two settings inprovide additional layers of protection in both backends as well.In the Zulip S3 backend, the random URLs to access files that are- presented to users don't actually host the content. Instead, the S3+ presented to users don't actually host the content. Instead, the S3backend verifies that the user has a valid Zulip session in therelevant organization (and that has access to a Zulip message linking tothe file), and if so, then redirects the browser to a temporary S3- URL for the file that expires a short time later. In this way,+ URL for the file that expires a short time later. In this way,possessing a URL to a secret file in Zulip does not provideunauthorized users with access to that file.@@ -244,7 +244,7 @@ strength allowed is controlled by two settings inservers to fetch images, improving privacy.- By default, Zulip will provide image previews inline in the body of- messages when a message contains a link to an image. You can+ messages when a message contains a link to an image. You cancontrol this using the `INLINE_IMAGE_PREVIEW` setting.- Zulip may make outgoing HTTP connections to other servers in a@@ -258,11 +258,11 @@ strength allowed is controlled by two settings in- Mobile push notifications (must be configured to be enabled)- Notably, these first 3 features give end users (limited) control to cause- the Zulip server to make HTTP requests on their behalf. As a result,+ the Zulip server to make HTTP requests on their behalf. As a result,Zulip supports routing all outgoing outgoing HTTP requests [throughSmokescreen][smokescreen-setup] to ensure that Zulip cannot beused to execute [SSRF attacks][SSRF] against other systems on an- internal corporate network. The default Smokescreen configuration+ internal corporate network. The default Smokescreen configurationdenies access to all non-public IP addresses, including 127.0.0.1.[SSRF]: https://owasp.org/www-community/attacks/Server_Side_Request_Forgerydiff --git a/docs/production/settings.md b/docs/production/settings.mdindex 0884c781b74..1454e57760c 100644--- a/docs/production/settings.md+++ b/docs/production/settings.md@@ -12,7 +12,7 @@ administrators][realm-admin-docs].[realm-admin-docs]: https://zulip.com/help/getting-your-organization-started-with-zulipThis page discusses additional configuration that a system-administrator can do. To change any of the following settings, edit+administrator can do. To change any of the following settings, editthe `/etc/zulip/settings.py` file on your Zulip server, and thenrestart the server with the following command:```bash@@ -42,12 +42,12 @@ if there's something you'd like to do but can't figure out how to.`EXTERNAL_HOST`: the user-accessible domain name for your Zulipinstallation (i.e., what users will type in their web browser). Thisshould of course match the DNS name you configured to point to your-server and for which you configured SSL certificates. If you passed+server and for which you configured SSL certificates. If you passed`--hostname` to the installer, this will be prefilled with that value.`ZULIP_ADMINISTRATOR`: the email address of the person or teammaintaining this installation and who will get support and error-emails. If you passed `--email` to the installer, this will be+emails. If you passed `--email` to the installer, this will beprefilled with that value.### Authentication backends@@ -68,14 +68,14 @@ them.The Zulip apps expect to be talking to servers with a properlysigned SSL certificate, in most cases and will not accept a-self-signed certificate. You should get a proper SSL certificate+self-signed certificate. You should get a proper SSL certificatebefore testing the apps.Because of how Google and Apple have architected the security model oftheir push notification protocols, the Zulip mobile apps for[iOS](https://itunes.apple.com/us/app/zulip/id1203036395) and[Android](https://play.google.com/store/apps/details?id=com.zulipmobile)-can only receive push notifications from a single Zulip server. We+can only receive push notifications from a single Zulip server. Wehave configured that server to be `push.zulipchat.com`, and offer a[push notification forwarding service](mobile-push-notifications.md) thatforwards push notifications through our servers to mobile devices.@@ -85,10 +85,10 @@ and configure this service.### Terms of Service and Privacy policyZulip allows you to configure your server's Terms of Service and-Privacy Policy pages (`/terms` and `/privacy`, respectively). You can+Privacy Policy pages (`/terms` and `/privacy`, respectively). You canuse the `TERMS_OF_SERVICE` and `PRIVACY_POLICY` settings to configure-the path to your server's policies. The syntax is Markdown (with-support for included HTML). A good approach is to use paths like+the path to your server's policies. The syntax is Markdown (with+support for included HTML). A good approach is to use paths like`/etc/zulip/terms.md`, so that it's easy to back up your policyconfiguration along with your other Zulip server configuration.diff --git a/docs/production/ssl-certificates.md b/docs/production/ssl-certificates.mdindex e02a4472e47..347cb8f715b 100644--- a/docs/production/ssl-certificates.md+++ b/docs/production/ssl-certificates.md@@ -16,8 +16,8 @@ files into place at the following paths:Your certificate file should contain not only your own certificate butits **full chain, including any intermediate certificates** used by-your certificate authority (CA). See the [nginx-documentation][nginx-chains] for details on what this means. If+your certificate authority (CA). See the [nginx+documentation][nginx-chains] for details on what this means. Ifyou're missing part of the chain, your server may work with somebrowsers, but not others and not the Zulip mobile and desktop apps.The desktop apps support [configuring a custom CA][desktop-certs] to@@ -33,7 +33,7 @@ browsers ignore errors that others don't.Two good tests include:- If your server is accessible from the public Internet, use the [SSL- Labs tester][ssllabs-tester]. Be sure to check for "Chain issues";+ Labs tester][ssllabs-tester]. Be sure to check for "Chain issues";if any, your certificate file is missing intermediate certificates.- Alternatively, run a command like `curl -SsI https://zulip.example.com`@@ -49,11 +49,11 @@ Two good tests include:[Let's Encrypt](https://letsencrypt.org/) is a free, completelyautomated CA launched in 2016 to help make HTTPS routine for the-entire Web. Zulip offers a simple automation for+entire Web. Zulip offers a simple automation for[Certbot](https://certbot.eff.org/), a Let's Encrypt client, to getSSL certificates from Let's Encrypt and renew them automatically.-We recommend most Zulip servers use Certbot. You'll want something+We recommend most Zulip servers use Certbot. You'll want somethingelse if:- you have an existing workflow for managing SSL certificatesthat you prefer;@@ -72,7 +72,7 @@ To enable the Certbot automation when first installing Zulip, justpass the `--certbot` flag when [running the install script][doc-install-script].The `--hostname` and `--email` options are required when using-`--certbot`. You'll need the hostname to be a real DNS name, and the+`--certbot`. You'll need the hostname to be a real DNS name, and theZulip server machine to be reachable by that name from the publicInternet.@@ -100,11 +100,11 @@ When the Certbot automation in Zulip is first enabled, by eithermethod, it creates an account for the server at the Let's Encrypt CA;requests a certificate for the given hostname; proves to the CA thatthe server controls the website at that hostname; and is then given a-certificate. (For details, refer to+certificate. (For details, refer to[Let's Encrypt](https://letsencrypt.org/how-it-works/).)Then it records a flag in `/etc/zulip/zulip.conf` saying Certbot is in-use and should be auto-renewed. A cron job checks that flag, then+use and should be auto-renewed. A cron job checks that flag, thenchecks if any certificates are due for renewal, and if they are (soapproximately once every 60 days), repeats the process of request,prove, get a fresh certificate.@@ -113,10 +113,10 @@ prove, get a fresh certificate.## Self-signed certificateIf you aren't able to use Certbot, you can generate a self-signed SSL-certificate. This can be convenient for testing, but isn't-recommended for production, as it is insecure. The Zulip desktop and+certificate. This can be convenient for testing, but isn't+recommended for production, as it is insecure. The Zulip desktop andmobile apps will not connect to a server if they cannot validate its-SSL certificate. The desktop apps support [configuring a custom+SSL certificate. The desktop apps support [configuring a customcertificate authority][desktop-certs] to allow validation of aninternal certificate.@@ -146,7 +146,7 @@ service nginx reload### The Android app can't connect to the server-This is most often caused by an incomplete certificate chain. See+This is most often caused by an incomplete certificate chain. Seediscussion in the [Manual install](#manual-install) section above.@@ -156,9 +156,9 @@ This can be caused by a server set up to support only TLS 1.1 orolder (including TLS 1.0, SSL 3, or SSL 2.)TLS 1.2 has been a standard for over 10 years, and all modern web-server software supports it. Starting in early 2020, all major+server software supports it. Starting in early 2020, all majorbrowsers [will *require* TLS 1.2 or later][tls12-required-news], and-will refuse to connect over TLS 1.1 or older. And on iOS, Apple [has+will refuse to connect over TLS 1.1 or older. And on iOS, Apple [hassince iOS 9][apple-ats] required TLS 1.2 for all connections made byapps, unless the app specifically opts into lower security.@@ -170,7 +170,7 @@ to check what TLS versions it supports is the [SSL Labstester][ssllabs-tester].To resolve this issue, update your server to support TLS 1.2,-and preferably also TLS 1.3. For nginx, see [the `ssl_protocols`+and preferably also TLS 1.3. For nginx, see [the `ssl_protocols`directive][nginx-doc-protocols] in your configuration.[nginx-doc-protocols]: https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_protocols@@ -188,14 +188,14 @@ configuration.The issue is that Android 7.0 supports only the curve `secp256r1` whendoing elliptic-curve cryptography for TLS, and not other curves like-`secp384r1` or `secp512r1`. If your server's TLS/SSL configuration+`secp384r1` or `secp512r1`. If your server's TLS/SSL configurationoffers only other curves, then Android 7.0 clients will be unable toconnect.By default `nginx` (and therefore a Zulip server) offers the-`secp256r1` curve among others, and so everything works. You can+`secp256r1` curve among others, and so everything works. You cancontrol the offered curves with `ssl_ecdh_curve` in the `nginx`-configuration on your server. See [nginx docs][nginx-doc-curve] for+configuration on your server. See [nginx docs][nginx-doc-curve] fordetails.[nginx-doc-curve]: https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_ecdh_curve@@ -207,9 +207,9 @@ cause:later.- If your server is reachable from the public Internet, use the [SSL- Labs tester][ssllabs-tester]. Under "Cipher Suites" you may see+ Labs tester][ssllabs-tester]. Under "Cipher Suites" you may seelines beginning with `TLS_ECDHE`, for cipher suites which use- elliptic-curve cryptography. These lines will have further text+ elliptic-curve cryptography. These lines will have further textlike `ECDH secp256r1` or `ECDH secp384r1`, which identifies specific- elliptic curves your server offers to use. This issue applies if+ elliptic curves your server offers to use. This issue applies ifyour server does not offer `secp256r1`.diff --git a/docs/production/troubleshooting.md b/docs/production/troubleshooting.mdindex 150a6abe0e9..27c72a1ca41 100644--- a/docs/production/troubleshooting.md+++ b/docs/production/troubleshooting.md@@ -11,7 +11,7 @@ overview](../overview/architecture-overview.md), particularly theunderstand the many services Zulip uses.If you encounter issues while running Zulip, take a look at Zulip's logs, which-are located in `/var/log/zulip/`. That directory contains one log file for+are located in `/var/log/zulip/`. That directory contains one log file foreach service, plus `errors.log` (has all errors), `server.log` (has logs fromthe Django and Tornado servers), and `workers.log` (has combined logs from thequeue workers).@@ -21,7 +21,7 @@ on this page includes details about how to fix common issues with Zulip servicesIf you run into additional problems, [please reportthem](https://github.com/zulip/zulip/issues) so that we can update-this page! The Zulip installation scripts logs its full output to+this page! The Zulip installation scripts logs its full output to`/var/log/zulip/install.log`, so please include the context for anytracebacks from that log.@@ -70,10 +70,10 @@ zulip-workers:zulip_events_user_presence RUNNING pid 11If you see any services showing a status other than `RUNNING`, or yousee an uptime under 5 seconds (which indicates it's crashingimmediately after startup and repeatedly restarting), that service-isn't running. If you don't see relevant logs in+isn't running. If you don't see relevant logs in`/var/log/zulip/errors.log`, check the log file declared via`stdout_logfile` for that service's entry in-`/etc/supervisor/conf.d/zulip.conf` for details. Logs only make it to+`/etc/supervisor/conf.d/zulip.conf` for details. Logs only make it to`/var/log/zulip/errors.log` once a service has started fully.### Restarting services with `supervisorctl restart all`@@ -110,13 +110,13 @@ application:- memcachedIf one of these services is not installed or functioning correctly,-Zulip will not work. Below we detail some common configuration+Zulip will not work. Below we detail some common configurationproblems and how to resolve them:- If your browser reports no webserver is running, that is likelybecause nginx is not configured properly and thus failed to start.nginx will fail to start if you configured SSL incorrectly or did- not provide SSL certificates. To fix this, configure them properly+ not provide SSL certificates. To fix this, configure them properlyand then run:```bashservice nginx restart@@ -146,10 +146,10 @@ problems and how to resolve them::::{important}We recommend that you disable or limit Ubuntu's unattended-upgrades-to skip some server packages. With unattended upgrades enabled but+to skip some server packages. With unattended upgrades enabled butnot limited, the moment a new PostgreSQL release is published, yourZulip server will have its PostgreSQL server upgraded (and thus-restarted). If you do disable unattended-upgrades, do not forget to+restarted). If you do disable unattended-upgrades, do not forget toregularly install apt upgrades manually!:::@@ -160,7 +160,7 @@ those connections throwing errors.Zulip is designed to recover from system service downtime by creatingnew connections once the system service is back up, so the Zulip-outage will end once the system service finishes restarting. But+outage will end once the system service finishes restarting. Butyou'll get a bunch of error emails during the system service outagewhenever one of the Zulip server's ~20 workers attempts to access thesystem service.@@ -197,11 +197,11 @@ Unattended-Upgrade::Package-Blacklist {## Monitoring-Chat is mission-critical to many organizations. This section contains+Chat is mission-critical to many organizations. This section containsadvice on monitoring your Zulip server to minimize downtime.First, we should highlight that Zulip sends Django error emails to-`ZULIP_ADMINISTRATOR` for any backend exceptions. A properly+`ZULIP_ADMINISTRATOR` for any backend exceptions. A properlyfunctioning Zulip server shouldn't send any such emails, so it's worthreporting/investigating any that you do see.@@ -211,16 +211,16 @@ standard stuff:- Basic host health monitoring for issues running out of disk space,especially for the database and where uploads are stored.- Service uptime and standard monitoring for the [services Zulip- depends on](#troubleshooting-services). Most monitoring software+ depends on](#troubleshooting-services). Most monitoring softwarehas standard plugins for Nginx, PostgreSQL, Redis, RabbitMQ,and memcached, and those will work well with Zulip.- `supervisorctl status` showing all services `RUNNING`.- Checking for processes being OOM killed.Beyond that, Zulip ships a few application-specific end-to-end health-checks. The Nagios plugins `check_send_receive_time`,+checks. The Nagios plugins `check_send_receive_time`,`check_rabbitmq_queues`, and `check_rabbitmq_consumers` are generally-sufficient to point to the cause of any Zulip production issue. See+sufficient to point to the cause of any Zulip production issue. Seethe next section for details.### Nagios configuration@@ -232,14 +232,14 @@ tarballs).The Nagios plugins used by that configuration are installedautomatically by the Zulip installation process in subdirectories-under `/usr/lib/nagios/plugins/`. The following is a summary of the+under `/usr/lib/nagios/plugins/`. The following is a summary of theuseful Nagios plugins included with Zulip and what they check:Application server and queue worker monitoring:- `check_send_receive_time`: Sends a test message through the systembetween two bot users to check that end-to-end message sending- works. An effective end-to-end check for Zulip's Django and Tornado+ works. An effective end-to-end check for Zulip's Django and Tornadosystems being healthy.- `check_rabbitmq_consumers` and `check_rabbitmq_queues`: Effectivechecks for Zulip's RabbitMQ-based queuing systems being healthy.@@ -267,5 +267,5 @@ encouraged!As a measure to mitigate the potential impact of any future memoryleak bugs in one of the Zulip daemons, Zulip service automatically-restarts itself every Sunday early morning. See+restarts itself every Sunday early morning. See`/etc/cron.d/restart-zulip` for the precise configuration.diff --git a/docs/production/upgrade-or-modify.md b/docs/production/upgrade-or-modify.mdindex dac4331c13a..01d9b2e13ff 100644--- a/docs/production/upgrade-or-modify.md+++ b/docs/production/upgrade-or-modify.md@@ -17,7 +17,7 @@ This page explains how to upgrade, patch, or modify Zulip, including:Note that there are additional instructions if you're [usingdocker-zulip][docker-upgrade], have [patched Zulip](#modifying-zulip),or have [modified Zulip-managed configuration-files](#preserving-local-changes-to-service-configuration-files). To upgrade+files](#preserving-local-changes-to-service-configuration-files). To upgradeto a new Zulip release:1. Read the [upgrade notes](../overview/changelog.html#upgrade-notes)@@ -56,7 +56,7 @@ Upgrading will result in brief downtime for the service, which shouldbe under 30 seconds unless there is an expensive database migrationinvolved (these will be documented in the [releasenotes](../overview/changelog.md), and usually can be avoided with-some care). If downtime is problematic for your organization,+some care). If downtime is problematic for your organization,consider testing the upgrade on a[backup](../production/export-and-import.html#backups) in advance,doing the final upgrade at off hours, or buying a support contract.@@ -69,7 +69,7 @@ run into any issues or need to roll back the upgrade.Zulip supports upgrading a production installation to any commit in aGit repository, which is great for [running pre-release changes from`main`](#applying-changes-from-main) or [maintaining a-fork](#making-changes). The process is simple:+fork](#making-changes). The process is simple:```bash# Upgrade to an official release@@ -163,15 +163,15 @@ See also the general Zulip server [troubleshootingguide](../production/troubleshooting.md).The upgrade scripts are idempotent, so there's no harm in trying again-after resolving an issue. The most common causes of errors are:+after resolving an issue. The most common causes of errors are:- Networking issues (e.g. your Zulip server doesn't have reliable- Internet access or needs a proxy set up). Fix the networking issue+ Internet access or needs a proxy set up). Fix the networking issueand try again.- Especially when using `upgrade-zulip-from-git`, systems with theminimal RAM for running Zulip can run into out-of-memory issuesduring the upgrade process (generally `tools/webpack` is the step- that fails). You can get past this by shutting down the Zulip+ that fails). You can get past this by shutting down the Zulipserver with `supervisorctl stop all` to free up RAM before runningthe upgrade process.@@ -206,7 +206,7 @@ This means that if the new version isn't working,you can quickly downgrade to the old version by running`/home/zulip/deployments/last/scripts/restart-server`, or to anearlier previous version by running-`/home/zulip/deployments/DATE/scripts/restart-server`. The+`/home/zulip/deployments/DATE/scripts/restart-server`. The`restart-server` script stops any running Zulip server, and startsthe version corresponding to the `restart-server` path you call.@@ -227,9 +227,9 @@ configuration.That said, Zulip's configuration files are designed to be flexibleenough for a wide range of installations, from a small self-hosted-system to Zulip Cloud. Before making local changes to a configuration+system to Zulip Cloud. Before making local changes to a configurationfile, first check whether there's an option supported by-`/etc/zulip/zulip.conf` for the customization you need. And if you+`/etc/zulip/zulip.conf` for the customization you need. And if youneed to make local modifications, please report the issue so that wecan make the Zulip Puppet configuration flexible enough to handle yoursetup.@@ -266,7 +266,7 @@ instructions for other supported platforms.```3. Switch to the root user and upgrade the operating system using the- OS's standard tooling. E.g. for Ubuntu, this means running+ OS's standard tooling. E.g. for Ubuntu, this means running`do-release-upgrade` and following the prompts until it completessuccessfully:@@ -278,7 +278,7 @@ instructions for other supported platforms.When `do-release-upgrade` asks you how to upgrade configurationfiles for services that Zulip manages like Redis, PostgreSQL,Nginx, and memcached, the best choice is `N` to keep the- currently installed version. But it's not important; the next+ currently installed version. But it's not important; the nextstep will re-install Zulip's configuration in any case.4. As root, upgrade the database to the latest version of PostgreSQL:@@ -290,7 +290,7 @@ instructions for other supported platforms.5. Ubuntu 20.04 has a different version of the low-level glibclibrary, which affects how PostgreSQL orders text data (known as"collations"); this corrupts database indexes that rely on- collations. Regenerate the affected indexes by running:+ collations. Regenerate the affected indexes by running:```bash/home/zulip/deployments/current/scripts/setup/reindex-textual-data --force@@ -314,7 +314,7 @@ instructions for other supported platforms.### Upgrading from Ubuntu 16.04 Xenial to 18.04 Bionic-1. Upgrade your server to the latest Zulip `2.1.x` release. You can+1. Upgrade your server to the latest Zulip `2.1.x` release. You canonly upgrade to Zulip 3.0 and newer after completing this process,since newer releases don't support Ubuntu 16.04 Xenial.@@ -362,7 +362,7 @@ instructions for other supported platforms.### Upgrading from Ubuntu 14.04 Trusty to 16.04 Xenial-1. Upgrade your server to the latest Zulip `2.0.x` release. You can+1. Upgrade your server to the latest Zulip `2.0.x` release. You canonly upgrade to Zulip `2.1.x` and newer after completing thisprocess, since newer releases don't support Ubuntu 14.04 Trusty.@@ -405,7 +405,7 @@ instructions for other supported platforms.### Upgrading from Debian Stretch to Debian Buster-1. Upgrade your server to the latest Zulip `2.1.x` release. You can+1. Upgrade your server to the latest Zulip `2.1.x` release. You canonly upgrade to Zulip 3.0 and newer after completing this process,since newer releases don't support Ubuntu Debian Stretch.@@ -418,7 +418,7 @@ instructions for other supported platforms.When prompted for you how to upgrade configurationfiles for services that Zulip manages like Redis, PostgreSQL,Nginx, and memcached, the best choice is `N` to keep the- currently installed version. But it's not important; the next+ currently installed version. But it's not important; the nextstep will re-install Zulip's configuration in any case.4. As root, upgrade the database installation and OS configuration to@@ -456,7 +456,7 @@ instructions for other supported platforms.7. Debian Buster has a different version of the low-level glibclibrary, which affects how PostgreSQL orders text data (known as"collations"); this corrupts database indexes that rely on- collations. Regenerate the affected indexes by running:+ collations. Regenerate the affected indexes by running:```bash/home/zulip/deployments/current/scripts/setup/reindex-textual-data --force@@ -471,7 +471,7 @@ instructions for other supported platforms.## Upgrading PostgreSQLStarting with Zulip 3.0, we use the latest available version of-PostgreSQL at installation time (currently version 13). Upgrades to+PostgreSQL at installation time (currently version 13). Upgrades tothe version of PostgreSQL are no longer linked to upgrades of thedistribution; that is, you may opt to upgrade to PostgreSQL 13 whilerunning Ubuntu 18.04 Bionic.@@ -513,7 +513,7 @@ confirm everything is working correctly.## Modifying ZulipZulip is 100% free and open source software, and you're welcome to-modify it! This section explains how to make and maintain+modify it! This section explains how to make and maintainmodifications in a safe and convenient fashion.If you do modify Zulip and then report an issue you see in your@@ -533,7 +533,7 @@ section](#applying-changes-from-main).## Making changesOne way to modify Zulip is to just edit files under-`/home/zulip/deployments/current` and then restart the server. This+`/home/zulip/deployments/current` and then restart the server. Thiscan work OK for testing small changes to Python code or shell scripts.But we don't recommend this approach for maintaining changes because:@@ -550,16 +550,16 @@ But we don't recommend this approach for maintaining changes because:Instead, we recommend the following GitHub-based workflow (see [ourGit guide][git-guide] if you need a primer):-- Decide where you're going to edit Zulip's code. We recommend [using+- Decide where you're going to edit Zulip's code. We recommend [usingthe Zulip development environment](../development/overview.md) ona desktop or laptop as it will make it extremely convenient for you- to test your changes without deploying them in production. But if+ to test your changes without deploying them in production. But ifyour changes are small or you're OK with risking downtime, you don'tstrictly need it; you just need an environment with Git installed.-- **Important**. Determine what Zulip version you're running on your- server. You can check by inspecting `ZULIP_VERSION` in+- **Important**. Determine what Zulip version you're running on your+ server. You can check by inspecting `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,+ below). If you apply your changes to the wrong version of Zulip,it's likely to fail and potentially cause downtime.- [Fork and clone][fork-clone] the [zulip/zulip][] repository on[GitHub](https://github.com).@@ -595,10 +595,10 @@ across future Zulip releases.### Upgrading to future releases-Eventually, you'll want to upgrade to a new Zulip release. If your+Eventually, you'll want to upgrade to a new Zulip release. If yourchanges were integrated into that Zulip release or are otherwise nolonger needed, you can just [upgrade as-usual](#upgrading-to-a-release). If you [upgraded to+usual](#upgrading-to-a-release). If you [upgraded to`main`](#upgrading-to-main); review that section again; newmaintenance releases are likely "older" than your current installationand you might need to upgrade to `main` again rather than to the@@ -606,7 +606,7 @@ new maintenance release.Otherwise, you'll need to update your branch by rebasing your changes(starting from a [clone][fork-clone] of the [zulip/zulip][]-repository). The example below assumes you have a branch off of 2.0.4+repository). The example below assumes you have a branch off of 2.0.4and want to upgrade to 2.1.0.```bash@@ -644,12 +644,12 @@ different from the above:If you are experiencing an issue that has already been fixed by theZulip 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+have a few options. There are two possible ways you might get thosefixes on your local Zulip server without waiting for an official release.### Applying a small change-Many bugs have small/simple fixes. In this case, you can use the Git+Many bugs have small/simple fixes. In this case, you can use the Gitworkflow [described above](#making-changes), using:```bash@@ -666,12 +666,12 @@ cherry-picking arbitrary commits if the issues don't also affectThe exception to this rule is when we ask or encourage a user to applya change to their production system to help verify the fix resolves-the issue for them. You can expect the Zulip community to be+the issue for them. You can expect the Zulip community to beresponsive in debugging any problems caused by a patch we askedyou 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+be added to the current stable release branch (E.g. `2.1.x`). Inaddition to scheduling that change for Zulip's next bug fix release,we support changes in stable release branches as though they werereleased.@@ -679,15 +679,15 @@ released.### Upgrading to `main`Many Zulip servers (including chat.zulip.org and zulip.com) upgrade to-`main` on a regular basis to get the latest features. Before doing+`main` on a regular basis to get the latest features. Before doingso, it's important to understand how to happily run a server based on`main`.For background, it's backporting arbitrary patches from `main` to an-older version requires some care. Common issues include:+older version requires some care. Common issues include:- Changes containing database migrations (new files under- `*/migrations/`), which includes most new features. We+ `*/migrations/`), which includes most new features. Wedon't support applying database migrations out of order.- Changes that are stacked on top of other changes to the same system.- Essentially any patch with hundreds of lines of changes will have@@ -698,29 +698,29 @@ unlikely to succeed without help from the core team via a supportcontract.If you need an unreleased feature, the best path is usually to-upgrade to Zulip `main` using [upgrade-zulip-from-git][]. Before+upgrade to Zulip `main` using [upgrade-zulip-from-git][]. Beforeupgrading to `main`, make sure you understand:- In Zulip's version numbering scheme, `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`).- The `main` branch is under very active development; dozens of new- changes are integrated into it on most days. The `main` branch+ changes are integrated into it on most days. The `main` branchcan have thousands of changes not present in the latest release (all- of which will be included in our next major release). On average+ 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 itmight have some bugs that are more severe than we would consideracceptable for a release.- We deploy `main` to chat.zulip.org and zulip.com on a regularbasis (often daily), so it's very important to the project that it- be stable. Most regressions will be minor UX issues or be fixed+ be stable. Most regressions will be minor UX issues or be fixedquickly, because we need them to be fixed for Zulip Cloud.- The development community is very interested in helping debug issuesthat arise when upgrading from the latest release to `main`, sincethey 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+ our next major release. (Much more so than we are in helping folks+ debug other custom changes). That said, we cannot make anyguarantees about how quickly we'll resolve an issue to folks withouta formal support contract.- We do not support downgrading from `main` to earlier versions, so@@ -730,20 +730,20 @@ upgrading to `main`, make sure you understand:upgrade fails.- Our changelog contains [draft releasenotes](../overview/changelog.md) available listing major changes- since the last release. The **Upgrade notes** section will always+ since the last release. The **Upgrade notes** section will alwaysbe current, even if some new features aren't documented.- Whenever we push a security or maintenance release, the changes inthat release will always be merged to `main`; so you can get thesecurity fixes by upgrading to `main`.- You can always upgrade from `main` to the next major release when itcomes out, using either [upgrade-zulip-from-git][] or the release- tarball. So there's no risk of upgrading to `main` resulting in+ tarball. So there's no risk of upgrading to `main` resulting ina system that's not upgradeable back to a normal release.## Contributing patchesZulip contains thousands of changes submitted by volunteer-contributors like you. If your changes are likely to be of useful to+contributors like you. If your changes are likely to be of useful toother organizations, consider [contributingthem](../overview/contributing.md).diff --git a/docs/production/upload-backends.md b/docs/production/upload-backends.mdindex 29165892050..65f15cac59c 100644--- a/docs/production/upload-backends.md+++ b/docs/production/upload-backends.md@@ -18,11 +18,11 @@ provider supported by the `boto` library).## S3 backend configurationHere, we document the process for configuring Zulip's S3 file upload-backend. To enable this backend, you need to do the following:+backend. To enable this backend, you need to do the following:1. In the AWS management console, create a new IAM account (aka APIuser) for your Zulip server, and two buckets in S3, one for uploaded-files included in messages, and another for user avatars. You need+files included in messages, and another for user avatars. You needtwo buckets because the "user avatars" bucket is generally configuredas world-readable, whereas the "uploaded files" one is not.@@ -68,7 +68,7 @@ as world-readable, whereas the "uploaded files" one is not.(`/home/zulip/deployments/current/scripts/restart-server`).It's simplest to just do this configuration when setting up your Zulip-server for production usage. Note that if you had any existing+server for production usage. Note that if you had any existinguploading files, this process does not upload them to Amazon S3; see[migration instructions](#migrating-from-local-uploads-to-amazon-s3-backend)below for those steps.@@ -78,7 +78,7 @@ below for those steps.## S3 bucket policyThe best way to do the S3 integration with Amazon is to create a new-IAM user just for your Zulip server with limited permissions. For+IAM user just for your Zulip server with limited permissions. Foreach of the two buckets, you'll want to[add an S3 bucket policy](https://awspolicygen.s3.amazonaws.com/policygen.html)entry that looks something like this:@@ -129,14 +129,14 @@ need a block like this:}```-The file-uploads bucket should not be world-readable. See the+The file-uploads bucket should not be world-readable. See the[documentation on the Zulip security model](security-model.md) fordetails on the security model for uploaded files.## Migrating from local uploads to Amazon S3 backendAs you scale your server, you might want to migrate the uploads from-your local backend to Amazon S3. Follow these instructions, step by+your local backend to Amazon S3. Follow these instructions, step bystep, to do the migration.1. First, [set up the S3 backend](#s3-backend-configuration) in the settings@@ -145,13 +145,13 @@ step, to do the migration.2. Run `./manage.py transfer_uploads_to_s3`. This will upload all thefiles from the local uploads directory to Amazon S3. By default,this command runs on 6 parallel processes, since uploading is a- latency-sensitive operation. You can control this parameter using+ latency-sensitive operation. You can control this parameter usingthe `--processes` option.3. Once the transfer script completes, disable `LOCAL_UPLOADS_DIR`, andrestart your server (continuing the last few steps of the S3backend setup instructions).-Congratulations! Your uploaded files are now migrated to S3.+Congratulations! Your uploaded files are now migrated to S3.**Caveat**: The current version of this tool does not migrate anuploaded organization avatar or logo.diff --git a/docs/production/video-calls.md b/docs/production/video-calls.mdindex 2f52e158859..905f4961ae6 100644--- a/docs/production/video-calls.md+++ b/docs/production/video-calls.md@@ -40,7 +40,7 @@ follows:1. Restart the Zulip server with`/home/zulip/deployments/current/scripts/restart-server`.-This enables Zoom support in your Zulip server. Finally, [configure+This enables Zoom support in your Zulip server. Finally, [configureZoom as the video callprovider](https://zulip.com/help/start-a-call) in the Zuliporganization(s) where you want to use it.@@ -71,7 +71,7 @@ Server as follows:3. Restart the Zulip server with`/home/zulip/deployments/current/scripts/restart-server`.-This enables BigBlueButton support in your Zulip server. Finally, [configure+This enables BigBlueButton support in your Zulip server. Finally, [configureBigBlueButton as the video callprovider](https://zulip.com/help/start-a-call) in the Zuliporganization(s) where you want to use it.diff --git a/docs/subsystems/analytics.md b/docs/subsystems/analytics.mdindex 1fa3749c6a8..067d04e5a8a 100644--- a/docs/subsystems/analytics.md+++ b/docs/subsystems/analytics.md@@ -109,12 +109,12 @@ efficient:then the endpoints to server data to users can be fast.- Doing expensive operations inside the database, rather than fetching datato Python and then sending it back to the database (which can be far- slower if there's a lot of data involved). The Django ORM currently+ slower if there's a lot of data involved). The Django ORM currentlydoesn't support the "insert into .. select" type SQL query that's neededfor this, which is why we use raw database queries (which we usually avoidin Zulip) rather than the ORM.- Aggregating where possible to avoid unnecessary queries against the- Message and UserMessage tables. E.g. rather than querying the Message+ Message and UserMessage tables. E.g. rather than querying the Messagetable both to generate sent message counts for each realm and again foreach user, we just query for each user, and then add up the numbers forthe users to get the totals for the realm.@@ -129,10 +129,10 @@ There are a few types of automated tests that are important for this sort ofsystem:- Most important: Tests for the code path that actually populates data into- the analytics tables. These are most important, because it can be very+ the analytics tables. These are most important, because it can be veryexpensive to fix bugs in the logic that generates these tables (onebasically needs to regenerate all of history for those tables), and these- bugs are hard to discover. It's worth taking the time to think about+ bugs are hard to discover. It's worth taking the time to think aboutinteresting corner cases and add them to the test suite.- Tests for the backend views code logic for extracting data from thedatabase and serving it to clients.@@ -147,7 +147,7 @@ analytics tests, to make sure it stays that way as we refactor.The system discussed above is designed primarily around the technicalproblem of showing useful analytics about things where the raw data is-already stored in the database (e.g. Message, UserMessage). This is great+already stored in the database (e.g. Message, UserMessage). This is greatbecause we can always backfill that data to the beginning of time, but ofcourse sometimes one wants to do analytics on things that aren't worthstoring every data point for (e.g. activity data, request performance@@ -161,10 +161,10 @@ statistics, etc.). There is currently a reference implementation of aThe main testing approach for the /stats page UI is manual testing.For most UI testing, you can visit `/stats/realm/analytics` whilelogged in as Iago (this is the server administrator view of stats for-a given realm). The only piece that you can't test here is the "Me"-buttons, which won't have any data. For those, you can instead log in+a given realm). The only piece that you can't test here is the "Me"+buttons, which won't have any data. For those, you can instead log inas the `[email protected]` in the `analytics` realm and visit-`/stats` there (which is only a bit more work). Note that the+`/stats` there (which is only a bit more work). Note that the`analytics` realm is a shell with no streams, so you'll only want touse it for testing the graphs.@@ -221,9 +221,9 @@ Tips and tricks:### /activity page- There's a somewhat less developed /activity page, for server- administrators, showing data on all the realms on a server. To+ administrators, showing data on all the realms on a server. Toaccess it, you need to have the `is_staff` bit set on your- UserProfile object. You can set it using `manage.py shell` and- editing the UserProfile object directly. A great future project is+ UserProfile object. You can set it using `manage.py shell` and+ editing the UserProfile object directly. A great future project isto clean up that page's data sources, and make this a documentedinterface.diff --git a/docs/subsystems/caching.md b/docs/subsystems/caching.mdindex f225ced3552..f54948c8d14 100644--- a/docs/subsystems/caching.md+++ b/docs/subsystems/caching.md@@ -1,7 +1,7 @@# Caching in ZulipLike any product with good performance characteristics, Zulip makes-extensive use of caching. This article talks about our caching+extensive use of caching. This article talks about our cachingstrategy, focusing on how we use `memcached` (since it's the thingpeople generally think about when they ask about how a server doescaching).@@ -9,7 +9,7 @@ caching).## Backend caching with memcachedOn the backend, Zulip uses `memcached`, a popular key-value store, for-caching. Our `memcached` caching helps let us optimize Zulip's+caching. Our `memcached` caching helps let us optimize Zulip'sperformance and scalability, since most requests don't need to talk tothe database (which, even for a trivial query with everything on thesame machine, usually takes 3-10x as long as a memcached fetch).@@ -37,11 +37,11 @@ Zulip's Django codebase, all one needs to do is call the standardaccessor functions for data (like `get_user` or `get_stream` to fetchuser and stream objects, or for view code, functions like`access_stream_by_id`, which checks permissions), and everything will-work great. The data fetches automatically benefit from `memcached`+work great. The data fetches automatically benefit from `memcached`caching, since those accessor methods have already been written totransparently use Zulip's memcached caching system, and the developerdoesn't need to worry about whether the data returned is up-to-date:-it is. In the following sections, we'll talk about how we make this+it is. In the following sections, we'll talk about how we make thiswork.As a sidenote, the policy of using these accessor functions wherever@@ -51,7 +51,7 @@ also generally take care of details you might not think aboutIt's amazing how slightly tricky logic that's duplicated in severalplaces invariably ends up buggy in some of those places, and inaggregate we call these accessor functions hundreds of times in-Zulip. But the caching is certainly a nice bonus.+Zulip. But the caching is certainly a nice bonus.### The core implementation@@ -74,17 +74,17 @@ def get_user(email: str, realm: Realm) -> UserProfile:This decorator implements a pretty classic caching paradigm:- The `user_profile_cache_key` function defines a unique map from a- canonical form of its arguments to a string. These strings are+ canonical form of its arguments to a string. These strings arenamespaced (the `user_profile:` part) so that they won't overlapwith other caches, and encode the arguments so that two uses of this- cache won't overlap. In this case, a hash of the email address and- realm ID are those canonicalized arguments. (The `make_safe_digest`+ cache won't overlap. In this case, a hash of the email address and+ realm ID are those canonicalized arguments. (The `make_safe_digest`is important to ensure we don't send special characters to- memcached). And we have two versions, depending whether the caller+ memcached). And we have two versions, depending whether the callerhas access to a `Realm` or just a `realm_id`.- When `get_user` is called, `cache_with_key` will compute the key,and do a Django `cache_get` query for the key (which goes to- memcached). If the key is in the cache, it just returns the value.+ memcached). If the key is in the cache, it just returns the value.Otherwise, it fetches the value from the database (using the actualcode in the body of `get_user`), and then stores the value back tothat memcached key before returning the result to the caller.@@ -101,12 +101,12 @@ huge amount of otherwise very self-similar caching code.The one thing to be really careful with in using `cache_with_key` isthat if an item is in the cache, the body of `get_user` (above) is-never called. This means some things that might seem like clever code-reuse are actually a really bad idea. For example:+never called. This means some things that might seem like clever code+reuse are actually a really bad idea. For example:- Don't add a `get_active_user` function that uses the same cache keyfunction as `get_user` (but with a different query that filters our- deactivated users). If one called `get_active_user` to access a+ deactivated users). If one called `get_active_user` to access adeactivated user, the right thing would happen, but if you called`get_user` to access that user first, then the `get_active_user`function would happily return the user from the cache, without ever@@ -118,13 +118,13 @@ even if they feature the same objects.### Cache invalidation after writesThe caching strategy described above works pretty well for anything-where the state it's storing is immutable (i.e. never changes). With+where the state it's storing is immutable (i.e. never changes). Withmutable state, one needs to do something to ensure that the Pythonprocesses don't end up fetching stale data from the cache after awrite to the database.We handle this using Django's longstanding-[post_save signals][post-save-signals] feature. Django signals let+[post_save signals][post-save-signals] feature. Django signals letyou configure some code to run every time Django does something (for`post_save`, right after any write to the database using Django's`.save()`).@@ -139,11 +139,11 @@ post_save.connect(flush_user_profile, sender=UserProfile)Once this `post_save` hook is registered, whenever one calls`user_profile.save(...)` with a UserProfile object in our Django-project, Django will call the `flush_user_profile` function. Zulip is+project, Django will call the `flush_user_profile` function. Zulip issystematic about using the standard Django `.save()` function formodifying `user_profile` objects (and passing the `update_fields`argument to `.save()` consistently, which encodes which fields on an-object changed). This means that all we have to do is write those+object changed). This means that all we have to do is write thosecache-flushing functions correctly, and people writing Zulip codewon't need to think about (or even know about!) the caching.@@ -156,7 +156,7 @@ those keys from the cache (if present).Maintaining these flush functions requires some care (every time weadd a new cache, we need to look through them), but overall it's apretty simple algorithm: If the changed data appears in any form in a-given cache key, that cache key needs to be cleared. E.g. the+given cache key, that cache key needs to be cleared. E.g. the`active_user_ids_cache_key` cache for a realm needs to be flushedwhenever a new user is created in that realm, or user isdeactivated/reactivated, even though it's just a list of IDs and thus@@ -175,8 +175,8 @@ code in Zulip just needs to modify Django model objects and callWhen upgrading a Zulip server, it's important to avoid having oneversion of the code interact with cached objects from another version-that has a different data layout. In Zulip, we avoid this through-some clever caching strategies. Each "deployment directory" for Zulip+that has a different data layout. In Zulip, we avoid this through+some clever caching strategies. Each "deployment directory" for Zulipin production has inside it a `var/remote_cache_prefix` file,containing a cache prefix (`KEY_PREFIX` in the code) that isautomatically appended to the start of any cache keys accessed by that@@ -188,19 +188,19 @@ from inconsistent versions of the source code / data formats in the cache.### Automated testing and memcached-For Zulip's `test-backend` unit tests, we use the same strategy. In+For Zulip's `test-backend` unit tests, we use the same strategy. Inparticular, we just edit `KEY_PREFIX` before each unit test; thismeans each of the thousands of test cases in Zulip has its own-independent memcached key namespace on each run of the unit tests. As+independent memcached key namespace on each run of the unit tests. Asa result, we never have to worry about memcached caching causingproblems across multiple tests.-This is a really important detail. It makes it possible for us to do+This is a really important detail. It makes it possible for us to doassertions in our tests on the number of database queries or memcachedqueries that are done as part of a particular function/route, and havethose checks consistently get the same result (those tests are greatfor catching bugs where we accidentally do database queries in a-loop). And it means one can debug failures in the test suite without+loop). And it means one can debug failures in the test suite withouthaving to consider the possibility that memcached is somehow confusingthe situation.@@ -225,8 +225,8 @@ You can run the server with that behavior disabled using### PerformanceOne thing be careful about with memcached queries is to avoid doing-them in loops (the same applies for database queries!). Instead, one-should use a bulk query. We have a fancy function,+them in loops (the same applies for database queries!). Instead, one+should use a bulk query. We have a fancy function,`generate_bulk_cached_fetch`, which is super magical and handles thisfor us, with support for a bunch of fancy features like marshallingdata before/after going into the cache (e.g. to compress `message`@@ -236,7 +236,7 @@ objects to minimize data transfer between Django and memcached).We generally try to avoid in-process backend caching in Zulip's Djangocodebase, because every Zulip production installation involves-multiple servers. We do have a few, however:+multiple servers. We do have a few, however:- `per_request_display_recipient_cache`: A cache flushed at the startof every request; this simplifies correctly implementing our goal ofnot repeatedly fetching the "display recipient" (e.g. stream name)@@ -252,11 +252,11 @@ apps; details like which users exist, with metadata like names andavatars, similar details for streams, recent message history, etc.This data is fetched in the `/register` endpoint (or `page_params`-for the web app), and kept correct over time. The key to keeping these+for the web app), and kept correct over time. The key to keeping thesestate up to date is Zulip's[real-time events system](../subsystems/events-system.md), whichallows the server to notify clients whenever state that might be-cached by clients is changed. Clients are responsible for handling+cached by clients is changed. Clients are responsible for handlingthe events, updating their state, and rerendering any UI componentsthat might display the modified state.diff --git a/docs/subsystems/client.md b/docs/subsystems/client.mdindex 3de6b464830..92f8e79a392 100644--- a/docs/subsystems/client.md+++ b/docs/subsystems/client.md@@ -1,7 +1,7 @@# Clients in Zulip`zerver.models.Client` is Zulip's analogue of the HTTP User-Agent-header (and is populated from User-Agent). It exists for use in+header (and is populated from User-Agent). It exists for use inanalytics and other places to provide human-readable summary dataabout "which Zulip client" was used for an operation (e.g. was it theAndroid app, the desktop app, or a bot?).@@ -19,7 +19,7 @@ A `Client` is used to sort messages into client categories such asGenerally, integrations in Zulip should declare a unique User-Agent,so that it's easy to figure out which integration is involved when-debugging an issue. For incoming webhook integrations, we do that+debugging an issue. For incoming webhook integrations, we do thatconvenentialy via the auth decorators (as we will describe shortly);other integrations generally should set the first User-Agent elementon their HTTP requests to something of the formdiff --git a/docs/subsystems/dependencies.md b/docs/subsystems/dependencies.mdindex e9dbd5c2a11..801bf8f9160 100644--- a/docs/subsystems/dependencies.md+++ b/docs/subsystems/dependencies.md@@ -1,22 +1,22 @@# Provisioning and third-party dependenciesZulip is a large project, with well over 100 third-party dependencies,-and managing them well is essential to the quality of the project. In+and managing them well is essential to the quality of the project. Inthis document, we discuss the various classes of dependencies that-Zulip has, and how we manage them. Zulip's dependency management has+Zulip has, and how we manage them. Zulip's dependency management hassome really nice properties:-- **Fast provisioning**. When switching to a different commit in the+- **Fast provisioning**. When switching to a different commit in theZulip project with the same dependencies, it takes under 5 secondsto re-provision a working Zulip development environment after- switching. If there are new dependencies, one only needs to wait to+ switching. If there are new dependencies, one only needs to wait todownload the new ones, not all the pre-existing dependencies.-- **Consistent provisioning**. Every time a Zulip development or+- **Consistent provisioning**. Every time a Zulip development orproduction environment is provisioned/installed, it should end upusing the exactly correct versions of all major dependencies.-- **Low maintenance burden**. To the extent possible, we want to+- **Low maintenance burden**. To the extent possible, we want toavoid manual work and keeping track of things that could be- automated. This makes it easy to keep running the latest versions+ automated. This makes it easy to keep running the latest versionsof our various dependencies.The purpose of this document is to detail all of Zulip's third-party@@ -25,11 +25,11 @@ dependencies and how we manage their versions.## ProvisioningWe refer to "provisioning" as the process of installing and-configuring the dependencies of a Zulip development environment. It's+configuring the dependencies of a Zulip development environment. It'sdone using `tools/provision`, and the output is conveniently logged by-`var/log/provision.log` to help with debugging. Provisioning makes-use of a lot of caching. Some of those caches are not immune to being-corrupted if you mess around with files in your repository a lot. We+`var/log/provision.log` to help with debugging. Provisioning makes+use of a lot of caching. Some of those caches are not immune to being+corrupted if you mess around with files in your repository a lot. Wehave `tools/provision --force` to (still fairly quickly) rerun moststeps that would otherwise have been skipped due to caching.@@ -42,13 +42,13 @@ also run an initial provision the first time only.In `version.py`, we have a special parameter, `PROVISION_VERSION`,which is used to help ensure developers don't spend time debuggingtest/linter/etc. failures that actually were caused by the developer-rebasing and forgetting to provision". `PROVISION_VERSION` has a+rebasing and forgetting to provision". `PROVISION_VERSION` has aformat of `x.y`; when `x` doesn't match the value from the last timethe user provisioned, or `y` is higher than than the value from lasttime, most Zulip tools will crash early and ask the user to provision.This has empirically made a huge impact on how often developers spendtime debugging a "weird failure" after rebasing that had an easy-solution. (Of course, the other key part of achieving this is all the+solution. (Of course, the other key part of achieving this is all thework that goes into making sure that `provision` reliably leaves thedevelopment environment in a good state.)@@ -58,29 +58,29 @@ require re-running provision, so don't forget about it!## Philosophy on adding third-party dependenciesIn the Zulip project, we take a pragmatic approach to third-party-dependencies. Overall, if a third-party project does something well+dependencies. Overall, if a third-party project does something wellthat Zulip needs to do (and has an appropriate license), we'd love to-use it rather than reinventing the wheel. If the third-party project+use it rather than reinventing the wheel. If the third-party projectneeds some small changes to work, we prefer to make those changes and-contribute them upstream. When the upstream maintainer is slow to+contribute them upstream. When the upstream maintainer is slow torespond, we may use a fork of the dependency until the code is mergedupstream; as a result, we usually have a few packages in`requirements.txt` that are installed from a GitHub URL.What we look for in choosing dependencies is whether the project is-well-maintained. Usually one can tell fairly quickly from looking at+well-maintained. Usually one can tell fairly quickly from looking ata project's issue tracker how well-managed it is: a quick look at howthe issue tracker is managed (or not) and the test suite is usuallyenough to decide if a project is going to be a high-maintenance-dependency or not. That said, we do still take on some smaller+dependency or not. That said, we do still take on some smallerdependencies that don't have a well-managed project, if we feel thatusing the project will still be a better investment than writing our-own implementation of that project's functionality. We've adopted a+own implementation of that project's functionality. We've adopted afew projects in the past that had a good codebase but whose maintainerno longer had time for them.One case where we apply added scrutiny to third-party dependencies is-JS libraries. They are a particularly important concern because we+JS libraries. They are a particularly important concern because wewant to keep the Zulip web app's JS bundle small, so that Zulipcontinues to load quickly on systems with low network bandwidth.We'll look at large JS libraries with much greater scrutiny for@@ -94,10 +94,10 @@ For the third-party services like PostgreSQL, Redis, Nginx, and RabbitMQthat are documented in the[architecture overview](../overview/architecture-overview.md), we rely on theversions of those packages provided alongside the Linux distribution-on which Zulip is deployed. Because Zulip+on which Zulip is deployed. Because Zulip[only supports Ubuntu in production](../production/requirements.md), thisusually means `apt`, though we do support-[other platforms in development](../development/setup-advanced.md). Since+[other platforms in development](../development/setup-advanced.md). Sincewe don't control the versions of these dependencies, we avoid relyingon specific versions of these packages wherever possible.@@ -107,7 +107,7 @@ few places:the `Package` and `SafePackage` directives.- For development, in `SYSTEM_DEPENDENCIES` in `tools/lib/provision.py`.- The packages needed to build a Zulip virtualenv, in- `VENV_DEPENDENCIES` in `scripts/lib/setup_venv.py`. These are+ `VENV_DEPENDENCIES` in `scripts/lib/setup_venv.py`. These areseparate from the rest because (1) we may need to install avirtualenv before running the more complex scripts that, in turn,install other dependencies, and (2) because that list is shared@@ -119,7 +119,7 @@ extension, used by our [full-text search](full-text-search.md).## Python packagesZulip uses the version of Python itself provided by the host OS for-the Zulip server. We currently support Python 3.6 and newer, with+the Zulip server. We currently support Python 3.6 and newer, withUbuntu Bionic being the platform requiring 3.6 support. The commentsin `.github/workflows/zulip-ci.yml` document the Python versions usedby each supported platform.@@ -127,79 +127,79 @@ by each supported platform.We manage Python packages via the Python-standard `requirements.txt`system and virtualenvs, but there’s a number of interesting detailsabout how Zulip makes this system work well for us that are worth-highlighting. The system is largely managed by the code in+highlighting. The system is largely managed by the code in`scripts/lib/setup_venv.py`-- **Using `pip` to manage dependencies**. This is standard in the+- **Using `pip` to manage dependencies**. This is standard in thePython ecosystem, and means we only need to record a list ofversions in a `requirements.txt` file to declare what we're using.Since we have a few different installation targets, we maintainseveral `requirements.txt` format files in the `requirements/`directory (e.g. `dev.in` for development, `prod.in` forproduction, `docs.in` for ReadTheDocs, `common.in` for the vast- majority of packages common to prod and development, etc.). We use+ majority of packages common to prod and development, etc.). We use`pip install --no-deps` to ensure we only install the packages weexplicitly declare as dependencies.-- **virtualenv with pinned versions**. For a large application like+- **virtualenv with pinned versions**. For a large application likeZulip, it is important to ensure that we're always using consistent,- predictable versions of all of our Python dependencies. To ensure+ predictable versions of all of our Python dependencies. To ensurethis, we install our dependencies in a [virtualenv][] that containsonly the packages and versions that Zulip needs, and we always pinexact versions of our dependencies in our `requirements.txt` files.We pin exact versions, not minimum versions, so that installing- Zulip won't break if a dependency makes a buggy release. A side+ Zulip won't break if a dependency makes a buggy release. A sideeffect is that it's easy to debug problems caused by dependencyupgrades, since we're always doing those upgrades with an explicitcommit updating the `requirements/` directory.-- **Pinning versions of indirect dependencies**. We "pin" or "lock"+- **Pinning versions of indirect dependencies**. We "pin" or "lock"the versions of our indirect dependencies files with- `tools/update-locked-requirements` (powered by `pip-compile`). What+ `tools/update-locked-requirements` (powered by `pip-compile`). Whatthis means is that we have some "source" requirements files, like`requirements/common.in`, that declare the packages that Zulip- depends on directly. Those packages have their own recursive- dependencies. When adding or removing a dependency from Zulip, one+ depends on directly. Those packages have their own recursive+ dependencies. When adding or removing a dependency from Zulip, onesimply edits the appropriate "source" requirements files, and then- runs `tools/update-locked-requirements`. That tool will use+ runs `tools/update-locked-requirements`. That tool will use`pip-compile` to generate the locked requirements files like`prod.txt`, `dev.txt` etc files that explicitly declare versions of- all of Zulip's recursive dependencies. For indirect dependencies+ all of Zulip's recursive dependencies. For indirect dependencies(i.e. dependencies not explicitly declared in the sourcerequirements files), it provides helpful comments explaining whichdirect dependency (or dependencies) needed that indirect dependency.The process for using this system is documented in more detail in`requirements/README.md`.-- **Caching of virtualenvs and packages**. To make updating the+- **Caching of virtualenvs and packages**. To make updating thedependencies of a Zulip installation efficient, we maintain a cacheof virtualenvs named by the hash of the relevant `requirements.txt`- file (`scripts/lib/hash_reqs.py`). These caches live under- `/srv/zulip-venv-cache/<hash>`. That way, when re-provisioning a+ file (`scripts/lib/hash_reqs.py`). These caches live under+ `/srv/zulip-venv-cache/<hash>`. That way, when re-provisioning adevelopment environment or deploying a new production version withthe same Python dependencies, no downloading or installation is- required: we just use the same virtualenv. When the only changes+ required: we just use the same virtualenv. When the only changesare upgraded versions, we'll use [virtualenv-clone][] to clone themost similar existing virtualenv and then just upgrade the packages- needed, making small version upgrades extremely efficient. And+ needed, making small version upgrades extremely efficient. Andfinally, we use `pip`'s built-in caching to ensure that a specificversion of a specific package is only downloaded once.-- **Garbage-collecting caches**. We have a tool,+- **Garbage-collecting caches**. We have a tool,`scripts/lib/clean_venv_cache.py`, which will clean old cached- virtualenvs that are no longer in use. In production, the algorithm+ virtualenvs that are no longer in use. In production, the algorithmpreserves recent virtualenvs as well as those in use by any currentproduction deployment directory under `/home/zulip/deployments/`.This helps ensure that a Zulip installation doesn't leak largeamounts of disk over time.-- **Scripts**. Often, we want a script running in production to use- the Zulip virtualenv. To make that work without a lot of duplicated+- **Scripts**. Often, we want a script running in production to use+ the Zulip virtualenv. To make that work without a lot of duplicatedcode, we have a helpful function,`scripts.lib.setup_path.setup_path`, which on import will put the- currently running Python script into the Zulip virtualenv. This is+ currently running Python script into the Zulip virtualenv. This iscalled by `./manage.py` to ensure that our Django code always usesthe correct virtualenv as well.-- **Mypy type checker**. Because we're using mypy in a strict mode,+- **Mypy type checker**. Because we're using mypy in a strict mode,when you add use of a new Python dependency, you usually need toeither adds stubs to the `stubs/` directory for the library, or edit`pyproject.toml` in the root of the Zulip project to configure- `ignore_missing_imports` for the new library. See+ `ignore_missing_imports` for the new library. See[our mypy docs][mypy-docs] for more details.### Upgrading packages@@ -220,29 +220,29 @@ reasoning here.- In a fashion very analogous to the Python codebase,`scripts/lib/node_cache.py` manages cached `node_modules`- directories in `/srv/zulip-npm-cache`. Each is named by its hash,+ directories in `/srv/zulip-npm-cache`. Each is named by its hash,computed by the `generate_sha1sum_node_modules` function.`scripts/lib/clean_node_cache.py` handles garbage-collection.- We use [yarn][], a `pip`-like tool for JavaScript, to download most- JavaScript dependencies. Yarn talks to standard the [npm][]- repository. We use the standard `package.json` file to declare our+ JavaScript dependencies. Yarn talks to standard the [npm][]+ repository. We use the standard `package.json` file to declare ourdirect dependencies, with sections for development and- production. Yarn takes care of pinning the versions of indirect+ production. Yarn takes care of pinning the versions of indirectdependencies in the `yarn.lock` file; `yarn install` updates the`yarn.lock` files.-- `tools/update-prod-static`. This process is discussed in detail in+- `tools/update-prod-static`. This process is discussed in detail inthe [static asset pipeline](../subsystems/html-css.html#static-asset-pipeline)article, but we don't use the `node_modules` directories directly in- production. Instead, static assets are compiled using our static+ production. Instead, static assets are compiled using our staticasset pipeline and it is the compiled assets that are served- directly to users. As a result, we don't ship the `node_modules`+ directly to users. As a result, we don't ship the `node_modules`directory in a Zulip production release tarball, which is a goodthing, because doing so would more than double the size of a Zuliprelease tarball.-- **Checked-in packages**. In contrast with Python, we have a few+- **Checked-in packages**. In contrast with Python, we have a fewJavaScript dependencies that we have copied into the main Zulip- repository under `static/third`, often with patches. These date- from an era before `npm` existed. It is a project goal to eliminate+ repository under `static/third`, often with patches. These date+ from an era before `npm` existed. It is a project goal to eliminatethese checked-in versions of dependencies and instead use versionsmanaged by the npm repositories.@@ -256,7 +256,7 @@ its version) and `scripts/lib/install-yarn`.its own path, which we use, though we install a `/usr/local/bin/node`wrapper to access the desired version conveniently and efficiently(`nvm` has a lot of startup overhead).-- We install `yarn` at `/srv/zulip-yarn`. We don't do anything+- We install `yarn` at `/srv/zulip-yarn`. We don't do anythingspecial to try to manage multiple versions of `yarn`.## ShellCheck and shfmt@@ -264,7 +264,7 @@ special to try to manage multiple versions of `yarn`.In the development environment, the `tools/setup/install-shellcheck`and `tools/setup/install-shfmt` scripts download binaries forShellCheck and shfmt from GitHub, check them against a known hash, and-install them to `/usr/local/bin`. These tools are run as part of the+install them to `/usr/local/bin`. These tools are run as part of the[linting system](../testing/linters.md).## Puppet packages@@ -272,7 +272,7 @@ install them to `/usr/local/bin`. These tools are run as part of theThird-party puppet modules are downloaded from the Puppet Forge intosubdirectories under `/srv/zulip-puppet-cache`, hashed based on theirversions; the latest is always symlinked as-`/srv/zulip-puppet-cache/current`. `zulip-puppet-apply` installs+`/srv/zulip-puppet-cache/current`. `zulip-puppet-apply` installsthese dependencies immediately before they are needed.## Other third-party and generated files@@ -285,9 +285,9 @@ maintain them.### EmojiZulip uses the [iamcal emoji data package][iamcal] for its emoji data-and sprite sheets. We download this dependency using `npm`, and then+and sprite sheets. We download this dependency using `npm`, and thenhave a tool, `tools/setup/build_emoji`, which reformats the emoji data-into the files under `static/generated/emoji`. Those files are in+into the files under `static/generated/emoji`. Those files are inturn used by our [Markdown processor](../subsystems/markdown.md) and`tools/update-prod-static` to make Zulip's emoji work in the variousenvironments where they need to be displayed.@@ -296,9 +296,9 @@ Since processing emoji is a relatively expensive operation, as part ofoptimizing provisioning, we use the same caching strategy for thecompiled emoji data as we use for virtualenvs and `node_modules`directories, with `scripts/lib/clean_emoji_cache.py` responsible for-garbage-collection. This caching and garbage-collection is required+garbage-collection. This caching and garbage-collection is requiredbecause a correct emoji implementation involves over 1000 small image-files and a few large ones. There is a more extended article on our+files and a few large ones. There is a more extended article on our[emoji infrastructure](emoji.md).### Translations data@@ -306,7 +306,7 @@ files and a few large ones. There is a more extended article on ourZulip's [translations infrastructure](../translating/translating.md) generatesseveral files from the source data, which we manage similar to ouremoji, but without the caching (and thus without the-garbage-collection). New translations data is downloaded from+garbage-collection). New translations data is downloaded fromTransifex and then compiled to generate both the production localefiles and also language data in `locale/language*.json` using`manage.py compilemessages`, which extends the default Django@@ -315,7 +315,7 @@ implementation of that tool.### Pygments dataThe list of languages supported by our Markdown syntax highlighting-comes from the [pygments][] package. `tools/setup/build_pygments_data` is+comes from the [pygments][] package. `tools/setup/build_pygments_data` isresponsible for generating `static/generated/pygments_data.json` so thatour JavaScript Markdown processor has access to the supported list.@@ -324,12 +324,12 @@ our JavaScript Markdown processor has access to the supported list.When making changes to Zulip's provisioning process or dependencies,usually one needs to think about making changes in 3 places:-- `tools/lib/provision.py`. This is the main provisioning script,+- `tools/lib/provision.py`. This is the main provisioning script,used by most developers to maintain their development environment.-- `docs/development/dev-setup-non-vagrant.md`. This is our "manual installation"- documentation. Strategically, we'd like to move the support for more+- `docs/development/dev-setup-non-vagrant.md`. This is our "manual installation"+ documentation. Strategically, we'd like to move the support for moreversions of Linux from here into `tools/lib/provision.py`.-- Production. Our tools for compiling/generating static assets need+- Production. Our tools for compiling/generating static assets needto be called from `tools/update-prod-static`, which is called by`tools/build-release-tarball` (for doing Zulip releases) as well as`tools/upgrade-zulip-from-git` (for deploying a Zulip server off ofdiff --git a/docs/subsystems/django-upgrades.md b/docs/subsystems/django-upgrades.mdindex d9534809d71..740c436b098 100644--- a/docs/subsystems/django-upgrades.md+++ b/docs/subsystems/django-upgrades.md@@ -1,7 +1,7 @@# Upgrading DjangoThis article documents notes on the process for upgrading Zulip to-new major versions of Django. Here are the steps:+new major versions of Django. Here are the steps:- Carefully read the Django upstream changelog, and `git grep` tocheck if we're using anything deprecated or significantly modified@@ -10,19 +10,19 @@ new major versions of Django. Here are the steps:and open an issue listing them;[example](https://github.com/zulip/zulip/issues/2564).- Start submitting PRs to do any deprecation-type migrations that work- on both the old and new version of Django. The goal here is to have+ on both the old and new version of Django. The goal here is to havethe actual cutover commit be as small as possible, and to test asmuch of the changes for the migration as we can independently fromthe big cutover.- Check the version support of the third-party Django packages we use(`git grep django requirements/` to see a list), upgrade any as- needed and file bugs upstream for any that lack support. Look into+ needed and file bugs upstream for any that lack support. Look intofixing said bugs.- Look at the pieces of Django code that we've copied and thenadapted, and confirm whether Django has any updates to the modified- code we should apply. Partial list:+ code we should apply. Partial list:- `CursorDebugWrapper`, which we have a modified version of in- `zerver/lib/db.py`. See+ `zerver/lib/db.py`. See[the issue for contributing this upstream](https://github.com/zulip/zulip/issues/974)- `PasswordResetForm` and any other forms we import from`django.contrib.auth.forms` in `zerver/forms.py` (which has all ofdiff --git a/docs/subsystems/email.md b/docs/subsystems/email.mdindex 490e1b7b0aa..b36e9e9c80c 100644--- a/docs/subsystems/email.md+++ b/docs/subsystems/email.md@@ -25,7 +25,7 @@ with only a few things you need to know to get started.`send_future_email`. The `ScheduledEmail` entries are eventually processedby a supervisor job that runs `zerver/management/commands/deliver_scheduled_emails.py`.- Always use `user_profile.delivery_email`, not `user_profile.email`,- when passing data into the `send_email` library. The+ when passing data into the `send_email` library. The`user_profile.email` field may not always be valid.- A good way to find a bunch of example email pathways is to `git grep` for`zerver/emails` in the `zerver/` directory.@@ -48,10 +48,10 @@ from a queue. Documentation on our queueing system is available## Development and testingAll the emails sent in the development environment can be accessed by-visiting `/emails` in the browser. The way that this works is that+visiting `/emails` in the browser. The way that this works is thatwe've set the email backend (aka what happens when you call the email`.send()` method in Django) in the development environment to be our-custom backend, `EmailLogBackEnd`. It does the following:+custom backend, `EmailLogBackEnd`. It does the following:- Logs any sent emails to `var/log/email_content.log`. This log isdisplayed by the `/emails` endpoint@@ -65,7 +65,7 @@ You can also forward all the emails sent in the developmentenvironment to an email account of your choice by clicking on**Forward emails to an email account** on the `/emails` page. Thisfeature can be used for testing how the emails gets rendered by-actual email clients. This is important because web email clients+actual email clients. This is important because web email clientshave limited CSS functionality, autolinkify things, and otherwisemutate the HTML email one can see previewed on `/emails`.@@ -123,18 +123,18 @@ email_password = gmail_password## Email templates-Zulip's email templates live under `templates/zerver/emails`. Email+Zulip's email templates live under `templates/zerver/emails`. Emailtemplates are a messy problem, because on the one hand, you want nice,readable markup and styling, but on the other, email clients have verylimited CSS support and generally require us to inject any CSS we're-using in the emails into the email as inline styles. And then you-also need both plain-text and HTML emails. We solve these problems+using in the emails into the email as inline styles. And then you+also need both plain-text and HTML emails. We solve these problemsusing a combination of the[premailer](https://github.com/peterbe/premailer) library and havingtwo copies of each email (plain-text and HTML).So for each email, there are two source templates: the `.txt` version-(for plain-text format) as well as a `.source.html` template. The+(for plain-text format) as well as a `.source.html` template. The`.txt` version is used directly; while the `.source.html` template isprocessed by `scripts/setup/inline_email_css.py` (generating a `.html` templateunder `templates/zerver/emails/compiled`); that tool (powered by@@ -143,19 +143,19 @@ under `templates/zerver/emails/compiled`); that tool (powered byWhat this means is that when you're editing emails, **you need to run`scripts/setup/inline_email_css.py`** after making changes to see the changes-take effect. Our tooling automatically runs this as part of+take effect. Our tooling automatically runs this as part of`tools/provision` and production deployments; but you should bump`PROVISION_VERSION` when making changes to emails that change testbehavior, or other developers will get test failures until theyprovision.While this model is great for the markup side, it isn't ideal for-[translations](../translating/translating.md). The Django+[translations](../translating/translating.md). The Djangotranslation system works with exact strings, and having different newmarkup can require translators to re-translate strings, which canresult in problems like needing 2 copies of each string (one forplain-text, one for HTML) and/or needing to re-translate a bunch of-strings after making a CSS tweak. Re-translating these strings is+strings after making a CSS tweak. Re-translating these strings isrelatively easy in Transifex, but annoying.So when writing email templates, we try to translate individualdiff --git a/docs/subsystems/emoji.md b/docs/subsystems/emoji.mdindex 1de17278750..365a3580d04 100644--- a/docs/subsystems/emoji.md+++ b/docs/subsystems/emoji.md@@ -1,7 +1,7 @@# EmojiEmoji seem like a simple idea, but there's actually a ton of-complexity that goes into an effective emoji implementation. This+complexity that goes into an effective emoji implementation. Thisdocument discusses a number of these issues.Currently, Zulip supports these four display formats for emoji:@@ -14,15 +14,15 @@ Currently, Zulip supports these four display formats for emoji:## Emoji codesThe Unicode standard has various ranges of characters set aside for-emoji. So you can put emoji in your terminal using actual Unicode-characters like 😀 and 👍. If you paste those into Zulip, Zulip will+emoji. So you can put emoji in your terminal using actual Unicode+characters like 😀 and 👍. If you paste those into Zulip, Zulip willrender them as the corresponding emoji image.However, the Unicode committee did not standardize on a set of-human-readable names for emoji. So, for example, when using the+human-readable names for emoji. So, for example, when using thepopular `:` based style for entering emoji from the keyboard, we haveto decide whether to use `:angry:` or `:angry_face:` to represent an-angry face. Different products use different approaches, but for+angry face. Different products use different approaches, but forpurposes like emoji pickers or autocomplete, you definitely want topick exactly one of these names, since otherwise users will always beseeing duplicates of a given emoji next to each other.@@ -32,9 +32,9 @@ section on [picking emoji names](#picking-emoji-names) below.### Custom emoji-Zulip supports custom user-uploaded emoji. We manage those by having+Zulip supports custom user-uploaded emoji. We manage those by havingthe name of the emoji be its "emoji code", and using an emoji_type-field to keep track of it. We are in the progress of migrating Zulip+field to keep track of it. We are in the progress of migrating Zulipto refer to these emoji only by ID, which is a requirement for beingable to support deprecating old realm emoji in a sensible way.@@ -42,17 +42,17 @@ able to support deprecating old realm emoji in a sensible way.We use the [iamcal emoji data package][iamcal] to provide spritesheets and individual images for our emoji, as well as a data set of-emoji categories, code points, etc. The sprite sheets are used+emoji categories, code points, etc. The sprite sheets are usedby the Zulip web app to display emoji in messages, emoji reactions,-etc. However, we can't use the sprite sheets in some contexts, such+etc. However, we can't use the sprite sheets in some contexts, suchas missed-message and digest emails, that need to have self-contained-assets. For those, we use individual emoji files under-`static/generated/emoji`. The structure of that repository contains+assets. For those, we use individual emoji files under+`static/generated/emoji`. The structure of that repository containsboth files named after the Unicode representation of emoji (as actualimage files) as well as symlinks pointing to those emoji.We need to maintain those both for the names used in the iamcal emoji-data set as well as our old emoji data set (`emoji_map.json`). Zulip+data set as well as our old emoji data set (`emoji_map.json`). Zuliphas a tool, `tools/setup/emoji/build_emoji`, that combines the`emoji.json` file from iamcal with the old `emoji_map.json` data setto construct the various symlink farms and output files described@@ -64,30 +64,30 @@ The `build_emoji` tool generates the set of files under`static/generated/emoji` is a symlink to that tree; we do this inorder to cache old versions to make provisioning and productiondeployments super fast in the common case that we haven't changed the-emoji tooling). See [our dependencies document](../subsystems/dependencies.md)+emoji tooling). See [our dependencies document](../subsystems/dependencies.md)for more details on this strategy.The emoji tree generated by this process contains several import elements:- `emoji_codes.json`: A set of mappings used by the Zulip frontend tounderstand what Unicode emoji exist and what their shortnames are,- used for autocomplete, emoji pickers, etc. This has been+ used for autocomplete, emoji pickers, etc. This has beendeduplicated using the logic in`tools/setup/emoji/emoji_setup_utils.py` to generally only have`:angry:` and not also `:angry_face:`, since having both is ugly andpointless for purposes like autocomplete and emoji pickers.- `images/emoji/unicode/*.png`: A farm of emoji- `images/emoji/*.png`: A farm of symlinks from emoji names to the- `images/emoji/unicode/` tree. This is used to serve individual emoji+ `images/emoji/unicode/` tree. This is used to serve individual emojiimages, as well as for the[backend Markdown processor](../subsystems/markdown.md) to know which emoji- names exist and what Unicode emoji / images they map to. In this+ names exist and what Unicode emoji / images they map to. In thistree, we currently include all of the emoji in `emoji-map.json`;this means that if you send `:angry_face:`, it won't autocomplete,but will still work (but not in previews).- Some CSS and PNGs for the emoji spritesheets, used in Zulip foremoji pickers where we would otherwise need to download over 1000 ofindividual emoji images (which would cause a browser performance- problem). We have multiple spritesheets: one for each emoji+ problem). We have multiple spritesheets: one for each emojiprovider that we support (Google, Twitter, EmojiOne, and Apple.).[iamcal]: https://github.com/iamcal/emoji-datadiff --git a/docs/subsystems/events-system.md b/docs/subsystems/events-system.mdindex 4a4b469a6f3..401937fa6e8 100644--- a/docs/subsystems/events-system.md+++ b/docs/subsystems/events-system.md@@ -1,7 +1,7 @@# Real-time push and eventsZulip's "events system" is the server-to-client push system that-powers our real-time sync. This document explains how it works; to+powers our real-time sync. This document explains how it works; toread an example of how a complete feature using this system works,check out the[new application feature tutorial](../tutorials/new-feature-tutorial.md).@@ -9,23 +9,23 @@ check out theAny single-page web application like Zulip needs a story for howchanges made by one client are synced to other clients, though havinga good architecture for this is particularly important for a chat tool-like Zulip, since the state is constantly changing. When we talk+like Zulip, since the state is constantly changing. When we talkabout clients, think a browser tab, mobile app, or API bot that needs-to receive updates to the Zulip data. The simplest example is a new+to receive updates to the Zulip data. The simplest example is a newmessage being sent by one client; other clients must be notified in-order to display the message. But a complete application like Zulip+order to display the message. But a complete application like Zuliphas dozens of different types of data that need to be synced to otherclients, whether it be new streams, changes in a user's name or-avatar, settings changes, etc. In Zulip, we call these updates that+avatar, settings changes, etc. In Zulip, we call these updates thatneed to be sent to other clients **events**.An important thing to understand when designing such a system is thatevents need to be synced to every client that has a copy of the olddata if one wants to avoid clients displaying inaccurate data to-users. So if a user has two browser windows open and sends a message,+users. So if a user has two browser windows open and sends a message,every client controlled by that user as well as any recipients of themessage, including both of those two browser windows, will receive-that event. (Technically, we don't need to send events to the client+that event. (Technically, we don't need to send events to the clientthat triggered the change, but this approach saves a bunch ofunnecessary duplicate UI update code, since the client making thechange can just use the same code as every other client, maybe plus a@@ -34,11 +34,11 @@ little notification that the operation succeeded).Architecturally, there are a few things needed to make a successfulreal-time sync system work:-- **Generation**. Generating events when changes happen to data, and+- **Generation**. Generating events when changes happen to data, anddetermining which users should receive each event.-- **Delivery**. Efficiently delivering those events to interested+- **Delivery**. Efficiently delivering those events to interestedclients, ideally in an exactly-once fashion.-- **UI updates**. Updating the UI in the client once it has received+- **UI updates**. Updating the UI in the client once it has receivedevents from the server.Reactive JavaScript libraries like React and Vue can help simplify the@@ -51,14 +51,14 @@ problems in a scalable, correct, and predictable way.## Generation systemZulip's generation system is built around a Python function,-`send_event(realm, event, users)`. It accepts the realm (used for+`send_event(realm, event, users)`. It accepts the realm (used forsharding), the event data structure (just a Python dictionary withsome keys and value; `type` is always one of the keys but the restdepends on the specific event) and a list of user IDs for the users-whose clients should receive the event. In special cases such as+whose clients should receive the event. In special cases such asmessage delivery, the list of users will instead be a list of dictsmapping user IDs to user-specific data like whether that user was-mentioned in that message. The data passed to `send_event` are simply+mentioned in that message. The data passed to `send_event` are simplymarshalled as JSON and placed in the `notify_tornado` RabbitMQ queueto be consumed by the delivery system.@@ -72,9 +72,9 @@ Usually, this list of users is one of 3 things:or the people on a private message thread.It is the responsibility of the caller of `send_event` to choose the-list of user IDs correctly. There can be security problems if e.g. an+list of user IDs correctly. There can be security problems if e.g. anevent containing private message content is sent to the entire-organization. However, if an event isn't sent to enough clients,+organization. However, if an event isn't sent to enough clients,there will likely be user-visible real-time sync bugs.Most of the hard work in event generation is about defining consistent@@ -84,7 +84,7 @@ wide range of possible clients, and make it easy for developers.## Delivery systemZulip's event delivery (real-time push) system is based on Tornado,-which is ideal for handling a large number of open requests. Details+which is ideal for handling a large number of open requests. Detailson Tornado are available in the[architecture overview](../overview/architecture-overview.md), but in short itis good at holding open a large number of connections for a long time.@@ -94,7 +94,7 @@ primarily `zerver/tornado/event_queue.py`.Zulip's event delivery system is based on "long-polling"; basicallyclients make `GET /json/events` calls to the server, and the serverdoesn't respond to the request until it has an event to deliver to the-client. This approach is reasonably efficient and works everywhere+client. This approach is reasonably efficient and works everywhere(unlike websockets, which have a decreasing but nonzero level ofclient compatibility problems).@@ -103,16 +103,16 @@ For each connected client, the **event queue server** maintains anthat client which have not yet been acknowledged by that client.Ignoring the subtle details around error handling, the protocol ispretty simple; when a client does a `GET /json/events` call, the-server checks if there are any events in the queue. If there are, it-returns the events immediately. If there aren't, it records that+server checks if there are any events in the queue. If there are, it+returns the events immediately. If there aren't, it records thatqueue as having a waiting client (often called a `handler` in thecode).When it pulls an event off the `notify_tornado` RabbitMQ queue, itsimply delivers the event to each queue associated with one of the-target users. If the queue has a waiting client, it breaks the+target users. If the queue has a waiting client, it breaks thelong-poll connection by returning an HTTP response to the waiting-client request. If there is no waiting client, it simply pushes the+client request. If there is no waiting client, it simply pushes theevent onto the queue.When starting up, each client makes a `POST /json/register` to the@@ -120,19 +120,19 @@ server, which creates a new event queue for that client and returns the`queue_id` as well as an initial `last_event_id` to the client (it canalso, optionally, fetch the initial data to save an RTT and avoidraces; see the below section on initial data fetches for details on-why this is useful). Once the event queue is registered, the client+why this is useful). Once the event queue is registered, the clientcan just do an infinite loop calling `GET /json/events` with thoseparameters, updating `last_event_id` each time to acknowledge anyevents it has received (see `call_on_each_event` in the[Zulip Python API bindings][api-bindings-code] for a complete example-implementation). When handling each `GET /json/events` request, the+implementation). When handling each `GET /json/events` request, thequeue server can safely delete any events that have an event ID lessthan or equal to the client's `last_event_id` (event IDs are just acounter for the events a given queue has received.)If network failures were impossible, the `last_event_id` parameter inthe protocol would not be required, but it is important for enabling-exactly-once delivery in the presence of potential failures. (Without+exactly-once delivery in the presence of potential failures. (Withoutit, the queue server would have to delete events from the queue assoon as it attempted to send them to the client; if that specific HTTPresponse didn't reach the client due to a network TCP failure, then@@ -150,13 +150,13 @@ every 45s or so (if no other events have arrived in the meantime).To avoid a large memory and other resource leak, the queues aregarbage collected after (by default) 10 minutes of inactivity from aclient, under the theory that the client has likely gone off the-Internet (or no longer exists) access; this happens constantly. If+Internet (or no longer exists) access; this happens constantly. Ifthe client returns, it will receive a "queue not found" error whenrequesting events; its handler for this case should just restart theclient / reload the browser so that it refetches initial data the same-way it would on startup. Since clients have to implement their+way it would on startup. Since clients have to implement theirstartup process anyway, this approach adds minimal technical-complexity to clients. A nice side effect is that if the event queue+complexity to clients. A nice side effect is that if the event queueserver (which stores queues in memory) were to crash and loseits data, clients would recover, just as if they had lost Internetaccess briefly (there is some DoS risk to manage, though).@@ -197,11 +197,11 @@ This is quite challenging to do technically, because fetching theinitial state for a complex web application like Zulip might involvedozens of queries to the database, caches, etc. over the course of100ms or more, and it is thus nearly impossible to do all of those-things together atomically. So instead, we use a more complicated+things together atomically. So instead, we use a more complicatedalgorithm that can produce the atomic result from non-atomic-subroutines. Here's how it works when you make a `register` API+subroutines. Here's how it works when you make a `register` APIrequest; the logic is in `zerver/views/events_register.py` and-`zerver/lib/events.py`. The request is directly handled by Django:+`zerver/lib/events.py`. The request is directly handled by Django:- Django makes an HTTP request to Tornado, requesting that a new eventqueue be created, and records its queue ID.@@ -212,16 +212,16 @@ request; the logic is in `zerver/views/events_register.py` andthat had been added to the Tornado event queue since itwas created.- Finally, Django "applies" the events (see the `apply_events`- function) to the initial state that it fetched. E.g. for a name+ function) to the initial state that it fetched. E.g. for a namechange event, it finds the user data in the `realm_user` datastructure, and updates it to have the new name.### TestingThe design above achieves everything we desire, at the cost that we need to-write a correct `apply_events` function. This is a difficult function to+write a correct `apply_events` function. This is a difficult function toimplement correctly, because the situations that it handles almost never-happen (being race conditions) during manual testing. Fortunately, we have+happen (being race conditions) during manual testing. Fortunately, we havea protocol for testing `apply_events` in our automated backend tests.#### Overview@@ -257,7 +257,7 @@ within `test_events.py`.The `verify_action` function simulates the possible race condition inorder to verify that the `apply_events` logic works correctly in the-context of some action function. To use our concrete example above,+context of some action function. To use our concrete example above,we are seeing that applying the events from the`do_remove_default_stream` action inside of `apply_events` to a stalecopy of your state results in the same state dictionary as doing the@@ -290,7 +290,7 @@ behind the `apply_events` function. It may also be helpful to read the codefor `verify_action` itself. Finally, you may want to ask for help on chat.Before we move on to the next step, it's worth noting that `verify_action`-only has one required parameter, which is the action function. We+only has one required parameter, which is the action function. Wetypically express the action function as a lambda, so that wecan pass in arguments:@@ -303,7 +303,7 @@ There are some notable optional parameters for `verify_action`:- `state_change_expected` must be set to `False` if your actiondoesn't actually require state changes for some reason; otherwise,`verify_action` will complain that your test doesn't really- exercise any `apply_events` logic. Typing notifications (which+ exercise any `apply_events` logic. Typing notifications (whichare ephemereal) are a common place where we use this.- `num_events` will tell `verify_action` how many events the@@ -319,16 +319,16 @@ the code itself in `BaseAction` (in `test_events.py`).#### Schema checking-The `test_events.py` system has two forms of schema checking. The+The `test_events.py` system has two forms of schema checking. Thefirst is verifying that you've updated the [GET /events APIdocumentation](https://zulip.com/api/get-events) to document your newevent's format for benefit of the developers of Zulip's mobile app,-terminal app, and other API clients. See the [API documentation+terminal app, and other API clients. See the [API documentationdocs](../documentation/api.md) for details on the OpenAPIdocumentation.The second is higher-detail check inside `test_events` that this-specific test generated the expected series of events. Let's look at+specific test generated the expected series of events. Let's look atthe last line of our example test snippet:```python@@ -339,17 +339,17 @@ check_default_streams("events[0]", events[0])We have discussed `verify_action` in some detail, and you willnote that it returns the actual events generated by the action-function. It is part of our test discipline in `test_events` to+function. It is part of our test discipline in `test_events` toverify that the events are formatted in a predictable way.Ideally, we would test that events match the exact data that weexpect, but it can be difficult to do this due to unpredictable-things like database ids. So instead, we just verify the "schema"-of the event(s). We use a schema checker like `check_default_streams`+things like database ids. So instead, we just verify the "schema"+of the event(s). We use a schema checker like `check_default_streams`to validate the types of the data.If you are creating a new event format, then you will have to-write your own schema checker in `event_schema.py`. Here is+write your own schema checker in `event_schema.py`. Here isthe example relevant to our example:```python@@ -362,9 +362,9 @@ default_streams_event = event_dict_type(check_default_streams = make_checker(default_streams_event)```-Note that `basic_stream_fields` is not shown in these docs. The+Note that `basic_stream_fields` is not shown in these docs. Thebest way to understand how to write schema checkers is to read-`event_schema.py`. There is a large block comment at the top of+`event_schema.py`. There is a large block comment at the top ofthe file, and then you can skim the rest of the file to see thepatterns.@@ -386,9 +386,9 @@ against the two versions of the schema that you declared above usingThe final detail we need to ensure that `apply_events` always workscorrectly is to make sure that we have relevant tests for-every event type that can be generated by Zulip. This can be tested+every event type that can be generated by Zulip. This can be testedmanually using `test-backend --coverage BaseAction` and then-checking that all the calls to `send_event` are covered. Someday+checking that all the calls to `send_event` are covered. Somedaywe'll add automation that verifies this directly by inspecting thecoverage data.@@ -400,9 +400,9 @@ available via the `page_params` parameter.### MessagesOne exception to the protocol described in the last section is the-actual messages. Because Zulip clients usually fetch them in a+actual messages. Because Zulip clients usually fetch them in aseparate AJAX call after the rest of the site is loaded, we don't need-them to be included in the initial state data. To handle those+them to be included in the initial state data. To handle thosecorrectly, clients are responsible for discarding events related tomessages that the client has not yet fetched.@@ -418,25 +418,25 @@ to make sure we handle backwards-compatibility properly.type, we just need to carefully document the changes in the [APIdocumentation](../documentation/api.md), being careful to bump`API_FEATURE_LEVEL` and include a `**Changes**` entry in the updated- `GET /events` API documentation. It's also a good idea to and open+ `GET /events` API documentation. It's also a good idea to and openissues with the mobile and terminal projects to notify them.- If we're making changes that could confuse existing client app logicthat parses events (E.g. changing the type/meaning of an existingfield, or removing a field), we need to be very careful, since Zulip- supports old clients connecting to a modern server. See our+ supports old clients connecting to a modern server. See our[release lifecycle](../overview/release-lifecycle.md) documentation- for more details on the policy. Our technical solution is to add a+ for more details on the policy. Our technical solution is to add a`client_capabilities` flag for the new format and have the codecontinue sending data in the old format for clients that don't- declare support for the new capability. `bulk_message_deletion` is- a good example to crib from. (A few years later, we'll make the+ declare support for the new capability. `bulk_message_deletion` is+ a good example to crib from. (A few years later, we'll make theclient capability required and remove support for not having it).- For most event types, Tornado just passes the event throughtransparently, and `event_queue.py` requires no changes.- However, when changing the format of data used by Tornado code, likerenaming the `presence_idle_user_ids` field in `message` events, weneed to be careful, because pre-upgrade events may be present in- Tornado's queue when we upgrade Tornado. So it's essential to write+ Tornado's queue when we upgrade Tornado. So it's essential to writelogic in `event_queue.py` to translate the old format into the newformat, or Tornado may crash when upgrading past the relevantcommit. We attempt to contain that sort of logic in the `from_dict`diff --git a/docs/subsystems/full-text-search.md b/docs/subsystems/full-text-search.mdindex 96d9e7adac4..18252a454ec 100644--- a/docs/subsystems/full-text-search.md+++ b/docs/subsystems/full-text-search.md@@ -1,7 +1,7 @@# Full-text searchZulip supports full-text search, which can be combined arbitrarily-with Zulip's full suite of narrowing operators. By default, it only+with Zulip's full suite of narrowing operators. By default, it onlysupports English text, but there is an experimental[PGroonga](https://pgroonga.github.io/) integration that providesfull-text search for all languages.@@ -19,7 +19,7 @@ search results.In order to optimize the performance of delivering messages, thefull-text search index is updated for newly sent messages in the-background, after the message has been delivered. This background+background, after the message has been delivered. This backgroundupdating is done by`puppet/zulip/files/postgresql/process_fts_updates`, which is usuallydeployed on the database server, but could be deployed on an@@ -31,7 +31,7 @@ Zulip also supports using [PGroonga](https://pgroonga.github.io/) forfull-text search. While PostgreSQL's built-in full-text search featuresupports only one language at a time (in Zulip's case, English), thePGroonga full-text search engine supports all languages-simultaneously, including Japanese and Chinese. Once we have tested+simultaneously, including Japanese and Chinese. Once we have testedthis new backend sufficiently, we expect to switch Zulip deploymentsto always use PGroonga.diff --git a/docs/subsystems/hashchange-system.md b/docs/subsystems/hashchange-system.mdindex 866363e6bf9..a033ca14862 100644--- a/docs/subsystems/hashchange-system.md+++ b/docs/subsystems/hashchange-system.md@@ -13,19 +13,19 @@ Some examples are:- `/#streams/11/announce`: Streams overlay with stream ID 11 (called"announce") selected.- `/#narrow/stream/42-android/topic/fun`: Message feed showing stream- "android" and topic "fun". (The `42` represents the id of the+ "android" and topic "fun". (The `42` represents the id of thestream.The main module in the frontend that manages this all is`static/js/hashchange.js` (plus `hash_util.js` for all the parsing-code), which is unfortunately one of our thorniest modules. Part of+code), which is unfortunately one of our thorniest modules. Part ofthe reason that it's thorny is that it needs to support a lot ofdifferent flows:- The user clicking on an in-app link, which in turn opens an overlay.For example the streams overlay opens when the user clicks the smallcog symbol on the left sidebar, which is in fact a link to- `/#streams`. This makes it easy to have simple links around the app+ `/#streams`. This makes it easy to have simple links around the appwithout custom click handlers for each one.- The user uses the "back" button in their browser (basicallyequivalent to the previous one, as a *link* out of the browser history@@ -70,7 +70,7 @@ Internally you have these functions:- `hashchange.do_hashchange_normal` handles most cases, like loading the mainpage (but maybe with a specific URL if you are narrowed to astream or topic or PMs, etc.).-- `hashchange.do_hashchange_overlay` handles overlay cases. Overlays have+- `hashchange.do_hashchange_overlay` handles overlay cases. Overlays havesome minor complexity related to remembering the page fromwhich the overlay was launched, as well as optimizing in-pagetransitions (i.e. don't close/re-open the overlay if you can@@ -84,19 +84,19 @@ reload itself:- If the browser has been offline for more than 10 minutes, thebrowser's [event queue][events-system] will have beengarbage-collected by the server, meaning the browser can no longer- get real-time updates altogether. In this case, the browser- auto-reloads immediately in order to reconnect. We have coded an+ get real-time updates altogether. In this case, the browser+ auto-reloads immediately in order to reconnect. We have coded anunsuspend callback (based on some clever time logic) that ensures wecheck immediately when a client unsuspends; grep for `watchdog` tosee the code.- If a new version of the server has been deployed, we want to reload- the browser so that it will start running the latest code. However,- we don't want server deploys to be disruptive. So, the backend+ the browser so that it will start running the latest code. However,+ we don't want server deploys to be disruptive. So, the backendpreserves user-side event queues (etc.) and just pushes a special- `restart` event to all clients. That event causes the browser to+ `restart` event to all clients. That event causes the browser tostart looking for a good time to reload, based on when the user isidle (ideally, we'd reload when they're not looking and restore- state so that the user never knew it happened!). The logic for+ state so that the user never knew it happened!). The logic fordoing this is in `static/js/reload.js`; but regardless we'll reloadwithin 30 minutes unconditionally.diff --git a/docs/subsystems/hotspots.md b/docs/subsystems/hotspots.mdindex 4f01d64555a..4e54abf3666 100644--- a/docs/subsystems/hotspots.md+++ b/docs/subsystems/hotspots.md@@ -48,7 +48,7 @@ However, if you would like to fix the orientation of a hotspot popover, aTo test your hotspot in the development environment, set`ALWAYS_SEND_ALL_HOTSPOTS = True` in `zproject/dev_settings.py`, andinvoke `hotspots.initialize()` in your browser console. Every hotspot-should be displayed. Note that this setting has a bug that can result+should be displayed. Note that this setting has a bug that can resultin multiple copies of hotspots appearing; you can clear that byreloading the browser.diff --git a/docs/subsystems/html-css.md b/docs/subsystems/html-css.mdindex 1a6eb69b757..df68e34a3a2 100644--- a/docs/subsystems/html-css.md+++ b/docs/subsystems/html-css.md@@ -3,12 +3,12 @@## Zulip CSS organizationThe Zulip application's CSS can be found in the `static/styles/`-directory. Zulip uses [Bootstrap](https://getbootstrap.com/) as its+directory. Zulip uses [Bootstrap](https://getbootstrap.com/) as itsmain third-party CSS library.-Zulip uses PostCSS for its CSS files. There are two high-level sections+Zulip uses PostCSS for its CSS files. There are two high-level sectionsof CSS: the "portico" (logged-out pages like /help/, /login/, etc.),-and the app. The portico CSS lives under the `static/styles/portico`+and the app. The portico CSS lives under the `static/styles/portico`subdirectory.## Editing Zulip CSS@@ -33,8 +33,8 @@ browser window (following backend changes).Without care, it's easy for a web application to end up with thousandsof lines of duplicated CSS code, which can make it very difficult to-understand the current styling or modify it. We would very much like-to avoid such a fate. So please make an effort to reuse existing+understand the current styling or modify it. We would very much like+to avoid such a fate. So please make an effort to reuse existingstyling, clean up now-unused CSS, etc., to keep things maintainable.### Be consistent with existing similar UI@@ -84,7 +84,7 @@ found [here][jconditionals].The context for Jinja2 templates is assembled from a few places:-- `zulip_default_context` in `zerver/context_processors.py`. This is+- `zulip_default_context` in `zerver/context_processors.py`. This isthe default context available to all Jinja2 templates.- As an argument in the `render` call in the relevant function that@@ -151,10 +151,10 @@ relevant background as well.### Primary build processZulip's frontend is primarily JavaScript in the `static/js` directory;-we are working on migrating these to TypeScript modules. Stylesheets+we are working on migrating these to TypeScript modules. Stylesheetsare written in CSS extended by various PostCSS plugins; they areconverted from plain CSS, and we have yet to take full advantage of-the features PostCSS offers. We use Webpack to transpile and build JS+the features PostCSS offers. We use Webpack to transpile and build JSand CSS bundles that the browser can understand, one for each entrypoints specified in `tools/webpack.*assets.json`; source maps aregenerated in the process for better debugging experience.@@ -188,9 +188,9 @@ first add it to the appropriate place under `static/`.version of third-party libraries.- Third-party files that we have patched should all go in`static/third/`. Tag the commit with "[third]" when adding or- modifying a third-party package. Our goal is to the extent possible+ modifying a third-party package. Our goal is to the extent possibleto eliminate patched third-party code from the project.-- Our own JavaScript and TypeScript files live under `static/js`. Ideally,+- Our own JavaScript and TypeScript files live under `static/js`. Ideally,new modules should be written in TypeScript (details on this policy below).- CSS files live under `static/styles`.- Portico JavaScript ("portico" means for logged-out pages) lives under@@ -225,18 +225,18 @@ If you want to test minified files in development, look for theA few useful notes are:- Zulip installs static assets in production in-`/home/zulip/prod-static`. When a new version is deployed, before the+`/home/zulip/prod-static`. When a new version is deployed, before theserver is restarted, files are copied into that directory.- We use the VFL (versioned file layout) strategy, where each file inthe codebase (e.g. `favicon.ico`) gets a new name- (e.g. `favicon.c55d45ae8c58.ico`) that contains a hash in it. Each+ (e.g. `favicon.c55d45ae8c58.ico`) that contains a hash in it. Eachdeployment, has a manifest file(e.g. `/home/zulip/deployments/current/staticfiles.json`) that maps- codebase filenames to serving filenames for that deployment. The+ codebase filenames to serving filenames for that deployment. Thebenefit of this VFL approach is that all the static files for pastdeployments can coexist, which in turn eliminates most classes ofrace condition bugs where browser windows opened just before a- deployment can't find their static assets. It also is necessary for+ deployment can't find their static assets. It also is necessary forany incremental rollout strategy where different clients getdifferent versions of the site.- Some paths for files (e.g. emoji) are stored in the@@ -261,24 +261,24 @@ where one is moving code from an existing JavaScript module, the newcommit should just move the code, not translate it to TypeScript).TypeScript provides more accurate information to development tools,allowing for better refactoring, auto-completion and static analysis.-TypeScript also uses the ES6 module system. See our documentation on+TypeScript also uses the ES6 module system. See our documentation on[TypeScript static types](../testing/typescript).Webpack does not ordinarily allow modules to be accessed directly fromthe browser console, but for debugging convenience, we have a customwebpack plugin (`tools/debug-require-webpack-plugin.ts`) that exposesa version of the `require()` function to the development environment-browser console for this purpose. For example, you can access our+browser console for this purpose. For example, you can access our`people` module by evaluating`people = require("./static/js/people")`, or the third-party `lodash`-module with `_ = require("lodash")`. This mechanism is **not** a+module with `_ = require("lodash")`. This mechanism is **not** astable API and should not be used for any purpose other thaninteractive debugging.We have one module, `zulip_test`, that’s exposed as a global variableusing `expose-loader` for direct use in Puppeteer tests and in the-production browser console. If you need to access a variable or-function in those scenarios, add it to `zulip_test`. This is also+production browser console. If you need to access a variable or+function in those scenarios, add it to `zulip_test`. This is also**not** a stable API.[Jinja2]: http://jinja.pocoo.org/diff --git a/docs/subsystems/input-pills.md b/docs/subsystems/input-pills.mdindex 0d4e3f44ba5..344d49f8427 100644--- a/docs/subsystems/input-pills.md+++ b/docs/subsystems/input-pills.md@@ -27,17 +27,17 @@ var pills = input_pill.create({```You can look at `static/js/user_pill.js` to see how the above-methods are implemented. Essentially you just need to convert+methods are implemented. Essentially you just need to convertfrom raw data (like an email) to structured data (like an objectwith display_value, email, and user_id for a user), and vice-versa. The most important field to supply is `display_value`.+versa. The most important field to supply is `display_value`.For user pills `pill_item.display_value === user.full_name`.## TypeaheadPills almost always work in conjunction with typeahead, andyou will want to provide a `source` function to typeahead-that can exclude items from the prior pills. Here is an+that can exclude items from the prior pills. Here is anexample snippet from our user group settings code.```jsdiff --git a/docs/subsystems/logging.md b/docs/subsystems/logging.mdindex 5a693244791..e921053f0bb 100644--- a/docs/subsystems/logging.md+++ b/docs/subsystems/logging.md@@ -1,12 +1,12 @@# Logging and error reportingHaving a good system for logging error reporting is essential to-making a large project like Zulip successful. Without reliable error+making a large project like Zulip successful. Without reliable errorreporting, one has to rely solely on bug reports from users in orderto produce a working product.Our goal as a project is to have zero known 500 errors on the backend-and zero known JavaScript exceptions on the frontend. While there+and zero known JavaScript exceptions on the frontend. While therewill always be new bugs being introduced, that goal is impossiblewithout an efficient and effective error reporting framework.@@ -21,7 +21,7 @@ The [Django][django-errors] framework provides much of theinfrastructure needed by our error reporting system:- The ability to send emails to the server's administrators with any- 500 errors, using the `mail_admins` function. We enhance these data+ 500 errors, using the `mail_admins` function. We enhance these datawith extra details (like what user was involved in the error) in`zerver/logging_handlers.py`, and then send them to theadministrator in `zerver/lib/error_notify.py` (which also supports@@ -47,10 +47,10 @@ exception, and the full request headers which triggered it.### Backend logging[Django's logging system][django-logging] uses the standard-[Python logging infrastructure][python-logging]. We have configured+[Python logging infrastructure][python-logging]. We have configuredthem so that `logging.exception` and `logging.error` get emailed tothe server maintainer, while `logging.warning` will just appear in-`/var/log/zulip/errors.log`. Lower log levels just appear in the main+`/var/log/zulip/errors.log`. Lower log levels just appear in the mainserver log (as well as in the log for corresponding process, be it`django.log` for the main Django processes or the appropriate`events_*` log file for a queue worker).@@ -59,7 +59,7 @@ server log (as well as in the log for corresponding process, be itThe main Zulip server log contains a line for each backend request.It also contains warnings, errors, and the full tracebacks for any-Python exceptions. In production, it goes to+Python exceptions. In production, it goes to`/var/log/zulip/server.log`; in development, it goes to the terminalwhere you run `run-dev.py`.@@ -104,7 +104,7 @@ processor, in memcached, or in other Python code.One useful thing to note, however, is that the database time is onlythe time spent connecting to and receiving a response from the-database. Especially when response are large, there can often be a+database. Especially when response are large, there can often be agreat deal of Python processing overhead to marshall the data from thedatabase into Django objects that is not accounted for in thesenumbers.@@ -113,13 +113,13 @@ numbers.We have a custom library, called `blueslip` (named after the form usedat MIT to report problems with the facilities), that takes care of-reporting JavaScript errors. In production, this means emailing the+reporting JavaScript errors. In production, this means emailing theserver administrators (though the setting controlling this,`BROWSER_ERROR_REPORTING`, is disabled by default, since most problemsare unlikely to be addressable by a system administrator, and it'svery hard to make JavaScript errors not at least somewhat spammy dueto the variety of browser versions and sets of extensions that someone-might use). In development, this means displaying a highly visible+might use). In development, this means displaying a highly visibleoverlay over the message view area, to make exceptions in testing anew feature hard to miss.@@ -130,23 +130,23 @@ new feature hard to miss.and assertion failures.- Blueslip keeps a log of all the notices it has received during abrowser session, and includes them in reports to the server, so that- one can see cases where exceptions chained together. You can print+ one can see cases where exceptions chained together. You can printthis log from the browser console using`blueslip = require("./static/js/blueslip"); blueslip.get_log()`.Blueslip supports several error levels:- `throw new Error(…)`: For fatal errors that cannot be easily- recovered from. We try to avoid using it, since it kills the+ recovered from. We try to avoid using it, since it kills thecurrent JS thread, rather than returning execution to the caller.- `blueslip.error`: For logging of events that are definitely causedby a bug and thus sufficiently important to be reported, but wherewe can handle the error without creating major user-facing problems(e.g. an exception when handling a presence update).- `blueslip.warn`: For logging of events that are a problem but not- important enough to send an email about in production. They are,+ important enough to send an email about in production. They are,however, highlighted in the JS console in development.- `blueslip.log` (and `blueslip.info`): Logged to the JS console in- development and also in the blueslip log in production. Useful for+ development and also in the blueslip log in production. Useful fordata that might help discern what state the browser was in during anerror (e.g. whether the user was in a narrow).- `blueslip.debug`: Similar to `blueslip.log`, but are not printed todiff --git a/docs/subsystems/management-commands.md b/docs/subsystems/management-commands.mdindex 516412be218..cac10977d45 100644--- a/docs/subsystems/management-commands.md+++ b/docs/subsystems/management-commands.md@@ -5,7 +5,7 @@ live under `{zerver,zilencer,analytics}/management/commands/`.If you need some Python code to run with a Zulip context (access tothe database, etc.) in a script, it should probably go in a management-command. The key thing distinguishing these from production scripts+command. The key thing distinguishing these from production scripts(`scripts/`) and development scripts (`tools/`) is that managementcommands can access the database.@@ -33,14 +33,14 @@ installation, e.g. `checkconfig`, `send_test_email`.## Writing management commandsIt's generally pretty easy to template off an existing management-command to write a new one. Some good examples are-`change_user_email` and `deactivate_realm`. The Django documentation+command to write a new one. Some good examples are+`change_user_email` and `deactivate_realm`. The Django documentationis good, but we have a few pieces advice specific to the Zulipproject.- If you need to access a realm or user, use the `ZulipBaseCommand`class in `zerver/lib/management.py` so you don't need to write the- tedious code of looking those objects up. This is especially+ tedious code of looking those objects up. This is especiallyimportant for users, since the library handles the issues aroundlooking up users by email well (if there's a unique user with thatemail, just modify it without requiring the user to specify the@@ -48,8 +48,8 @@ project.- Avoid writing a lot of code in management commands; managementcommands are annoying to unit test, and thus easier to maintain ifall the interesting logic is in a nice function that is unit tested- (and ideally, also used in Zulip's existing code). Look for code in- `zerver/lib/` that already does what you need. For most actions,+ (and ideally, also used in Zulip's existing code). Look for code in+ `zerver/lib/` that already does what you need. For most actions,you can just call a `do_change_foo` type function from`zerver/lib/actions.py` to do all the work; this is usually farbetter than manipulating the database directly, since the librarydiff --git a/docs/subsystems/markdown.md b/docs/subsystems/markdown.mdindex 76476183c62..5fd01bd97c1 100644--- a/docs/subsystems/markdown.md+++ b/docs/subsystems/markdown.md@@ -1,13 +1,13 @@# Markdown implementationZulip uses a special flavor of Markdown/CommonMark for its message-formatting. Our Markdown flavor is unique primarily to add important+formatting. Our Markdown flavor is unique primarily to add importantextensions, such as quote blocks and math blocks, and also to do-previews and correct issues specific to the chat context. Beyond+previews and correct issues specific to the chat context. Beyondthat, it has a number of minor historical variations resulting fromits history predacting CommonMark (and thus Zulip choosing differentsolutions to some problems) and based in part on Python-Markdown,-which is proudly a classic Markdown implementation. We reduce these+which is proudly a classic Markdown implementation. We reduce thesevariations with every major Zulip release.Zulip has two implementations of Markdown. The backend implementation@@ -15,11 +15,11 @@ at `zerver/lib/markdown/` is based on[Python-Markdown](https://pypi.python.org/pypi/Markdown) and is used toauthoritatively render messages to HTML (and implementsslow/expensive/complex features like querying the Twitter API to-render tweets nicely). The frontend implementation is in JavaScript,+render tweets nicely). The frontend implementation is in JavaScript,based on [marked.js](https://github.com/chjj/marked)(`static/js/echo.js`), and is used to preview and locally echomessages the moment the sender hits Enter, without waiting for round-trip from the server. Those frontend renderings are only shown to the+trip from the server. Those frontend renderings are only shown to thesender of a message, and they are (ideally) identical to the backendrendering.@@ -28,12 +28,12 @@ The JavaScript Markdown implementation has a function,contains any syntax that needs to be rendered to HTML on the backend.If `markdown.contains_backend_only_syntax` returns true, the frontend simply won'techo the message for the sender until it receives the rendered HTML-from the backend. If there is a bug where `markdown.contains_backend_only_syntax`+from the backend. If there is a bug where `markdown.contains_backend_only_syntax`returns false incorrectly, the frontend will discover this when thebackend returns the newly sent message, and will update the HTML basedon the authoritative backend rendering (which would cause a change inthe rendering that is visible only to the sender shortly after a-message is sent). As a result, we try to make sure that+message is sent). As a result, we try to make sure that`markdown.contains_backend_only_syntax` is always correct.## Testing@@ -46,7 +46,7 @@ The Python-Markdown implementation is tested byA shared set of fixed test data ("test fixtures") is present in`zerver/tests/fixtures/markdown_test_cases.json`, and is automatically usedby both test suites; as a result, it is the preferred place to add new-tests for Zulip's Markdown system. Some important notes on reading+tests for Zulip's Markdown system. Some important notes on readingthis file:- `expected_output` is the expected output for the backend Markdown@@ -57,13 +57,13 @@ this file:`markdown.contains_backend_only_syntax` rejects the syntax, ensuringit will be rendered only by the backend processor.- When the two processors disagree, we set `marked_expected_output` in- the fixtures; this will ensure that the syntax stays that way. If+ the fixtures; this will ensure that the syntax stays that way. Ifthe differences are important (i.e. not just whitespace), we shouldalso open an issue on GitHub to track the problem.- For mobile push notifications, we need a text version of therendered content, since the APNS and GCM push notification systems- don't support richer markup. Mostly, this involves stripping HTML,- but there's some syntax we take special care with. Tests for what+ don't support richer markup. Mostly, this involves stripping HTML,+ but there's some syntax we take special care with. Tests for whatthis plain-text version of content should be are stored in the`text_content` field.@@ -72,10 +72,10 @@ implementation, the easiest way to do this is as follows:1. Log in to your development server.2. Stop your Zulip server with Ctrl-C, leaving the browser open.-3. Compose and send the messages you'd like to test. They will be+3. Compose and send the messages you'd like to test. They will belocally echoed using the frontend rendering.-This procedure prevents any server-side rendering. If you don't do+This procedure prevents any server-side rendering. If you don't dothis, backend will likely render the Markdown you're testing and swapit in before you can see the frontend's rendering.@@ -118,14 +118,14 @@ Important considerations for any changes are:accidentally triggering Markdown syntax or typeahead that isn'trelated to what they are trying to express.- Performance: Zulip can render a lot of messages very quickly, and- we'd like to keep it that way. New regular expressions similar to+ we'd like to keep it that way. New regular expressions similar tothe ones already present are unlikely to be a problem, but we needto be thoughtful about expensive computations or third-party APIrequests.- Database: The backend Markdown processor runs inside a Python thread(as part of how we implement timeouts for third-party API queries),and for that reason we currently should avoid making database- queries inside the Markdown processor. This is a technical+ queries inside the Markdown processor. This is a technicalimplementation detail that could be changed with a few days of work,but is an important detail to know about until we do that work.- Testing: Every new feature should have both positive and negative@@ -135,7 +135,7 @@ Important considerations for any changes are:## Per-realm featuresZulip's Markdown processor's rendering supports a number of features-that depend on realm-specific or user-specific data. For example, the+that depend on realm-specific or user-specific data. For example, therealm could have[linkifiers](https://zulip.com/help/add-a-custom-linkifier)or [custom emoji](https://zulip.com/help/add-custom-emoji)@@ -144,7 +144,7 @@ groups (which depend on data like users' names, IDs, etc.).At a backend code level, these are controlled by the `message_realm`object and other arguments passed into `do_convert` (`sent_by_bot`,-`translate_emoticons`, `mention_data`, etc.). Because+`translate_emoticons`, `mention_data`, etc.). BecausePython-Markdown doesn't support directly passing arguments into theMarkdown processor, our logic attaches these data to the Markdownprocessor object via e.g. `_md_engine.zulip_db_data`, and then@@ -154,7 +154,7 @@ For non-message contexts (e.g. an organization's profile (aka thething on the right-hand side of the login page), stream descriptions,or rendering custom profile fields), one needs to just pass in a`message_realm` (see, for example, `zulip_default_context` for the-organization profile code for this). But for messages, we need to+organization profile code for this). But for messages, we need topass in attributes like `sent_by_bot` and `translate_emoticons` thatindicate details about how the user sending the message is configured.@@ -171,21 +171,21 @@ plain text (e.g. emails) that it helps more than getting in the way.The main issue for using Markdown in instant messaging is that theMarkdown standard syntax used in a lot of wikis/blogs has nontrivialerror rates, where the author needs to go back and edit the post to-fix the formatting after typing it the first time. While that's+fix the formatting after typing it the first time. While that'sbasically fine when writing a blog, it gets annoying very fast in achat product; even though you can edit messages to fix formatting-mistakes, you don't want to be doing that often. There are basically+mistakes, you don't want to be doing that often. There are basically2 types of error rates that are important for a product like Zulip:- What fraction of the time, if you pasted a short technical emailthat you wrote to your team and passed it through your Markdownimplementation, would you need to change the text of your email for it- to render in a reasonable way? This is the "accidental Markdown+ to render in a reasonable way? This is the "accidental Markdownsyntax" problem, common with Markdown syntax like the italics syntaxinteracting with talking about `char *`s.- What fraction of the time do users attempting to use a particular- Markdown syntax actually succeed at doing so correctly? Syntax like+ Markdown syntax actually succeed at doing so correctly? Syntax likerequired a blank line between text and the start of a bulleted listraise this figure substantially.@@ -223,7 +223,7 @@ accurate.- Disable special use of `\` to escape other syntax. Rendering `\\` as`\` was hugely controversial, but having no escape syntax is also- controversial. We may revisit this. For now you can always put+ controversial. We may revisit this. For now you can always putthings in code blocks.### Lists@@ -271,7 +271,7 @@ accurate.- Disabled images with `![]()` (images from links are shown as an inlinepreview).-- Allow embedding any avatar as a tiny (list bullet size) image. This+- Allow embedding any avatar as a tiny (list bullet size) image. Thisis used primarily by version control integrations.- We added the `~~~ quote` block quote syntax.diff --git a/docs/subsystems/notifications.md b/docs/subsystems/notifications.mdindex 3c2fa5b280a..75d7dec9b92 100644--- a/docs/subsystems/notifications.md+++ b/docs/subsystems/notifications.md@@ -36,9 +36,9 @@ as follows:in the main event dictionary.- The `presence_idle_user_ids` set, containing the subset ofrecipient users who can potentially receive notifications, but have not- interacted with a Zulip client in the last few minutes. (Users who+ interacted with a Zulip client in the last few minutes. (Users whohave generally will not receive a notification unless the- `enable_online_push_notifications` flag is enabled). This data+ `enable_online_push_notifications` flag is enabled). This datastructure ignores users for whom the message is not notifiable,which is important to avoid this being thousands of `user_ids` formessages to large streams with few currently active users.@@ -102,7 +102,7 @@ as follows:- The queue processors for those queues make the final determinationfor whether to send a notification, and do the work to generate anemail (`zerver/lib/email_notifications.py`) or mobile- (`zerver/lib/push_notifications.py`) notification. We'll detail+ (`zerver/lib/push_notifications.py`) notification. We'll detailthis process in more detail for each system below, but it'simportant to know that it's normal for a message to sit in thesequeues for minutes (and in the future, possibly hours).@@ -120,7 +120,7 @@ as follows:messages into a single email. These features are unnecessaryfor mobile push notifications, because we can live-update thosedetails with a future notification, whereas emails cannot be readily- updated once sent. Zulip's email notifications are styled similarly+ updated once sent. Zulip's email notifications are styled similarlyto GitHub's email notifications, with a clean, simple design thatmakes replying from an email client possible (using the [incomingemail integration](../production/email-gateway.md)).@@ -144,7 +144,7 @@ structure of the system, when thinking about changes to it:to Tornado via RabbitMQ for scalability reasons.- **Tornado doesn't do database queries**. Because the Tornado systemis an asynchronous event-driven framework, and our Django database- library is synchronous, database queries are very expensive. So+ library is synchronous, database queries are very expensive. Sothese queries need to be done in either `do_send_messages` or thequeue processor logic. (For example, this means `presence` datashould be checked in either `do_send_messages` or the queuediff --git a/docs/subsystems/performance.md b/docs/subsystems/performance.mdindex d2dba84972a..596e3b39c7c 100644--- a/docs/subsystems/performance.md+++ b/docs/subsystems/performance.md@@ -1,7 +1,7 @@# Performance and scalabilityThis page aims to give some background to help prioritize work on the-Zulip's server's performance and scalability. By scalability, we mean+Zulip's server's performance and scalability. By scalability, we meanthe ability of the Zulip server on given hardware to handle a certainworkload of usage without performance materially degrading.@@ -9,14 +9,14 @@ First, a few notes on philosophy.- We consider it an important technical goal for Zulip to be fast,because that's an important part of user experience for a real-time- collaboration tool like Zulip. Many UI features in the Zulip web app+ collaboration tool like Zulip. Many UI features in the Zulip web appare designed to load instantly, because all the data required forthem is present in the initial HTTP response, and both the ZulipAPI and web app are architected around that strategy.- The Zulip database model and server implementation are carefullydesigned to ensure that every common operation is efficient, withautomated tests designed to prevent the accidental introductions of- inefficient or excessive database queries. We much prefer doing+ inefficient or excessive database queries. We much prefer doingdesign/implementation work to make requests fast over the operationalwork of running 2-5x as much hardware to handle the same load.@@ -30,9 +30,9 @@ important to understand the load profiles for production uses.Zulip servers typically involve a mixture of two very different typesof load profiles:- Open communities like open source projects, online classes,- etc. have large numbers of users, many of whom are idle. (Many of+ etc. have large numbers of users, many of whom are idle. (Many ofthe others likely stopped by to ask a question, got it answered, and- then didn't need the community again for the next year). Our own+ then didn't need the community again for the next year). Our own[chat.zulip.org](https://zulip.com/developer-community/) is a goodexample for this, with more than 15K total user accounts, of whichonly several hundred have logged in during the last few weeks.@@ -42,7 +42,7 @@ of load profiles:scalability and request latency.- Fulltime teams, like your typical corporate Zulip installation,have users who are mostly active for multiple hours a day and sending a- high volume of messages each. This load profile is most important+ high volume of messages each. This load profile is most importantfor self-hosted servers, since many of those are used exclusively bythe employees of the organization running the server.@@ -53,7 +53,7 @@ organizations from each of those two load profiles.It's important to understand that Zulip has a handful of endpointsthat result in the vast majority of all server load, and essentially-every other endpoint is not important for scalability. We still put+every other endpoint is not important for scalability. We still puteffort into making sure those other endpoints are fast for latencyreasons, but were they to be 10x faster (a huge optimization!), itwouldn't materially improve Zulip's scalability.@@ -63,7 +63,7 @@ around the several specific endpoints that have a combination ofrequest volume and cost that makes them important.That said, it is important to distinguish the load associated with an-API endpoint from the load associated with a feature. Almost any+API endpoint from the load associated with a feature. Almost anysignificant new feature is likely to result in its data being sent tothe client in `page_params` or `GET /messages`, i.e. one of theendpoints important to scalability here. As a result, it is important@@ -77,7 +77,7 @@ optimizations which save a few milliseconds that would be invisible to the end uif they carry any cost in code readability.In Zulip's documentation, our general rule is to primarily write facts-that are likely to remain true for a long time. While the numbers+that are likely to remain true for a long time. While the numberspresented here vary with hardware, usage patterns, and time (there'ssubstantial oscillation within a 24 hour period), we expect the roughsense of them (as well as the list of important endpoints) is not@@ -96,7 +96,7 @@ POST /users/me/* | 50ms | 0.04% | 20The "Average impact" above is computed by multiplying request volumeby average time; this tells you roughly that endpoint's **relative**-contribution to the steady-state total CPU load of the system. It's+contribution to the steady-state total CPU load of the system. It'snot precise -- waiting for a network request is counted the same asactive CPU time, but it's extremely useful for providing intuition forwhat code paths are most important to optimize, especially since@@ -106,7 +106,7 @@ memcached to do work.As one can see, there are two categories of endpoints that areimportant for scalability: those with extremely high request volumes,and those with moderately high request volumes that are also-expensive. It doesn't matter how expensive, for example,+expensive. It doesn't matter how expensive, for example,`POST /users/me/subscriptions` is for scalability, because the volumeis negligible.@@ -115,7 +115,7 @@ is negligible.Zulip's Tornado-based [real-time pushsystem](../subsystems/events-system.md), and in particular`GET /events`, accounts for something like 50% of all HTTP requests to-a production Zulip server. Despite `GET /events` being extremely+a production Zulip server. Despite `GET /events` being extremelyhigh-volume, the typical request takes 1-3ms to process, and doesn'tuse the database at all (though it will access `memcached` and`redis`), so they aren't a huge contributor to the overall CPU usage@@ -128,16 +128,16 @@ usage of a Zulip installation.It's worth noting that most (~80%) Tornado requests end thelongpolling via a `heartbeat` event, which are issued to idle-connections after about a minute. These `heartbeat` events are+connections after about a minute. These `heartbeat` events areuseless aside from avoiding problems with networks/proxies/NATs thatare configured poorly and might kill HTTP connections that have been-idle for a minute. It's likely that with some strategy for detecting+idle for a minute. It's likely that with some strategy for detectingsuch situations, we could reduce their volume (and thus overallTornado load) dramatically.Currently, Tornado is sharded by realm, which is sufficient forarbitrary scaling of the number of organizations on a multi-tenant-system like zulip.com. With a somewhat straightforward set of work,+system like zulip.com. With a somewhat straightforward set of work,one could change this to sharding by `user_id` instead, which willeventually be important for individual large organizations with manythousands of concurrent users.@@ -147,9 +147,9 @@ thousands of concurrent users.`POST /users/me/presence` requests, which submit the current user'spresence information and return the information for all other activeusers in the organization, account for about 36% of all HTTP requests-on production Zulip servers. See+on production Zulip servers. See[presence](../subsystems/presence.md) for details on this system and-how it's optimized. For this article, it's important to know that+how it's optimized. For this article, it's important to know thatpresence is one of the most important scalability concerns for anychat system, because it cannot be cached long, and is structurally aquadratic problem.@@ -158,7 +158,7 @@ Because typical presence requests consume 10-50ms of server-sideprocessing time (to fetch and send back live data on all other activeusers in the organization), and are such a high volume, presence isthe single most important source of steady-state load for a Zulip-server. This is true for most other chat server implementations as+server. This is true for most other chat server implementations aswell.There is an ongoing [effort to rewrite the data model for@@ -177,8 +177,8 @@ Zulip is somewhat unusual among web apps in sending essentially all of thedata required for the entire Zulip web app in this single request,which is part of why the Zulip web app loads very quickly -- one onlyneeds a single round trip aside from cacheable assets (avatars, images, JS,-CSS). Data on other users in the organization, streams, supported-emoji, custom profile fields, etc., is all included. The nice thing+CSS). Data on other users in the organization, streams, supported+emoji, custom profile fields, etc., is all included. The nice thingabout this model is that essentially every UI element in the Zulipclient can be rendered immediately without paying latency to theserver; this is critical to Zulip feeling performant even for users@@ -206,7 +206,7 @@ history](#fetching-message-history).The cost for fetching `page_params` varies dramatically basedprimarily on the organization's size, varying from 90ms-300ms for atypical organization but potentially multiple seconds for large open-organizations with 10,000s of users. There is also smaller+organizations with 10,000s of users. There is also smallervariability based on a individual user's personal data state,primarily in that having 10,000s of unread messages results in asomewhat expensive query to find which streams/topics those are in.@@ -217,7 +217,7 @@ greater than a second to be a bug, and there is ongoing work to fix that.It can help when thinking about this to imagine `page_params` as whatin another web app would have been 25 or so HTTP GET requests, eachfetching data of a given type (users, streams, custom emoji, etc.); in-Zulip, we just do all of those in a single API request. In the+Zulip, we just do all of those in a single API request. In thefuture, we will likely move to a design that does much of the databasefetching work for different features in parallel to improve latency.@@ -230,7 +230,7 @@ of active optimization work.Bulk requests for message content and metadata([`GET /messages`](https://zulip.com/api/get-messages)) account for-~3% of total HTTP requests. The zulip web app has a few major reasons+~3% of total HTTP requests. The zulip web app has a few major reasonsit does a large number of these requests:- Most of these requests are from users clicking into different views@@ -239,21 +239,21 @@ it does a large number of these requests:relevant stream/topic cached locally.- When a browser opens the Zulip web app, it will eventually fetch andcache in the browser all messages newer than the oldest unread- message in a non-muted context. This can be in total extremely+ message in a non-muted context. This can be in total extremelyexpensive for users with 10,000s of unread messages, resulting in asingle browser doing 100 of these requests.- When a new version of the Zulip server is deployed, every browserwill reload within 30 minutes to ensure they are running the latest- code. For installations that deploy often like chat.zulip.org and+ code. For installations that deploy often like chat.zulip.org andzulip.com, this can result in a thundering herd effect for both `/`- and `GET /messages`. A great deal of care has been taking in+ and `GET /messages`. A great deal of care has been taking indesigning this [auto-reloadsystem](../subsystems/hashchange-system.html#server-initiated-reloads)to spread most of that herd over several minutes.Typical requests consume 20-100ms to process, much of which is waitingto fetch message IDs from the database and then their content from-memcached. While not large in an absolute sense, these requests are+memcached. While not large in an absolute sense, these requests areexpensive relative to most other Zulip endpoints.Some requests, like full-text search for commonly used words, can be@@ -261,7 +261,7 @@ more expensive, but they are sufficiently rare in an absolute sense soas to be immaterial to the overall scalability of the system.This server-side code path is already heavily optimized on a-per-request basis. However, we have technical designs for optimizing+per-request basis. However, we have technical designs for optimizingthe overall frequency with which clients need to make these requestsin two major ways:@@ -270,7 +270,7 @@ in two major ways:caching of narrows that the user has viewed in the current session,avoiding repeat fetches of message content during a given session.- Adjusting the behavior for clients with 10,000s of unread messages- to not fetch as much old message history into the cache. See [this+ to not fetch as much old message history into the cache. See [thisissue](https://github.com/zulip/zulip/issues/16697) for relevantdesign work.@@ -280,7 +280,7 @@ scalability cost of fetching message history dramatically.### User uploadsRequests to fetch uploaded files (including user avatars) account for-about 5% of total HTTP requests. Zulip spends consistently ~10-15ms+about 5% of total HTTP requests. Zulip spends consistently ~10-15msprocessing one of these requests (mostly authorization logic), beforehanding off delivery of the file to `nginx` or S3 (depending on theconfigured [upload backend](../production/upload-backends.md)).@@ -302,7 +302,7 @@ sent to 50 users triggers ~50 `GET /events` requests.A typical message-send request takes 20-70ms, with more expensiverequests typically resulting from [Markdown-rendering](../subsystems/markdown.md) of more complex syntax. As a+rendering](../subsystems/markdown.md) of more complex syntax. As aresult, these requests are not material to Zulip's scalability.Editing messages and adding emoji reactions are very similar tosending them for the purposes of performance and scalability, since@@ -335,11 +335,11 @@ The above doesn't cover all of the work that a production Zulip serverdoes; various tasks like sending outgoing emails or recording the datathat powers [/stats](https://zulip.com/help/analytics) are run by[queue processors](../subsystems/queuing.md) and cron jobs, not in-response to incoming HTTP requests. In practice, all of these have+response to incoming HTTP requests. In practice, all of these havebeen written such that they are immaterial to total load and thusarchitectural scalability, though we do from time to time need to dooperational work to add additional queue processors for particularly-high-traffic queues. For all of our queue processors, any+high-traffic queues. For all of our queue processors, anyserialization requirements are at most per-user, and thus it would bestraightforward to shard by `user_id` or `realm_id` if required.@@ -351,7 +351,7 @@ services (memcached, redis, rabbitmq, and most importantly postgres),as well as queue processors (which might get backlogged).In practice, efforts to make an individual endpoint faster will very-likely reduce the load on these services as well. But it is worth+likely reduce the load on these services as well. But it is worthconsidering that database time is a more precious resource thanPython/CPU time (being harder to scale horizontally).diff --git a/docs/subsystems/pointer.md b/docs/subsystems/pointer.mdindex 9094c844a53..d8b77fe5beb 100644--- a/docs/subsystems/pointer.md+++ b/docs/subsystems/pointer.md@@ -21,7 +21,7 @@ First a bit of terminology:the messages the user has access to.- The blue cursor box (the "pointer") is around is called the- "selected" message. Zulip ensures that the currently selected+ "selected" message. Zulip ensures that the currently selectedmessage is always in-view.## Pointer logic@@ -53,7 +53,7 @@ streams.)### Unnarrow: previous sequence-When you unnarrow using e.g. the `a` key, you will automatically be+When you unnarrow using e.g. the `a` key, you will automatically betaken to the same message that was selected in the All messages view beforeyou narrowed, unless in the narrow you read new messages, in whichcase you will be jumped forward to the first unread and non-muted@@ -76,10 +76,10 @@ see [the architectural overview](../overview/architecture-overview.md).How does Zulip decide whether a message has been read by the user?The algorithm needs to correctly handle a range of ways people might-use the product. The algorithm is as follows:+use the product. The algorithm is as follows:- Any message which is selected or above a message which is selected- is marked as read. So messages are marked as read as you scroll+ is marked as read. So messages are marked as read as you scrolldown the keyboard when the pointer passes over them.- If the whitespace at the very bottom of the feed is in view, alldiff --git a/docs/subsystems/presence.md b/docs/subsystems/presence.mdindex 4d312f445d7..8f87972bbd2 100644--- a/docs/subsystems/presence.md+++ b/docs/subsystems/presence.md@@ -5,41 +5,41 @@ This document explains the model for Zulip's presence.In a chat tool like Zulip, users expect to see the “presence” statusof other users: is the person I want to talk to currently online? Ifnot, were they last online 5 minutes ago, or more like an hour ago, or-a week? Presence helps set expectations for whether someone is likely-to respond soon. To a user, this feature can seem like a simple thing-that should be easy. But presence is actually one of the hardest+a week? Presence helps set expectations for whether someone is likely+to respond soon. To a user, this feature can seem like a simple thing+that should be easy. But presence is actually one of the hardestscalability problems for a team chat tool like Zulip.There's a lot of performance-related details in the backend and-network protocol design that we won't get into here. The focus of+network protocol design that we won't get into here. The focus ofthis is what one needs to know to correctly implement a Zulip client'spresence implementation (e.g. web app, mobile app, terminal client, orother tool that's intended to represent whether a user is online andusing Zulip).A client should report to the server every minute a `POST` request to-`/users/me/presence`, containing the current user's status. The-requests contains a few parameters. The most important is "status",+`/users/me/presence`, containing the current user's status. The+requests contains a few parameters. The most important is "status",which had 2 valid values:- "active" -- this means the user has interacted with the client- recently. We use this for the "green" state in the web app.+ recently. We use this for the "green" state in the web app.- "idle" -- the user has not interacted with the client recently.This is important for the case where a user left a Zulip tab open on- their desktop at work and went home for the weekend. We use this+ their desktop at work and went home for the weekend. We use thisfor the "orange" state in the web app.The client receives in the response to that request a data set that,for each user, contains their status and timestamp that we last heard-from that client. There are a few important details to understand+from that client. There are a few important details to understandabout that data structure:- It's really important that the timestamp is the last time we heard- from the client. A client can only interpret the status to display+ from the client. A client can only interpret the status to displayabout another user by doing a simple computation using the (status,- timestamp) pair. E.g. a user who last used Zulip 1 week ago will- have a timestamp of 1 week ago and a status of "active". Why?- Because this correctly handles the race conditions. For example, if+ timestamp) pair. E.g. a user who last used Zulip 1 week ago will+ have a timestamp of 1 week ago and a status of "active". Why?+ Because this correctly handles the race conditions. For example, ifthe threshold for displaying a user as "offline" was 5 minutessince the user was last online, the client can at any timeaccurately compute whether that user is offline (even if the lastdiff --git a/docs/subsystems/queuing.md b/docs/subsystems/queuing.mdindex 726fadf809a..00bef9c08d6 100644--- a/docs/subsystems/queuing.md+++ b/docs/subsystems/queuing.md@@ -1,6 +1,6 @@# Queue processors-Zulip uses RabbitMQ to manage a system of internal queues. These are+Zulip uses RabbitMQ to manage a system of internal queues. These areused for a variety of purposes:- Asynchronously doing expensive operations like sending email@@ -14,7 +14,7 @@ used for a variety of purposes:- Communicating events to push to clients (browsers, etc.) from themain Zulip Django application process to the Tornado-based events- system. Example events might be that a new message was sent, a user+ system. Example events might be that a new message was sent, a userhas changed their subscriptions, etc.- Processing mobile push notifications and email mirroring system@@ -37,10 +37,10 @@ To add a new queue processor:- Define the processor in `zerver/worker/queue_processors.py` usingthe `@assign_queue` decorator; it's pretty easy to get the template- for an existing similar queue processor. This suffices to test your+ for an existing similar queue processor. This suffices to test yourqueue worker in the Zulip development environment(`tools/run-dev.py` will automatically restart the queue processors- and start running your new queue processor code). You can also run+ and start running your new queue processor code). You can also runa single queue processor manually using e.g.`./manage.py process_queue --queue=user_activity`.@@ -51,7 +51,7 @@ To add a new queue processor:The queue will automatically be added to the list of queues tracked by`scripts/nagios/check-rabbitmq-consumers`, so Nagios can properly-check whether a queue processor is running for your queue. You still+check whether a queue processor is running for your queue. You stillneed to update the sample Nagios configuration in `puppet/zulip_ops`manually.@@ -61,12 +61,12 @@ You can publish events to a RabbitMQ queue using the`queue_json_publish` function defined in `zerver/lib/queue.py`.An interesting challenge with queue processors is what should happen-when queued events in Zulip's backend tests. Our current solution is+when queued events in Zulip's backend tests. Our current solution isthat in the tests, `queue_json_publish` will (by default) simple call-the `consume` method for the relevant queue processor. However,+the `consume` method for the relevant queue processor. However,`queue_json_publish` also supports being passed a function that shouldbe called in the tests instead of the queue processor's `consume`-method. Where possible, we prefer the model of calling `consume` in+method. Where possible, we prefer the model of calling `consume` intests since that's more predictable and automatically covers the queueprocessor's code path, but it isn't always possible.@@ -79,7 +79,7 @@ If you need to clear a queue (delete all the events in it), run./manage.py purge_queue user_activity```-You can also use the amqp tools directly. Install `amqp-tools` from+You can also use the amqp tools directly. Install `amqp-tools` fromapt and then run:```bashdiff --git a/docs/subsystems/realms.md b/docs/subsystems/realms.mdindex 63985b41f3c..60326651b5d 100644--- a/docs/subsystems/realms.md+++ b/docs/subsystems/realms.md@@ -8,7 +8,7 @@ user documentation as an organization (the name "realm" comes fromWherever possible, we avoid using the term `realm` in any user-facingstring or documentation; "Organization" is the equivalent term used inthose contexts (and we have linters that attempt to enforce this rule-in translateable strings). We may in the future modify Zulip's+in translateable strings). We may in the future modify Zulip'sinternals to use `organization` instead.The@@ -30,16 +30,16 @@ There are two main methods for creating realms.The above command will output a URL which can be used for creating anew realm and an administrator user for that realm. The link expires-after the creation of the realm. The link also expires if not used+after the creation of the realm. The link also expires if not usedwithin 7 days. The expiration period can be changed by modifying`REALM_CREATION_LINK_VALIDITY_DAYS` in settings.py.### Enabling open realm creationIf you want anyone to be able to create new realms on your server, you-can enable open realm creation. This will add a **Create new+can enable open realm creation. This will add a **Create neworganization** link to your Zulip homepage footer, and anyone can-create a new realm by visiting this link (**/new**). This+create a new realm by visiting this link (**/new**). Thisfeature is disabled by default in production instances, and can beenabled by setting `OPEN_REALM_CREATION = True` in settings.py.@@ -57,24 +57,24 @@ records so that the subdomains point to your Zulip installation IP. Anjob.We also recommend upgrading to at least Zulip 1.7, since older Zulip-releases had much less nice handling for subdomains. See our+releases had much less nice handling for subdomains. See our[docs on using subdomains](../production/multiple-organizations.md) foruser-facing documentation on this.### Working with subdomains in development environmentBy default, Linux does not provide a convenient way to use subdomains-in your local development environment. To solve this problem, we use+in your local development environment. To solve this problem, we usethe **zulipdev.com** domain, which has a wildcard A record pointing to-127.0.0.1. You can use zulipdev.com to connect to your Zulip+127.0.0.1. You can use zulipdev.com to connect to your Zulipdevelopment server instead of localhost. The default realm with theShakespeare users has the subdomain `zulip` and can be accessed byvisiting **zulip.zulipdev.com**.If you are behind a **proxy server**, this method won't work. When youmake a request to load zulipdev.com in your browser, the proxy server-will try to get the page on your behalf. Since zulipdev.com points-to 127.0.0.1 the proxy server is likely to give you a 503 error. The+will try to get the page on your behalf. Since zulipdev.com points+to 127.0.0.1 the proxy server is likely to give you a 503 error. Theworkaround is to disable your proxy for `*.zulipdev.com`. The DNSlookup should still work even if you disable proxy for*.zulipdev.com. If it doesn't you can add zulipdev.com records indiff --git a/docs/subsystems/release-checklist.md b/docs/subsystems/release-checklist.mdindex 108b80242ba..ea2e366ad3f 100644--- a/docs/subsystems/release-checklist.md+++ b/docs/subsystems/release-checklist.md@@ -11,7 +11,7 @@ preparing a new release.`pip list --outdated`).- [Upload strings toTransifex](../translating/internationalization.html#translation-process)- using `push-translations`. Post a Transifex+ using `push-translations`. Post a Transifex[Announcement](https://www.transifex.com/zulip/zulip/announcements/)notifying translators that we're approaching a release.- Merge draft updates to the [changelog](../overview/changelog.md)@@ -22,7 +22,7 @@ preparing a new release.remove any backwards-compatibility code in this release.- Create a burn-down list of issues that need to be fixed before we canrelease, and make sure all of them are being worked on.-- Draft the release blog post (a.k.a. the release notes) in Paper. In+- Draft the release blog post (a.k.a. the release notes) in Paper. Init, list the important changes in the release, from most to leastnotable.@@ -36,9 +36,9 @@ preparing a new release.release, on both Bionic and Focal.- Repeat until release is ready.- Send around the Paper blog post draft for review.-- Move the blog post draft to Ghost. (For a draft in Dropbox Paper,+- Move the blog post draft to Ghost. (For a draft in Dropbox Paper,use "··· > Export > Markdown" to get a pretty good markup- conversion.) Proofread the post, especially for formatting. Tag+ conversion.) Proofread the post, especially for formatting. Tagthe post with "Release announcements" in Ghost.### Executing the release@@ -80,8 +80,8 @@ preparing a new release.- On the release branch, update `ZULIP_VERSION` in `version.py` tothe present release with a `+git` suffix, e.g. `4.0+git`.- On `main`, update `ZULIP_VERSION` to the future major release with- a `-dev+git` suffix, e.g. `5.0-dev+git`. Make a Git tag for this- update commit with a `-dev` suffix, e.g. `5.0-dev`. Push the tag+ a `-dev+git` suffix, e.g. `5.0-dev+git`. Make a Git tag for this+ update commit with a `-dev` suffix, e.g. `5.0-dev`. Push the tagto both zulip.git and zulip-internal.git to get a correct versionnumber for future Cloud deployments.- Consider removing a few old releases from ReadTheDocs; we keep aboutdiff --git a/docs/subsystems/schema-migrations.md b/docs/subsystems/schema-migrations.mdindex c4a8a3b6f45..8ec72fa2c01 100644--- a/docs/subsystems/schema-migrations.md+++ b/docs/subsystems/schema-migrations.md@@ -24,7 +24,7 @@ migrations.code as part of the migration, it's best to read past migrations tounderstand how to write them well.`git grep RunPython zerver/migrations/02*` will find many good- examples. Before writing migrations of this form, you should read+ examples. Before writing migrations of this form, you should readDjango's docs and the sections below.- **Numbering conflicts across branches**: If you've done your schemachange in a branch, and meanwhile another schema change has taken@@ -32,13 +32,13 @@ migrations.number. There are two easy way to fix this:- If your migrations were automatically generated using`manage.py makemigrations`, a good option is to just remove your- migration and rerun the command after rebasing. Remember to+ migration and rerun the command after rebasing. Remember to`git rebase` to do this in the the commit that changed `models.py`if you have a multi-commit branch.- If you wrote code as part of preparing your migrations, or preferthis workflow, you can use run `./tools/renumber-migrations`,which renumbers your migration(s) and fixes up the "dependencies"- entries in your migration(s). The tool could use a bit of work to+ entries in your migration(s). The tool could use a bit of work toprompt unnecessarily less, but it will update the working tree foryou automatically (you still need to do all the `git add`commands, etc.).@@ -54,14 +54,14 @@ migrations.to be built while the server is active. While in historical migrationswe've used `RunSQL` directly, newer versions of Django add the correspondingoperation `AddIndexConcurrently` and thus that's what should normally be used.-- **Atomicity**. By default, each Django migration is run atomically- inside a transaction. This can be problematic if one wants to do+- **Atomicity**. By default, each Django migration is run atomically+ inside a transaction. This can be problematic if one wants to dosomething in a migration that touches a lot of data and would bestbe done in batches of e.g. 1000 objects (e.g. a `Message` or- `UserMessage` table change). There is a [useful Django+ `UserMessage` table change). There is a [useful Djangofeature][migrations-non-atomic] that makes it possible to add`atomic=False` at the top of a `Migration` class and thus not have- the entire migration in a transaction. This should make it possible+ the entire migration in a transaction. This should make it possibleto use the batch update tools in `zerver/lib/migrate.py` (originallywritten to work with South) for doing larger database migrations.@@ -101,25 +101,25 @@ migrations.non-atomic, splitting it into two migration files (recommended), or replacing the`RunPython` logic with pure SQL (though this can generally be difficult).-- **Making large migrations work**. Major migrations should have a+- **Making large migrations work**. Major migrations should have afew properties:- - **Unit tests**. You'll want to carefully test these, so you might+ - **Unit tests**. You'll want to carefully test these, so you mightas well write some unit tests to verify the migration works- correctly, rather than doing everything by hand. This often saves+ correctly, rather than doing everything by hand. This often savesa lot of time in re-testing the migration process as we makeadjustments to the plan.- - **Run in batches**. Updating more than 1K-10K rows (depending on- type) in a single transaction can lock up a database. It's best+ - **Run in batches**. Updating more than 1K-10K rows (depending on+ type) in a single transaction can lock up a database. It's bestto do lots of small batches, potentially with a brief sleep inbetween, so that we don't block other operations from finishing.- - **Rerunnability/idempotency**. Good migrations are ones where if+ - **Rerunnability/idempotency**. Good migrations are ones where ifoperational concerns (e.g. it taking down the Zulip server forusers) interfere with it finishing, it's easy to restart the- migration without doing a bunch of hand investigation. Ideally,+ migration without doing a bunch of hand investigation. Ideally,the migration can even continue where it left off, without needingto redo work.- - **Multi-step migrations**. For really big migrations, one wants+ - **Multi-step migrations**. For really big migrations, one wantsto split the transition into into several commits that are eachindividually correct, and can each be deployed independently:@@ -138,7 +138,7 @@ few properties:## Automated testing for migrationsZulip has support for writing automated tests for your database-migrations, using the `MigrationsTestCase` test class. This system is+migrations, using the `MigrationsTestCase` test class. This system isinspired by [a great blog post][django-migration-test-blog-post] onthe subject.@@ -148,7 +148,7 @@ from `test_classes.py` and friends from inside the tests (which isnormally not possible in Django's migrations framework).If you find yourself writing logic in a `RunPython` migration, we-highly recommend adding a test using this framework. We may end up+highly recommend adding a test using this framework. We may end updeleting the test later (they can get slow once they are manymigrations away from current), but it can help prevent disaster wherean incorrect migration messes up a database in a way that's impossiblediff --git a/docs/subsystems/sending-messages.md b/docs/subsystems/sending-messages.mdindex c71d3af3d73..83a721eb37c 100644--- a/docs/subsystems/sending-messages.md+++ b/docs/subsystems/sending-messages.md@@ -5,7 +5,7 @@ lot of underlying complexity required to make a professional-qualityexperience.This document aims to explain conceptually what happens when a message-is sent in Zulip, and why that is correct behavior. It assumes the+is sent in Zulip, and why that is correct behavior. It assumes thereader is familiar with our[real-time sync system](../subsystems/events-system.md) forserver-to-client communication and@@ -34,7 +34,7 @@ and narrowing).## Compose areaThe compose box does a lot of fancy things that are out of scope for-this article. But it also does a decent amount of client-side+this article. But it also does a decent amount of client-sidevalidation before sending a message off to the server, especiallyaround mentions (E.g. checking the stream name is a valid stream,displaying a warning about the number of recipients before a user can@@ -49,12 +49,12 @@ process described in ourThis section details the ways in which it is different:- There is significant custom code inside the `process_message_event`-function in `zerver/tornado/event_queue.py`. This custom code has a+function in `zerver/tornado/event_queue.py`. This custom code has anumber of purposes:- Triggering [email and mobile pushnotifications](../subsystems/notifications.md) for any users whodo not have active clients and have settings of the form "push- notifications when offline". In order to avoid doing any real+ notifications when offline". In order to avoid doing any realcomputational work inside the Tornado codebase, this logic aimsto just do the check for whether a notification should begenerated, and then put an event into an appropriate@@ -65,7 +65,7 @@ number of purposes:was `mentioned`) into the events.- Handling the [local echo details](#local-echo).- Handling certain client configuration options that affect- messages. E.g. determining whether to send the+ messages. E.g. determining whether to send theplaintext/Markdown raw content or the rendered HTML (e.g. the`apply_markdown` and `client_gravatar` features in our[events API docs](https://zulip.com/api/register-queue)).@@ -76,20 +76,20 @@ number of purposes:basically everything that can fail due to bad user input.- The core `do_send_messages` function (which handles actually sendingthe message) in `zerver/lib/actions.py` is one of the most optimized and thus complex parts of- the system. But in short, its job is to atomically do a few key+ the system. But in short, its job is to atomically do a few keythings:- Store a `Message` row in the database.- Store one `UserMessage` row in the database for each user who isa recipient of the message (including the sender), withappropriate `flags` for whether the user was mentioned, an alert- word appears, etc. See+ word appears, etc. See[the section on soft deactivation](#soft-deactivation) fora clever optimization we use here that is important for largeopen organizations.- Do all the database queries to fetch relevant data for and thensend a `message` event to the[events system](../subsystems/events-system.md) containing the- data it will need for the calculations described above. This+ data it will need for the calculations described above. Thisstep adds a lot of complexity, because the events system cannotmake queries to the database directly.- Trigger any other deferred work caused by the current message,@@ -104,7 +104,7 @@ number of purposes:An essential feature for a good chat is experience is local echo(i.e. having the message appear in the feed the moment the user hits-send, before the network round trip to the server). This is essential+send, before the network round trip to the server). This is essentialboth for freeing up the compose box (for the user to send moremessages) as well as for the experience to feel snappy.@@ -117,24 +117,24 @@ Zulip aims for a near-perfect local echo experience, which requires iswhy our [Markdown system](../subsystems/markdown.md) requires bothan authoritative (backend) Markdown implementation and a secondary(frontend) Markdown implementation, the latter used only for the local-echo feature. Read our Markdown documentation for all the tricky+echo feature. Read our Markdown documentation for all the trickydetails on how that works and is tested.The rest of this section details how Zulip manages locally echoedmessages.- The core function in the frontend codebase- `echo.try_deliver_locally`. This checks whether correct local echo+ `echo.try_deliver_locally`. This checks whether correct local echois possible (via `markdown.contains_backend_only_syntax`) and useful(whether the message would appear in the current view), and if so,causes Zulip to insert the message into the relevant feed(s).- Since the message hasn't been confirmed by the server yet, it- doesn't have a message ID. The frontend makes one up, via+ doesn't have a message ID. The frontend makes one up, via`local_message.next_local_id`, by taking the highest message ID it- has seen and adding the decimal `0.01`. The use of a floating point+ has seen and adding the decimal `0.01`. The use of a floating pointvalue is critical, because it means the message should sortcorrectly with other messages (at the bottom) and also won't be- duplicated by a real confirmed-by-the-backend message ID. We choose+ duplicated by a real confirmed-by-the-backend message ID. We choosejust above the `max_message_id`, because we want any new messagesthat other users send to the current view to be placed after it inthe feed (this decision is somewhat arbitrary; in any case we'll@@ -143,30 +143,30 @@ messages.visually).- The `POST /messages` API request to the server to send the messageis passed two special parameters that clients not implementing local- echo don't use: `queue_id` and `local_id`. The `queue_id` is the ID+ echo don't use: `queue_id` and `local_id`. The `queue_id` is the IDof the client's event queue; here, it is used just as a uniqueidentifier for the specific client (e.g. a browser tab) that sent- the message. And the `local_id` is, by the construction above, a+ the message. And the `local_id` is, by the construction above, aunique value within that namespace identifying the message.- The `do_send_messages` backend code path includes the `queue_id` and`local_id` in the data it passes to the- [events system](../subsystems/events-system.md). The events+ [events system](../subsystems/events-system.md). The eventssystem will extend the `message` event dictionary it delivers tothe client containing the `queue_id` with `local_message_id` field,containing the `local_id` that the relevant client used when sending- the message. This allows the client to know that the `message`+ the message. This allows the client to know that the `message`event it is receiving is the same message it itself had sent.- Using that information, rather than adding the "new message" to therelevant message feed, it updates the (locally echoed) message'sproperties (at the very least, message ID and timestamp) and- rerenders it in any message lists where it appears. This is+ rerenders it in any message lists where it appears. This isprimarily done in the `process_from_server` function in`static/js/echo.js`.### Local echo in message editingZulip also supports local echo in the message editing code path for-edits to just the content of a message. The approach is analogous+edits to just the content of a message. The approach is analogous(using `markdown.contains_backend_only_syntax`, etc.)), except wedon't need any of the `local_id` tracking logic, because the messagealready has a permanent message id; as a result, the whole@@ -191,7 +191,7 @@ one place:system).- The events system processes, and dispatches that event to allclients subscribed to receive notifications for users who should- receive the message (including the sender). As a side effect, it+ receive the message (including the sender). As a side effect, itadds queue items to the email and push notification queues (which,in turn, may trigger those notifications).- Other clients receive the event and display the new message.@@ -201,14 +201,14 @@ one place:display timestamp to the message).- The `send_message_backend` view function returnsa 200 `HTTP` response; the client receives that response and mostly- does nothing with it other than update some logging details. (This+ does nothing with it other than update some logging details. (Thismay happen before or after the client receives the event notifyingit about the new message via its event queue.)## Message editingMessage editing uses a very similar principle to how sending messages-works. A few details are worth mentioning:+works. A few details are worth mentioning:- `maybe_enqueue_notifications_for_message_update` is an analogue of`maybe_enqueue_notifications`, and exists to handle cases like a@@ -226,7 +226,7 @@ works. A few details are worth mentioning:### Inline URL previewsZulip's inline URL previews feature (`zerver/lib/url_preview/`) uses-variant of the message editing/local echo behavior. The reason is+variant of the message editing/local echo behavior. The reason isthat for inline URL previews, the backend needs to fetch the contentfrom the target URL, and for slow websites, this could result in asignificant delay in rendering the message and delivering it to other@@ -260,7 +260,7 @@ in each room, channel, or stream).We track these data in the backend in the `UserMessage` table, storingrows `(message_id, user_id, flags)`, where `flags` is 32 bits of spacefor boolean data like whether the user has read or starred the-message. All the key queries needed for accessing message history,+message. All the key queries needed for accessing message history,full-text search, and other key features can be done efficiently withthe database indexes on this table (with joins to the `Message` tablecontaining the actual message content where required).@@ -292,17 +292,17 @@ even simple questions).A key insight for addressing this problem is that there isn’t much ofa use case for long chat discussions among 1000s of users who are all-continuously online and actively participating. Streams with a very+continuously online and actively participating. Streams with a verylarge number of active users are likely to only be used for occasionalannouncements, where some latency before everyone sees the message is-fine. Even in giant organizations, almost all messages are sent to+fine. Even in giant organizations, almost all messages are sent tosmaller streams with dozens or hundreds of active users, representingsome organizational unit within the community or company.However, large, active streams are common in open source projects,standards bodies, professional development groups, and other largecommunities with the rough structure of the Zulip development-community. These communities usually have thousands of user accounts+community. These communities usually have thousands of user accountssubscribed to all the default streams, even if they only have dozensor hundreds of those users active in any given month. Many of theother accounts may be from people who signed up just to check the@@ -312,7 +312,7 @@ be seen again.The key technical insight is that if we can make the latency scalewith the number of users who actually participate in the community,not the total size of the community, then our database write limited-send latency of 1 second per 2000 users is totally fine. But we need+send latency of 1 second per 2000 users is totally fine. But we needto do this in a way that doesn’t create problems if any of thethousands of “inactive” users come back (or one of the active userssends a private message to one of the inactive users), since it’s@@ -322,7 +322,7 @@ back or will eventually be interacted with by an existing user.We solved this problem with a solution we call “soft deactivation”;users that are soft-deactivated consume less resources from Zulip in away that is designed to be invisible both to other users and to the-user themself. If a user hasn’t logged into a given Zulip+user themself. If a user hasn’t logged into a given Zuliporganization for a few weeks, they are tagged as soft-deactivated.The way this works internally is:@@ -333,24 +333,24 @@ users when a message is sent to a stream where they are subscribed.- If/when the user ever returns to Zulip, we can at that timereconstruct the UserMessage rows that they missed, and create the rowsat that time (or, to avoid a latency spike if/when the user returns to-Zulip, this work can be done in a nightly cron job). We can construct+Zulip, this work can be done in a nightly cron job). We can constructthose rows later because we already have the data for when the usermight have been subscribed or unsubscribed from streams by otherusers, and, importantly, we also know that the user didn’t interactwith the UI since the message was sent (and thus we can safely assume-that the messages have not been marked as read by the user). This is+that the messages have not been marked as read by the user). This isdone in the `add_missing_messages` function, which is the core of thesoft-deactivation implementation.- The “usually” above is because there are a few flags that resultfrom content in the message (e.g., a message that mentions a userresults in a “mentioned” flag in the UserMessage row), that we need to-keep track of. Since parsing a message can be expensive (>10ms of+keep track of. Since parsing a message can be expensive (>10ms ofwork, depending on message content), it would be too inefficient toneed to re-parse every message when a soft-deactivated user comes back-to Zulip. Conveniently, those messages are rare, and so we can just+to Zulip. Conveniently, those messages are rare, and so we can justcreate UserMessage rows which would have “interesting” flags at the-time they were sent without any material performance impact. And then+time they were sent without any material performance impact. And then`add_missing_messages` skips any messages that already have a`UserMessage` row for that user when doing its backfill.@@ -358,7 +358,7 @@ The end result is the best of both worlds:- Nobody's view of the world is different because the user wassoft-deactivated (resulting in no visible user-experience impact), at-least if one is running the cron job. If one does not run the cron+least if one is running the cron job. If one does not run the cronjob, then users returning after being away for a very long time willpotentially have a (very) slow loading experience as potentially100,000s of UserMessage rows might need to be reconstructed at once.@@ -367,7 +367,7 @@ server only needs to do work for users who are currently interactingwith Zulip.Empirically, we've found this technique completely resolved the "send-latency" scaling problem. The latency of sending a message to a stream+latency" scaling problem. The latency of sending a message to a streamnow scales only with the number of active subscribers, so one can senda message to a stream with 5K subscribers of which 500 are active, andit’ll arrive in the couple hundred milliseconds one would expect if@@ -375,12 +375,12 @@ the extra 4500 inactive subscribers didn’t exist.There are a few details that require special care with this system:- [Email and mobile push- notifications](../subsystems/notifications.md). We need to make+ notifications](../subsystems/notifications.md). We need to makesure these are still correctly delivered to soft-deactivated users;making this work required careful work for those code paths thatassumed a `UserMessage` row would always exist for a message thattriggers a notification to a given user.- Digest emails, which use the `UserMessage` table extensively to- determine what has happened in streams the user can see. We can use+ determine what has happened in streams the user can see. We can usethe user's subscriptions to construct what messages they should haveaccess to for this feature.diff --git a/docs/subsystems/settings.md b/docs/subsystems/settings.mdindex 21ce6efdcab..e35379d2c43 100644--- a/docs/subsystems/settings.md+++ b/docs/subsystems/settings.md@@ -27,7 +27,7 @@ from shareable configuration.Zulip uses the [Django settingssystem](https://docs.djangoproject.com/en/2.2/topics/settings/), whichmeans that the settings files are Python programs that set a lot of-variables with all-capital names like `EMAIL_GATEWAY_PATTERN`. You can+variables with all-capital names like `EMAIL_GATEWAY_PATTERN`. You canaccess these anywhere in the Zulip Django code using e.g.:```python@@ -45,19 +45,19 @@ $ ./scripts/get-django-setting EMAIL_GATEWAY_PATTERNZulip has separated those settings that we expect a systemadministrator to change (with nice documentation) from the ~1000 lines-of settings needed by the Zulip Django app. As a result, there are a+of settings needed by the Zulip Django app. As a result, there are afew files involved in the Zulip settings for server administrators.In a production environment, we have:- `/etc/zulip/settings.py` (the template is in the Zulip repo at`zproject/prod_settings_template.py`) is the main system- administrator-facing settings file for Zulip. It contains all the+ administrator-facing settings file for Zulip. It contains all theserver-specific settings, such as how to send outgoing email, thehostname of the PostgreSQL database, etc., but does not contain anysecrets (e.g. passwords, secret API keys, cryptographic keys, etc.).The way we generally do settings that can be controlled with shellaccess to a Zulip server is to put a default in- `zproject/default_settings.py`, and then override it here. As this+ `zproject/default_settings.py`, and then override it here. As thisis the main documentation for Zulip settings, we recommend thatproduction installations [carefully update `/etc/zulip/settings.py`every major@@ -66,9 +66,9 @@ In a production environment, we have:- `/etc/zulip/zulip-secrets.conf` (generated by`scripts/setup/generate_secrets.py` as part of installation)- contains secrets used by the Zulip installation. These are read+ contains secrets used by the Zulip installation. These are readusing the standard Python `ConfigParser`, and accessed in- `zproject/computed_settings.py` by the `get_secret` function. All+ `zproject/computed_settings.py` by the `get_secret` function. Allsecrets/API keys/etc. used by the Zulip Django application should bestored here, and read using the `get_secret` function in`zproject/config.py`.@@ -96,11 +96,11 @@ additionally:environment; these are set after importing `prod_settings_template.py`.- `zproject/dev-secrets.conf` replaces- `/etc/zulip/zulip-secrets.conf`, and is not tracked by Git. This+ `/etc/zulip/zulip-secrets.conf`, and is not tracked by Git. Thisallows you to configure your development environment to supportfeatures like [authenticationoptions](../development/authentication.md) that require secrets to- work. It is also used to set certain settings that in production+ work. It is also used to set certain settings that in productionbelong in `/etc/zulip/settings.py`, e.g. `SOCIAL_AUTH_GITHUB_KEY`.You can see a full list with `git grep development_only=True`, oradd additional settings of this form if needed.@@ -139,10 +139,10 @@ want those settings.### Testing non-default settingsYou can write tests for settings using e.g.-`with self.settings(TERMS_OF_SERVICE=None)`. However, this only works+`with self.settings(TERMS_OF_SERVICE=None)`. However, this only worksfor settings which are checked at runtime, not settings which are onlyaccessed in initialization of Django (or Zulip) internals-(e.g. `DATABASES`). See the [Django docs on overriding settings in+(e.g. `DATABASES`). See the [Django docs on overriding settings intests][django-test-settings] for more details.[django-test-settings]: https://docs.djangoproject.com/en/2.2/topics/testing/tools/#overriding-settings@@ -151,9 +151,9 @@ tests][django-test-settings] for more details.Realm settings are preferred for any configuration that is a matter oforganizational policy (as opposed to technical capabilities of the-server). As a result, configuration options for user-facing+server). As a result, configuration options for user-facingfunctionality is almost always added as a new realm setting, not a-server setting. The [new feature tutorial][doc-newfeat] documents the+server setting. The [new feature tutorial][doc-newfeat] documents theprocess for adding a new realm setting to Zulip.So for example, the following server settings will eventually bediff --git a/docs/subsystems/slash-commands.md b/docs/subsystems/slash-commands.mdindex 722c6e6ad03..80fa5f77257 100644--- a/docs/subsystems/slash-commands.md+++ b/docs/subsystems/slash-commands.md@@ -24,7 +24,7 @@ They send commands to the server using the `/json/command`endpoint.In the case of "/ping", the server code in `zcommand.py`-basically just acks the client. The client then computes+basically just acks the client. The client then computesthe round trip time and shows a little message abovethe compose box that the user can see and then dismiss.@@ -32,7 +32,7 @@ For commands like "/day" and "/night", the server doesa little bit of logic to toggle the user's night modesetting, and this is largely done inside `zcommand.py`.The server sends a very basic response, and then-the client actually changes the display colors. The+the client actually changes the display colors. Theclient also shows the user a little message abovethe compose box instructing them how to reverse thechange.@@ -40,7 +40,7 @@ change.(It's possible that we don't really need a general`/json/zcommand` endpoint for these, and wemay decide later to just use custom-API endpoints for each command. There's some logic+API endpoints for each command. There's some logicin having a central API for these, though, since theyare typically things that only UI-based clients willinvoke, and they may share validation code.)diff --git a/docs/subsystems/typing-indicators.md b/docs/subsystems/typing-indicators.mdindex f12124ed04a..710de2f41c4 100644--- a/docs/subsystems/typing-indicators.md+++ b/docs/subsystems/typing-indicators.md@@ -3,12 +3,12 @@Zulip supports a feature called "typing indicators."Typing indicators are status messages that tell you when-another user is composing a message to you. Zulip's typing UI+another user is composing a message to you. Zulip's typing UIis similar to what you see in other chat/text systems.This document describes how we have implemented the feature in Zulip,and our main audience is developers who want to understand the-system and possibly improve it. This document assumes that the+system and possibly improve it. This document assumes that theclient is our web app, but any client can play along with thisprotocol.@@ -22,7 +22,7 @@ There are two major roles for users in this system:ready to shift their attention elsewhere).Any Zulip user can play either one of these roles, and sometimes-they can be playing both roles at once. Having said that, you+they can be playing both roles at once. Having said that, youcan generally understand the system in terms of a single messagebeing composed by the "writing user."@@ -42,26 +42,26 @@ function that facilitates this is called `send_typing_notification_ajax`.If the "writing user" is composing a long message, we want to sendrepeated updates to the server, so that downstream clients know that the-user is still typing. (Zulip messages tend to be longer than+user is still typing. (Zulip messages tend to be longer thanmessages in other chat/text clients, so this detail is important.)We have a small state machine in `static/shared/js/typing_status.js` thatmakes sure subsequent "start" requests get sent out every ten-seconds. (This document is intended to describe the high level+seconds. (This document is intended to describe the high levelarchitecture; the actual time values may be tuned in future releases.See the constant `TYPING_STARTED_WAIT_PERIOD`, for example.)If the "writing user" goes more than five seconds without any text-input, then we send a request with an `op` of `stop`. We also send+input, then we send a request with an `op` of `stop`. We also send"stop" messages when the user explicitly aborts composing a messageby closing the compose box (or other actions).A common scenario is that a user is just pausing to think for a few-seconds, but they still intend to finish the message. Of course,+seconds, but they still intend to finish the message. Of course,that's hard to distinguish from the scenario of the user got pulled-away from their desk. For the former case, where the "writing user"+away from their desk. For the former case, where the "writing user"completes the message with lots of pauses for thinking, a series of-"start" and "stop" messages may be sent over time. Timeout values+"start" and "stop" messages may be sent over time. Timeout valuesreflect tradeoffs, where we have to guess how quickly people type,how long they pause to think, and how frequently they get interrupted.@@ -79,15 +79,15 @@ As such, the server piece here is basically a single Django viewfunction with a small bit of library support to send out eventsto clients.-Requests come into `/json/typing`. The view mostly calls out+Requests come into `/json/typing`. The view mostly calls outto `check_send_typing_notification` to do the heavy lifting.One of the main things that the server does is to simply validatethat the `to` users are for valid, active users in the realm.Once the request has been validated, the server sends events to-potential recipients of the message. The event type for that-payload is `typing`. See the function `do_send_typing_notification`+potential recipients of the message. The event type for that+payload is `typing`. See the function `do_send_typing_notification`for more details.## Receiving user@@ -115,7 +115,7 @@ The main goal is then to triage which events should lead todisplay changes.The web app client maintains a list of incoming "typists" using-code in `static/js/typing_data.js`. The API here has functions+code in `static/js/typing_data.js`. The API here has functionslike the following:- `add_typist`@@ -124,9 +124,9 @@ like the following:- `get_all_typists`One subtle thing that the client has to do here is to maintain-timers for typing notifications. The constant+timers for typing notifications. The constant`TYPING_STARTED_EXPIRY_PERIOD` is used to determine that the-"writing user" has abandoned the message. Of course, the+"writing user" has abandoned the message. Of course, the"writing user" will also explicitly send us `stop` notificationsat certain times.@@ -141,8 +141,8 @@ that affect the overall system.In general, client developers should agree on timeout parametersfor how frequently we "kickstart" typing notifications for users-sending long messages. This means standardizing the "writing-user" piece of the system. It's possible that certain clients+sending long messages. This means standardizing the "writing+user" piece of the system. It's possible that certain clientswill have slightly different mechanisms for detecting that usershave abandoned messages, but the re-transmit frequency should besimilar.@@ -150,7 +150,7 @@ similar.When implementing the "receiving user" piece, it's important torealize how clients behave on the other end of the protocol. It'spossible, for example, to never receive a "stop" notification-from a client that was shut down abruptly. You should allow+from a client that was shut down abruptly. You should allowreasonable amounts of time for the other side to send notifications,allowing for network delays and server delays, but you shouldnot let the notifications become too "sticky" either.@@ -158,22 +158,22 @@ not let the notifications become too "sticky" either.## RoadmapThis document is being written just under a year after typing-indicators were first implemented. The feature has been popular,+indicators were first implemented. The feature has been popular,and after some initial cleanup, it has not required a lot ofmaintenance.The most likely big change to typing indicators is that we will-add them for stream conversations. This will require some thought+add them for stream conversations. This will require some thoughtfor large streams, in terms of both usability and performance.Another area for refinement is to tune the timing values a bit.Right now we are probably too aggressive about sending `stop`-messages, when users often are just pausing. It's possible+messages, when users often are just pausing. It's possibleto better account for typing speed or other heuristic thingslike how much of the message has already been typed.From an infrastructure perspective, we should be mindful of-bandwidth concerns. A fairly easy change would be to send+bandwidth concerns. A fairly easy change would be to senduser ids instead of emails.Some folks may want to turn off typing indicators, so we willdiff --git a/docs/subsystems/widgets.md b/docs/subsystems/widgets.mdindex 08c78bbc716..dc8de466cad 100644--- a/docs/subsystems/widgets.md+++ b/docs/subsystems/widgets.md@@ -64,60 +64,60 @@ We'll use the poll widget as an example.The `SubMessage` table, as the name indicates, allowsyou to associate multiple submessages to any given-`Message` row. When a message gets sent, there's a+`Message` row. When a message gets sent, there's ahook inside of `widget.py` that will detect widgets-like "/poll". If a message needs to be+like "/poll". If a message needs to bewidgetized, an initial `SubMessage` row will becreated with an appropriate `msg_type` (and persisted-to the database). This data will also be included-in the normal Zulip message event payload. Clients+to the database). This data will also be included+in the normal Zulip message event payload. Clientscan choose to ignore the submessage-related data, inwhich case they'll gracefully degrade to seeing "/poll".Of course, the web app client actually recognizes theappropriate widgets.The web app client will next collect poll options and votes-from users. The web app client has+from users. The web app client hascode in `submessage.js` that dispatches eventsto `widgetize.js`, which in turn sends events to-individual widgets. The widgets know how to render+individual widgets. The widgets know how to renderthemselves and set up click/input handlers to collect-data. They can then post back to `/json/submessage`+data. They can then post back to `/json/submessage`to attach more data to the message (and the-details are encapsulated with a callback). The server+details are encapsulated with a callback). The serverwill continue to persist `SubMessage` rows in the-database. These rows are encoded as JSON, and the+database. These rows are encoded as JSON, and theschema of the messages is driven by the individual widgets.Most of the logic is in the client; things are fairly opaqueto the server at this point.If a client joins Zulip after a message has accumulatedseveral submessage events, it will see all of those-events the first time it sees the parent message. Clients+events the first time it sees the parent message. Clientsneed to know how to build/rebuild their state as each-submessage comes in. They also need to tolerate+submessage comes in. They also need to toleratemisformatted data, ideally just dropping data on the floor.If a widget throws an exception, it's caught before therest of the message feed is affected.As far as rendering is concerned, each widget moduleis given a parent `elem` when its `activate` function-is called. This is just a `<div>` inside of the parent-message in the message pane. The widget has access to+is called. This is just a `<div>` inside of the parent+message in the message pane. The widget has access tojQuery and template.render, and the developer can createnew templates in `static/templates/widgets/`.A good way to learn the system is to read the code-in `static/js/poll_widget.js`. It is worth noting that+in `static/js/poll_widget.js`. It is worth noting thatwriting a new widget requires only minor backend-changes in the current architecture. This could change+changes in the current architecture. This could changein the future, but for now, a frontend developer mostlyneeds to know JS, CSS, and HTML.It may be useful to think of widgets in terms of a-bunch of clients exchanging peer-to-peer messages. The+bunch of clients exchanging peer-to-peer messages. Theserver's only real role is to decide who gets delivered-which submessages. It's a lot like a "subchat" system.+which submessages. It's a lot like a "subchat" system.### Backward compatibility@@ -127,14 +127,14 @@ breaking old messages.Widget developers can revise code to improve awidget's visual polish without too much concern-for breaking how old messages get widgetized. They will need to+for breaking how old messages get widgetized. They will need tobe more cautious if they change the actual datastructures passed around in the submessage payloads.For significant schema changes, it would be worthwhile to addsome kind of versioning scheme inside of `SubMessages`, eitherat the DB level or more at the JSON level within fields.-This has yet to be designed. One thing to consider is that+This has yet to be designed. One thing to consider is thatmost widgets are somewhat ephemeral in nature, so it's notthe end of the world if upgrades cause some older messagesto be obsolete, as long as the code degrades gracefully.@@ -142,7 +142,7 @@ to be obsolete, as long as the code degrades gracefully.Mission-critical widgets should have a deprecation strategy.For example, you could add optional features for one versionbump and then only make them mandatory for the next version,-as long as you don't radically change the data model. And+as long as you don't radically change the data model. Andif you're truly making radical changes, you can alwayswrite a Django migration for the `SubMessage` data.@@ -153,7 +153,7 @@ they are served up by the core Zulip server implementation.Of course, anybody who wishes to build their own widgethas the option of forking the server code and self-hosting,but we want to encourage folks to submit widget-code to our codebase in PRs. If we get to a critical mass+code to our codebase in PRs. If we get to a critical massof contributed widgets, we will want to explore a moredynamic mechanism for "plugging in" code from outside sources,but that is not in our immediate roadmap.@@ -162,23 +162,23 @@ This is sort of a segue to the next section of this document.Suppose you want to write your own custom bot, and youwant to allow users to click buttons to respond to options,but you don't want to have to modify the Zulip server codebase-to turn on those features. This is where our "zform"+to turn on those features. This is where our "zform"architecture comes to the rescue.## zform (trivia quiz bot)This section will describe our "zform" architecture.-For context, imagine a naive trivia bot. The trivia bot+For context, imagine a naive trivia bot. The trivia botsends a question with the answers labeled as A, B, C,-and D. Folks who want to answer the bot send back an+and D. Folks who want to answer the bot send back ananswer have to send an actual Zulip message with somethinglike `@trivia_bot answer A to Q01`, which is kind of-tedious to type. Wouldn't it be nice if the bot could+tedious to type. Wouldn't it be nice if the bot couldserve up some kind of buttons with canned replies, sothat the user just hits a button?-That is where zforms come in. Zulip's trivia bot sends+That is where zforms come in. Zulip's trivia bot sendsthe Zulip server a JSON representation of a form itwants rendered, and then the client renders a generic"**zform**" with buttons corresponding to `short_name` fields@@ -225,7 +225,7 @@ Here is what an example payload looks like:When users click on the buttons, **generic** clickhandlers automatically simulate a client reply usinga field called `reply` (in `choices`) as the content-of the message reply. Then the bot sees the reply+of the message reply. Then the bot sees the replyand grades the answer using ordinary chat-bot coding.The beautiful thing is that any third party developer@@ -298,7 +298,7 @@ recipients of the parent message.When the message gets to the client, the codepath for **zform**is actually quite similar to what happens with a more-customized widget like **poll**. (In fact, **zform** is a+customized widget like **poll**. (In fact, **zform** is asibling of **poll** and **zform** just has a somewhat moregeneric job to do.) In `static/js/widgetize.js` you will seewhere this code converges, with snippets like this:diff --git a/docs/testing/continuous-integration.md b/docs/testing/continuous-integration.mdindex d142b51dd56..faf92298e9c 100644--- a/docs/testing/continuous-integration.md+++ b/docs/testing/continuous-integration.md@@ -8,7 +8,7 @@ GitHub Actions and debugging issues with it.## GoalsThe overall goal of our CI is to avoid regressions and minimize the-total time spent debugging Zulip. We do that by trying to catch as+total time spent debugging Zulip. We do that by trying to catch asmany possible future bugs as possible, while minimizing both latencyand false positives, both of which can waste a lot of developer time.There are a few implications of this overall goal:@@ -28,14 +28,14 @@ run to iteratively debug something.- GitHub Actions stores timestamps for every line in the logs. Theyare hidden by default; you can see them by toggling the-`Show timestamps` option in the menu on any job's log page. (You can+`Show timestamps` option in the menu on any job's log page. (You canget this sort of timestamp in a development environment by pipingoutput to `ts`).- GitHub Actions runs on every branch you push on your Zulip fork.This is helpful when debugging something complicated.-- You can also ssh into a container to debug failures. SSHing into+- You can also ssh into a container to debug failures. SSHing intothe containers can be helpful, especially in rare cases where thetests are passing in your computer but failing in the CI. There arevarious@@ -103,7 +103,7 @@ running `tools/ci/build-docker-images`; see instructions at the top ofAn important element of making GitHub Actions perform effectively is cachingbetween jobs the various caches that live under `/srv/` in a Zulip-development or production environment. In particular, we cache the+development or production environment. In particular, we cache thefollowing:- Python virtualenvs@@ -117,7 +117,7 @@ We have designed these caches carefully (they are also used inproduction and the Zulip development environment) to ensure that eachis named by a hash of its dependencies and ubuntu distribution name,so Zulip should always be using the same version of dependencies it-would have used had the cache not existed. In practice, bugs are+would have used had the cache not existed. In practice, bugs arealways possible, so be mindful of this possibility.A consequence of this caching is that test jobs for branches whichdiff --git a/docs/testing/linters.md b/docs/testing/linters.mdindex 827998ee996..ba4ad24ab1a 100644--- a/docs/testing/linters.md+++ b/docs/testing/linters.md@@ -17,7 +17,7 @@ but for other files, we are quite thorough about checking semanticcorrectness.Obviously, a large reason for linting code is to enforce the [Zulip-coding standards](../contributing/code-style.md). But we also use the linters to+coding standards](../contributing/code-style.md). But we also use the linters toprevent common coding errors.We borrow some open source tools for much of our linting, and the links@@ -50,7 +50,7 @@ You can also run them individually or pass specific files:````./tools/lint` has many useful options; you can read about them in its-internal documentation using `./tools/lint --help`. Of particular+internal documentation using `./tools/lint --help`. Of particularnote are:- `--fix`: Several of our linters support automatically fixing basicissues; this option will ask `tools/lint` to run those.@@ -66,7 +66,7 @@ but it is good practice to run lint checks locally.We provide a[Git pre-commit hook](../git/zulip-tools.html#set-up-git-repo-script)that can automatically run `tools/lint` on just the files that-changed (in a few 100ms) whenever you make a commit. This can save+changed (in a few 100ms) whenever you make a commit. This can saveyou a lot of time, by automatically detecting linter errors as youmake them.:::@@ -87,9 +87,9 @@ And, of course, for minor oversights, `lint` is your friend, not your foe.Occasionally, our linters will complain about things that are more ofan artifact of the linter limitations than any actual problem with your-code. There is usually a mechanism where you can bypass the linter in+code. There is usually a mechanism where you can bypass the linter inextreme cases, but often it can be a simple matter of writing your code-in a slightly different style to appease the linter. If you have+in a slightly different style to appease the linter. If you haveproblems getting something to lint, you can submit an unfinished PRand ask the reviewer to help you work through the lint problem, or youcan find other people in the [Zulip Community](https://zulip.com/developer-community/)@@ -100,12 +100,12 @@ find limitations in either the Zulip home-grown stuff or our third partytools, feedback will be highly appreciated.Finally, one way to clean up your code is to thoroughly exercise it-with tests. The [Zulip test documentation](../testing/testing.md)+with tests. The [Zulip test documentation](../testing/testing.md)describes our test system in detail.## Lint checks-Most of our lint checks get performed by `./tools/lint`. These include the+Most of our lint checks get performed by `./tools/lint`. These include thefollowing checks:- Check Python code with pyflakes.@@ -118,10 +118,10 @@ following checks:- Check HTML templates for matching tags and indentations.- Check CSS for parsability and formatting.- Check JavaScript code for addClass calls.-- Running `mypy` to check static types in Python code. Our+- Running `mypy` to check static types in Python code. Our[documentation on using mypy](../testing/mypy.md) covers mypy inmore detail.-- Running `tsc` to compile TypeScript code. Our [documentation on+- Running `tsc` to compile TypeScript code. Our [documentation onTypeScript](typescript.md) covers TypeScript in more detail.The rest of this document pertains to the checks that occur in `./tools/lint`.@@ -139,14 +139,14 @@ In order for our entire lint suite to run in a timely fashion, the `lint`script performs several lint checks in parallel by forking out subprocesses.Note that our project does custom regex-based checks on the code, and we-also customize how we call pyflakes and pycodestyle (pep8). The code for these+also customize how we call pyflakes and pycodestyle (pep8). The code for thesetypes of checks mostly lives [here](https://github.com/zulip/zulip/tree/main/tools/linter_lib).### Special options-You can use the `-h` option for `lint` to see its usage. One particular+You can use the `-h` option for `lint` to see its usage. One particularflag to take note of is the `--modified` flag, which enables you to only run-lint checks against files that are modified in your Git repo. Most of the+lint checks against files that are modified in your Git repo. Most of the"sub-linters" respect this flag, but some will continue to process all the files.Generally, a good workflow is to run with `--modified` when you are iterating onthe code, and then run without that option right before committing new code.@@ -162,7 +162,7 @@ various file types.#### Generic source code checks-We check almost our entire codebase for trailing whitespace. Also, we+We check almost our entire codebase for trailing whitespace. Also, wedisallow tab (\t) characters in all but two files.We also have custom regex-based checks that apply to specific file types.@@ -170,7 +170,7 @@ For relatively minor files like Markdown files and JSON fixtures, thisis the extent of our checking.Finally, we're checking line length in Python code (and hope to extend-this to other parts of the codebase soon). You can use+this to other parts of the codebase soon). You can use`#ignorelinelength` for special cases where a very long line makessense (e.g. a link in a comment to an extremely long URL).@@ -178,19 +178,19 @@ sense (e.g. a link in a comment to an extremely long URL).Our Python code is formatted using Black (using the options in the`[tool.black]` section of `pyproject.toml`) and isort (using the-options in `.isort.cfg`). The `lint` script enforces this by running+options in `.isort.cfg`). The `lint` script enforces this by runningBlack and isort in check mode, or in write mode with `--fix`.-The bulk of our Python linting gets outsourced to the "pyflakes" tool. We+The bulk of our Python linting gets outsourced to the "pyflakes" tool. Wecall "pyflakes" in a fairly vanilla fashion, and then we post-process itsoutput to exclude certain specific errors that Zulip is comfortableignoring.Zulip also has custom regex-based rules that it applies to Python code.-Look for `python_rules` in the source code for `lint`. Note that we+Look for `python_rules` in the source code for `lint`. Note that weprovide a mechanism to exclude certain lines of codes from these checks.Often, it is simply the case that our regex approach is too crude to-correctly exonerate certain valid constructs. In other cases, the code+correctly exonerate certain valid constructs. In other cases, the codethat we exempt may be deemed not worthwhile to fix.#### JavaScript code@@ -203,7 +203,7 @@ We check our JavaScript code in a few different ways:#### Puppet manifestsWe use Puppet as our tool to manage configuration files, using-Puppet "manifests." To lint Puppet manifests, we use the "parser validate"+Puppet "manifests." To lint Puppet manifests, we use the "parser validate"option of Puppet.#### HTML templates@@ -214,7 +214,7 @@ Zulip uses two HTML templating systems:- [handlebars](https://handlebarsjs.com/)Zulip has an internal tool that validates both types of templates for-correct indentation and matching tags. You can find the code here:+correct indentation and matching tags. You can find the code here:- driver: [check-templates](https://github.com/zulip/zulip/blob/main/tools/check-templates)- engine: [lib/template_parser.py](https://github.com/zulip/zulip/blob/main/tools/lib/template_parser.py)@@ -232,7 +232,7 @@ for the rules we currently enforce.#### Shell scriptsZulip uses [shellcheck](https://github.com/koalaman/shellcheck) to-lint our shell scripts. We recommend the+lint our shell scripts. We recommend the[shellcheck gallery of bad code][shellcheck-bad-code] as a resource onhow to not write bad shell.diff --git a/docs/testing/manual-testing.md b/docs/testing/manual-testing.mdindex 20a466f4ea8..4ed94b79f46 100644--- a/docs/testing/manual-testing.md+++ b/docs/testing/manual-testing.md@@ -1,14 +1,14 @@# Manual testing #As a general rule, we like to have automated tests for everything that-can be practically tested. However, there are certain types of bugs+can be practically tested. However, there are certain types of bugsthat are best caught with old fashioned manual testing (also called-manual QA). Manual testing not only catches bugs, but it also helps+manual QA). Manual testing not only catches bugs, but it also helpsdevelopers learn more about the system and think about the existingsemantics of a feature they're working on.This doc assumes you know how to set up a local development server-and open the Zulip app in the browser. It also assumes a basic+and open the Zulip app in the browser. It also assumes a basicknowledge of how to use Zulip.## Basic stuff ##@@ -16,24 +16,24 @@ knowledge of how to use Zulip.When testing Zulip manually, here are things to focus on:- The best bugs to catch are security/permissions bugs.-- Don't rush manual testing. Look for small details like+- Don't rush manual testing. Look for small details likedisplay glitches.- Always test with multiple users (you can use incognito windowsto facilitate this).- Always keep the inspector console open and watch for warningsor errors.-- Be methodical about collecting information on bugs. (You will+- Be methodical about collecting information on bugs. (You willeventually want to create tickets, but you may want to consolidateyour own notes before filing tickets.)You generally want to test with Cordelia as the primary user,-and use Hamlet as her primary conversation partner. Use Iago-when you need to test administrative functions. Send messages+and use Hamlet as her primary conversation partner. Use Iago+when you need to test administrative functions. Send messagesto Othello or Prospero if you want to verify things such asCordelia not being able to receive messages not intended for her.The rest of this document groups tasks into basic areas of-functionality of the system. If you have multiple people testing+functionality of the system. If you have multiple people testingat once, you can divvy up QA tasks by these sections in the doc.### Message view ###@@ -150,9 +150,9 @@ Here are some tasks:Zulip uses the term "narrowing" to refer to opening different viewsof your messages, whether by clicking on sidebar options, recipient-bars, or by using search. The main focus of these tasks should-be watching unread counts. Of course, you also want to see messages-show up in the message pane. And, finally, you should make sure+bars, or by using search. The main focus of these tasks should+be watching unread counts. Of course, you also want to see messages+show up in the message pane. And, finally, you should make surethat no messages outside the narrow show up in Cordelia's view.@@ -190,14 +190,14 @@ messages after each narrow):- Go to Denmark view.- Go to Denmark/foo view.-There are 56 things to test here. If you can get into a rhythm+There are 56 things to test here. If you can get into a rhythmwhere you can test each case in about 30 seconds, then the wholeexercise is about 30 minutes, assuming no bugs.### Composing messages ###We have pretty good automated tests for our Markdown processor, so-manual testing is targeted more to other interactions. For composing+manual testing is targeted more to other interactions. For composinga message, pay attention to details like what is automaticallypopulated and where the focus is placed.@@ -257,9 +257,9 @@ populated and where the focus is placed.### Popover menus ###For this task you just want to go through all of our popover menus-and exercise them. The main nuance here is that you occasionally want+and exercise them. The main nuance here is that you occasionally wantto click somewhere on the UI outside of an existing popover to see if-the popover menu is "too sticky." Also, occasionally actions will be+the popover menu is "too sticky." Also, occasionally actions will besomewhat jarring; for example, if you mute a message in the current view,then the message will disappear from the view.@@ -306,7 +306,7 @@ Here are the things to test:### Sidebar filtering ###This is a fairly quick task where we test the search filters on the left sidebar-and the buddy list. If Cordelia is not subscribed to Denmark, subscribe her to+and the buddy list. If Cordelia is not subscribed to Denmark, subscribe her tothat stream.- Streams filtering@@ -349,7 +349,7 @@ First, we start off with "positive" tests.users.For negative tests, we want to dig a little deeper to find back-doors for Cordelia to access the stream. Here are some techniques+doors for Cordelia to access the stream. Here are some techniquesto try:- Try to have her compose a message to the stream by@@ -359,7 +359,7 @@ to try:- Go to stream settings and see if the stream shows up.For public streams, it's ok for Cordelia to know the stream exists,-and she can subsequently subscribe. For private streams, she should+and she can subsequently subscribe. For private streams, she shouldnot even know they exist (until she's invited, of course).- Negative tests@@ -380,9 +380,9 @@ not even know they exist (until she's invited, of course).### Search ###The main task for testing search is to play around with search-suggestions (autocomplete). Once you select an option, verify the+suggestions (autocomplete). Once you select an option, verify themessage view is consistent with the search and that the left sidebar-reflects the current narrow. If a search comes up legitimately+reflects the current narrow. If a search comes up legitimatelyempty, have Hamlet send a message that matches the search.Here are searches you should be able to do with autocomplete:@@ -530,7 +530,7 @@ Here are the tasks:### To be continued... ###-This document does not cover settings/admin options yet. The main+This document does not cover settings/admin options yet. The mainthings to do when testing the settings system are:- Verify that changes are synced to other users.- Verify error messages appear if you do something wrong and look right.diff --git a/docs/testing/mypy.md b/docs/testing/mypy.mdindex c14674abec6..e57113eb4d5 100644--- a/docs/testing/mypy.md+++ b/docs/testing/mypy.md@@ -1,9 +1,9 @@# Python static type checker (mypy)[mypy](http://mypy-lang.org/) is a compile-time static type checker-for Python, allowing optional, gradual typing of Python code. Zulip+for Python, allowing optional, gradual typing of Python code. Zulipwas fully annotated with mypy's Python 2 syntax in 2016, before our-migration to Python 3 in late 2017. In 2018 and 2020, we migrated+migration to Python 3 in late 2017. In 2018 and 2020, we migratedessentially the entire codebase to the nice PEP 484 (Python 3 only)and PEP 526 (Python 3.6) syntax for static types:@@ -19,7 +19,7 @@ You can learn more about it at:- The[mypy cheat sheet for Python 3](https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html)is the best resource for quickly understanding how to write the PEP- 484 type annotations used by mypy correctly. The+ 484 type annotations used by mypy correctly. The[Python 2 cheat sheet](https://mypy.readthedocs.io/en/latest/cheat_sheet.html)is useful for understanding the type comment syntax needed for ourfew modules that need to support both Python 2 and 3.@@ -38,7 +38,7 @@ CI testing process in the `backend` build.## Installing mypy-mypy is installed by default in the Zulip development environment. If+mypy is installed by default in the Zulip development environment. Ifyou'd like to install just the version of `mypy` that we're using(useful if e.g. you want `mypy` installed on your laptop outside theVagrant guest), you can do that with@@ -52,7 +52,7 @@ To run mypy on Zulip's python code, you can run the command:tools/run-mypy```-Mypy outputs errors in the same style as a compiler would. For+Mypy outputs errors in the same style as a compiler would. Forexample, if your code has a type error like this:```python@@ -70,7 +70,7 @@ test.py:200: error: Incompatible types in assignment (expression has type "str",## Mypy is there to find bugs in Zulip before they impact usersFor the purposes of Zulip development, you can treat `mypy` like a-much more powerful linter that can catch a wide range of bugs. If,+much more powerful linter that can catch a wide range of bugs. If,after running `tools/run-mypy` on your Zulip branch, you get mypyerrors, it's important to get to the bottom of the issue, not just dosomething quick to silence the warnings, before we merge the changes.@@ -86,7 +86,7 @@ Possible explanations include:Each explanation has its own solution, but in every case the resultshould be solving the mypy warning in a way that makes the Zulip-codebase better. If you're having trouble, silence the warning with+codebase better. If you're having trouble, silence the warning withan `Any` or `# type: ignore[code]` so you're not blocked waiting for help,add a `# TODO: ` comment so it doesn't get forgotten in code review,and ask for help in chat.zulip.org.@@ -105,7 +105,7 @@ root of the project, letting `mypy` know that it's third-party code,or add type stubs to the `stubs/` directory, which has type stubs thatmypy can use to type-check calls into that third-party module.-It's easy to add new stubs! Just read the docs, look at some of+It's easy to add new stubs! Just read the docs, look at some ofexisting examples to see how they work, and remember to remove the`ignore_missing_imports` entry in `pyproject.toml` when you add them.@@ -116,9 +116,9 @@ to use `mypy`!), but means the code can't be fully type-checked.## `type_debug.py`-`zerver/lib/type_debug.py` has a useful decorator `print_types`. It+`zerver/lib/type_debug.py` has a useful decorator `print_types`. Itprints the types of the parameters of the decorated function and the-return type whenever that function is called. This can help find out+return type whenever that function is called. This can help find outwhat parameter types a function is supposed to accept, or ifparameters with the wrong types are being passed to a function.@@ -145,8 +145,8 @@ func([int, ...], [int, ...]) -> [int, ...][1, 2, 3, 4, 5, 6, 7]```-`print_all` prints the type of the first item of lists. So `[int, ...]` represents-a list whose first element's type is `int`. Types of all items are not printed+`print_all` prints the type of the first item of lists. So `[int, ...]` represents+a list whose first element's type is `int`. Types of all items are not printedbecause a list can have many elements, which would make the output too large.Similarly in dicts, one key's type and the corresponding value's type are printed.@@ -156,13 +156,13 @@ So `{1: 'a', 2: 'b', 3: 'c'}` will be printed as `{int: str, ...}`.Sometimes, a function's type is most precisely expressed as a fewpossibilities, and which possibility can be determined by looking at-the arguments. You can express that idea in a way mypy understands-using `@overload`. For example, `check_list` returns a `Validator`+the arguments. You can express that idea in a way mypy understands+using `@overload`. For example, `check_list` returns a `Validator`function that verifies that an object is a list, raising an exceptionif it isn't.It supports being passed a `sub_validator`, which will verify that-each element in the list has a given type as well. One can express+each element in the list has a given type as well. One can expressthe idea "If `sub_validator` validates that something is a `ResultT`,`check_list(sub_validator)` validators that something is a`List[ResultT]` as follows:@@ -186,7 +186,7 @@ type logic for the case where we are passed a `sub_validator`.**Warning:** Mypy only checks the body of an overloaded functionagainst the final signature and not against the more restrictive-`@overload` signatures. This allows some type errors to evade+`@overload` signatures. This allows some type errors to evadedetection by mypy:```python@@ -201,7 +201,7 @@ x: int = f("three!!")```Due to this potential for unsafety, we discourage overloading unless-it's absolutely necessary. Consider writing multiple functions with+it's absolutely necessary. Consider writing multiple functions withdifferent names instead.See the [mypy overloading documentation][mypy-overloads] for more details.@@ -213,12 +213,12 @@ See the [mypy overloading documentation][mypy-overloads] for more details.### When is a type annotation justified?Usually in fully typed code, mypy will protect you from writing a type-annotation that isn't justified by the surrounding code. But when you+annotation that isn't justified by the surrounding code. But when youneed to write annotations at the border between untyped and typedcode, keep in mind that **a type annotation should always represent a-guarantee,** not an aspiration. If you have validated that some value-is an `int`, it can go in an `int` annotated variable. If you are-going to validate it later, it should not. When in doubt, an `object`+guarantee,** not an aspiration. If you have validated that some value+is an `int`, it can go in an `int` annotated variable. If you are+going to validate it later, it should not. When in doubt, an `object`annotation is always safe.Mypy understands many Python constructs like `assert`, `if`,@@ -238,7 +238,7 @@ def f(x: object, y: Optional[str]) -> None:It won't be able do this narrowing if the validation is hidden behinda function call, so sometimes it's helpful for a validation functionto return the type-narrowed value back to the caller even though the-caller already has it. (The validators in `zerver/lib/validator.py`+caller already has it. (The validators in `zerver/lib/validator.py`are examples of this pattern.)### Avoid the `Any` type@@ -248,7 +248,7 @@ type](https://mypy.readthedocs.io/en/stable/dynamic_typing.html) forinteroperability with untyped code, but it is completely unchecked.You can put an value of an arbitrary type into an expression of type`Any`, and get an value of an arbitrary type out, and mypy will make-no effort to check that the input and output types match. So using+no effort to check that the input and output types match. So using`Any` defeats the type safety that mypy would otherwise provide.```python@@ -281,8 +281,8 @@ alternatives first:`instance(value, str)` test.- If you really have no information about the type of a value, use the- **`object` type**. Since every type is a subtype of `object`, you- can correctly annotate any value as `object`. The [difference+ **`object` type**. Since every type is a subtype of `object`, you+ can correctly annotate any value as `object`. The [differencebetween `Any` and`object`](https://mypy.readthedocs.io/en/stable/dynamic_typing.html#any-vs-object)is that mypy will check that you safely validate an `object` with@@ -290,17 +290,17 @@ alternatives first:type.- A common way for `Any` annotations to sneak into your code is the- interaction with untyped third-party libraries. Mypy treats any+ interaction with untyped third-party libraries. Mypy treats anyvalue imported from an untyped library as annotated with `Any`, andtreats any type imported from an untyped library as equivalent to- `Any`. Consider providing real type annotations for the library by+ `Any`. Consider providing real type annotations for the library by[**writing a stub file**](#mypy-stubs-for-third-party-modules).### Avoid `cast()`The [`cast`function](https://mypy.readthedocs.io/en/stable/casts.html) lets you-provide an annotation that Mypy will not verify. Obviously, this is+provide an annotation that Mypy will not verify. Obviously, this iscompletely unsafe in general.```python@@ -329,7 +329,7 @@ Mypy allows you to ignore any type checking error with a[`# type: ignore`comment](https://mypy.readthedocs.io/en/stable/common_issues.html#spurious-errors-and-locally-silencing-the-checker),but you should avoid this in the absence of a very good reason, such-as a bug in mypy itself. If there are no safe options for dealing+as a bug in mypy itself. If there are no safe options for dealingwith the error, prefer an unchecked `cast`, since its unsafety issomewhat more localized.@@ -347,7 +347,7 @@ issue.not checked against the `@overload` signatures.- **Avoid `Callable[..., T]`** (with literal ellipsis `...`), since- mypy cannot check the types of arguments passed to it. Provide the+ mypy cannot check the types of arguments passed to it. Provide thespecific argument types (`Callable[[int, str], T]`) in simple cases,or use [callbackprotocols](https://mypy.readthedocs.io/en/stable/protocols.html#callback-protocols)@@ -357,11 +357,11 @@ issue.The [`Optional`type](https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html#built-in-types)-is for optional values, which are values that could be `None`. For+is for optional values, which are values that could be `None`. Forexample, `Optional[int]` is equivalent to `Union[int, None]`.The `Optional` type is **not for optional parameters** (unless they-are also optional values as above). This signature does not use the+are also optional values as above). This signature does not use the`Optional` type:```python@@ -371,7 +371,7 @@ def func(flag: bool = False) -> str:A collection such as `List` should only be `Optional` if `None` wouldhave a different meaning than the natural meaning of an empty-collection. For example:+collection. For example:- An include list where the default is to include everything should be`Optional` with default `None`.@@ -397,7 +397,7 @@ The basic Python collections[`Dict`](https://docs.python.org/3/library/typing.html#typing.Dict),and [`Set`](https://docs.python.org/3/library/typing.html#typing.Set)are mutable, but it's confusing for a function to mutate a collection-that was passed to it as an argument, especially by accident. To+that was passed to it as an argument, especially by accident. Toavoid this, prefer annotating function parameters with read-onlytypes:@@ -422,14 +422,14 @@ In some cases the more general[`Collection`](https://docs.python.org/3/library/typing.html#typing.Collection)or[`Iterable`](https://docs.python.org/3/library/typing.html#typing.Iterable)-types might be appropriate. (But don’t use `Iterable` for a value+types might be appropriate. (But don’t use `Iterable` for a valuethat might be iterated multiple times, since a one-use iterator is`Iterable` too.)A function's return type can be mutable if the return value is alwaysa freshly created collection, since the caller ends up with the onlyreference to the value and can freely mutate it without risk of-confusion. But a read-only return type might be more appropriate for+confusion. But a read-only return type might be more appropriate fora function that returns a reference to an existing collection.Read-only types have the additional advantage of being [covariant@@ -497,7 +497,7 @@ def f(s: str) -> str:But Mypy doesn't yet support the advanced type annotations that wouldbe needed to correctly type generic signature-changing decorators,such as `zerver.decorator.authenticated_json_view`, which passes an-extra argument to the inner function. For these decorators we must+extra argument to the inner function. For these decorators we mustunfortunately give up some type safety by falling back to`Callable[..., T]`.@@ -505,7 +505,7 @@ unfortunately give up some type safety by falling back toAll of our linters, including mypy, are designed to only check filesthat have been added in git (this is by design, since it means you-have untracked files in your Zulip checkout safely). So if you get a+have untracked files in your Zulip checkout safely). So if you get a`mypy` error like this after adding a new file that is referenced bythe existing codebase:diff --git a/docs/testing/philosophy.md b/docs/testing/philosophy.mdindex 84b3f518cb9..4edd61dfee5 100644--- a/docs/testing/philosophy.md+++ b/docs/testing/philosophy.md@@ -1,13 +1,13 @@# Testing philosophyZulip's automated tests are a huge part of what makes the project able-to make progress. This page records some of the key principles behind+to make progress. This page records some of the key principles behindhow we have designed our automated test suites.## Effective testing allows us to move quicklyZulip's engineering strategy can be summarized as "move quickly-without breaking things". Despite reviewing many code submissions+without breaking things". Despite reviewing many code submissionsfrom new contributors without deep expertise in the code they arechanging, Zulip's maintainers spend most of the time they spendintegrating changes on product decisions and code@@ -17,9 +17,9 @@ lower-level issues.This is possible because we have spent years systematically investingin testing, tooling, code structure, documentation, and developmentpractices to help ensure that our contributors write code that needs-relatively few changes before it can be merged. The testing element+relatively few changes before it can be merged. The testing elementof this is to have reliable, extensive, easily extended test suites-that cover most classes of bugs. Our testing systems have been+that cover most classes of bugs. Our testing systems have beendesigned to minimize the time spent manually testing or otherwiseinvestigating whether changes are correct.@@ -34,7 +34,7 @@ While not every part of Zulip has a great test suite, many componentsdo, and for those components, the tests mean that new contributors canoften make substantive changes and have them bemore or less correct by the time they share the-changes for code review. More importantly, it means that maintainers+changes for code review. More importantly, it means that maintainerssave most of the time that would otherwise be spent verifying that thechanges are simply correct, and instead focus on making sure that thecodebase remains readable, well-structured, and well-tested.@@ -43,12 +43,12 @@ codebase remains readable, well-structured, and well-tested.When automated test suites are slow or unreliable, developers willavoid running them, and furthermore, avoid working on improving them-(both the system and individual tests). Because changes that make+(both the system and individual tests). Because changes that maketests slow or unreliable are often unintentional side effects of otherdevelopment, problems in this area tend to accumulate as a codebase-grows. As a result, barring focused effort to prevent this outcome,+grows. As a result, barring focused effort to prevent this outcome,any large software project will eventually have its test suite rot-into one that is slow, unreliable, untrustworthy, and hated. We aim+into one that is slow, unreliable, untrustworthy, and hated. We aimfor Zulip to avoid that fate.So we consider it essential to maintaining every automated test suite@@ -62,7 +62,7 @@ suite (`test-js-with-node`) to run in under 10 seconds.It'd be a long blog post to summarize everything we do to help achievethese goals, but a few techniques are worth highlighting:- Our test suites are designed to not access the Internet, since the- Internet might be down or unreliable in the test environment. Where+ Internet might be down or unreliable in the test environment. Whereoutgoing HTTP requests are required to test something, we mock theresponses with libraries like `responses`.- We carefully avoid the potential for contamination of data inside@@ -70,7 +70,7 @@ these goals, but a few techniques are worth highlighting:- Every test case prepends a unique random prefix to all keys ituses when accessing Redis and memcached.- Every test case runs inside a database transaction, which is- aborted after the test completes. Each test process interacts+ aborted after the test completes. Each test process interactsonly with a fresh copy of a special template database used forserver tests that is destroyed after the process completes.- We rigorously investigate non-deterministically failing tests as though@@ -79,9 +79,9 @@ these goals, but a few techniques are worth highlighting:## Integration testing or unit testing?Developers frequently ask whether they should write "integration-tests" or "unit tests". Our view is that tests should be written+tests" or "unit tests". Our view is that tests should be writtenagainst interfaces that you're already counting on keeping stable, or-already promising people you'll keep stable. In other words,+already promising people you'll keep stable. In other words,interfaces that you or other people are already counting on mostly notchanging except in compatible ways.@@ -104,26 +104,26 @@ tiny internal functions, then any time you refactor something andchange the internal interfaces -- even though you just made them up,and they're completely internal to that codebase so there's nothingthat will break if you change them at will -- you have to go deal with-editing a bunch of tests to match the new interfaces. That's+editing a bunch of tests to match the new interfaces. That'sespecially a lot of work if you try to take the tests seriously,because you have to think through whether the tests breaking aretelling you something you should actually listen to.In some big codebases, this can lead to tests feeling a lot likebusywork... and it's because a lot of those tests really are-busywork. And that leads to developers not being committed to+busywork. And that leads to developers not being committed tomaintaining and expanding the test suite in a thoughtful way.But if your tests are written against an external API, and you makesome refactoring change and a bunch of tests break... now that's-telling you something very real! You can always edit the tests... but+telling you something very real! You can always edit the tests... butthe tests are stand-ins for real users and real code out there beyondyour reach, which will break the same way.So you can still make the change... but you have to deal with figuringout an appropriate migration or backwards-compatibility strategy forall those real users out there. Updating the tests is one of the easy-parts. And those changes to the tests are a nice reminder to code+parts. And those changes to the tests are a nice reminder to codereviewers that you've changed an interface, and the reviewer shouldthink carefully about whether those interface changes will be aproblem for any existing clients and whether they're properly reflected@@ -167,7 +167,7 @@ So, to summarize our approach to integration vs. unit testing:## Avoid duplicating code with security impactDeveloping secure software with few security bugs is extremely-difficult. An important part of our strategy for avoiding security+difficult. An important part of our strategy for avoiding securitylogic bugs is to design patterns for how all of our code thatprocesses untrusted user input can be well tested without eitherwriting (and reviewing!) endless tests or requiring every developer to@@ -177,7 +177,7 @@ Our strategy for this is to write a small number of carefully-designedfunctions like `access_stream_by_id` that we test carefully, and thenuse linting and other coding conventions to require that all access todata from code paths that might share that data with users be mediated-through those functions. So rather than having each view function do+through those functions. So rather than having each view function doit own security checks for whether the user can access a given stream,and needing to test each of those copies of the logic, we only need todo that work once for each major type of data structure and level of@@ -211,7 +211,7 @@ test conditions.The benefit of this strategy is that you guarantee that the test setuponly differs as intended: Done well, it helps avoid the otherwiseextremely common failure mode where a `test_foo_failure` test passes-for the wrong reason. (E.g. the action fails not because of the+for the wrong reason. (E.g. the action fails not because of thepermission check, but because a required HTTP parameter was only addedto an adjacent `test_foo_success`).@@ -228,7 +228,7 @@ designed to be robust to future refactoring.But for some things, like documentation and CSS, the only way to testis to view the element in a browser and try things that might not-work. What to test will vary with what is likely to break. For+work. What to test will vary with what is likely to break. Forexample, after a significant change to Zulip's Markdown documentation,if you haven't verified every special bit of formatting visually andclicked every new link, there's a good chance that you've introduced adiff --git a/docs/testing/testing-with-django.md b/docs/testing/testing-with-django.mdindex 42051fa5997..dacb16ecd0f 100644--- a/docs/testing/testing-with-django.md+++ b/docs/testing/testing-with-django.md@@ -2,21 +2,21 @@## Overview-Zulip uses the Django framework for its Python backend. We+Zulip uses the Django framework for its Python backend. Weuse the testing framework from[django.test](https://docs.djangoproject.com/en/1.10/topics/testing/)-to test our code. We have over a thousand automated tests that verify that+to test our code. We have over a thousand automated tests that verify thatour backend works as expected.-All changes to the Zulip backend code should be supported by tests. We+All changes to the Zulip backend code should be supported by tests. Weenforce our testing culture during code review, and we also use-coverage tools to measure how well we test our code. We mostly use+coverage tools to measure how well we test our code. We mostly usetests to prevent regressions in our code, but the tests can haveancillary benefits such as documenting interfaces and influencingthe design of our software.If you have worked on other Django projects that use unit testing, you-will probably find familiar patterns in Zulip's code. This document+will probably find familiar patterns in Zulip's code. This documentdescribes how to write tests for the Zulip backend, with a particularemphasis on areas where we have either wrapped Django's test frameworkor just done things that are kind of unique in Zulip.@@ -26,7 +26,7 @@ or just done things that are kind of unique in Zulip.Our tests live in `zerver/tests/`. You can run them with`./tools/test-backend`. The tests run in parallel using multiplethreads in your development environment, and can finish in under 30s-on a fast machine. When you are in iterative mode, you can run+on a fast machine. When you are in iterative mode, you can runindividual tests or individual modules, following the dotted.test.nameconvention below:@@ -36,7 +36,7 @@ cd /srv/zulip```There are many command line options for running Zulip tests, such-as a `--verbose` option. The+as a `--verbose` option. Thebest way to learn the options is to use the online help:```bash@@ -44,8 +44,8 @@ best way to learn the options is to use the online help:```We also have ways to instrument our tests for finding code coverage,-URL coverage, and slow tests. Use the `-h` option to discover these-features. We also have a `--profile` option to facilitate profiling+URL coverage, and slow tests. Use the `-h` option to discover these+features. We also have a `--profile` option to facilitate profilingtests.By default, `test-backend` will run all requested tests, and report@@ -55,12 +55,12 @@ error with the `--stop` option (or `-x`).Another useful option is `--rerun`, which will rerun just the teststhat failed in the last test run.-**Webhook integrations**. For performance, `test-backend` with no+**Webhook integrations**. For performance, `test-backend` with noarguments will not run webhook integration tests (`zerver/webhooks/`),which would otherwise account for about 25% of the total runtime.When working on webhooks, we recommend instead running`test-backend zerver/webhooks` manually (or better, the direction for-the specific webhooks you're working on). And of course our CI is+the specific webhooks you're working on). And of course our CI isconfigured to always use `test-backend --include-webhooks` and run allof the tests.@@ -75,10 +75,10 @@ You can also read some of the existing tests in `zerver/tests`to get a feel for other patterns we use.A good practice is to get a "failing test" before you start to implement-your feature. First, it is a useful exercise to understand what needs to happen+your feature. First, it is a useful exercise to understand what needs to happenin your tests before you write the code, as it can help drive out simple-design or help you make incremental progress on a large feature. Second,-you want to avoid introducing tests that give false positives. Ensuring+design or help you make incremental progress on a large feature. Second,+you want to avoid introducing tests that give false positives. Ensuringthat a test fails before you implement the feature ensures that if somebodyaccidentally regresses the feature in the future, the test will catchthe regression.@@ -91,7 +91,7 @@ which contains our `ZulipTestCase` and `WebhookTestCase` classes.### Setting up data for tests-All tests start with the same fixture data. (The tests themselves+All tests start with the same fixture data. (The tests themselvesupdate the database, but they do so inside a transaction that getsrolled back after each of the tests complete. For more details on how thefixture data gets set up, refer to `tools/setup/generate-fixtures`.)@@ -122,7 +122,7 @@ Here are some example action methods that tests may use for data setup:### Testing code that accesses the filesystemSome tests need to access the filesystem (e.g. `test_upload.py` tests-for `LocalUploadBackend` and the data import tests). Doing+for `LocalUploadBackend` and the data import tests). Doingthis correctly requires care to avoid problems like:- Leaking files after every test (which are clutter and can eventuallyrun the development environment out of disk) or@@ -142,7 +142,7 @@ To avoid these problems, you can do the following:Our common testing infrastructure handles some of this for you,e.g. it replaces `settings.LOCAL_UPLOADS_DIR` for each test process-with a unique path under `/var/<uuid>/test-backend`. And+with a unique path under `/var/<uuid>/test-backend`. And`UploadSerializeMixin` manages some of the cleanup work for`test_upload.py`.@@ -168,7 +168,7 @@ Additionally, you can observe any calls made to your mocked object.When writing tests, it often occurs that you make calls to functionstaking complex arguments. Creating a real instance of such an argumentwould require the use of various different libraries, a lot of-boilerplate code, etc. Another scenario is that the tested code+boilerplate code, etc. Another scenario is that the tested codeaccesses files or objects that don't exist at testing time. Finally,it is good practice to keep tests independent from others. Mocks helpyou to isolate test cases by simulating objects and methods irrelevant@@ -318,8 +318,8 @@ On the other hand, if we had used `import os.urandom`, we would need to call `mo#### Zulip mocking practicesFor mocking we generally use the "mock" library and use `mock.patch` as-a context manager or decorator. We also take advantage of some context managers-from Django as well as our own custom helpers. Here is an example:+a context manager or decorator. We also take advantage of some context managers+from Django as well as our own custom helpers. Here is an example:```pythonwith self.settings(RATE_LIMITING=True):@@ -345,7 +345,7 @@ receive Django HttpRequest object.## Zulip testing philosophyIf there is one word to describe Zulip's philosophy for writing tests,-it is probably "flexible." (Hopefully "thorough" goes without saying.)+it is probably "flexible." (Hopefully "thorough" goes without saying.)When in doubt, unless speed concerns are prohibitive,you usually want your tests to be somewhat end-to-end, particularly@@ -356,8 +356,8 @@ test suite...### Endpoint tests-We strive to test all of our URL endpoints. The vast majority of Zulip-endpoints support a JSON interface. Regardless of the interface, an+We strive to test all of our URL endpoints. The vast majority of Zulip+endpoints support a JSON interface. Regardless of the interface, anendpoint test generally follows this pattern:- Set up the data.@@ -394,7 +394,7 @@ via Django.### Fixture-driven testsParticularly for testing Zulip's integrations with third party systems,-we strive to have a highly data-driven approach to testing. To give a+we strive to have a highly data-driven approach to testing. To give aspecific example, when we test our GitHub integration, the test codereads a bunch of sample inputs from a JSON fixture file, feeds themto our GitHub integration code, and then verifies the output against@@ -420,20 +420,20 @@ A detailed description of mocks, along with useful coded snippets, can be foundIn [zerver/tests/test_templates.py](https://github.com/zulip/zulip/blob/main/zerver/tests/test_templates.py)we have a test that renders all of our backend templates witha "dummy" context, to make sure the templates don't have obvious-errors. (These tests won't catch all types of errors; they are+errors. (These tests won't catch all types of errors; they arejust a first line of defense.)### SQL performance testsA common class of bug with Django systems is to handle bulk data inan inefficient way, where the backend populates objects for join tables-with a series of individual queries that give O(N) latency. (The+with a series of individual queries that give O(N) latency. (Theremedy is often just to call `select_related()`, but sometimes itrequires a more subtle restructuring of the code.)We try to prevent these bugs in our tests by using a context managercalled `queries_captured()` that captures the SQL queries used by-the backend during a particular operation. We make assertions about+the backend during a particular operation. We make assertions aboutthose queries, often simply asserting that the number of queries isbelow some threshold.@@ -442,21 +442,21 @@ below some threshold.The Zulip backend has a mechanism where it will fetch initial datafor a client from the database, and then it will subsequently applysome queued up events to that data to the data structure before notifying-the client. The `BaseAction.do_test()` helper helps tests+the client. The `BaseAction.do_test()` helper helps testsverify that the application of those events via apply_events() producesthe same data structure as performing an action that generates said event.This is a bit esoteric, but if you read the tests, you will see some of-the patterns. You can also learn more about our event system in the+the patterns. You can also learn more about our event system in the[new feature tutorial](../tutorials/new-feature-tutorial.html#handle-database-interactions).### Negative testsIt is important to verify error handling paths for endpoints, particularlysituations where we need to ensure that we don't return results to clients-with improper authentication or with limited authorization. A typical test+with improper authentication or with limited authorization. A typical testwill call the endpoint with either a non-logged in client, an invalid API-key, or missing input fields. Then the test will call `assert_json_error()`+key, or missing input fields. Then the test will call `assert_json_error()`to verify that the endpoint is properly failing.## Testing considerations@@ -468,26 +468,26 @@ If you have several tests repeating the same type of test setup,consider making a setUp() method or a test helper.- **Network independence** Our tests should still work if you don't-have an internet connection. For third party clients, you can simulate-their behavior using fixture data. For third party servers, you can+have an internet connection. For third party clients, you can simulate+their behavior using fixture data. For third party servers, you cantypically simulate their behavior using mocks.- **Coverage** We have 100% line coverage on several of our backend-modules. You can use the `--coverage` option to generate coverage+modules. You can use the `--coverage` option to generate coveragereports, and new code should have 100% coverage, which generallyrequires testing not only the "happy path" but also error handling-code and edge cases. It will generate a nice HTML report that you can+code and edge cases. It will generate a nice HTML report that you canview right from your browser (the tool prints the URL where the reportis exposed in your development environment).- **Console output** A properly written test should print nothing tothe console; use `with self.assertLogs` to capture and verify any-logging output. Note that we reconfigure various loggers in+logging output. Note that we reconfigure various loggers in`zproject/test_extra_settings.py` where the output is unlikely to beinteresting when running our test suite.`test-backend --ban-console-output` checks for stray print statements.Note that `test-backend --coverage` will assert thatvarious specific files in the project have 100% test coverage and-throw an error if their coverage has fallen. One of our project goals+throw an error if their coverage has fallen. One of our project goalsis to expand that checking to ever-larger parts of the codebase.diff --git a/docs/testing/testing-with-node.md b/docs/testing/testing-with-node.mdindex 4f9558ce69b..da8097a0803 100644--- a/docs/testing/testing-with-node.md+++ b/docs/testing/testing-with-node.md@@ -1,7 +1,7 @@# JavaScript/TypeScript unit testsOur node-based unit tests system is the preferred way to test-JavaScript/TypeScript code in Zulip. We prefer it over the [Puppeteer+JavaScript/TypeScript code in Zulip. We prefer it over the [Puppeteerblack-box whole-app testing](../testing/testing-with-puppeteer.md),system since it is much (>100x) faster and also easier to do correctlythan the Puppeteer system.@@ -15,8 +15,8 @@ See `test-js-with-node --help` for useful options; even though thewhole suite is quite fast, it still saves time to run a single test byname when debugging something.-The JS unit tests are written to work with node. You can find them-in `frontend_tests/node_tests`. Here is an example test from+The JS unit tests are written to work with node. You can find them+in `frontend_tests/node_tests`. Here is an example test from`frontend_tests/node_tests/stream_data.js`:```js@@ -38,8 +38,8 @@ in `frontend_tests/node_tests`. Here is an example test from```The names of the node tests generally align with the names of the-modules they test. If you modify a JS module in `static/js` you should-see if there are corresponding test in `frontend_tests/node_tests`. If+modules they test. If you modify a JS module in `static/js` you should+see if there are corresponding test in `frontend_tests/node_tests`. Ifthere are, you should strive to follow the patterns of the existing testsand add your own tests.@@ -69,7 +69,7 @@ working on or debugging the Zulip node tests.Conceptually, the `zjquery` library provides minimal versions of most`jQuery` DOM manipulation functions, and has a convenient system for-letting you set up return values for more complex functions. For+letting you set up return values for more complex functions. Forexample, if the code you'd like to test calls `$obj.find()`, you canuse `$obj.set_find_results(selector, $value)` to set up `zjquery` sothat calls to `$obj.find(selector)` will return `$value`. See the unit@@ -97,7 +97,7 @@ based on how other functions have been stubbed in the same file.The other big challenge with doing unit tests for a JavaScript projectis that often one wants to limit the scope the production code beingrun, just to avoid doing extra setup work that isn't relevant to the-code you're trying to test. For that reason, each unit test file+code you're trying to test. For that reason, each unit test fileexplicitly declares all of the modules it depends on, with a fewdifferent types of declarations depending on whether we want to:@@ -178,8 +178,8 @@ data/logic modules (UI modules are lower priority for unit testing).Our node test system is pretty simple, and it's possible to configurethe native debugger features of popular editors to allow stepping-through the code. Below we document the editors where someone has put-together detailed instructions for how to do so. Contributions of+through the code. Below we document the editors where someone has put+together detailed instructions for how to do so. Contributions ofnotes for other editors are welcome!## Webstorm integration setup@@ -201,7 +201,7 @@ These instructions assume you're using the Vagrant development environment.- `Vagrant executable` should already be correctly `vagrant`.- `Environment Variables` is not needed.-3. You'll now need to set up a WebStorm "Debug Configuration". Open+3. You'll now need to set up a WebStorm "Debug Configuration". Openthe `Run/Debug Configuration` menu and create a new `Node.js` config:1. Under `Node interpreter:` click the 3 dots to the right side andclick on the little plus in the bottom left of the@@ -217,7 +217,7 @@ These instructions assume you're using the Vagrant development environment.1. Under `JavaScript file`, enter `frontend_tests/zjsunit/index.js`-- this is the root script for Zulip's node unit tests.-Congratulations! You've now set up the integration.+Congratulations! You've now set up the integration.## Running tests with the debuggerdiff --git a/docs/testing/testing-with-puppeteer.md b/docs/testing/testing-with-puppeteer.mdindex 42eed4a27c5..ae63750c2f2 100644--- a/docs/testing/testing-with-puppeteer.md+++ b/docs/testing/testing-with-puppeteer.md@@ -26,7 +26,7 @@ of various useful helper functions defined inThe Puppeteer tests use a real Chromium browser (powered by[puppeteer](https://github.com/puppeteer/puppeteer)), connected to a-real Zulip development server. These are black-box tests: Steps in a+real Zulip development server. These are black-box tests: Steps in aPuppeteer test are largely things one might do as a user of the Zulipweb app, like "Type this key", "Wait until this HTML elementappears/disappears", or "Click on this HTML element".@@ -45,7 +45,7 @@ async function test_private_message_compose_shortcut(page) {The test function presses the `x` key, waits for the`#private_message_recipient` input element to appear, verifies its-content is empty, and then closes the compose box. The+content is empty, and then closes the compose box. The`waitForSelector` step here (and in most tests) is critical; teststhat don't wait properly often fail nonderministically, because thetest will work or not depending on whether the browser updates the UI@@ -70,14 +70,14 @@ integration](../testing/continuous-integration.md):interactive to debug an issue in the normal Zulip developmentenvironment than in the Puppeteer test suite.- Does the change being tested adjust the HTML structure in a way that- affects any of the selectors used in the tests? If so, the test may+ affects any of the selectors used in the tests? If so, the test mayjust need to be updated for your changes.- Does the test fail deterministically when you run it locally usingE.g. `./tools/test-js-with-puppeteer compose.ts`? If so, you caniteratively debug to see the failure.-- Does the test fail nondeterministically? If so, the problem is+- Does the test fail nondeterministically? If so, the problem islikely that a `waitForSelector` statement is either missing or not- waiting for the right thing. Tests fail nondeterministically much+ waiting for the right thing. Tests fail nondeterministically muchmore often on very slow systems like those used for ContinuousIntegration (CI) services because small races are amplified in thoseenvironments; this often explains failures in CI that cannot be@@ -115,7 +115,7 @@ These tools/features are often useful when debugging:extra [Django settings](../subsystems/settings.md) from`zproject/test_extra_settings.py` to configure an isolated databaseso that the tests will not interfere/interact with a normal- development environment. The console output while running the tests+ development environment. The console output while running the testsincludes the console output for the server; any Python exceptionsare likely actual bugs in the changes being tested.@@ -143,22 +143,22 @@ notes above:assumes the last step was processed by the browser (E.g. after youclick on a user's avatar, you need an explicit wait for the profilepopover to appear before you can try to click on a menu item in that- popover). This means that before essentially every action in your+ popover). This means that before essentially every action in yourPuppeteer tests, you'll want to use `waitForSelector` or similarwait function to make sure the page or element is ready before you- interact with it. The [puppeteer docs site](https://pptr.dev/) is a+ interact with it. The [puppeteer docs site](https://pptr.dev/) is auseful reference for the available wait functions.- When using `waitForSelector`, you always want to use the`{visible: true}` option; otherwise the test will stop waiting assoon as the target selector is present in the DOM even if it's- hidden. For the common UI pattern of having an element always be+ hidden. For the common UI pattern of having an element always bepresent in the DOM whose presence is managed via show/hide ratherthan adding/removing it from the DOM, `waitForSelector` without`visible: true` won't wait at all.- The test suite uses a smaller set of default user accounts and otherdata initialized in the database than the normal developmentenvironment; specifically, it uses the same setup as the [backend- tests](../testing/testing-with-django.md). To see what differs from+ tests](../testing/testing-with-django.md). To see what differs fromthe development environment, check out the conditions on`options["test_suite"]` in`zilencer/management/commands/populate_db.py`.diff --git a/docs/testing/testing.md b/docs/testing/testing.mdindex b9aed18f25e..af5a6655d13 100644--- a/docs/testing/testing.md+++ b/docs/testing/testing.md@@ -28,7 +28,7 @@ as follows:```However, you will rarely want to do this while actively developing,-because it takes a long time. Instead, your edit/refresh cycle will+because it takes a long time. Instead, your edit/refresh cycle willtypically involve running subsets of the tests with commands like these:```bash@@ -39,7 +39,7 @@ typically involve running subsets of the tests with commands like these:./tools/test-js-with-node utils.js```-The commands above will all run in just a few seconds. Many more+The commands above will all run in just a few seconds. Many moreuseful options are discussed in each tool's documentation (e.g.`./tools/test-backend --help`).@@ -60,7 +60,7 @@ eventually work with, each with its own page detailing how it works:Additionally, Zulip also has about a dozen smaller tests suites:- `tools/test-migrations`: Checks whether the `zerver/migrations`- migration content the models defined in `zerver/models.py`. See our+ migration content the models defined in `zerver/models.py`. See our[schema migration documentation](../subsystems/schema-migrations.md)for details on how to do database migrations correctly.- `tools/test-documentation`: Checks for broken links in this@@ -72,12 +72,12 @@ Additionally, Zulip also has about a dozen smaller tests suites:`zerver/openapi/python_examples.py`.- `test-locked-requirements`: Verifies that developers didn't forgetto run `tools/update-locked-requirements` after modifying- `requirements/*.in`. See+ `requirements/*.in`. See[our dependency documentation](../subsystems/dependencies.md) fordetails on the system this is verifying.- `tools/check-capitalization`: Checks whether translated strings (akauser-facing strings) correctly follow Zulip's capitalization- conventions. This requires some maintenance of an exclude list+ conventions. This requires some maintenance of an exclude list(`tools.lib.capitalization.IGNORED_PHRASES`) of proper nounsmentioned in the Zulip project, but helps a lot in avoiding newstrings being added that don't match our style.@@ -104,7 +104,7 @@ something valuable to helping keep Zulip bug-free.## Internet access inside test suitesAs a policy matter, the Zulip test suites should never make outgoing-HTTP or other network requests. This is important for 2 major+HTTP or other network requests. This is important for 2 majorreasons:- Tests that make outgoing Internet requests will fail when the user@@ -116,7 +116,7 @@ reasons:developer time, and we try to avoid them wherever possible.As a result, Zulip's major test suites should never access the-Internet directly. Since code in Zulip does need to access the+Internet directly. Since code in Zulip does need to access theInternet (e.g. to access various third-party APIs), this means thatthe Zulip tests use mocking to basically hardcode (for the purposes ofthe test) what responses should be used for any outgoing Internet@@ -125,7 +125,7 @@ requests that Zulip would make in the code path being tested.This is easy to do using test fixtures (a fancy word for fixed dataused in tests) and the `mock.patch` function to specify what HTTPresponse should be used by the tests for every outgoing HTTP (or other-network) request. Consult+network) request. Consult[our guide on mocking](../testing/testing-with-django.html#zulip-mocking-practices) tolearn how to mock network requests easily; there are also a number ofexamples throughout the codebase.@@ -133,7 +133,7 @@ examples throughout the codebase.We partially enforce this policy in the main Django/backend test suiteby overriding certain library functions that are used in outgoing HTTPcode paths (`httplib2.Http().request`, `requests.request`, etc.) to-throw an exception in the backend tests. While this is enforcement is+throw an exception in the backend tests. While this is enforcement isnot complete (there a lot of other ways to use the Internet fromPython), it is easy to do and catches most common cases of new codedepending on Internet access.@@ -151,9 +151,9 @@ This enforcement code results in the following exception:The one exception to this policy is our documentation tests, whichwill attempt to verify that the links included in our documentation-aren't broken. Those tests end up failing nondeterministically fairly+aren't broken. Those tests end up failing nondeterministically fairlyoften, which is unfortunate, but there's simply no other correct way-to verify links other than attempting to access them. The compromise+to verify links other than attempting to access them. The compromisewe've implemented is that in CI, these tests only verify links towebsites controlled by the Zulip project (zulip.com, our GitHub,our ReadTheDocs), and not links to third-party websites.diff --git a/docs/testing/typescript.md b/docs/testing/typescript.mdindex dda223e0679..1a18190bcb0 100644--- a/docs/testing/typescript.md+++ b/docs/testing/typescript.md@@ -2,7 +2,7 @@Zulip is early in the process of migrating our codebase to use[TypeScript](https://www.typescriptlang.org/), the leading static type-system for JavaScript. It works as an extension of the ES6 JavaScript+system for JavaScript. It works as an extension of the ES6 JavaScriptstandard, and provides similar benefits to our use of[the mypy static type system for Python](../testing/mypy.md).@@ -33,7 +33,7 @@ The following resources are valuable for learning TypeScript:## Type checkingTypeScript types are checked by the TypeScript compiler, `tsc`, which-is run as part of our [lint checks](linters.md). You can run the+is run as part of our [lint checks](linters.md). You can run thecompiler yourself with `tools/run-tsc`, which will check all theTypeScript files once, or `tools/run-tsc --watch`, which willcontinually recheck the files as you edit them.@@ -41,13 +41,13 @@ continually recheck the files as you edit them.## Linting and styleWe use the Eslint plugin for TypeScript to lint TypeScript code, just-like we do for JavaScript. Our long-term goal is to use an idiomatic+like we do for JavaScript. Our long-term goal is to use an idiomaticTypeScript style for our TypeScript codebase.However, because we are migrating an established JavaScript codebase,we plan to start with a style that is closer to the existingJavaScript code, so that we can easily migrate individual modules-without too much code churn. A few examples:+without too much code churn. A few examples:- TypeScript generally prefers explicit `return undefined;`, whereasour existing JavasScript style uses just `return;`.@@ -72,22 +72,22 @@ Our plan is to order which modules we migrate carefully, starting withthose that:- Appear frequently as reverse dependencies of other modules- (e.g. `people.js`). These are most valuable to do first because+ (e.g. `people.js`). These are most valuable to do first becausethen we have types on the data being interacted with by othermodules when we migrate those.- Don't have large open pull requests (to avoid merge conflicts); onecan scan for these using [TinglingGit](https://github.com/zulip/TinglingGit).- Have good unit test coverage, which limits the risk of breaking- correctness through refactoring. Use+ correctness through refactoring. Use`tools/test-js-with-node --coverage` to get a coverage report.When migrating a module, we want to be especially thoughtful aboutputting together a commit structure that makes mistakes unlikely and-the changes easy to verify. E.g.:+the changes easy to verify. E.g.:- First a commit that just converts the language to TypeScript adding- types. The result may potentially have some violations of the- long-term style we want (e.g. not using `const`). Depending on how+ types. The result may potentially have some violations of the+ long-term style we want (e.g. not using `const`). Depending on howwe're handling linting, we set some override eslint rules at the topof the module at this stage so CI still passes.- Then a commit just migrating use of `var` to `const/let` withoutdiff --git a/docs/translating/chinese.md b/docs/translating/chinese.mdindex 15ccdc82592..3b290a819f0 100644--- a/docs/translating/chinese.md+++ b/docs/translating/chinese.md@@ -117,7 +117,7 @@ readability considerations.- Mute/Unmute - **开启/关闭免打扰**"Mute" is mostly translated as "静音(Silent)", which is common in TV-set. Such a translation is not appropriate for Zulip. "开启/关闭免打+set. Such a translation is not appropriate for Zulip. "开启/关闭免打扰(Turn off/on Notification)" is a sense to sense translation, whichis also borrowed from the WeChat.diff --git a/docs/translating/internationalization.md b/docs/translating/internationalization.mdindex 301ccc40f92..7d2fecc2a23 100644--- a/docs/translating/internationalization.md+++ b/docs/translating/internationalization.md@@ -6,19 +6,19 @@ the Zulip UI in their preferred language.This article aims to teach Zulip contributors enough aboutinternationalization and Zulip's tools for it so that they can make-correct decisions about how to tag strings for translation. A few+correct decisions about how to tag strings for translation. A fewprinciples are important in how we think about internationalization:- Our goal is for **all end-user facing strings** in Zulip to betagged for translation in both [HTML templates](#html-templates) and- code, and our linters attempt to enforce this. There are some+ code, and our linters attempt to enforce this. There are someexceptions: we don't tag strings in Zulip's landing pages(e.g. /features) and other documentation (e.g. /help) fortranslation at this time (though we do aim for those pages to beusable with tools like Google Translate).- Translating all the strings in Zulip for a language and maintainingthat translation is a lot of work, and that work scales with the- number of strings tagged for translation in Zulip. For this reason,+ number of strings tagged for translation in Zulip. For this reason,we put significant effort into only tagging for translation contentthat will actually be displayed to users, and minimizing unnecessaryuser-facing strings in the product.@@ -29,7 +29,7 @@ principles are important in how we think about internationalization:policy](../translating/translating.html#capitalization) that we enforce using lintersthat check all strings tagged for translation in Zulip.-This article aims to provide a brief introduction. We recommend the+This article aims to provide a brief introduction. We recommend the[EdX i18n guide][edx-i18n] as a great resource for learning more aboutinternationalization in general; we agree with essentially all oftheir style guidelines.@@ -42,23 +42,23 @@ There are a few critical details about human language that are importantto understand when implementing an internationalized application:- **Punctuation** varies between languages (e.g. Japanese doesn't use- `.`s at the end of sentences). This means that you should always+ `.`s at the end of sentences). This means that you should alwaysinclude end-of-sentence symbols like `.` and `?` inside theto-be-translated strings, so that translators can correctlytranslate the content.- **Word order** varies between languages (e.g. some languages put- subjects before verbs, others the other way around). This means+ subjects before verbs, others the other way around). This meansthat **concatenating translateable strings** produces broken results(more details with examples are below).- The **width of the string needed to express something** variesdramatically between languages; this means you can't just hardcode abutton or widget to look great for English and expect it to work in- all languages. German is a good test case, as it has a lot of long+ all languages. German is a good test case, as it has a lot of longwords, as is Japanese (as character-based languages use a lot lesswidth).- This is more about how i18n tooling works, but in code, thetranslation function must be passed the string to translate, not a- variable containing the target string. Otherwise, the parsers that+ variable containing the target string. Otherwise, the parsers thatextract the strings in a project to send to translators will notfind your string.@@ -96,7 +96,7 @@ The end-to-end tooling process for translations in Zulip is as follows.`./tools/i18n/push-translations` command (which invokes a TransifexAPI tool, `tx push`, internally).-4. Translators translate the strings in the Transifex UI. (In theory,+4. Translators translate the strings in the Transifex UI. (In theory,it's possible to translate locally and then do `tx push`, butbecause our workflow is to sync translation data from Transifex toZulip, making changes to translations in Zulip risks having the@@ -145,8 +145,8 @@ can use the `_()` function in the templates like this:If a piece of text contains both a literal string component and variables,you can use a block translation, which makes use of placeholders to-help translators to translate an entire sentence. To translate a-block, Jinja2 uses the [trans][] tag. So rather than writing+help translators to translate an entire sentence. To translate a+block, Jinja2 uses the [trans][] tag. So rather than writingsomething ugly and confusing for translators like this:```jinja@@ -169,7 +169,7 @@ which can be imported as follows:from django.utils.translation import gettext as _```-Zulip expects all the error messages to be translatable as well. To+Zulip expects all the error messages to be translatable as well. Toensure this, the error message passed to `JsonableError`should always be a literal string enclosed by `_()`function, e.g.:@@ -239,8 +239,8 @@ $("#foo").html(The only HTML tags allowed directly in translated strings are thesimple HTML tags enumerated in `default_html_elements`-(`static/js/i18n.js`) with no attributes. This helps to avoid-exposing HTML details to translators. If you need to include more+(`static/js/i18n.js`) with no attributes. This helps to avoid+exposing HTML details to translators. If you need to include morecomplex markup such as a link, you can define a custom HTML taglocally to the translation:@@ -254,7 +254,7 @@ $t_html(### Handlebars templatesFor translations in Handlebars templates we also use FormatJS, through two-Handlebars [helpers][] that Zulip registers. The syntax for simple strings is:+Handlebars [helpers][] that Zulip registers. The syntax for simple strings is:```html+handlebars{{t 'English text' }}@@ -282,7 +282,7 @@ The syntax for block strings or strings containing variables is:```Just like in JavaScript code, variables are enclosed in *single*-braces (rather than the usual Handlebars double braces). Unlike in+braces (rather than the usual Handlebars double braces). Unlike inJavaScript code, variables are automatically escaped by our Handlebarshelper.@@ -291,11 +291,11 @@ Handlebars expressions like `{{variable}}` or blocks liketranslated block, because they don't work properly with translation.The Handlebars expression would be evaluated before the string isprocessed by FormatJS, so that the string to be translated wouldn't be-constant. We have a linter to enforce that translated blocks don't+constant. We have a linter to enforce that translated blocks don'tcontain handlebars.Restrictions on including HTML tags in translated strings are the same-as in JavaScript. You can insert more complex markup using a local+as in JavaScript. You can insert more complex markup using a localcustom HTML tag like this:```html+handlebarsdiff --git a/docs/translating/russian.md b/docs/translating/russian.mdindex 287d4ffb7f3..de9158b6fb2 100644--- a/docs/translating/russian.md+++ b/docs/translating/russian.md@@ -48,7 +48,7 @@- invite-only - **закрытый**- public - **открытый**- name - **название** for things, **имя** for people-- id - **код**+- id - **код**- notifications - **оповещения**- @-mentions - **@-упоминания**- mute - **заглушить**diff --git a/docs/translating/translating.md b/docs/translating/translating.mdindex e23a98a7990..e408d663452 100644--- a/docs/translating/translating.md+++ b/docs/translating/translating.md@@ -6,7 +6,7 @@ Zulip.Additionally, the Zulip UI is translated into more than a dozen majorlanguages, including Spanish, German, Hindi, French, Chinese, Russian,-and Japanese, and we're always excited to add more. If you speak a+and Japanese, and we're always excited to add more. If you speak alanguage other than English, your help with translating Zulip is begreatly appreciated!@@ -41,7 +41,7 @@ to any languages that you'd like to contribute to (or add new ones).usually takes less than a day. You should then be able to accessZulip's dashboard in Transifex.-1. Translate the strings for your language in Transifex. Zulip has+1. Translate the strings for your language in Transifex. Zulip hasseveral resource files:- `mobile.json` is for the iOS/Android mobile apps.- `desktop.json` is for the parts of the Zulip desktop apps that@@ -54,7 +54,7 @@ to any languages that you'd like to contribute to (or add new ones).current [stable release series](../overview/release-lifecycle.md).Transifex is smart about only asking you to translate a string once- even if it appears in multiple resources. The `4-x--` type variants+ even if it appears in multiple resources. The `4-x--` type variantsallow translators to get a language to 100% translated for thecurrent release.@@ -67,7 +67,7 @@ to any languages that you'd like to contribute to (or add new ones).Some useful tips for your translating journey:- Follow your language's [translation guide](#translation-style-guides).- Keeping it open in a tab while translating is very handy. If one+ Keeping it open in a tab while translating is very handy. If onedoesn't exist one, write one as you go; they're easiest to write asyou go along and will help any future translators a lot.@@ -116,21 +116,21 @@ can usually just deploy the latest translations there.`tools/i18n/sync-translations` command (it will require some [initialsetup](../translating/internationalization.html#transifex-cli-setup)). Thiscommand will download the resource files from Transifex and replace-your local resource files with them, and then compile them. You can+your local resource files with them, and then compile them. You cannow test your translation work in the Zulip UI.There are a few ways to see your translations in the Zulip UI:-- You can insert the language code as a URL prefix. For example, you+- You can insert the language code as a URL prefix. For example, youcan view the login page in German using- `http://localhost:9991/de/login/`. This works for any part of the+ `http://localhost:9991/de/login/`. This works for any part of theZulip UI, including portico (logged-out) pages.- For Zulip's logged-in UI (i.e. the actual web app), you can [pick thelanguage](https://zulip.com/help/change-your-language) in theZulip UI.- If your system has languages configured in your OS/browser, Zulip'sportico (logged-out) pages will automatically use your configured- language. Note that we only tag for translation strings in pages+ language. Note that we only tag for translation strings in pagesthat individual users need to use (e.g. `/login/`, `/register/`,etc.), not marketing pages like `/features/`.- In case you need to understand how the above interact, Zulip figures@@ -175,7 +175,7 @@ Some translated languages don't have these, but we highly encouragetranslators for new languages (or those updating a language) write astyle guide as they work , since it's easy to take notes as youtranslate, and doing so greatly increases the ability of future-translators to update the translations in a consistent way. See [our+translators to update the translations in a consistent way. See [ourdocs on this documentation](../documentation/overview.md) for how tosubmit your changes.@@ -183,7 +183,7 @@ submit your changes.We expect that all the English translatable strings in Zulip areproperly capitalized in a way consistent with how Zulip does-capitalization in general. This means that:+capitalization in general. This means that:- The first letter of a sentence or phrase should be capitalized.- Correct: "Manage streams"diff --git a/docs/tutorials/new-feature-tutorial.md b/docs/tutorials/new-feature-tutorial.mdindex 755af93e788..9b4c26237e7 100644--- a/docs/tutorials/new-feature-tutorial.md+++ b/docs/tutorials/new-feature-tutorial.md@@ -22,7 +22,7 @@ will also be helpful to review when creating a new feature. Manyaspects of the structure will be familiar to Django developers. Visit[Django's documentation](https://docs.djangoproject.com/en/2.2/#index-first-steps)for more information about how Django projects are typically-organized. And finally, the+organized. And finally, the[message sending](../subsystems/sending-messages.md) documentation onthe additional complexity involved in sending messages.@@ -199,8 +199,8 @@ dictionary.```**The majority of realm settings can be included in-`property_types`.** However, there are some properties that need custom-logic and thus cannot use this framework. For example:+`property_types`.** However, there are some properties that need custom+logic and thus cannot use this framework. For example:- The realm `authentication_methods` attribute is a bitfield and needsadditional code for validation and updating.@@ -255,7 +255,7 @@ Like typical apps, we will need our backend to update the database andsend some response to the client that made the request.Beyond that, we need to orchestrate notifications about the setting change-to *other* clients (or other users, if you will). Clients+to *other* clients (or other users, if you will). Clientsfind out about settings through two closely related code paths. When a clientfirst contacts the server, the server sends the client itsinitial state. Subsequently, clients subscribe to "events," which can@@ -481,7 +481,7 @@ write automated backend tests for your new feature.To test the new setting syncs correctly with the `property_types`framework, one usually just needs to add a line in each of`test_events.py` and `test_realm.py` with a list of values to switch-between in the test. In the case of a boolean field, no action is+between in the test. In the case of a boolean field, no action isrequired, because those tests will correctly assume that the onlyvalues to test are `True` and `False`.@@ -541,7 +541,7 @@ In frontend, we have split the `property_types` into three objects:- `org_settings`: This contains properties for the "organizationsettings" page. Settings belonging to this section generallydecide what features should be available to a user like deleting a- message, message edit history etc. Our `mandatory_topics` feature+ message, message edit history etc. Our `mandatory_topics` featurebelongs in this section.- `org_permissions`: This contains properties for the "organization@@ -560,7 +560,7 @@ before implementing it.*Note that some settings, like `realm_msg_edit_limit_setting`,require special treatment, because they don't match the common-pattern. We can't extract the property name and compare the value of+pattern. We can't extract the property name and compare the value ofsuch input elements with those in `page_params`, so we have tomanually handle such situations in a couple key functions:@@ -570,7 +570,7 @@ manually handle such situations in a couple key functions:compare and set the values of corresponding DOM element.- `settings_org.update_dependent_subsettings`: This handles settings- whose value and state depend on other elements. For example,+ whose value and state depend on other elements. For example,`realm_waiting_period_threshold` is only shown for with the rightstate of `realm_waiting_period_setting`.@@ -586,7 +586,7 @@ backend, so no UI updates are required.).However, if you had written a function to update the UI after a givensetting has changed, your function should be referenced in the-`realm_settings` of `server_events_dispatch.js`. See for example+`realm_settings` of `server_events_dispatch.js`. See for example`settings_emoji.update_custom_emoji_ui`.``` diff@@ -619,7 +619,7 @@ Here are few important cases you should consider when testing your changes:properly.- If your setting is dependent on another setting, carefully check- that both are properly synchronized. For example, the input element+ that both are properly synchronized. For example, the input elementfor `realm_waiting_period_threshold` is shown only when we haveselected the custom time limit option in the`realm_waiting_period_setting` dropdown.diff --git a/docs/tutorials/reading-list.md b/docs/tutorials/reading-list.mdindex 56fdf3a1d8b..6ebf581d0a0 100644--- a/docs/tutorials/reading-list.md+++ b/docs/tutorials/reading-list.md@@ -76,7 +76,7 @@ Some titles have been shortened for organizational purposes.*Tutorial* - [clean-code-javascript Software engineering principles](https://github.com/ryanmcdermott/clean-code-javascript)-*Course* - [React native and redux course](https://www.udemy.com/course/the-complete-react-native-and-redux-course/) (*Not free!*)+*Course* - [React native and redux course](https://www.udemy.com/course/the-complete-react-native-and-redux-course/) (*Not free!*)*Slides* - [TypeScript vs. CoffeeScript vs. ES6](https://www.slideshare.net/NeilGreen1/type-script-vs-coffeescript-vs-es6)diff --git a/docs/tutorials/shell-tips.md b/docs/tutorials/shell-tips.mdindex 6b3b44b4a09..3d5b5a6930b 100644--- a/docs/tutorials/shell-tips.md+++ b/docs/tutorials/shell-tips.md@@ -300,11 +300,11 @@ $ /usr/bin/env python3 ./my_program.pyThe purpose of `/usr/bin/env` in our shebangs is as a way to locatethe `python3` program in your current environment, the same one the-shell would use if you ran `python3 my_program.py`. You may see+shell would use if you ran `python3 my_program.py`. You may seePython scripts outside of Zulip with a shebang like`#!/usr/bin/python3`; but because of the way Python virtualenvs work,this has the effect of running the script outside of any currently-activated virtualenv. We use `/usr/bin/env` to keep our scripts+activated virtualenv. We use `/usr/bin/env` to keep our scriptsrunning inside the virtualenv where we've installed all ourdependencies.diff --git a/docs/tutorials/writing-views.md b/docs/tutorials/writing-views.mdindex e60a4a35fff..a461cc85c07 100644--- a/docs/tutorials/writing-views.md+++ b/docs/tutorials/writing-views.md@@ -84,7 +84,7 @@ valid session cookie) before providing the view for this route, orredirects the browser to a login page. This is used in the root path(`/`) of the website for the web client. If a request comes from abrowser without a valid session cookie, they are redirected to a login-page. It is a small fork of Django's+page. It is a small fork of Django's[login_required][login-required-link], adding a few extra checksspecific to Zulip.@@ -104,7 +104,7 @@ Templates for the main website are found in## Writing API REST endpointsThese are code-parseable views that take x-www-form-urlencoded or JSON-request bodies, and return JSON-string responses. Almost all Zulip+request bodies, and return JSON-string responses. Almost all Zulipview code is in the implementations of API REST endpoints.The REST API does authentication of the user through `rest_dispatch`,@@ -124,9 +124,9 @@ string given via HTTP basic auth for API clients.### Request variablesMost API views will have some arguments that are passed as part of the-request to control the behavior of the view. In any well-engineered+request to control the behavior of the view. In any well-engineeredview, you need to write code to parse and validate that the arguments-exist and have the correct form. For many applications, this leads to+exist and have the correct form. For many applications, this leads toone of several bad outcomes:- The code isn't written, so arguments aren't validated, leading to@@ -139,7 +139,7 @@ one of several bad outcomes:In Zulip, we solve this problem with a the special decorator called`has_request_variables` which allows a developer to declare thearguments a view function takes and validate their types all within-the `def` line of the function. We like this framework because we+the `def` line of the function. We like this framework because wehave found it makes the validation code compact, readable, andconveniently located in the same place as the method it is validatingarguments for.@@ -158,11 +158,11 @@ def create_user_backend(request, user_profile, email=REQ(), password=REQ(),```You will notice the special `REQ()` in the keyword arguments to-`create_user_backend`. `has_request_variables` parses the declared+`create_user_backend`. `has_request_variables` parses the declaredkeyword arguments of the decorated function, and for each that has aninstance of `REQ` as the default value, it extracts the HTTP parameterwith that name from the request, parses it as JSON, and passes it to-the function. It will return an nicely JSON formatted HTTP 400 error+the function. It will return an nicely JSON formatted HTTP 400 errorin the event that an argument is missing, doesn't parse as JSON, orotherwise is invalid.@@ -194,7 +194,7 @@ REQ also helps us with request variable validation. For example:not automatically marshall the input from JSON).- Since there is no need to JSON-encode strings, usually simply- `my_string=REQ()` is correct. One can pass e.g.+ `my_string=REQ()` is correct. One can pass e.g.`str_validator=check_string_in(...)` where one wants to run avalidator on the value of a string.@@ -205,7 +205,7 @@ for more validators and their documentation.### Deciding which HTTP verb to useWhen writing a new API view, you should writing a view to do just one-type of thing. Usually that's either a read or write operation.+type of thing. Usually that's either a read or write operation.If you're reading data, GET is the best option. Other read-only verbsare HEAD, which should be used for testing if a resource is available to@@ -243,18 +243,18 @@ change the server more than once or cause unwanted side effects.### Making changes to the databaseIf the view does any modification to the database, that change is done-in a helper function in `zerver/lib/actions.py`. Those functions are+in a helper function in `zerver/lib/actions.py`. Those functions areresponsible for doing a complete update to the state of the server,which often entails both updating the database and sending any events-to notify clients about the state change. When possible, we prefer to+to notify clients about the state change. When possible, we prefer todesign a clean boundary between the view function and the actionsfunction is such that all user input validation happens in the viewcode (i.e. all 400 type errors are thrown there), and the actions codeis responsible for atomically executing the change (this is usuallysignalled by having the actions function have a name starting with-`do_`. So in most cases, errors in an actions function will be the+`do_`. So in most cases, errors in an actions function will be theresult of an operational problem (e.g. lost connection to the-database) and lead to a 500 error. If an actions function is+database) and lead to a 500 error. If an actions function isresponsible for validation as well, it should have a name startingwith `check_`.diff --git a/static/shared/README.md b/static/shared/README.mdindex 8afc26408a0..4e4b01c5dd5 100644--- a/static/shared/README.md+++ b/static/shared/README.md@@ -10,7 +10,7 @@ Note that the deployment cycles are different:- In the mobile app, this code is deployed in the same way as therest of the mobile app: it's bundled up into the app binary which- is uploaded to app stores and users install on their devices. The+ is uploaded to app stores and users install on their devices. Theclient will be running the version built into their version of themobile app, which may be newer, older, or simply different from theversion on the server.diff --git a/tools/droplets/README.md b/tools/droplets/README.mdindex 78319078d95..c31d91be2ca 100644--- a/tools/droplets/README.md+++ b/tools/droplets/README.md@@ -161,7 +161,7 @@ Rough steps:key of `base.zulipdev.org` during this step.1. Create a user called `zulipdev` and add it to the `sudo` group.1. Make sudo of `zulipdev` user passwordless by including- `zulipdev ALL=(ALL) NOPASSWD:ALL` in `/etc/sudoers.d/90-cloud-init-users`+ `zulipdev ALL=(ALL) NOPASSWD:ALL` in `/etc/sudoers.d/90-cloud-init-users`1. Copy the `authorized_keys` file of `root` user to the `.ssh` directory of `zulipdev` user1. Switch to `zulipdev` user and set the permissions for the `.ssh` folder to `700` and`.ssh/authorized_keys` to `600`.