Commit Graph

64101 Commits

Author SHA1 Message Date
Kunal Sharma
c6e40e70b7 saved_snippets: Remove "new-style" class from add/edit modals. 2025-03-31 09:21:43 -07:00
Anders Kaseorg
5d686f2562 dev-vagrant-docker: Upgrade docker-systemctl-replacement to 1.5.9063.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-30 14:11:39 -07:00
Mateusz Mandera
e31dfebc07 test-api: Make desdemona consenting to private data export.
Fixes CI - it was failing due to the API test for organization exports,
which was returning an error due to there being no Organization Owners
with consent to private data export.
2025-03-28 23:05:19 -07:00
Tim Abbott
3a6bacca2b docs: Update changelog for 10.1 release. 2025-03-28 17:49:23 -07:00
Mateusz Mandera
716ead8f4e export: Also add guardrail to the management command. 2025-03-28 17:44:58 -07:00
Mateusz Mandera
8ab400b95d export: Add guardrails against generating a dysfunctional export via UI.
As explained in the comments, if in an export with consent there are no
consenting owners or in a public export there are no owners with email
visibility set to at least ADMINS, the exported data will, upon import,
create an organization without usable owner accounts.
2025-03-28 17:44:58 -07:00
Mateusz Mandera
9864eee029 export: Add detailed tests for export of public vs private data.
Adds detailed tests for the work in the prior commits fixing the
treatment of private data in various tables in exports with consent and
public exports.
2025-03-28 17:44:58 -07:00
Mateusz Mandera
d098b9c349 export: Don't export DirectMessageGroup info of non-consented users.
This is private information, as by inspecting the DirectMessageGroup
objects and their associated Subscription objects, you could determine
which users conversed with each other in a DM group.

This did *not* leak any actual message - only the fact that at least one
of the users in the group sent a group DM.
2025-03-28 17:44:28 -07:00
Mateusz Mandera
0fd79e379e export: Fix public exports.
The prior significantly restricted what data gets exported from
non-consented users. The last thing we're missing is to fix the logic
to work correctly for public exports.

Prior commits focused on addressing exports with consent. This commit
adapts it to work with public exports.:
- Do not turn user accounts into mirror dummies in the public export - or
  after export->import you'll end up with a realm with no functional
  accounts; as every user is non-consented and the original logic added in
  the prior commits will turn them into mirror dummies.
- Some of the custom fetch/process functions were changed without
  considering public exports - now they work correctly, by setting
  consenting_user_ids to an empty set.
2025-03-28 17:44:28 -07:00
Mateusz Mandera
6695e8f9eb export: Scrub Subscriptions to defaults for non-consented users.
The Subscription Config is constructed in a bit of a strange way, that's
not compatible with defining a custom_fetch function.
Instead we have to extend the system to support passing a custom
function for processing just the final list of rows right before it's
returned for writing to export files.
2025-03-28 17:44:28 -07:00
Mateusz Mandera
03887bf871 export: Don't turn non-consented deactivated users into mirror dummies.
As explained in the comment, if we turn a non-consented deactivated user
into a mirror dummy, this will violate the rule that a deactivated user
cannot restore their account by themselves after an export->import
cycle.
2025-03-28 17:44:28 -07:00
Mateusz Mandera
85a98009cd export: Treat is_mirror_dummy=True users as consenting.
As explained in the comment added to the function, in terms of privacy
concerns, it is fine to export all data for these accounts. And it is
important to do - so that exporting an organization which was originally
imported e.g. from Slack doesn't result in excessively limited data for
accounts that were mirror dummies and never "activated" themselves.
2025-03-28 17:44:28 -07:00
Mateusz Mandera
a956c31645 export: Treat deactivated user with consent enabled as consenting.
Prior to this, deactivated user were presumed to be non-consenting to
private data export, regardless of their setting.
2025-03-28 17:44:28 -07:00
Mateusz Mandera
0b5d0a348e export: Fix get_consented_user_ids to also account for bots.
Now that we severely limited the way that non-consenting users get
exported, we need to start to consider bots as consenting when
appropriate - otherwise the exported bot accounts will be unusable after
importing.
2025-03-28 17:44:28 -07:00
Mateusz Mandera
82f17b14d3 export: Scrub RealmAuditLog rows where modified_user is non-consenting. 2025-03-28 17:44:28 -07:00
Mateusz Mandera
479b1dea84 export: Don't export real email of users unless accessible to admins.
An administrator shouldn't be able to bypass a user's setting to hide
their email address from everyone, including admins.
Therefore, we should overwrite the delivery_email for such users during
export - unless the user consented to have their private data exported.

The notable consequence of this is that such user accounts will become
completely inaccessible after importing this data to a new server, due
to not having a functional email address on record.

