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.
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.
This commit renames `stream_creator_or_nobody` value for
`default_group_name` field in `server_supported_permission_settings`
object to `channel_creator`.
`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.
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.
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.
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".
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.
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.
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.
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.
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.
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.
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.
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.
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.
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>
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.
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.
The test cases are copied from ReorderCustomProfileFieldTest since we
are imitating the reordering mechanism from custom profile fields to
channel folders.
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.
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.
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.
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.
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.
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.