Commit Graph

52000 Commits

Author SHA1 Message Date
Tim Abbott
a802f0f339 version: Update version after 7.4 release. 2023-09-15 18:02:00 -07:00
Tim Abbott
d5b8d4b17d Release Zulip Server 7.4. 7.4 2023-09-15 17:27:53 -07:00
Tim Abbott
4de73f823c i18n: Update translation data from Transifex. 2023-09-15 17:20:41 -07:00
Anders Kaseorg
39a908d350 ci: Restore commented clean_unused_caches.py invocation.
The comment logic doesn’t make sense.  Every build gets to write to
the caches; some builds do in fact add new items, and without
clean_unused_caches.py there’s no way for them to remove items.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 124c5d02e5)
2023-09-15 13:12:36 -07:00
Anders Kaseorg
94af282460 requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 9a53baea93)
2023-09-15 12:22:42 -07:00
Anders Kaseorg
547ac31ee6 requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 1905df2342)
2023-09-15 12:21:28 -07:00
Anders Kaseorg
7c50e1a40e ruff: Fix PIE808 Unnecessary start argument in range.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 81bd63cb46)
2023-09-15 12:21:28 -07:00
Alex Vandiver
e2dcea1664 requirements: Use greenlet>=3.0.0a1 to fix uwsgi segfault.
Pull in the fix for python-greenlet/greenlet#330.

(cherry picked from commit 2e760f18ac)
2023-09-15 12:12:34 -07:00
Tim Abbott
839c86ead5 css: Fix backporting error of back-to-login button.
In 7.x, this was invalid syntax with our postcss-preset-env configuration.

See the following for context:

