Commit Graph

57598 Commits

Author SHA1 Message Date
Mateusz Mandera c9ca4e68e5 scim: Add config option to disable initial streams for guests.
When an organization (without open ability for anyone to join) invites a
guest user, the invitation prompts allows them to choose whether the
guest should be added to default streams or not. This is useful, because
since we don't have per-role default streams configs, they may want
default streams to be for full Members.

SCIM provisioning doesn't have this control, since a newly provisioned
user gets created via a direct do_create_user call, thus adding them to
the organization's default streams, with no workaround possible aside of
just getting rid of default streams in the organization.

To make provisioning guests in such an organization usable, we add a
simple config option to create them with no streams. It's configured by
adding
```
"create_guests_without_streams": True
```

to the config dict in settings.SCIM_CONFIG.
2024-04-11 12:28:26 -07:00
rht c77ed52fa9
slack import: Refer the archive file as a file or dir. 2024-04-11 12:05:56 -07:00
roanster007 0be93b8519 stream_settings: Fix error on stream setting update when compose closed.
Previously, when stream settings were updated, without opening the
compose box, assertion error were thrown.

This error was a result of a regression in compose_recipient, due to an
extra assert statement added during its typescript migration in
25ff0d4418.

This is fixed by removing the statement.
2024-04-11 11:28:55 -07:00
sujal shah dd91157993 integration: Split 'opened_or_update_pull_request' event type.
Modified the 'get_zulip_event_name' function to
differentiate between 'opened' and 'updated' actions
for pull requests within the 'pull_request' event type.
Created separate event types for 'opened_pull_request' and
'updated_pull_request'. Updated the 'EVENT_FUNCTION_MAPPER'
dictionary to include handlers for these new event types.
Adjusted the'get_opened_or_update_pull_request_body' function to handle
both 'opened' and 'updated' actions appropriately.

Fixes #29594.
2024-04-11 11:23:08 -07:00
Karl Stolley 7291f0a919 info_density: Set font size, line height vars in dev. 2024-04-11 10:25:03 -07:00
Varun Singh 9ad7a9f0be data: Restrict parameter type to not be undefined.
Since the type of request_method(AjaxRequestHandler) has
been extended in the previous commit.Consequently the 'data'
field of 'request_method' has to be typed such that it
satisfies this change.

Because request_method's type can also be 'typeof patch' which
does not accept undefined 'data' field, I haved 'omit'-ted
'undefined' from 'data's type in function signature to satisfy
TypeScript.

Now ,in support of the changes I have made to two different function
sign(namely setting_ui.do_settings_change,dialog_widget.submit_api_request)
I am stating some points about data field inside these respective
function signs.

1.settings_ui.do_settings_change: For this 'data' was actually never
undefined. Each function call has a 'data' object passed( with one
or more fields).

2.dialog_widget.submit_api_request: For this case many function calls
actually didn't have 'data' field (ie.'data' was undefined).
BUT,for those cases it was defaulted to '{}'(see function sign).
So effectively 'request_method' didn't recieve an undefined 'data' for
this case too. I have removed the defaulting and passed '{}' in the
function calls for those cases, which effectively does the some job,
but satisfies the type.

For both these cases 'data' field isn't undefined and hence an Omit,for me
makes sense.
2024-04-11 10:08:45 -07:00
Varun Singh 9b9ea01dfa channel: Use TypeScript unions for 'AjaxRequestHandler'.
Type AjaxRequestHandler is used for typing request methods
(like channel.get, channel.post etc.)Use cases include
'request_method' parameter in settings_ui.do_settings_change
and dialog_widget.submit_api_request.

Problem with the type definition:
The current type definition( ie. 'typeof call' ) satisfies every
'request_method' type EXCEPT channel.patch request.One can notice
the difference b/w 'call' and 'patch' function in channel.ts .