These accounts will only be possible to reclaim via a manual
intervention to change the email address on the `UserProfile` by server
administrators.
2025-03-28 17:44:28 -07:00
Mateusz Mandera
9a49b6a62c export: Plumb consented_user_ids to export_usermessage_batch in a file.
This allows us to get rid of the call to `get_consented_user_ids` in
`fetch_usermessages`. Now it's only called at the beginning of the
export, eliminating the redundant db query and also resolving the
potential for data consistency issues, if some users change their
consent setting after the export starts.

Now the full export process operates with a single snapshot of these
consenting user ids.

These ids need to be plumbed through via a file rather than normal arg
passing, because this is a separate management command, run in
subprocesses during the export.
2025-03-28 17:44:28 -07:00
Mateusz Mandera
b56b9d570d export: Reset settings to default for users not in exportable_user_ids.
These users didn't consent to having their private data exported.
Therefore, correct handling of these users should involve scrubbing
their settings to just match the realm defaults.
2025-03-28 17:44:27 -07:00
Mateusz Mandera
69da235ed1 export: Use exportable_user_ids arg to plumb through consenting users.
Instead of making repeated calls to get_consented_user_ids, we can just
fetch it (mostly) once and put it in
`context["exportable_user_ids"]`. This is essentially what the
(unused until now) exportable_user_ids logic was added for after all.

The added, intended, effect of this is that non-consenting users will
now get exported as mirror dummy accounts, due to the handling of
non-exportable users in `custom_fetch_user_profile`.

The remaining additional call to `get_consented_user_ids` is in
`fetch_usermessages`. This one is tricky as this function gets called
in subprocesses via
`zerver/management/commands/export_usermessage_batch.py` management
command invoked by the export process.
It requires passing the `exportable_user_ids` in some other way. This
can be dealt with in upcoming commits.
2025-03-28 17:44:27 -07:00
Mateusz Mandera
f2024ad625 export: Only export Client objects needed by the data being exported.
We shouldn't export the entire Client table - it includes Clients for
all the realms on the server, completely unrelated to the realm we're
exporting. Since these contain parts of the UserAgents used by the
users, we should treat these as private data and only export the Clients
that the specific data we're exporting "knows" about.
2025-03-28 17:44:27 -07:00
Mateusz Mandera
7e599cf959 export: Don't export miscellaneous private data of non-consenting users. 2025-03-28 17:44:27 -07:00
Anders Kaseorg
87e4b99706 custom_profile_fields: Restrict access to users in the same realm.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-28 17:41:32 -07:00
Anders Kaseorg
85abd9d58b realm_export: Restrict deletion to users in the same realm.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-28 17:40:22 -07:00
Aman Agrawal
83d917853e apps: Provide arm64 app build by default for macOS.
This reduces confusion amount users when they download the
intel version and it works super slow. Downloading the arm64
version on an intel mac would just not work.

Users who use intel macs have a habit now (atleast me) to look
for `Intel` version of software when downloading an app. So, made
`Intel` bold to help that process.
2025-03-28 16:45:07 -07:00
Kartikay5849
1e4eec9803 ui: Update unread banner text and button label.
Changes banner text to "This conversation also has older unread
messages. Jump to first unread message?"
Updates button label from "Jump to first unread" to "Jump".
2025-03-28 16:43:39 -07:00
whilstsomebody
846d771084 left_sidebar: Use opaque hover color to avoid topic bleedthrough. 2025-03-28 16:43:09 -07:00
Karl Stolley
67da4d5a2b left_sidebar: Display bot icon, status emoji as inline block. 2025-03-28 14:12:56 -07:00
Karl Stolley
131e031f1c left_sidebar: Present two-line DM rows. 2025-03-28 14:12:56 -07:00
Niloth P
cabea0ea9a invite: Update email pill widget's usage.
- Rename the variable "pills" to "email_pill_widget". To conform better
with other pill widgets.
- Re-use the email pill creation function.
- Directly access `item.email`, skipping function call.
2025-03-28 09:58:39 -07:00
Niloth P
2b7961f30f app_variables: Rename background color of pill containers.
Pill containers that do not use placeholders.
2025-03-28 09:58:39 -07:00
Niloth P
dafef91c8c integration-url-modal: Use input pills for branch names. 2025-03-28 09:58:39 -07:00
Alex Vandiver
88b74c46bc docs: Clarify which IAM role is being referenced. 2025-03-28 09:41:43 -07:00
Alex Vandiver
9c043c6c14 tusd: Attempt to derive S3 region.
We already do this in computed_settings.py, but only if the
S3 (secret) key is set.  Those aren't required to be set, and tusd
_requires_ a region, so we try again to suss it out here.
2025-03-28 09:41:43 -07:00
Alex Vandiver
794588629d tusd: Support running without explicit AWS keys.
Fixes: #34102.
2025-03-28 09:41:43 -07:00
Prakhar Pratyush
7e20100ebd test_message_topics: Optimize test by limiting fetch_event_types.
Earlier, in 'EmptyTopicNameTest.test_initial_state_data',
we were not passing a short 'fetch_event_types' to 'do_events_register'
resulting in unnecessary work to fetch extra initial data which
isn't important for the test.

