Commit Graph

4103 Commits

Author SHA1 Message Date
Aditya Kumar Kasaudhan
fe99ed9993 navigation_view: Add reminders to built-in view fragments.
This omission had no effect on current users, but will be important once view 
customization is implemented.

It was missed in zulip#32528.
2025-10-19 17:39:13 -07:00
Lauryn Menard
6fb19fdd2d templates: Add rel-canonical link to some documentation pages.
Updates templates/zerver/meta_tags.html to add a rel-canonical
link if REL_CANONICAL_LINK is in the template context dict.

We add REL_CANONICAL_LINK to the documentation context for the
API and integrations documentation pages in all cases. The link
will be self-referencing for the main zulip.com site.

For policies documentation pages, we add REL_CANONICAL_LINK to
the context only when settings.CORPORATE_ENABLED is true, so
that self-hosted servers' policies documentation do not have a
rel-canonical link set.

Part of #35110.
2025-10-01 11:50:59 -04:00
Anders Kaseorg
f24a0a6b81 ruff: Fix RUF059 Unpacked variable is never used.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-09-30 16:47:54 -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
Aman Agrawal
40f4ad2cb0 register: Add AI/LLM as option for how user found Zulip. 2025-09-24 10:24:23 -07:00
Aman Agrawal
c6bf35b392 registration: Use a loop to set extra content value. 2025-09-24 10:24:23 -07:00
Sahil Batra
d4d7a8fe2a streams: Make sure that unused anonymous groups are not created.
Anonymous groups were being created for stream permission
settings when calling the subscriptions endpoint without
any streams data or when calling it only for subscribing
users to streams and not for creating any new streams.

This commit makes sure that no such unused anonymous groups
are created.
2025-09-23 12:15:51 -07:00
Sahil Batra
1e21f7b224 register: Rename stream_creator_or_nobody to channel_creator.
This commit renames `stream_creator_or_nobody` value for
`default_group_name` field in `server_supported_permission_settings`
object to `channel_creator`.
2025-09-23 12:12:23 -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
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
012115a2bc documentation: Make sure article is secure to use.
The `article` variable being passed to `get_path` can also be a relative
path, which has it's security implications. By using `secure_filename`,
we mitigate that risk. We don't need to check if `/` exists in article
anymore since `secure_filename` will do so on it's own.
2025-09-03 09:28:15 -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
Prakhar Pratyush
f52533795b api_docs: Document /remotes/push/e2ee/register endpoint.
This commit documents the `/remotes/push/e2ee/register` endpoint.

We use auth_email="ZULIP_ORG_ID" and auth_api_key="ZULIP_ORG_KEY"
instead of "BOT_EMAIL_ADDRESS" and "BOT_API_KEY".
2025-08-28 11:46:09 -07:00
Kislay Verma
18d9b686b7 add_subscriptions: Only exclude DMs and not new channel notifications.
When the number of new subscriptions crosses a threshold, we wish to
avoid sending DMs to the user as implemented in #31206. But there was
a bug causing announcement channel and new channel notification
messages to also not be sent.

This commit fixes that bug by ensuring that we only exclude direct
message notications.
2025-08-27 17:06:31 -07:00
Lauryn Menard
699c0c6200 create-channel: Remove send_new_subscription_messages parameter.
Removes send_new_subscription_messages parameter from
`POST channel/create` endpoint as Notification Bot DMs
are never sent when users are subscribed as part of
creating a new channel.

Not considered a documentable API change, since the previous parameter
never had any effect, so this is effectively just a documentation and
error-handling bug fix, not an API change relevant to implementors.
2025-08-27 11:12:05 -07:00
Lauryn Menard
dda2c6e285 create-channel: Clarify flow of new channel and subscription notices.
Updates comments in send_user_subscribed_and_new_channel_notifications
so that it is clearer what notification each "if" block of the function
is generating.

Also, moves variables that are only used in the user subscribed DMs to
that "if" block.
2025-08-27 11:12:05 -07:00
Lauryn Menard
8b1e536e6b create-channel: Rename send_messages_for_new_subscribers helper.
Because send_messages_for_new_subscribers also sends channel
notification messages about newly created channels, a clearer
name for is send_user_subscribed_and_new_channel_notifications.
2025-08-27 11:12:05 -07:00
Mateusz Mandera
5ef6852cfe delete_in_topic: Don't unnecessarily fetch .recipient.
This reverts commit f119c33789.
With 51cef01c29 merged, there is no need
to fetch .recipient here, as it won't be accessed by the delete messages
codepath.
2025-08-27 09:08:00 -07:00
Mateusz Mandera
51cef01c29 message: Use .is_channel_message column instead of is_stream_message().
This avoids a potential unnecessary message.recipient fetch required by
is_stream_message(). is_stream_message() methods precedes the addition
of the denormalized is_channel_message column and is now unnecessary.

In practice, we usually fetch Message objects with `.recipient` already,
so I don't expect any notable performance impact here - but it's still a
useful change to make.
2025-08-19 23:37:07 -07:00
Tim Abbott
3e84eaab5d onboarding: Improve welcome bot custom message wrapper.
The previous text was rather wordy, and using a silent mention makes
it clear who has the ability to control this group, and who one can
potentially contact with questions.
2025-08-13 14:09:20 -07:00
Alex Vandiver
04fe9be715 upload: Serve 0-byte files locally, not from S3. 2025-08-13 14:07:21 -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
Sahil Batra
bcdfcf909d welcome-bot: Only send message with custom text when testing.
We now only send the custom message when using
"Send me a test message" button and not send the
standard welcome bot message.
2025-08-12 00:12:52 -07:00
apoorvapendse
8f14b717ff zerver: Drop support for Zulip API emails in channel creation.
Also write the description a bit better.

