Commit Graph

5697 Commits

Author SHA1 Message Date
Alex Vandiver
1f0cfd4662 email-mirror: Add a standalone server that processes incoming email.
Using postfix to handle the incoming email gateway complicates things
a great deal:

- It cannot verify that incoming email addresses exist in Zulip before
  accepting them; it thus accepts mail at the `RCPT TO` stage which it
  cannot handle, and thus must reject after the `DATA`.

- It is built to handle both incoming and outgoing email, which
  results in subtle errors (1c17583ad5, 79931051bd, a53092687e,
  #18600).

- Rate-limiting happens much too late to avoid denial of
  service (#12501).

- Mis-configurations of the HTTP endpoint can break incoming
  mail (#18105).

Provide a replacement SMTP server which accepts incoming email on port
25, verifies that Zulip can accept the address, and that no
rate-limits are being broken, and then adds it directly to the
relevant queue.

Removes an incorrect comment which implied that missed-message
addresses were only usable once.  We leave rate-limiting to only
channel email addresses, since missed-message addresses are unlikely
to be placed into automated systems, as channel email addresses are.

Also simplifies #7814 somewhat.
2025-05-19 16:39:44 -07:00
Shubham Padia
078a27def2 help-beta: Convert admonitions to asides and KeyboardTip.
Fixes #31249.
We have converted `warn` to `note` since that was the translation that
remains most faithful to how we display `warn` admonitions in our
current help center implementation. See
https://chat.zulip.org/#narrow/channel/19-documentation/topic/Stage.202.3A.20New.20syntax.20for.20!!!tip.20in.20help-beta/near/2174415
for more details.

We've also duplicated code from Python-Markdown to represent how
admonitions worked there more accurately. Duplication should be fine
since this is a one-off script and Python-Markdown is not a project
that's gonna change drastically in the future.
2025-05-15 11:53:40 -07:00
Aman Agrawal
136c0f1c44 registration: Enable import from slack using realm registration form.
Co-authored-by: Alex Vandiver <alexmv@zulip.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-05-14 13:24:38 -07:00
Alex Vandiver
41fbe0bb4f kandra: Install PostgreSQL 17 by default. 2025-05-14 09:16:46 -07:00
Shubham Padia
dfc2a7d19a help-beta: Convert include files to mdx along with required conversion.
Earlier, we were just renaming the files in help/include and copying
them over. Which meant that none of the mdx features or any of the
components we add could be used there. We could also not support nested
imports which are a part of the help/include files.

We also set an explcit height and width of 1em for icons, since some odd
behaviour for icon height and width was noticed when writing this
commit. unplugin-icons sets height and width by itself. It was setting
the height to 1024 and 960 for some icons. It is better to set the
height explicitly.
2025-05-13 10:21:17 -07:00
Shubham Padia
b1bf937cad help-beta: Remove BASE_DIR from path.join for output_dir.
BASE_DIR is already part of output_dir. There is no need to specify it
once more.
2025-05-13 10:21:17 -07:00
Shubham Padia
130877615e help-beta: Use .insert to insert string at a particular line.
The previous logic could not handle adding the given string at the 1st
line. We also rename the function to accurately represent what it does,
insert_string_at_line.
2025-05-13 10:21:17 -07:00
Shubham Padia
bb7af6e5c1 help-beta: Refactor convert_string_to_mdx to handle file read as well.
In future, we intend to add a function that will read the include files
and do a conversion to mdx. That conversion will be different from the
conversion that we are doing right now for the main help files. That is
why we have extracted the markdown file reading logic to the
`get_markdown_string_from_file` and renamed `convert_string_to_mdx` to
`convert_help_center_file_to_mdx` to be more specific for help center
files.
2025-05-13 10:21:17 -07:00
Shubham Padia
0f85d6327d help-beta: Fix bug of not rendering font-awesome icons correctly.
In `replace_icons`, when replacing zulip icons, the original
`markdown_string` was being passed instead of the result from the
previous font-awesome icon replacement.
2025-05-13 10:21:17 -07:00
Shubham Padia
68ec074a84 help-beta: Add support for displaying zulip icons.
We're using unplugin-icons to do so.
2025-05-12 18:13:26 -07:00
Shubham Padia
c97cd1c5dd help-beta: Add support for displaying font-awesome icons.
In our app, we use the font-awesome stylesheet, add it to our webpack
bundle and use the appropriate class with the <i> tag.
Here. although for font-awesome, we can use the stylesheet to do the
same, we would need to use `webfonts-loader` for our custom icons.
In this astro project, we want to follow the Astro way, and
unplugin-icons fits better with the Astro way of doing things.
See this topic on the discussion on how we chose unplugin-icons:
https://chat.zulip.org/#narrow/channel/19-documentation/topic/Stage.202.3A.20Icons/near/2168842
2025-05-12 18:13:26 -07:00
Shubham Padia
b378e33136 help-beta: Make it easier to keep track of imports in conversion.
Before this, every function itself was responsible for adding it's own
imports. That is extra string manipulation which we had to think about
everytime we were adding new conversion function.
Now, we have an import statement set that the functions can modify, and
we have a function responsible for adding those imports. This makes it
easier in the future to add more conversion functions which might be
introducing imports.
2025-05-12 18:13:26 -07:00
Vector73
8e400eb283 tools: Update files in api_docs folder along with zulip.yaml. 2025-05-12 16:00:29 -07:00
Vector73
42439b8f09 tools: Update version along with feature level.
Fixed merge-api-changelogs tool to update version too along
with feature level in API docs.
2025-05-12 16:00:29 -07:00
Anders Kaseorg
61c04078cc server_events: Extract interface for compose, transmit to new module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-12 11:07:12 -07:00
Shubham Padia
05542d6cb4 help-beta: Pass allowedHosts when running dev server.
Vite introduced allowedHosts config at
https://vite.dev/config/server-options#server-allowedhosts. This caused
our help beta dev server to break in case of dev droplets since it's
hostname is not specified in the allowed lists. Since we have a way to
know our hostname, we do not pass a blanket true for all hostnames in
this case.
2025-05-08 09:40:12 -07:00
Tim Abbott
c09b0b9b6b tools: Fix temporary feature level calculation. 2025-05-06 15:58:58 -07:00
Harsh
cfdb80ed48 typeahead: Replace code block language hint text with more clear options
This commit
- Replace the blank option with an italicized option that's the current
   default language, if there is one selected with "default" label.
- Make the "text" option more informative by adding (no highlighting)
   to the label.
- Remove the hint for "text".
- Prioritize as left to right, before start typing:
   blank/default language, text, quote, spoiler, math, everything else...

fixes: #33682
2025-05-01 16:36:20 -07:00
Lauryn Menard
6d7bff4a16 create-realm: Simplify organization name field on new org form.
Removes the placeholder text and hint. Adds a link to the help
center article about creating your organization profile.

Fixes #34496.
2025-05-01 12:00:56 -07:00
Karl Stolley
142d1958a0 url_previews: Post-process embed links for performant CSS. 2025-04-28 16:10:13 -07:00
Niloth P
7e3218ee45 generate-integration-docs-screenshot: Support plain/text payloads.
All *.txt fixtures were assumed to only contain URL parameters,
now fixtures with plain/text payloads are also supported.
2025-04-16 14:05:29 -07:00
Shubham Padia
b813d868a7 help-beta: Merge lists of same type adjacent to each other.
Fixes #31252.
One of our major use cases for file imports is to have bullet points as
partials to import at different places in the project. But when
importing the file with Astro, it creates its own lists. So we merge
lists together if they have nothing but whitespace between them.
There were some talks to use a component called FlattenList that would
flatten the list inside it, but that would also flatten lists that were
nested on purpose. This approach while feeling a bit hacky would not
flatten nested lists.
2025-04-15 13:55:09 -07:00
Shubham Padia
c0a2b2a31d help-beta: Convert our custom file import syntax to astro.
We use all these markdown files in `include` only to import them into
our main help markdown files. Most of these files are bulleted lists of
text. When importing these files, they might appear as an indented
sublist of an existing list. We plan to introduce mechanism to flatten
it in further commits.
2025-04-15 13:55:09 -07:00
Alex Vandiver
826c643401 tusd: Update development version.
This update was missed in 21eff33875.
2025-04-15 10:36:18 -07:00
Vector73
b3efb901fc tools: Use .md extension for temporary API changelog files. 2025-04-13 20:22:53 -07:00
Ritwik
9feba0f16f emoji: Remap ':smile' emoji and update the settings UI.
This commit remaps the ':smile' emoji to 😄 and
introduces ':slight_smile' which maps to `🙂`.

Fixes #32712
2025-04-07 17:34:52 -07:00
Shubham Padia
496aa16f19 help-beta: Add component for emoticon translations table.
Fixes #31257.
2025-04-07 10:33:39 -07:00
Anders Kaseorg
39d8fa38fd update-for-legacy-translations: Don’t delete empty strings.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-04-05 07:17:47 -07:00
KIRTAN AGARWAL
b1d955379e test-backend: Remove outdated reference to MarkdownTest class.
The tests and test classes have been slightly renamed over time.
2025-04-01 17:58:22 -07:00
Anders Kaseorg
b470df98da unescape-contents: Remove.
With commit 2de648df02 (#32346), this
has no effect.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-04-01 09:05:30 -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
Niloth P
dafef91c8c integration-url-modal: Use input pills for branch names. 2025-03-28 09:58:39 -07:00
Amaan-pathan
b0844109ca settings: Show UTC offsets in timezone dropdown.
This improves usability by helping users quickly recognize timezones
with their offsets.

Fixes #20988.
2025-03-26 16:52:32 -07:00
Niloth P
b2910aa05c integration-docs: Migrate PythonAPIIntegration docs.
To zulip/python-zulip-api, to keep them closer to their source code.

- Renamed the generate_zulip_bots_static_files to
generate_bots_integrations_static_files to accomodate the new function.
- Added a new function to
tools/setup/generate_bots_integrations_static_files to copy the
integration docs into static/generated/integrations.
- Updated integrations.py and computed_settings.py to use the new doc
paths.
- Deleted the affected integration docs.
- Updated the dependency URL.
2025-03-26 11:19:31 -07:00
Tim Abbott
df426ae282 tools: Treat hosted weblate as a bot in contributor counts. 2025-03-25 09:55:20 -07:00
Alex Vandiver
3c400e5f88 webpack: Allow customizing the 5xx page.
Note that this only changes the nginx 5xx page, not the Django one.
2025-03-24 14:39:47 -07:00
Anders Kaseorg
ce81d8498d provision: Ignore Python warnings while building requirements.
Build warnings are unfortunately very common in third-party packages.
They’re difficult to reliably detect since packages don’t always build
from source, and they can’t be whitelisted on a per-package basis
since they’re all attributed to setuptools or an anonymous code
string.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-19 17:15:09 -07:00
Alex Vandiver
bca862e243 migrations: Backfill is_channel_message. 2025-03-18 09:34:11 -07:00
Anders Kaseorg
29fb68ebcc install-shfmt: Upgrade shfmt from 3.10.0 to 3.11.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-14 18:32:23 -07:00
Anders Kaseorg
7cbda7d7a5 ruff: Fix SIM905 Consider using a list literal instead of str.split.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-14 17:31:50 -07:00
Anders Kaseorg
0cc6b77670 ruff: Fix PLC1802 len(…) used as condition without comparison.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-14 17:31:50 -07:00
Sayam Samal
80a352dc02 buttons: Add loading indicator to buttons. 2025-03-10 11:21:11 -07:00
Sayam Samal
3275fcc96e popup_banners: Redesign connection banner to use new banner component.
This commit serves as the base commit for redesigning the alert banners
by migrating them to use the new banner component. We use a new name
to refer to these banners — "Popup banners", which is more descriptive
about their behavior.

The Popup banners are appended to the container in a stacking order,
i.e., the most recent popup banner appears on the top and the oldest one
is sent to the bottom of the stack. These banners also inherit the
animations from the alert banners for visual appeal.

This commit also fixes the bug where clicking on the "Try now" button
in the popup banner resulting from an error in the `/json/messages`
endpoint resulted in call to restart_get_events in server_events.js
instead of load_messages in message_fetch.ts.

Fixes #31282.
2025-03-10 11:21:11 -07:00
Vector73
47897e6f95 tools: Fix merge-api-changelogs. 2025-03-10 09:22:13 -07:00
Niloth P
ec04aaf797 integrations-url-modal: Add URL parameter for filtering by branches.
Use the config option "branches" to enable the UI for filtering
branches.

Fixes: #33736.
2025-03-05 10:39:13 -08:00
Alex Vandiver
a5beb608bb test-backend: Remove now non-existant file.
This should have been removed in 9dfaa83aa8.
2025-03-04 16:09:25 -08:00
Alex Vandiver
c5200e8b05 deliver_scheduled_emails: Use a queue, instead of infinite retries.
`deliver_scheduled_emails` tries to deliver the email synchronously,
and if it fails, it retries after 10 seconds.  Since it does not track
retries, and always tries the earliest-scheduled-but-due message
first, the worker will not make forward progress if there is a
persistent failure with that message, and will retry indefinitely.
This can result in excessive network or email delivery charges from
the remote SMTP server.

Switch to delivering emails via a new queue worker.  The
`deliver_scheduled_emails` job now serves only to pull deferred jobs
out of the table once they are due, insert them into RabbitMQ, and
then delete them.  This limits the potential for head-of-queue
failures to failures inserting into RabbitMQ, which is more reasonable
than failures speaking to a complex external system we do not control.
Retries and any connections to the SMTP server are left to the
RabbitMQ consumer.

We build a new RabbitMQ queue, rather than use the existing
`email_senders` queue, because that queue is expected to be reasonably
low-latency, for things like missed message notifications.  The
`send_future_email` codepath which inserts into ScheduledEmails is
also (ab)used to digest emails, which are extremely bursty in their
frequency -- and a large burst could significantly delay emails behind
it in the queue.

The new queue is explicitly only for messages which were not initiated
by user actions (e.g., invitation reminders, digests, new account
follow-ups) which are thus not latency-sensitive.

Fixes: #32463.
2025-03-04 16:09:25 -08:00
Shubham Padia
0def74b097 message: Make is_modifying_message a mandatory kwarg.
This is valuable so that one is forced to explicitly make a decision
on what is correct when adding new callers. Past experience tells us that
not having to explicitly show the decision leads to people introducing
security bugs in PRs that the maintainer has to catch in review, and our
goal for access control code should be that security bugs are hard to write.
Fixes #33688.
2025-02-28 10:10:33 -08:00
Anders Kaseorg
3af4900891 install-node: Upgrade Node.js from 22.12.0 to 22.14.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-26 16:20:47 -08:00