This commits updates the test to pass a 'fetch_event_types'
parameter with the event types required for the test.
2025-03-28 09:24:47 -07:00
Prakhar Pratyush
a5c9ae1576 jquery: Simplify $topic_not_mandatory_placeholder toggling.
This commit replaces repetitive 'addClass/removeClass' pair usage
with a 'toggleClass' call to manage the visibility of
$topic_not_mandatory_placeholder used in compose recipient topic
input box, inline topic edit input box, and move message new topic
input box.

Helps to reduce code duplication.
2025-03-28 09:23:26 -07:00
Alex Vandiver
5bda1ac521 kandra: Include the new grok monitoring exporter for all frontend hosts. 2025-03-28 10:50:03 -04:00
Alex Vandiver
840fa74854 kandra: Add a grok exporter to parse nginx logfiles.
This provides access logging metrics to Prometheus.  For cardinality
reasons, we cannot (nor would we want to) put every request path into
its own label value -- but we do separate out the most-frequent access
paths (as well as some low-frequency but high-interest ones) into
their own label values.

In order to differentiate accesses to https://zulip.com/ from
https://example.zulipchat.com/ (both of which appear at path `/`), we
use a `grok_exporter.realm_names_regex` value in `zulip.conf`, which
is expected to be set to match the hostname of all possible realms.
2025-03-27 21:56:54 -07:00
Alex Vandiver
ba9569a6fe sha256-tarball-to: Support zipfiles. 2025-03-27 21:56:54 -07:00
Alex Vandiver
bd54f0363e kandra: Update prometheus configuration.
This pulls in the more complete production Prometheus configuration.
2025-03-27 21:56:54 -07:00
Evy Kassirer
70e542c9cc buddy_list: Make sure we always open Others section during search. 2025-03-27 16:03:11 -07:00
Lauryn Menard
d7873fbc11 compose-actions: Set topic earlier if specified in start opts.
When on_compose_select_recipient_update is called when we start
the compose box actions, then it subsequently calls
compose_recipient.update_on_recipient_change.

If there is a specified topic in the opts for the compose box,
then that should be set for various functions that are called
in update_on_recipient_change.

compose_recipient.update_topic_displayed_text is called later for
all cases, direct messages and empty topics, which will update the
compose_state.topic again.
2025-03-27 12:52:07 -07:00
Lauryn Menard
24a65c1783 narrow-state: Filter out "with" operator in narrowed_by_topic_reply.
As the web app is now using the "with" operator for links to channel
topic conversations, we need to filter out that operator when
checking the current narrow state.
2025-03-27 12:52:07 -07:00
Lauryn Menard
ae66bf287b typing-events: Use valid channel ID to get conversation typists. 2025-03-27 12:52:07 -07:00
Lauryn Menard
ec89e5afd2 billing: Improve error handling when invoicing plans as needed.
When we're unable to process an invoice for a customer due to a billing
or assertion error, we log the error and add the customer ID to a set
of failed customer IDs. This allows us to continuing invoicing other
customers, and at the same time not invoice any other pending plans
attached to a customer we failed to invoice.
2025-03-27 12:51:52 -07:00
Lauryn Menard
10fff6a691 billing: Extract helper for invoicing check of remote server audit log.
Extracts the logic for making sure that, for self-hosted plans, the
remote server audit log data is current before invoicing an active
plan.
2025-03-27 12:51:52 -07:00
Lauryn Menard
0f567a1a66 billing: Extract helper for sending invoice overdue email.
Extracts the logic for sending an email to billing support when
a remote server's audit log data is stale and there is an active
CustomerPlan that needs to be invoiced.
2025-03-27 12:51:52 -07:00
Lauryn Menard
10a02142dc billing: Extract helper for sending fixed price plan renewal email.
Extracts the logic for sending a reminder email about the end of a
fixed price plan to billing support into a separate function.
2025-03-27 12:51:52 -07:00
Evy Kassirer
8adb46867b stream_settings: Move muted channels help text to below header. 2025-03-27 11:55:04 -07:00
Prakhar Pratyush
d011fb0621 typing: Rename "(no topic)" to empty string topic.
This commit renames "(no topic)" to "" when used as
topic name in `POST /typing`.

Message sent in "(no topic)" is translated as being
sent in "" by the server, so it makes sense to show
the typing notification in "" when message is being composed.
2025-03-27 09:29:49 -07:00