Discussion:
https://chat.zulip.org/#narrow/channel/378-api-design/topic/Channel.20creation.20should.20return.20the.20channel.20ID/near/2240040.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-11 23:40:12 -07:00
Mateusz Mandera
f119c33789 delete_in_topic: Don't fetch .recipient for each message in a loop.
The grouping logic in `do_delete_messages` calls
`message.is_stream_message()` in a loop, which needs to access
message.recipient. This is obviously super inefficient if .recipient
hasn't been prefetched for the message objects.

`delete_in_topic` is the only function that calls `do_delete_messages`
with many messages, so this is the only spot we need to fix, to address
the immediate bug.
Of course a better improvement would be to fix `do_delete_messages` to
do something smarter than naively accessing message.recipient in a loop.
2025-08-11 10:08:40 -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
apoorvapendse
4d49fa6fbb streams: Extract zephyr realm invite check.
This will be reused later in the
`/channels/create` view.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-08 18:41:47 -07:00
apoorvapendse
1190afbe4f streams: Extract pydantic validation for topics_policy.
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-08 18:41:47 -07:00
Shubham Padia
5f9860776f test_docs: Remove help specific tests and port rest over to /api.
We do not test relative links here since relative links were only
used in the old help pages. We should probably remove the logic
for relative links after we have done the official cutover to the
starlight help center: #35654.
2025-08-08 11:59:29 -07:00
Shubham Padia
9ec15e99bd test_urls: Use /api instead of /help pages for some tests.
We are going to move the help center to starlight soon and the tests
won't be able to access that help center until we solve things in a
followup issue. We move some of the urls being tested from /help to /api
to not loose coverage on those tests.
2025-08-08 11:59:29 -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
Vector73
0ac24bd437 api: Add support for passing partial to include_subscribers parameter.
Fixes #35318.
2025-08-04 18:43:14 -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
Mateusz Mandera
072f234269 confirmation: Rename REALM_CREATION to NEW_REALM_USER_REGISTRATION.
Clears up some naming confusion - `REALM_CREATION_LINK_VALIDITY_DAYS` is
a setting which describes the validaty period of RealmCreationKey, not
of Confirmation with REALM_CREATION type. Now that the latter is called
NEW_REALM_USER_REGISTRATION, there should be no confusion about this.
2025-08-04 18:41:00 -07:00
Lauryn Menard
7a9b78f1f5 settings: Add user setting to ignore channel folders in left sidebar.
Fixes #35573.
2025-08-01 09:18:19 -07:00
Alex Vandiver
085d137871 upload: Rename attachment_vips_source, as it's not just for vips_source. 2025-07-29 10:01:40 -07:00
Alex Vandiver
e37ee13577 upload: Add charset even on content-types guessed at download time. 2025-07-29 10:01:40 -07:00
Alex Vandiver
0c6b3373be upload: Ensure that we always have a content-type.
Old uploads are stored without a content-type, and guess_type may not
provide a type for them.
2025-07-29 10:01:40 -07:00
Sahil Batra
8ae9cca3c9 channel_folders: Check max length restrictions while updating.
This commit updates code to make sure we check maximum allowed
length for name and description for channel folders when updating
them.
2025-07-28 23:12:58 -07:00
Prakhar Pratyush
fc6cd9a966 settings: Add require_e2ee_push_notifications realm setting.
This commit adds a realm setting:
"Require end-to-end encryption for push notification content".

This commit just involves backend & UI changes to add the setting,
the impact of this setting is in the next commit.

Fixes part of #35370.
2025-07-28 17:06:59 -07:00
Aman Agrawal
f4dd3aa066 auth: Pass None as default_subdomain to verify the host.
We were not verifying correctly if the host is in the same
subdomain as we never returned None for get_subdomain_from_hostname.
2025-07-28 10:59:38 -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
Alex Vandiver
8af90294d8 altcha: More error-proofing around settings validation. 2025-07-25 22:29:51 -07:00
Alex Vandiver
25fbb05fea upload: Attempt to guess character set text/* which are served inline.
This is only `text/plain`, currently.  In such cases where the
client-provided content-type also does not specify a `charset`, we use
`chardet` to make a guess, and store that guess to provide later when
serving the content.  The detection is done in a streaming fashion,
and thus should not require re-downloading the full content.
2025-07-24 22:40:12 -07:00
Alex Vandiver
edb5943d8b upload: Use content_type instead of mimetype for consistency. 2025-07-24 22:40:12 -07:00
Prakhar Pratyush
1c7dd83dbe register_push_device: Add an error code to push-not-configured error.
This commit adds an error code to make it easier for clients
to identify when push device registration is rejected due to
server not being configured to use push notification service.

Fixes part of 35368.
2025-07-23 11:11:46 -07:00
Alex Vandiver
5319a2f33e narrow: Skip topic mutes for DM narrows. 2025-07-22 20:57:36 -07:00
Sahil Batra
eb57fe10a2 streams: Handle empty topic only streams being used for announcements.
This commit updates code to send messages to "general chat" topic
if streams used for announcements for "New user signups",
"New created streams", "Moderation requests" and "Zulip updates"
have topics policy set to allow only "general chat" messages.
2025-07-22 16:59:47 -07:00