Hence,We need to expand the AjaxRequestHandler type.I have unioned it
with 'typeof patch' is account for the case when 'request_method'parameter
is of type channel.patch.

Discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/setting_ui.20do_settings_change/near/1754557
2024-04-11 10:08:45 -07:00
Varun Singh b6473deca0 zod: Consistently use named imports. 2024-04-11 09:47:28 -07:00
Varun Singh 4985363bd7 poll_widget: Rename type to be more relevant. 2024-04-11 09:47:28 -07:00
Varun Singh 2d4bed4ab4 state_data: Fix alphabetical order. 2024-04-11 09:47:28 -07:00
Alex Vandiver d834f1fc01 unarchive_stream: Prevent unarchiving a stream in the wrong realm. 2024-04-11 09:41:41 -07:00
Lauryn Menard 01b59c5aa2 message-type: Add support for "channel" as value for type parameter.
For endpoints with a type parameter to indicate whether a message is
a direct or stream message, adds support for passing "channel" as a
value for stream messages.

Part of stream to channel rename project.
2024-04-11 09:40:25 -07:00
Alya Abbott d24dadb52f help: Add "Find administrators" help page. 2024-04-11 09:37:29 -07:00
Alya Abbott a7ae454f52 help: Document role filter for Users list. 2024-04-11 09:37:29 -07:00
Alex Vandiver 87fb703e5b kandra: Log and timestamp autossh output.
By default, autossh writes to syslog; setting AUTOSSH_DEBUG is the
only way to produce output to STDERR.  Timestamp that and log that to
the logfile, making the logs perhaps useful.
2024-04-11 09:34:43 -07:00
evykassirer a8d261a68f dropdown_widget: Fix DropdownWidgetOptions.
Addresses this comment
https://github.com/zulip/zulip/pull/29611/files#r1559751399
2024-04-11 09:32:19 -07:00
Anders Kaseorg 36aa0177bd Revert "apt-repos: Disallow libmagic1 1:5.45-2 (Ubuntu 24.04) again."
This reverts commit 13e28fc3ac.
2024-04-10 16:07:25 -07:00
Anders Kaseorg 0d1ed06762 requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-10 15:32:37 -07:00
Shubham Padia 3f6ceba39a settings_users: Add role filter to user list.
Fixes #18617.
- The role filter is added to both active and deactivated user
list. The original plan was to introduce a multi select checkbox
dropdown for the roles, but since that component is not ready yet,
we will use the dropdown component for the first iteration.
- To accomodate multiple filters, we have used an approach
similar to the one in recent_view_ui.js where we use dropdown
callback function and on("input") event on text search to set the
filter value in memory. The predicate functions uses these filters.
- We have also changed the default message when there are no
users to show to reflect `filters` instead of `current filter`.
2024-04-10 13:45:06 -07:00
Sahil Singh 6c2535fe46 bots: Avoid multiple active bots with the same name.
Creating a bot with a name that is already in use
will raise an error. However, by deactivating
the existing bot, creating a new bot with the
same name, and then reactivating the original bot,
it is possible to have multiple bots with the same name.

To fix this, we check if the bot name is already
in use in the active bots list. If it is,
an error will be raised, prompting either the
name of the existing bot to be changed or
the bot to be deactivated.

Co-authored-by: Sujal Shah <sujalshah28092004@gmail.com>
2024-04-10 13:14:25 -07:00
Alya Abbott 0007673d9f help: Clarify warning about not applying authentication methods. 2024-04-10 13:10:44 -07:00
Mahhheshh 68646cacfc message_edit_history: Add loading spinner.
Adds a loading spinner to the message history overlay,
improving the user experience by providing visual feedback while the
message edit history is loading.
2024-04-10 13:10:12 -07:00
evykassirer 16bf8d3df6 views_util: Convert module to typescript. 2024-04-10 12:19:52 -07:00
evykassirer 9366d42f14 dropdown_widget: Pass current value to get_options to avoid hacky this. 2024-04-10 12:19:52 -07:00
evykassirer c449bb35e2 narrow_title: Fix filter type. 2024-04-10 12:19:52 -07:00
Vector73 2734a9483b api_documentation: Document "/invites/multiuse" endpoint.
Adds "/invites/multiuse" endpoint to the API documentation.

