Commit Graph

47031 Commits

Author SHA1 Message Date
Anders Kaseorg
7ba639960d actions: Move part into zerver.lib.bulk_create.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit f6a06ba6e3)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
76641a5f21 actions: Move part into zerver.lib.message.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit c041b68578)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
b54240d6cf actions: Move part into zerver.lib.subscription_info.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 9dd7e34ab3)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
508c676f61 actions: Split out zerver.actions.presence.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit b7adfb02f6)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
b60ba10351 actions: Move part into zerver.lib.users.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit ab04068294)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
b8567d8d8f actions: Split out zerver.actions.uploads.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit e230ea2598)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
025219da16 actions: Move part into zerver.lib.streams.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit a29f1b39da)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
5bcb52390c actions: Split out zerver.actions.user_activity.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 6168c0110a)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
90cbf900d4 actions: Split out zerver.actions.user_topics.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit df4849bb15)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
ddf76baf89 actions: Split out zerver.actions.realm_emoji.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 385616f27f)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
be7169bed0 actions: Split out zerver.actions.realm_export.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 8fc5922ebd)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
bdc67055b1 actions: Split out zerver.actions.realm_icon.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 3d7aa98c45)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
f5b96c8551 actions: Split out zerver.actions.realm_logo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 7f088f3403)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
2e48056a9c actions: Split out zerver.actions.invites.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit ca8d374e21)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
e0f9f58411 actions: Split out zerver.actions.alert_words.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 241463e215)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
f29b1d3192 actions: Split out zerver.actions.default_streams.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 1ac7496855)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
b1e8ead908 actions: Split out zerver.actions.hotspots.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 12130da339)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
5cb7acec36 actions: Split out zerver.actions.realm_linkifiers.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 975f5a3c2d)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
0cb261ac6b actions: Split out zerver.actions.realm_playgrounds.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit e887abcf41)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
b58a5b3bf3 actions: Split out zerver.actions.submessage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 3a135b04d9)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
76dc8bc9f7 actions: Split out zerver.actions.typing.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 62d3b5bfd5)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
bf5f006971 actions: Split out zerver.actions.user_groups.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 372c10f5f3)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
500bd04e11 actions: Split out zerver.actions.video_calls.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 90cae59ea6)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
d35bdd312f actions: Split out zerver.lib.recipient_users.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit c136eebb33)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
51d9bbca1e actions: Split out zerver.lib.user_counts.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 703186c339)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
f3c9a5019b actions: Split out zerver.lib.user_message.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 05195c02c1)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
36fa5e0385 actions: Move part into zerver.models.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 7f00aa078e)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
faea77d03f actions: Split out zerver.lib.sounds.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 6a70f75587)
2022-04-15 10:08:19 -07:00
Anders Kaseorg
ea9ba8b24c actions: Add zerver/actions directory.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit dd8b1aaba6)
2022-04-15 10:08:19 -07:00
Greg Price
051f1c3120 docs: Update apps' compatibility threshold to 3.0, from 2.1.0.
Zulip Server 3.0 is now about 21 months old, which is more than
18 months.  Per the general policy in the "Client apps" section
below, that means it's time to drop support for older versions.

We released 4.0 in 2021-05, so around 2022-11 we can update this
further to say 4.0.
2022-04-14 11:54:44 -07:00
Alex Vandiver
fb03c3205e timeout: Add test coverage.
(cherry picked from commit e6e4b7b3ef)
2022-04-13 20:47:34 -07:00
Alex Vandiver
662396d2c5 timeout: Minor comment cleanups.
We remove the StackOverflow link because it is now so dated as to be
irrelevant -- it does not use `self.ident`, and cargo-cults the return
value of PyThreadState_SetAsyncExc.

(cherry picked from commit 04159a674c)
2022-04-13 20:47:34 -07:00
Alex Vandiver
4a5204a967 timeout: Warn if the thread did not exit.
As noted in the docstring for this function, the timeout is
best-effort only -- if the thread is blocked in a syscall, it will not
service the exception until it returns.  It can also choose to catch
and ignore the TimeoutExpired; in either case it will still be running
even after the `timeout()` function returns.

Raising a vare TimeoutExpired it still somewhat accurate, but obscures
that the backend thread may still be running along merrily.  Notice
such cases, and log a warning about them.

(cherry picked from commit 3af2c8d9a3)
2022-04-13 20:47:34 -07:00
Alex Vandiver
44a3cd8dd3 timeout: Re-raise from where the TimeoutExpired hit the thread.
Having just thrown an exception into the thread, it is often useful to
know _what_ was the slow code that we interrupted.  Raising a bare
TimeoutExpired here obscures that information, as any `exc_info` will
end there.

Examine the thread for any exception information, and use that to
re-raise.  This exception information is not guaranteed to exist -- if
the thread didn't respond to the exception in time, or caught it, for
instance.

