Commit Graph

2652 Commits

Author SHA1 Message Date
Lauryn Menard
e4b425c083 docs: Update links for renamed securing-your-zulip-server doc. 2025-10-13 10:06:31 -07:00
Lauryn Menard
b4c63b73dc prod-template: Fix link for LDAP email sync unique ID. 2025-09-30 12:50:11 -07:00
Alya Abbott
f20035e2ad docs: Reorganize authentication backends documentation. 2025-09-30 12:50:11 -07:00
Shubham Padia
c3fbe00eb0 help: Add default page to display on /help when help server is off.
We've copied the button and error colors from portico_signin.css. We did
not want the new HTML file to depend on portico_signin.css since they
are unrelated. In addition, having those colors diverge over time might
not be an issue.

We make the raw mode work with /help and /help/ both.

See https://chat.zulip.org/#narrow/channel/19-documentation/topic/edits.20not.20appearing.20with.20vagrant/near/2257442

Co-authored-by: Alya Abbott <alya@zulip.com>
2025-09-26 11:41:10 -07:00
Sahil Batra
764f4aa2e0 groups: Use realm_for_sharding for limiting NamedUserGroup queries.
For get and filter queries of NamedUserGroup, realm_for_sharding
field is used instead of realm field, as directly using
realm_for_sharding field on NamedUserGroup makes the query faster
than using realm present on the base UserGroup table.
2025-09-23 12:15:53 -07:00
Anders Kaseorg
40a022dcc3 zephyr: Remove Zephyr mirroring support.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-09-16 11:18:18 -07:00
bedo
72d1fa7661 default_settings: Add explanatory comment to "sends_email_by_ip".
Add "5 emails per day" comment
to indicate what (86400, 5) inside "sends_email_by_ip" means.
2025-09-12 13:06:29 -07:00
bedo
bc1ed82620 rate_limiter: Block IPv6 by /64 instead of per-single-IP.
Fixes #21544.

The network prefix (e.g. 64) identifies the network portion
which determines which bucket should that IPv6 belong to.

Implemented as a generic approach, so we have the option
to use different prefix sizes (leading to different buckets)
in the future.

Add comprehensive assertions for which IPv6s
are expected to belong to the same bucket and which are not.
2025-09-12 13:06:29 -07:00
Alex Vandiver
70b709494c sentry: Use TornadoIntegration when running under Tornado.
The DjangoIntegration is explicitly disabled, because it attempts to
hook into the request handling in a way which is not compatible with
Tornado, and leaks event handlers.
2025-09-10 10:21:16 -07:00
Alex Vandiver
169daa31a0 settings: Derive RUNNING_INSIDE_TORNADO based on sys.argv.
This allows it to be used at application startup time.
2025-09-10 10:21:16 -07:00
Prakhar Pratyush
271aba001c api_docs: Fix 500 error on /api/register-remote-push-device.
`settings.ZULIP_SERVICES_URL` is used to construct curl
example for `/api/register-remote-push-device`.

On zulip cloud `settings.ZULIP_SERVICES_URL=None`, it resulted
in 500 error on visiting that page.

This commit fixes the bug by using "https://push.zulipchat.com"
as the default value if `settings.ZULIP_SERVICES_URL=None`.

The doc already mentions that the endpoint is meant to be used
by self-hosted servers, so the default value makes sense if
ZULIP_SERVICES_URL=None.
2025-09-05 11:01:05 -07:00
Shubham Padia
d333ddb961 help: Remove current help center.
This commit removes the current help center markdown files and any logic
that was used to host those files at help/.

We also remove a bunch of tests, we should the equivalent of those tests
for the new help center. Issues to track: #35649, #35647. These issues
track adding back tests for redirects and broken links.

We had a symlink from templates/zerver/integrations/email.md pointing to
help/using-zulip-via-email.md. We can no longer have that symlink since
the latter has been converted to an MDX file. We have deleted the
symlink and put a markdown file in it's place. Both the files have
comments to edit the other in case of changes.

This commit also makes changes in astro config, astro component paths
and other places to move the starlight help center docs base path from
/starlight_help to /help.

The change to rename /starlight_help/ to /help/ in MDX files is done in
the next commit. If we squash these commits, this line should be
removed.

`./tools/build-help-center` no longer does the conversion step.

We also remove some dead code related to the old help center in
documentation.py.
2025-09-03 09:28:15 -07:00
Mateusz Mandera
7d40fcfd7e saml: Don't allow listing zulip_groups in extra_attrs in IdP config.
zulip_groups is a special attribute, for the group sync feature, and
will always be read from the SAMLResponse if it's present and group sync
is enabled.
Listing it in extra_attrs is a misconfiguration that results in
confusing behavior. See #35787.
2025-08-27 13:21:00 -07:00
Alex Vandiver
4fc49db781 cache: Adjust to pickle_protocol=5, since we require Python 3.8+.
https://docs.python.org/3/library/pickle.html#data-stream-format
2025-08-27 09:22:56 -07:00
Alex Vandiver
c68be03df7 markdown: Remove vestigial Twitter code and cache.
Contrary to what the comment implied, the remaining `fetch_tweet_data`
function would never return a cache hit, as it is namespaced by the
current deploy's cache key.
2025-08-27 09:22:56 -07:00
Prakhar Pratyush
3cbf0e70a2 push_notification: Add support to send E2EE test push notification.
This commit adds an endpoint `/mobile_push/e2ee/test_notification`
to send an end-to-end encrypted test push notification to the user's
selected mobile device or all of their mobile devices.
2025-08-13 00:13:50 -07:00
apoorvapendse
6203861529 zerver: API to create channel.
Fixes #16206.

