Commit Graph

38106 Commits

Author SHA1 Message Date
Alex Vandiver
8e692180e5 certbot: Explicitly apt-get update before installing certbot.
There is no guarantee that the apt data is up-to-date, unless we
explicitly update.

Fixes: zulip/docker-zulip#275
(cherry picked from commit 4b3121db0b)
2021-03-23 15:14:46 -07:00
Tim Abbott
c85e00e02e analytics: Remove buggy HttpResponseNotFound text.
Had this been in normal route, this would have been an XSS bug, as we
were passing what the developer clearly believed to be plain text into
an HTML 404 page.

The affected routes have @require_server_admin, a permission that we
do not expect any self-hosted users to have ever enabled (as it is
undocumented and doing so is only possible manually via a `manage.py
shell`, and we believe to only be useful for running a SaaS service
like zulip.com).  So the security impact is limited to a handful of
staff of zulip.com and this isn't a candidate for a CVE.

Thanks to GitHub's CodeQL for finding this.
2021-03-18 12:22:02 -07:00
Anders Kaseorg
c72fe95383 requirements: Upgrade Python requirements.
Sync versions from commit 049d140557 on
master, excluding Django, hyperlink, markdown, moto, mypy,
python-debian, responses, and social-auth-core.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-11 17:18:29 -08:00
Anders Kaseorg
3b0dbdf2b4 Remove HipChat link from installation guide.
We removed the page it points to in master (#16953), so this is a
broken link.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-11 17:17:42 -08:00
Alex Vandiver
7ae4629a4a puppet: Only match incoming gateway address on our mail domain.
79931051bd allows outgoing emails from
localhost, but outgoing recipients are still subjected to virtualmaps.
This caused all outgoing email from Zulip with destination addresses
containing `.`, `+`, or starting with `mm`, to be redirected back
through the email gateway.

Bracket the virualmap addresses used for local delivery to the mail
gateway with a restriction on the domain matching the
`postfix.mailname` configuration, regex-escaped, so those only apply
to email destined for that domain.

The hostname is _not_ moved from `mydestination` to
`virtual_alias_domains`, as that would preclude delivery to
actually-local addresses, like `postmaster@`.
2021-02-11 15:47:08 -08:00
Alex Vandiver
34fbfe88ed version: Update version after 3.3 release. 2021-02-11 15:44:07 -08:00
Clara Dantas
a58f541b63 models.py: Add get_role_name function in UserProfile class.
This function returns the name of the user role that we can use
to display in error report emails.

(Backported from master; fixes #17067, fixes #17102).
2021-01-27 11:34:12 -08:00
Anders Kaseorg
deec501da4 email_notifications: Fix HTML injection bug.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit c0ad595855)
2021-01-26 16:32:56 -08:00
Aman Agrawal
3b6406c971 node_tests: Fix suddenly failing tests for unknown reasons.
(cherry picked from commit 6f31a2d49f)
2021-01-26 16:32:49 -08:00
Anders Kaseorg
68bf4156b3 desktop_integration: Handle logout et al. events from desktop app.
I added these hooks in Zulip Desktop 5.5.0; handling these events in
the frontend will let us remove the janky desktop-side fallback code
that uses fake click events on menu items with specific indexes.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit bfd9999cf8)
2020-12-08 16:43:50 -08:00
Alex Vandiver
62f8a75569 Fix changelog 2020-12-01 13:14:53 -08:00
Alex Vandiver
145f466dc5 Release Zulip Server 3.3 3.3 2020-11-30 23:07:27 -08:00
sahil839
2f4e6e4f2b management: Replace knight command with change_user_role command.
We replace knight command with change_user_role command which
allows us to change role of a user to owner, admins, member and
guest. We can also give/revoke api_super_user permission using
this command.

Tweaked by tabbott to improve the logging output and update documentation.

Fixes #16586.

(cherry picked from commit a96811ab58)
2020-11-18 23:41:43 -08:00
Anders Kaseorg
d42a17f798 requirements: Upgrade Python requirements.
Sync versions from commit 1275613812 on
master, excluding hyperlink, markdown, moto, mypy, python-debian, and
social-auth-core.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-11-18 17:05:12 -08:00
Anders Kaseorg
e470253b62 lint: Add shfmt as a linter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 6099612a15)
2020-10-28 17:12:50 -07:00
Anders Kaseorg
9a17d70cd7 shfmt: Reformat shell scripts with shfmt.
https://github.com/mvdan/sh

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit dfaea9df65)
2020-10-28 17:12:50 -07:00
Tim Abbott
1cc51972bb docs: Update list of files new since last release.
This fixes CI failing due to our not having released the /video-calls.md rename.
2020-10-28 17:12:50 -07:00
Tim Abbott
923c8bf55f settings: Clean up Zoom configuration comments. 2020-10-18 16:48:08 -07:00
Tim Abbott
7f3d55e6ea docs: Merge Zoom and BBB configuration pages. 2020-10-18 16:47:38 -07:00
strifel
a79e40182f docs: Add more specific Big Blue Button documentation. 2020-10-18 16:45:51 -07:00
Steve Howell
4d8865b15e reactions: Handle missing realm emojis.
For the lines of code that I changed here, we were
getting field reports that the below code
was getting `undefined`:

    emoji.all_realm_emojis.get(r.emoji_code)