Creates a shared schema for the invite_as and invite_expires_in_minutes
parameters that are the same for the "POST /invites" endpoint.

Also, updates the response documented for the "GET /invites" endpoint
to match the information in the "POST /invites" and "/invites/multiuse"
documentation.
2024-04-10 11:29:14 -07:00
Mahhheshh 619f85fac7 message_edit_history: Set cursor to default on hover. 2024-04-10 11:25:31 -07:00
N-Shar-ma 30b68214d3 settings: Do not scroll to save button when typing in textarea / input.
In an unsaved state, when focus is in a textarea or an input of type
text, we don't yet scroll the save button into view to not interrupt the
user's typing. When the input / textarea loses focus, we scroll then if
needed, triggered via the `change` event.
2024-04-10 11:18:17 -07:00
afeefuddin 61966e9d6e compose_tooltips: Convert module to TypeScript. 2024-04-10 11:17:20 -07:00
Lauryn Menard 39c5855b88 hash-util: Use NarrowTerm type from state_data.
Replaces the Term type in hash_util.ts with the NarrowTerm type
that is defined in state_data.
2024-04-10 11:15:27 -07:00
tnmkr 2f88b810e0 renumber-migrations: Skip migration 0501.
Security fix cf8b9ad needed migration
`zerver/0501_delete_dangling_usermessages` on the 8.x branch (3db1733).
This resulted in two migrations numbered 0501, due to which this tool
always got stuck on 0501.
2024-04-10 11:15:00 -07:00
Anders Kaseorg 15cec69995 check-openapi: Modernize yargs usage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-08 16:50:56 -07:00
Anders Kaseorg 7d6c5beb19 message-screenshot: Fix commander@12 usage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-08 16:45:47 -07:00
Alex Vandiver f4d109c289 puppet: Fix arrow alignment. 2024-04-05 09:18:04 -07:00
Alex Vandiver 235e2eefc8 puppet: Switch from top-level fact variables to facts dict, again.
These were somehow missed in 57f8b48ff9.
2024-04-05 09:18:04 -07:00
N-Shar-ma 7072794871 css: Make pills' content collapse according to width available.
We set `min-width: 0` on all nested flex containers for pills, not just
the pills label, which allows the label content to collapse as much as
needed with ellipsis when overflowing.

Fixes: #27205.
2024-04-05 09:14:37 -07:00
Aman Agrawal 4812c81968 click_handlers: Don't handle clicks with meta / ctrl keypress.
Fixes #17935

This allows users to ctrl + click a link to open it in new tab
without changing the state in the current tab.
2024-04-05 09:12:03 -07:00
Anders Kaseorg 64cabae46d web: Fix usage of .replace with variable replacement.
String.prototype.replace and String.prototype.replaceAll interpret
certain sequences such as $$ within a string provided as the
replacement argument.  Avoid this interpretation by providing a
function.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-05 09:11:23 -07:00
Alex Vandiver 44c4b93f6e docs: Improve PostgreSQL documentation.
This removes a bunch of out-of-date documentation which is better
addressed outside of Zulip, and provides more details on running a
PostgreSQL server on a separate host.
2024-04-04 16:50:08 -07:00
Alex Vandiver 7187146422 install: Move PUPPET_CLASSES env var to --puppet-classes argument.
`--no-init-db` is used to silence the need for `--hostname` and
`--email` arguments; it is a proxy for "this is not a frontend host."
We would ideally like to use `has_class` to know if the user's
provided puppet classes are include an `app_frontend`, and thus
`--hostname` and `--email` are required -- but doing that requires
several other steps, and we would like this feedback to be immediate.