Co-authored-by: Sahil Batra <sahil@zulip.com>
Co-authored-by: Steve Howell <showell@zulip.com>
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-08 19:29:17 -07:00
Saubhagya Patel
bb5c87e306 bots: Add a setting to customize the Welcome Bot message.
This commit includes the following changes:
- Add an administrator setting to customize the Welcome Bot
message when sending an invitation.
- Add an API endpoint to test the customized Welcome Bot message
by sending a copy of the message to the administrator.

Fixes #27663.

Co-authored-by: Akarsh Jain <akarsh.jain.790@gmail.com>
2025-08-08 18:59:37 -07:00
Mateusz Mandera
254b0ff477 scim: Add support for Groups. 2025-08-08 17:29:11 -07:00
Kislay Verma
f0a88d51cc message_reminders: Add support for notes.
This commit adds the ability for users to include notes
with their message reminders.

Fixes #35070.

Co-Authored-By: Aman Agrawal <amanagr@zulip.com>
2025-08-07 17:13:12 -07:00
Shubham Padia
22b231ab6f channel-folders: Add PATCH method to reorder channel folders.
The test cases are copied from ReorderCustomProfileFieldTest since we
are imitating the reordering mechanism from custom profile fields to
channel folders.
2025-08-06 16:34:40 -07:00
Mateusz Mandera
40b1f6eb4e confirmation: Replace RealmCreationKey - use Confirmation instead.
Fixes #20028.

There's no reason to have a special `RealmCreationKey` class - the
`Confirmation` system already does this job.

This is somewhat complicated by the need to write a migration for
`RealmCreationKey`->`Confirmation` for pre-existing, valid objects, to
avoid breaking realm creation links that haven't been used yet.
2025-08-04 18:41:15 -07:00
Prakhar Pratyush
d972bb1ca9 push_notifications: Redact content for older clients if E2EE required.
This commit replaces the `PUSH_NOTIFICATION_REDACT_CONTENT` server
setting with `require_e2ee_push_notifications` realm setting.

If `require_e2ee_push_notifications` set to True:
* Older clients: Content redacted
* Updated clients: Encrypted content

If `require_e2ee_push_notifications` set to False:
* Older clients: Content NOT redacted
* Updated clients: Encrypted content

Note: Older clients refers to clients that don't support E2EE.

Fixes part of #35370.
2025-07-28 17:06:59 -07:00
Alex Vandiver
fd390b9eb1 settings: Enable Altcha in development if on localhost.
We only do this on localhost, because users of remote development
servers will run afoul of "Secure context is required"[^1].

[^1]: https://altcha.org/docs/troubleshooting/#secure-context
2025-07-25 22:29:51 -07:00
Alex Vandiver
74675fae94 settings: Use get_secret for altcha_hmac.
When building tarballs, we do not have development secrets.
2025-07-25 22:29:51 -07:00
Mateusz Mandera
4bd6fd6307 ldap: Use savepoint=True to avoid breaking ldap sync transaction.
Due to the atomic(savepoint=False) here, an LDAP sync exception while
syncing a single user breaks the whole sync_ldap_user_data transaction,
preventing it from successfully syncing other users.

Fixes a regression introduced in
1eecbad381

Closes #35291.
2025-07-21 13:10:04 -07:00
ducnb
715d07c231 api: Add administrator endpoint for updating user status.
Fixes #33139.
2025-07-18 17:37:26 -07:00
Tim Abbott
3bd82927dc ldap: Improve unique_account_id defaults and docs.
Some installations will change `dn` when a user marries, and also for
Active Directory and various other LDAP providers I've checked,
there's often a better value to use.
2025-07-18 14:34:09 -07:00
Mateusz Mandera
4210ccc5db realm_reactivation: Use redirect-to-POST trick.
Uses the approach done for email change confirmations in #34980 to avoid
triggering a reactivation via just a GET request. Instead, the GET
should return a page which will trigger the browser to then POST the key
to the endpoint.
2025-07-16 13:53:20 -07:00
Tim Abbott
458c660f65 home: Enable partial_subscribers in web app.
Fixed #34244.
2025-07-16 13:11:56 -07:00
Prakhar Pratyush
5f8edf669d zerver: Add endpoint to register a push device to server.
This commit adds an endpoint to register a push device
to receive E2EE push notifications.
2025-07-14 14:52:39 -07:00
Mateusz Mandera
99b97ea883 saml: Don't put group_memberships_sync_map in the session.
In 40956ae4c5 we implemented group sync
via SAML during sign in and sign up. The sign up implementation used a
session variable group_memberships_sync_map to plumb through the sync
information to the registration codepath, to execute group sync after
user creation.

