Commit Graph

55953 Commits

Author SHA1 Message Date
Aman Agrawal 02a4b3ce62 stripe: Add some test for self hosted free trial.
Cannot test invoice until it is implemented.
2024-01-12 08:50:51 -08:00
Aman Agrawal f96d58cf02 settings: Set default free trial days for basic plan to 30 days. 2024-01-12 08:50:51 -08:00
Aman Agrawal f285de39e9 populate_realms: Allow billing page access without stripe_api_key. 2024-01-12 08:47:43 -08:00
Aman Agrawal 39376190fe populate_billing_realms: Bump licenses to 25 to avoid negative amount. 2024-01-12 08:47:43 -08:00
Aman Agrawal fd85f51745 populate_billing_realms: Add a realms on basic plan. 2024-01-12 08:47:43 -08:00
Aman Agrawal c9a4660911 header: Avoid using `.dropdown` for class name.
This is avoid conflict with styles defined for `.dropdown` in
bootstrap.
2024-01-12 08:40:51 -08:00
Aman Agrawal 9d1e977e2a portico: Don't use `dropdown-toggle` class.
We want to avoid using `dropdown-toggle` class to avoid
properties leaking from bootstrap.
2024-01-12 08:40:51 -08:00
Aman Agrawal 70ecdf2add helpers: Remove dead bootstrap tabs code. 2024-01-12 08:40:51 -08:00
Alya Abbott c7a39312ab help: Make minor tweaks to warning about multiple organizations billing. 2024-01-12 08:40:09 -08:00
Mateusz Mandera a5538636f0 remote_billing: Remove stale comment about ToS in the server flow.
That comment is stale, now we just do a proper tos_consent check, based
on the last. version the user consented to.
2024-01-12 08:39:48 -08:00
Mateusz Mandera 63254f18ec remote_billing: Handle two confirmation links for same user correctly.
The bug was that a user could do the first part of the flow twice,
receiving two confirmation links, before finishing signup. Then they
could use the first link, followed by the second, which would case an
IntegrityError due to trying to create the RemoteRealmBillingUser
for the second time.

When the second link gets clicked, we should just transparently redirect
the user further into the flow so that they can proceed.
2024-01-12 08:39:48 -08:00
Alex Vandiver e6a0284275 queue_processors: Defer initial email connection creation.
We previously created the connection to the outgoing email server when
the EmailSendingWorker was first created.  Since creating the
connection can fail (e.g. because of firewalls or typos in the
hostname), this can cause the `QueueProcessingWorker` creation to
raise an exception.  In multi-threaded mode, exceptions in the worker
threads which are _not_ during the handling of a specific event
percolate out to `log_and_exit_if_exception` and trigger the
termination of the entire process -- stopping all worker threads from
making forward progress.

Contain the blast radius of misconfigured email servers by deferring
the opening of the connection until it is first needed.  This will not
cause any overall performance change, since it only affects the
latency of the very first email after startup.
2024-01-12 08:38:46 -08:00
Alex Vandiver e1acd7b974 process_queue: For threaded workers, create them when they start.
Creating the QueueProcessingWorker objects when the ThreadedWorker is
created can lead to a race which caused confusing error messages:

1. A thread tries to call `self.worker = get_worker()`
2. This call raises an exception, which is caught by
   `log_and_exit_if_exception`
3. `log_and_exit_if_exception` sends our process a SIGUSR1, _but
    otherwise swallows the error_.
4. The thread's `.run()` is called, which tries to access
   `self.worker`, which was never set, and throws another exception.
5. The process handles the SIGUSR1, restarting.

Move the creation of the worker to when it is started, so the worker
object does not need to be stored, and possibly have a decoupled
failure.
2024-01-12 08:38:46 -08:00
Anders Kaseorg be13557ead playground_links_popover: Remove wrong $ prefix for non-jQuery variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-11 18:15:59 -05:00
Anders Kaseorg 43e53d9b9d user_status: Fix parsing of partial user_status events.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-11 14:06:11 -08:00
Alex Vandiver e0bd169c77 docs: Fix other help pages that were renamed or moved, to save a redirect. 2024-01-11 13:52:12 -08:00
Alex Vandiver c217280c23 docs: Fix help links for pm -> dm rename, to save a redirect. 2024-01-11 13:52:12 -08:00
Alex Vandiver eefe147c34 web: Fix links which were missing trailing slashes. 2024-01-11 13:52:12 -08:00
Vector73 ed97420ffc
settings: Fix setting label click functionality.
This commit fixes "Automatically follow topics where I'm mentioned"
setting label click functionality so that the setting is toggled
on clicking the label.
2024-01-11 13:34:46 -08:00
Karl Stolley fd559495ab message_row: Remove unnecessary .sender-status-controls style and structure. 2024-01-11 12:53:31 -08:00
Karl Stolley 272b62138e message_row: Remove styles and JS for nonexistant .sender-status. 2024-01-11 12:53:29 -08:00
Karl Stolley 09ae717fee message_edit: Lay out edit buttons with flexbox. 2024-01-11 12:51:02 -08:00
Karl Stolley f0f8d6a42d message_edit: Remove styles with no associated structure. 2024-01-11 12:51:02 -08:00
Karl Stolley fd5fe64a33 message_edit: Consolidate styles into message row CSS. 2024-01-11 12:51:02 -08:00
evykassirer 4b14f0efad stream_topic_history_util: Convert module to typescript. 2024-01-11 12:45:39 -08:00
Alex Vandiver ec4f3e44df docs: Fix selfhoster URL to be the canonical one.
We redirect from `/serverlogin` to `/serverlogin/`, so save a 301.
2024-01-11 12:43:31 -08:00
Prakhar Pratyush 976354dbda stripe: Fix the invoice item description for flat discounts.
Earlier, in process_initial_upgrade, the flat_discount value
wasn't converted into dollars when specified in the invoice
description, resulting in showing the incorrect value of $2000
as a discount.