https://chat.zulip.org/#narrow/stream/49-development-help/topic/webpack.20exception.20running.207.2Ex/near/1641309
https://chat.zulip.org/#narrow/stream/2-general/topic/CSS.20nesting.20syntax/near/1528649
2023-09-15 12:04:38 -07:00
Alex Vandiver
48995f8218 ci: Temporarily upgrade postgresql-client-common before upgrading.
This works around a failure in the current postgresql-client-common
and postgresql-client-15 packages; it exists primarily to improve
the signal on our CI builds, as the failure is a real failure caused
by the package upgrade process.
2023-09-15 10:22:55 -07:00
Daniil Fadeev
276830b275 left_sidebar: Fix the layout for filter names that are long. 2023-09-15 10:22:55 -07:00
Alex Vandiver
f43736bef5 nginx: Do not forward X-amz-cf-id header to S3.
All `X-amz-*` headers must be included in the signed request to S3;
since Django did not take those headers into account (it constructed a
request from scratch, while nginx's request inherits them from the
end-user's request), the proxied request fails to be signed correctly.

Strip off the `X-amz-cf-id` header added by CloudFront.  While we
would ideally strip off all `X-amz-*` headers, this requires a
third-party module[^1].

[^1]: https://github.com/openresty/headers-more-nginx-module#more_clear_input_headers
2023-09-15 10:22:55 -07:00
Karl Stolley
49d7830886 compose: Render Mac-specific Cmd, Return at compose bottom. 2023-09-15 10:22:55 -07:00
Alex Vandiver
761dae7571 nginx: Suppress proxy warnings when the proxy itself sent the request.
This is common in cases where the reverse proxy itself is making
health-check requests to the Zulip server; these requests have no
X-Forwarded-* headers, so would normally hit the error case of
"request through the proxy, but no X-Forwarded-Proto header".

Add an additional special-case for when the request's originating IP
address is resolved to be the reverse proxy itself; in these cases,
HTTP requests with no X-Forwarded-Proto are acceptable.
2023-09-15 10:22:55 -07:00
Mateusz Mandera
d9c94944e0 docs: Add a warning about restarting individual services.
restart-server is almost always the way to go, so we can be clearer
about it.
2023-09-15 10:22:55 -07:00
Anders Kaseorg
3780ee2fc6 middleware: Fix exception logging format on JSON views.
Previously (with ERROR_REPORTING = True), we’d stuff the entire
traceback of the initial exception into the subject line of an error
email, and then also send a separate email for the JSON 500 response.
Instead, log one error with the standard Django format.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-09-15 10:22:55 -07:00
Alex Vandiver
ff520a3d52 requirements: Downgrade orjson to 3.9.2.
orjson 3.9.3 introduced a crash (ijl/orjson#415) -- revert to the last
version before the bug.

(cherry picked from commit 2612a3b657)
2023-08-31 19:06:29 +00:00
Alex Vandiver
170f8dabd4 version: Update version after 7.3 release. 2023-08-25 18:19:21 +00:00
Alex Vandiver
b85046eb08 Release Zulip Server 7.3. 7.3 2023-08-25 17:57:18 +00:00
Mateusz Mandera
ee9a450f4e bulk_access_messages_expect_usermessage: Fix function name and comments.
The name and docstring were just wrong, having a UserMessage row isn't
sufficient for having message access and is actually only relevant in a
private stream with private history. The function is only used in a
single place anyway, in bulk_access_messages.

The comment mentioning this function in handle_remove_push_notification
can be tweaked to just not mention any function specifically and just
say why we're not checking message access.
2023-08-25 17:57:09 +00:00
Mateusz Mandera
26f0695b94 delete_in_topic: Add comment explaining the access logic. 2023-08-25 17:57:09 +00:00
Mateusz Mandera
a30cd12433 CVE-2023-32678: Prevent unauthorized editing/deletion in priv streams.
Users who used to be subscribed to a private stream and have been
removed from it since retain the ability to edit messages/topics, and
delete messages that they used to have access to, if other relevant
organization permissions allow these actions. For example, a user may be
able to edit or delete their old messages they posted in such a private
stream. An administrator will be able to delete old messages (that they
had access to) from the private stream.

We fix this by fixing the logic in has_message_access (which lies at the
core of our message access checks - access_message() and
bulk_access_messages())
to not rely on only a UserMessage row for checking access but also
verify stream type and subscription status.
2023-08-25 17:56:57 +00:00
Anders Kaseorg
ea0b8cc011 requirements: Fix transitively replaced two_factor migrations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 4300ec3293)
2023-08-24 21:22:12 +00:00
Anders Kaseorg
6b016eb5bf check-database-compatibility: Ignore twofactor typo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit ead7b9177a)
2023-08-24 21:21:38 +00:00
Satyam Bansal
35b0b2fb6a integrations: Add support for "Test plugin" in Sentry integration.
Previously, if a user tried to create a webhook using the Webhooks
plugin in Sentry and used the "Test plugin" to test the webhook,
the server would send a 500 error, even though the integration
worked perfectly. This led users to believe that the integration
was not working.

Fixes #26173.

(cherry picked from commit eb8714c9dc)
2023-08-23 03:06:07 +00:00
Satyam Bansal
05c2269571 integrations: Add Raven SDK test to Sentry Integration.
(cherry picked from commit 6898667fa4)
2023-08-23 03:06:07 +00:00
Satyam Bansal
d3048b8791 integrations: Rename fixture in Sentry integration.
This is done to clarify from where this fixture is coming from; as there
are two documented ways to test the integration.

(cherry picked from commit fdc14ee3f0)
2023-08-23 03:06:07 +00:00
Zixuan James Li
ec8a284ad5 webhooks: Use 200 status code for unknown events.
Because the third party might not be expecting a 400 from our
webhooks, we now instead use 200 status code for unknown events,
while sending back the error to Sentry. Because it is no longer an error
response, the response type should now be "success".

Fixes #24721.

(cherry picked from commit 84723654c8)
2023-08-23 03:06:07 +00:00
Alex Vandiver
61b5577cf4 sentry: Reduce http timeout.
This helps reduce the impact on busy uwsgi processes in case there are
slow timeout failures of Sentry servers.  The p99 is less than 300ms,
and p99.9 per day peaks at around 1s, so this will not affect more
than .1% of requests in normal operation.