We can use a more robust approach instead, and just amend groups on the
`PreregistrationUser` object that's going to be used for registration.
2025-07-11 10:18:58 -07:00
Mateusz Mandera
a61d849e37 ldap: Implement external auth id auth+sync.
Fixes #24104.
2025-07-09 15:31:17 -07:00
Mateusz Mandera
d273059475 backend: Rename username var to email in ldap get_or_build_user.
Since we have an email value in that variable, we should call it
appropriately.
2025-07-09 15:31:17 -07:00
Mateusz Mandera
40956ae4c5 saml: Implement group sync.
Adds support for syncing group memberships for a user when logging in
via SAML. The list of group memberships is passed by the IdP in the
zulip_groups SAML attribute in the SAMLResponse.
2025-07-08 17:02:08 -07:00
Mateusz Mandera
ee1801feba compat: Remove SOCIAL_AUTH_SYNC_CUSTOM_ATTRS_DICT. 2025-07-08 17:02:08 -07:00
Mateusz Mandera
fe993032a6 validate_email_not_already_in_realm: Add kwarg for mirror dummies.
In user signup context, we are okay with there being an existing mirror
dummy user with the matching email - at the end of the signup, that
mirror dummy account will be activated and control of it given to the
user doing this signup.

However, in email change contexts (SCIM API and regular email change
flow), we can't change an account's email address to the address that
already belongs to an existing mirror dummy user.

To avoid subtle bugs like this, we make callers have to explicitly
specify whether existance of mirror dummies with the matching email
address is okay or not.
2025-07-07 17:15:08 -07:00
Mateusz Mandera
2bfefe2ebd confirm_email_change: Use redirect-to-POST trick.
Just like with signup confirmation links, we shouldn't trigger email
change based on a GET to the confirmation URL - POST should be required.

So upon GET of the confirmation link, we serve a form which will
immediately be POSTed by JS code to finalize the email change.
2025-07-07 17:15:08 -07:00
Prakhar Pratyush
8b3cef554b settings: Add push_registration_encryption_keys map.
The `push_registration_encryption_keys` map stores the
assymetric key pair generated on bouncer.

The public key will be used by the client to encrypt
registration data and the bouncer will use the corresponding
private key to decrypt.

- Updated the `generate_secrets.py` script to generate the map
during installation in dev environment.
- Added a management command to add / remove key i.e. use it
for key rotation while retaining the older key-pair for a period
of time.
2025-07-06 21:11:26 -07:00
Sayam Samal
f8d82775d1 showroom: Set up devtools/inputs page for showcasing input components.
This is a prep commit to setup the devtools/inputs page for the
redesigned input components.
2025-07-03 11:45:35 -07:00
Aman Agrawal
25731859b6 zerver: Add endpoints and events for reminders.
There are similar to what exists for scheduled messages expect
the PATCH requests which will be added later when the
functionality is implemented.
2025-07-02 12:47:00 -07:00
Evy Kassirer
0c5e1ac492 subscription_data: Flesh out partial suscription data sent to client.
Part of #34244.
2025-06-30 17:10:36 -07:00
Mateusz Mandera
dadec69986 settings: Add SCIM_CONFIG to default_settings.
This should have been declared in default_settings.py to begin with.
2025-06-30 13:00:03 -07:00
Kislay Verma
5f80f0a970 channel: Add option to notify users newly added to a channel.
When a user is added to a channel, we send
the user that was added a Notification Bot
DMs to let them know about it.

In this commit, we add an option for whether or not
this message is sent.

If more than 100 users are added at once, we
do not send notification bot DMs since it would
be a performance-costly operation.

We also send this threshold value of 100 in the
initial state data to the clients.

Fixes part of #31189
2025-06-26 10:08:11 -07:00
Tim Abbott
8179a31dc7 docs: Delete legacy presence subsystem page.
Everything on this page is now better explained in the API
documentation for presence.
2025-06-19 15:20:15 -07:00
Anders Kaseorg
717cf60edf python: Use Django 5.2 reverse(…, query=…).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-12 09:32:38 -07:00
Tim Abbott
0ec07fe4c8 queue: Allow sharding user_activity worker.
This follows the existing patterns for the sharded mobile
notifications worker.
2025-06-06 10:33:20 -07:00
Alex Vandiver
5828bfe8ce i18n: Trim {% trans %} sections by default.
This pulls in changes from the latest django-jinja[^1]
`makemessages.py` monkey-patching.  Specifically, it adds support for
`trimmed`, `notrimmed`, and the `ext.i18n.trimmed` policy.  We enable
that, which removes unsightly and unnecessary whitespace inside of
`{% trans %}` blocks.

[^1]: aac828ca63/django_jinja/management/commands/makemessages.py
2025-05-29 11:58:57 -07:00
Aditya Kumar Kasaudhan
c5f126c6ff navigation_views: Add backend for navigation views in left sidebar.
Fixes part of #32077.
2025-05-23 16:25:08 -07:00
Sahil Batra
5de0f265bd channel_folders: Add support to update channel folders.
Fixes part of #31972.
2025-05-20 13:25:06 -07:00