It's not really clear to me how this could happen,
but we definitely should fail softly here.  We
still report it as an error, but we let the function
return and don't trigger a TypeError.

If there's a legitimate reason for realms to delete
realm emojis, we should either downgrade this to a
warning or consider a strategy of back-fixing messages
when realm emojis get deleted.
2020-10-12 12:16:36 -07:00
Tim Abbott
321a44a736 upgrade-postgres: Pass the requested postgres explicitly. 2020-10-08 12:29:55 -07:00
Aman Agrawal
04c026fd24 message_send: Fix old guests being treated as full members.
For streams in which only full members are allowed to post,
we block guest users from posting there.

Guests users were blocked from posting to admin only streams
already. So now, guest users can only post to
STREAM_POST_POLICY_EVERYONE streams.

This is not a new feature but a bugfix which should have
happened when implementing full member stream policy / guest users.
2020-10-08 11:30:53 -07:00
Alex Vandiver
d7dbb029a9 puppet: Permit outgoing mail from postfix.
The configuration change made in 1c17583ad5 only allowed delivery to
those specific Zulip addresses.  However, they also prevent the
mailserver from being used as an outgoing email relay from Zulip,
since all mail that passed through the mailserver (from any
originator) was required to have a `RCPT TO` that matched those
regexes.

Allow mail originating from `mynetworks` to have an arbitrary
addresses in `RCPT TO`.

(cherry picked from commit 79931051bd)
2020-09-25 15:21:04 -07:00
Alex Vandiver
93bb85d821 version: Update version after 3.2 release. 2020-09-15 16:34:20 -07:00
Alex Vandiver
0aa67c0c99 Release Zulip Server 3.2 3.2 2020-09-15 15:58:33 -07:00
Aman
8d67598ff2 provision: Fix missing <sasl/sasl.h> headers during provision.
(cherry picked from commit 7b9fe77bf1)
2020-09-15 01:48:26 -07:00
Anders Kaseorg
34a13c8094 requirements: Remove django-cookies-samesite.
Its functionality was added to Django upstream in 2.1.  Also remove
the SESSION_COOKIE_SAMESITE = 'Lax' setting since it’s the default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit e84c7fb09f)
2020-09-15 01:16:49 -07:00
Alex Vandiver
36ce1ce75e filters: Fix tests for deac48810d.
deac48810d cherry-picked the behaviour changes of 4167517a6f, but not
the test changes to go with it.
2020-09-11 19:49:34 -07:00
Alex Vandiver
f36b935f0e puppet: Restrict postfix incoming addresses to postmaster and zulip.
This removes the possibility of local user enumeration via RCPT TO.
2020-09-11 18:50:47 -07:00
Tim Abbott
c2508c0966 docs: Fix spelling of audit_fix_indexes.
Fixes #16140.
2020-08-14 16:57:03 -07:00
Mohit Gupta
deac48810d filters: Fix has:image and avoid future issues for other has filters.
This fixes a bug with the original frontend-side implementation for
has: filters, where it would incorrectly not match content in cases
where the message's nesting structure did not have an outer tag.

Bug was introduced in 02ea52fc18.

Fixes #16118.
2020-08-14 16:53:16 -07:00
Alex Vandiver
c316f267e7 docs: Add explicit steps to verify FTS indexes after upgrading to 3.0.
The OS upgrade paths which go through 2.1 do not call
`upgrade-zulip-stage-2` with `--audit-fts-indexes` because that flag
was added in 3.0.

Add an explicit step to do this audit after the 3.0 upgrade.  Stating
it as another command to run, rather than attempting to tell them
to add it to the `upgrade-zulip` call that we're linking to seems
easiest, since that does not dictate if they should upgrade to a
release or from the tip of git.

We do not include a step describing this for the Trusty -> Xenial
upgrade, because the last step already chains into Xenial -> Bionic,
which itself describes auditing the indexes.