(cherry picked from commit e714264756)
2022-04-13 20:47:34 -07:00
Alex Vandiver
efddda2609 timeout: Remove cargo-culted and impossible-to-reach code block.
The quote in question originates in python/cpython@b8b6d0c2c6, when
the code was added.  However, the code stopped having that comment,
and was no longer able to return anything but 1 or 0, starting in
python/cpython@4643c2fda1 -- Python 2.5.

Remove the block.

(cherry picked from commit 85eeaf5f18)
2022-04-13 20:47:34 -07:00
Alex Vandiver
ecfcc20351 send_email: Only warn if EMAIL_HOST_PASSWORD is unset, not "".
Some email hosts actually do want an empty password; since the default
is `None`, we should key on that, and not just being false-y.

(cherry picked from commit ee04f42897)
2022-04-13 20:46:38 -07:00
Alex Vandiver
fa68acd669 settings: Use default database_user value when looking up.
Failure to pull the default "zulip" value here can lead to
accidentally applying a `postgres_password` value which is unnecessary
and may never work.

For consistency, always skip password auth attempts for the "zulip"
user on localhost, even if the password is set.  This mirrors the
behavior of `process_fts_updates`.

(cherry picked from commit 828c9d1c18)
2022-04-13 20:44:56 -07:00
Mateusz Mandera
9c88f6c4ce scim: Temporarily stop running SCIM change operations atomically.
do_deactivate_user can't be run in an atomic block due to concerns
around revoking session in a transaction. See
62ba8e455d for more details.

Without the change in this commit, the process of deactivating a user
via SCIM is broken.
2022-04-13 16:02:04 -07:00
Mateusz Mandera
8aa6958923 docs: Fix incorrect path to SAML certs in SAML Keycloak instructions.
This was supposed to be /etc/zulip/saml/idps/
2022-04-13 16:01:25 -07:00
Alex Vandiver
88e2f64869 docs: Fix typo.
We don't suggest self-hosing, unless via a sprinkler in warm weather.
2022-04-13 11:38:35 -07:00
Alex Vandiver
c7df68eb48 check-database-compatibility: Sort and prettify output.
(cherry picked from commit 09860dc284)
2022-04-06 14:16:55 -07:00
Alex Vandiver
599094bcf5 docs: Fold FTS index updating into the upgrade step.
On the Debian 10 -> 11 upgrade, the server is running Zulip 4.x, which
lets us pass `--audit-fts-indexes` to `upgrade-zulip-stage-2` rather
than run the command as a separate step.

(cherry picked from commit 488aaef9b7)
2022-04-06 14:16:55 -07:00
Alex Vandiver
4a4be8620c docs: Upgrade Zulip before trying to fix collations.
The reindex-textual-data tool needs the venv to be cable to run;
switch the order of the last two steps, making them now match the
Debian 9 -> 10 and 10 -> upgrades.

Ref #21296.

(cherry picked from commit 1e3a6984a4)
2022-04-06 14:16:54 -07:00
Aman Agrawal
3dc29fbc76 message_edit: Fix false sub/unsub bookend on using a near link.
We were not setting the `historical` flag correctly for
messages fetched via `json_fetch_raw_message` when used didn't
have any UserMessage.

Extended relevant tests to fetch check message flags too.
2022-04-04 12:34:43 -07:00
Alex Vandiver
c49dfc5679 version: Update version after 5.1 release. 2022-04-01 23:13:55 -07:00
Alex Vandiver
08c2d9a766 Release Zulip Server 5.1. 5.1 2022-04-02 05:45:55 +00:00
Alex Vandiver
d9e7feae0a migrations: Remove the possibly-duplicated emoji re-uploading.
In 85e531e377, we duplicated this block
of migration code to fix a bug, but moving it (aka deleting the
original copy) is a cleaner solution.

(cherry picked from commit 35e27aef4a)
2022-04-01 22:31:54 -07:00
Alex Vandiver
58e29a9ca0 supervisor: 'foo:*' also matches 'foo'.
7c4293a7d3 switched to checking if the
service was already running, and use `supervisorctl start` if it was
not.

Unfortunately, `list_supervisor_processes("zulip-tornado:*")` did not
include `zulip-tornado`, and as such a non-sharded process was always
considered to _not_ be running, and was thus started, not restarted.
Starting an already-started service is a no-op, and thus non-sharded
tornado processes were never restarted.

The observed behaviour is that requests to the tornado process attempt
to load the user from the cache, with a different prefix from Django,
and immediately invalidate the session and eject the user back to the
login page.

Fix the `list_supervisor_processes` logic to match without the
trailing `:*`.

(cherry picked from commit 65e19c4fbd)
2022-04-01 17:25:29 -07:00
Alex Vandiver
266dbad737 check-database-compatibility: Ignore squashed and renamed migrations.
Fixes: #21596.
(cherry picked from commit eb31681934)
2022-04-01 17:03:38 -07:00
Tim Abbott
4db1aa75ce migrations: Repeat part of migration 0376.
The blockquote explains the motivation for this change in detail.

Fixes #21608.

(cherry picked from commit 85e531e377)
2022-04-01 15:21:05 -07:00