We make the presence of `--puppet-classes` equivalent to
`--no-init-db`, since nearly every configuration with
`--puppet-classes` does not install both a database and a frontend,
which is what is required to initialize a database.
2024-04-04 16:49:43 -07:00
Alex Vandiver 89484fbbe6 install: Remove the hidden VIRTUALENV_NEEDED parameter.
We can do this behaviour better by using `has_roles`.
2024-04-04 16:49:42 -07:00
Alex Vandiver efdfaaf5a2 install: Only install node on frontend hosts. 2024-04-04 16:49:22 -07:00
Alex Vandiver a69e690122 puppet: Split out a zulip::profile::standalone_nodb class. 2024-04-04 16:48:58 -07:00
Alex Vandiver 263212decf puppet: Remove gettext, zulip::static_asset_compiler.
These came in via d0dcc8bf26, which looks like it copied the comment
from the provisioning code.  Production installs (even from git) do
not call `./manage.py makemessages`, so there is no reason to require
this for production deployments.
2024-04-04 16:48:58 -07:00
Alex Vandiver 65f1f83dac docs: Factor out PostgreSQL support matrix. 2024-04-04 16:48:58 -07:00
Alex Vandiver bd82c6edf9 settings: Support multiple database replicas in REMOTE_POSTGRES_HOST.
The libpq client library, used under the hood by psycopg2, supports
passing a list of hosts; they are tried sequentially until one of them
works[^1].

In cases where this is used, it is often the case that the other
servers are read-only hot spare replicas.  Since Zulip does not expect
to be in a read-only transaction, we require that the server that we
connect to be writable, by passing `target_session_attrs`[^2].

To limit how long we may block connecting to a potentially bad host
before moving on, we set `connection_timeout` from null (meaning
forever) to 2 (the lowest supported value)[^3], so we move on quickly
in the case that the server is running but unable to handle new
connections.

[^1]: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-MULTIPLE-HOSTS
[^2]: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-TARGET-SESSION-ATTRS
[^3]: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-CONNECT-TIMEOUT
2024-04-04 16:48:58 -07:00
Alex Vandiver 92121a0626 postgresql: Decouple wal_g from streaming replication.
Streaming replication may be used even if `wal-g` is not -- as long as
the user can move a copy of the base backup to the replica (e.g. using
`pg_basebackup`).  Remove the warning about this combination, and move
the `primary_conninfo` setting outside of the `s3_backups_bucket`
check.
2024-04-04 16:48:58 -07:00
Alex Vandiver 5121bff3c0 postgresql: Drop lowered max_wal_senders value.
This was originally added in a PostgreSQL 9.5 configuration, where the
default is 0, meaning replication is disabled[^1].  In PostgreSQL 10
and above, the default is 10[^2], and there is no reason to lower it
from that value.

[^1]: https://www.postgresql.org/docs/9.5/runtime-config-replication.html
[^2]: https://www.postgresql.org/docs/10/runtime-config-replication.html#RUNTIME-CONFIG-REPLICATION-SENDER
2024-04-04 16:48:58 -07:00
Alex Vandiver acc94a5f32 create-database: Skip stop-server and flush-memcached on standalone Pg.
If running on a stand-alone PostgreSQL server, then supervisor does
exist -- but `stop-server` is useless, and in fact cannot run because
the Zulip directory may not be readable by the `zulip` user.

Detect if this is an application front-end server by looking for
`/home/zulip/deployments`, and use the stop-server and flush-memcached
from there if it exists.  The `create-db.sql` and
`terminate-psql-sessions` files are still read from the local
directory, but those already have precautions from being from a
non-world-readable directory, and are more obviously important to keep
in sync with the `create-database` script.
2024-04-04 16:48:58 -07:00
Alex Vandiver c56dd5ec4d puppet: Fix indentation. 2024-04-04 16:48:58 -07:00