This commit converts the value in cents to dollars and adds tests
to verify the invoice generated.
2024-01-11 12:35:58 -08:00
Prakhar Pratyush f7d4d04130 api_docs: Update doc for realm_push_notification_enabled_end_timestamp.
This commit updates the doc to explicitly mention that
'realm_push_notifications_enabled_end_timestamp' is a UNIX timestamp.
2024-01-11 12:32:16 -08:00
Lauryn Menard 787d64e327 support: Update validation for adding or updating a discount.
Updates the HTML input field to have a min of 0, max of 99.99 and
allow increments of 0.01.

Also, use format_discount_percentage for displaying the customer
default discount in the support form.
2024-01-11 09:20:41 -08:00
evykassirer 8bd9a91216 stream_list_sort: Convert module to typescript. 2024-01-10 17:43:08 -08:00
evykassirer a75253cdba stream_list_sort: Use more accurate stream_id name. 2024-01-10 17:43:08 -08:00
evykassirer 426e345e65 stream_list_sort: Use a flag instead of checking for undefined list. 2024-01-10 17:43:08 -08:00
Karl Stolley de00e44fb0 plans: Link to cloud, self-hosted sponsorship areas. 2024-01-10 15:10:04 -08:00
Sahil Batra c0c9623ae4 message: Allow system bots to mention group if everyone else can.
We now allow system bots to mention a group if can_mention_group
setting is set to "role:everyone" group and not when it is set
to some other group.
2024-01-10 14:57:21 -08:00
sanchi-t 0a626f5e3c csrf_failure: Update error page.
Switches from Django's default error page to Zulip standard error
template.  Also updates template for 405 error code to not use the 404
art.

Fixes #25626.
2024-01-10 09:49:24 -08:00
Aman Agrawal c58c12911c typing_events: Show typing notification in a proper topic narrow.
It is possible to have multiple topic / stream terms if user
is searching or if the URL is malformed. So, we should check
if the user is in a proper topic narrow before showing
typing notifications.

This fixes the error of topic being undefined due to there
being multiple topic terms in narrow when trying to display
notifications.
2024-01-10 09:08:38 -08:00
Alex Vandiver 3bf047beb8 iptables: Skip conntrack for DNS queries.
Under heavy request load, it is possible for the conntrack kernel
table to fill up (by default, 256k connections).  This leads to DNS
requests failing because they cannot make a new conntrack entry.

Allow all port-53 UDP traffic in and out without connection tracking.
This means that unbound port-53 traffic is no longer filtered out by
the on-host firewall -- but it is already filtered out at the border
firewall, so this does not change the external network posture.
`systemd-resolve` also only binds to 127.0.0.53 on the loopback
interface, so there is no server to attack on inbound port 53.
2024-01-10 09:07:00 -08:00
Alex Vandiver d18de3e0a4 puppet: Add a knob to adjust conntrack max size. 2024-01-10 09:07:00 -08:00
Alex Vandiver 588aec96f9 puppet: Factor out a sysctl operator. 2024-01-10 09:07:00 -08:00
evykassirer cd58655a4b stream_topic_history: Convert module to typescript. 2024-01-10 09:02:17 -08:00
evykassirer 8a1fa8b161 stream_topic_history: Simplify add_or_update params. 2024-01-10 09:02:17 -08:00
Sahil Batra dcac272afc user_group_popover: Convert module to typescript. 2024-01-09 16:47:37 -08:00
afeefuddin d0deaff7fd portico-header: Dropped find accounts link for smaller windows.
Fixes #27477
2024-01-09 16:46:24 -08:00
Alya Abbott d790b28322 billing: Improve /plans and billing help pages.
- Clarify sponsorship policies.
- Explain how paid self-hosted plans fund the Zulip project.
2024-01-09 16:03:55 -08:00
Alex Vandiver 4da87524ff
nagios: Remove provisioning of zulip contact alias.
fcf096c52e removed the callsite which would have notified this
contact. Note that the source config file was presumably installed via the
python-zulip-api package.
2024-01-09 16:01:07 -08:00
Karl Stolley 5c0e37844b plans: Reduce font-size of text comparison elements. 2024-01-09 16:00:16 -08:00
Karl Stolley f71c7458a7 plans: Consolidate positioning on comparison values. 2024-01-09 16:00:16 -08:00
Karl Stolley 941b76f510 plans: Reduce font-weight on push placeholder button. 2024-01-09 15:59:38 -08:00
Alex Vandiver 7720d362ba messages: Only lock UserMessage rows, not other joined tables.
By default, `SELECT FOR UPDATE` will also lock any rows which are
`JOIN`ed into the selected rows; in the case of UserMessage rows, this
can mean arbitrary Message rows.

Since the messages themselves are not being changed, it is not
necessary to lock them -- and doing so may lead to deadlocks, in the
case that the UserMessage row is locked for update before the Message,
and some other request has already taken a read lock on the Message
and is blocked on the UserMessage write lock.

Change `select_for_update_query` to explicitly only lock UserMessage.
2024-01-09 13:13:59 -08:00
roanster007 69de75ec0b compose: Fix display of compose banner when dm disallowed.
Previously, when the compose bar was open with any DM recipient,
and the organization wide setting to disallow DM is toggled, then
the DM not allowed banner is not displayed on the compose until
it is reopened.

This is fixed by changing the server event dispatch of
private_message_policy from noop to a method to  check for
the compose's posting policy status, and display the banner.

Fixes #27774
2024-01-09 12:35:02 -08:00