This is not a complete solution (see #26229); it is merely stop-gap
mitigation.

(cherry picked from commit a076d49be7)
2023-08-23 03:06:07 +00:00
Lauryn Menard
21c5ea1444 sentry-webhook: Revise documentation page to be clearer.
(cherry picked from commit 3d8090a116)
2023-08-23 02:48:43 +00:00
Satyam Bansal
421ce4ffe0 integrations: Add support for sample events in Sentry Integration.
Fixes #25778.

(cherry picked from commit 16563a3217)
2023-08-23 02:29:07 +00:00
Satyam Bansal
792748ae63 integrations: Add exception fixture for Vue in Sentry Integration.
(cherry picked from commit 580d8c4dfe)
2023-08-23 02:29:07 +00:00
Satyam Bansal
1252fbe434 integrations: Check for Raven SDK only on python in Sentry Integration.
Fixes part of #25778.

(cherry picked from commit 3bdb806fba)
2023-08-23 02:29:07 +00:00
Satyam Bansal
d026f35c5b integrations: Add support for Rails backend in Sentry Integration.
(cherry picked from commit 142e455d81)
2023-08-23 02:29:07 +00:00
Satyam Bansal
c7839ff084 integrations: Update documentation for Sentry Integration.
(cherry picked from commit 9e793c37e6)
2023-08-23 02:29:07 +00:00
Greg Price
5b4f5a89fb docs: Consistently say "18 months" on compatibility, no specific version numbers.
Previously I've wanted to have this page spell out the concrete
version number that our clients support, rather than the policy we
use for determining that version number, because that's the sort of
question that I feel like as a user I'd want a straight answer to
and would be annoyed if I couldn't get one.

But as the text stands, it's come to look more like it's the policy
(something that's heavyweight to change) than like the value that
the policy currently happens to work out to.  Also, because this page
is kind of chaotically organized (and fixing that is a bigger yak
than I want to shave right now), it repeats the 18-month rule in
three separate places and the current value (version 4.0) is in
a fourth separate place, so it looks internally inconsistent.

Let's therefore take a different tack: like in those other three
spots on this page, state just the policy instead of the value it
currently works out to; but also add a link to help the reader
pin down for themselves what value that does work out to.

This also means we no longer need to update this page as old releases
age and that value advances.

Also fix a typo, and cut the reference to working degraded on
older releases.  Starting earlier this year we finally started
hard-refusing such connections:
  https://github.com/zulip/zulip-mobile/issues/5102
  https://github.com/zulip/zulip-mobile/pull/5633
(which was because there were some swathes of compatibility code
that we could only cut if we completely broke the handling of
ancient servers, and so we preferred to have the app communicate
that break clearly up front.)

(cherry picked from commit bb6fe0385e)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
f54f07f6cb requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 113ac6eb98)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
f1595cf7db requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit e32366638a)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
e953ff71e4 tools: Use subprocess.check_call where appropriate.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 041dcdfbad)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
47e2b07316 ruff: Fix PLW1510 subprocess.run without explicit check argument.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit c43629a222)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
4ac849d006 ruff: Appease SIM118 "class" not in uncle.keys().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 36dde99308)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
43b09fd89d ruff: Fix PYI032 Prefer object for the second parameter to __eq__.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit ec00c2970f)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
8a1704f765 ruff: Fix E721 Do not compare types, use isinstance().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 53e8c0c497)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
96be7b72c2 ruff: Collapse short multi-line import statements.
isort did this by default, though it’s unclear whether that was
intended; see https://github.com/astral-sh/ruff/issues/4153.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 733083c65d)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
99b37de89f ruff: Fix UP032 Use f-string instead of format call.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit e932e2ce52)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
323223db4c ruff: Fix SIM118 Use k not in d instead of k not in d.keys().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 74d6d76046)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
91e5ef39eb ruff: Fix PLR1714 Consider merging multiple comparisons.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 2ae285af7c)
2023-08-23 02:29:05 +00:00
Anders Kaseorg
b9aa772885 ruff: Fix RUF015 Prefer next(...) over single element slice.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 3b09197fdf)
2023-08-23 02:28:06 +00:00
Anders Kaseorg
a0ce536fa4 tests: Remove compatibility code for Python < 3.5.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 4e645c8ff9)
2023-08-23 02:28:06 +00:00
Anders Kaseorg
3325f2ef06 ruff: Fix UP032 Use f-string instead of format call.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit bca5564c1e)
2023-08-23 02:28:06 +00:00