Fixes #15877.
2020-08-12 12:49:23 -07:00
Alex Vandiver
87e02760bf docs: Be explicit about continuing with upgrades.
Strongly suggest Xenial -> Bionic, or upgrading to 3.x, at the end of
the various other upgrading steps.
2020-08-12 12:49:23 -07:00
Alex Vandiver
0b7be2610c docs: Fold "check if it is working" into the last step. 2020-08-12 12:49:23 -07:00
Alex Vandiver
94f57ad8bd docs: Don't suggest --audit-fts-indexes for non-3.0 upgrades.
Only Zulip 3.0 and above support the `--audit-fts-indexes` option to
`upgrade-zulip-stage-2`; saying "same as Bionic to Focal" on other
other steps, which are for Zulip 2.1 or 2.0, will result in errors.

Provide the full text of the updated `upgrade-zulip-stage-2` call in
step 5 for all non-3.0 upgrades.  For Trusty to Xenial and Stretch to
Buster, we do not say "Same as Xenial to Bionic" , because it is
likely that readers do not notice that step does not read "Same as
Bionic to Focal."
2020-08-12 12:49:23 -07:00
Tim Abbott
17e4b34f10 docs: Clarify how manage.py backup --output works. 2020-08-09 17:44:26 -07:00
Tim Abbott
5bf521fa55 compose: Fix buggy message post policy warning.
The previous logic with `new Date` produced invalid values for
differences longer than a year.
2020-08-06 15:44:38 -07:00
sahil839
29dd22e405 stream_edit: Send values of changed settings only to backend.
This commit changes change_stream_privacy function to only
send the values of changed settings to backend.
We also avoid sending PATCH request if none of the settings
in stream privacy modal are changed.

This change also fixes the bug in changing stream permissions
for realms with limited plans.

Fixes #16024.
2020-08-06 13:03:57 -07:00
Anders Kaseorg
efe9cbba29 memcached: Switch from pylibmc to python-binary-memcached.
Backported to 3.x by tabbott.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-06 12:52:38 -07:00
Mateusz Mandera
b0d2094967 auth: Treat emails case-insensitively in ExternalAuthResult.
Our intent throughout the codebase is to treat email
case-insensitively.
The only codepath affected by this bug is remote_user_sso, as that's the
only one that currently passes potentially both a user_profile and
ExternalAuthDataDict when creating the ExternalAuthResult. That's why we
add a test specifically for that codepath.
2020-08-05 11:40:51 -07:00
Casper Kvan Clausen
584d71a221 puppet: Support nginx_listen_port with http_only 2020-08-03 18:44:02 -07:00
Tim Abbott
12ac89ef3f tornado: Fix ID lists leaked to the events API.
Apparently, `update_message` events unexpectedly contained what were
intended to be internal data structures about which users were
mentioned in a given message.

The bug has been present and accumulating new data structures for
years.

Fixing this should improve the performance of handling update_message
events as well as cleaning up this API's interface.

This was discovered by our automated API documentation schema checking
tooling detecting these unexpected elements in these event
definitions; that same logic should prevent future bugs like this from
being introduced in the future.
2020-08-03 18:27:57 -07:00
Mateusz Mandera
3870a1b304 find_account: Fix the email search query.
The search should be case-insensitive.
2020-08-02 12:37:44 -07:00
Tim Abbott
928b8ad031 version: Update version after 3.1 release. 2020-07-30 15:52:52 -07:00
Tim Abbott
31f7006309 Release Zulip Server 3.1. 3.1 2020-07-30 15:44:18 -07:00
arpit551
d8b966e528 migrations: Upgrade migrations to remove duplicates in all Count tables.
This commit upgrades 0015_clear_duplicate_counts migration to remove
duplicate count in StreamCount, UserCount, InstallationCount as well.

Fixes https://github.com/zulip/docker-zulip/issues/266
2020-07-30 15:18:07 -07:00
Mateusz Mandera
444359ebd3 saml: Use self.logger in get_issuing_idp.
get_issuing_idp is no longer a class method, so that akward logger
fetching can be skipped and self.logger can be accessed.
2020-07-26 15:49:44 -07:00
Mateusz Mandera
c78bdd6330 saml: Fix incorrect settings object being passed in get_issuing_idp.
Fixes #15904.

settings is supposed to be a proper OneLogin_Saml2_Settings object,
rather than an empty dictionary. This bug wasn't easy to spot because
the codepath that causes this to demonstrate runs only if the
SAMLResponse contains encrypted assertions.
2020-07-26 15:49:43 -07:00
Gittenburg
f4e02f0e80 upload: Do not open compose box when editing.
Previously editing a message and uploading a file in
the edit textarea opened the message compose box.

Fixes #15890.
2020-07-23 11:29:51 -07:00