mirror of
https://github.com/zulip/zulip.git
synced 2025-10-25 17:14:02 +00:00
Compare commits
11 Commits
chat.zulip
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c31a23d589 | ||
|
|
2ea21b00f7 | ||
|
|
ad19c16dca | ||
|
|
cce328a38f | ||
|
|
1714bfa173 | ||
|
|
69f2e95e49 | ||
|
|
7e29b35fa0 | ||
|
|
c17564ac27 | ||
|
|
5319b767a1 | ||
|
|
3f2aca5481 | ||
|
|
efa28c3a65 |
13
puppet/zulip/lib/facter/zulip_version.rb
Normal file
13
puppet/zulip/lib/facter/zulip_version.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
Facter.add(:zulip_version) do
|
||||
setcode do
|
||||
Dir.chdir("/home/zulip/deployments/current") do
|
||||
output = `python3 -c 'import version; print(version.ZULIP_VERSION_WITHOUT_COMMIT' 2>&1`
|
||||
if not $?.success?
|
||||
Facter.debug("zulip_version error: #{output}")
|
||||
nil
|
||||
else
|
||||
output.strip
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
22
puppet/zulip/lib/puppet/functions/get_django_setting_slow.rb
Normal file
22
puppet/zulip/lib/puppet/functions/get_django_setting_slow.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require "shellwords"
|
||||
|
||||
# Note that this is very slow (~350ms) and may get values which will
|
||||
# rapidly go out of date, since settings are changed much more
|
||||
# frequently than deploys -- in addition to potentially just not
|
||||
# working if we're not on the application server. We should generally
|
||||
# avoid using this if at all possible.
|
||||
|
||||
Puppet::Functions.create_function(:get_django_setting_slow) do
|
||||
def get_django_setting_slow(name)
|
||||
if File.exist?("/etc/zulip/settings.py")
|
||||
output = `/home/zulip/deployments/current/scripts/get-django-setting #{name.shellescape} 2>&1`
|
||||
if $?.success?
|
||||
output.strip
|
||||
else
|
||||
nil
|
||||
end
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -35,6 +35,8 @@ class zulip::camo (String $listen_address = '0.0.0.0') {
|
||||
$proxy = ''
|
||||
}
|
||||
|
||||
$zulip_version = $facts['zulip_version']
|
||||
$external_uri = pick(get_django_setting_slow('ROOT_DOMAIN_URI'), 'https://zulip.com')
|
||||
file { "${zulip::common::supervisor_conf_dir}/go-camo.conf":
|
||||
ensure => file,
|
||||
require => [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[program:go-camo]
|
||||
command=/usr/local/bin/secret-env-wrapper GOCAMO_HMAC=camo_key <%= @bin %> --listen=<%= @listen_address %>:9292 -H "Strict-Transport-Security: max-age=15768000" -H "X-Frame-Options: DENY" --metrics --verbose --allow-content-video
|
||||
command=/usr/local/bin/secret-env-wrapper GOCAMO_HMAC=camo_key <%= @bin %> --listen=<%= @listen_address %>:9292 -H "Strict-Transport-Security: max-age=15768000" -H "X-Frame-Options: DENY" --metrics --verbose --allow-content-video --user-agent "Zulip-Server/<%= @zulip_version %> (<%= @external_uri %>/) go-camo/<%= @version %>" --server-name "go-camo/<%= @version %>"
|
||||
environment=HTTP_PROXY="<%= @proxy %>",HTTPS_PROXY="<%= @proxy %>"
|
||||
priority=15
|
||||
autostart=true
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
version=0.8.22
|
||||
version=0.9.5
|
||||
arch="$(uname -m)"
|
||||
tarball="uv-$arch-unknown-linux-gnu.tar.gz"
|
||||
declare -A sha256=(
|
||||
[aarch64]=726b72a137fda33565143325f7d31c42cd30ff9ccdf067e00d124d37b4081cb2
|
||||
[x86_64]=741ff1f5742c5a4a25d2f829e8395355e43f7a5ae2ebc6368e9ae2df0efb69cf
|
||||
[aarch64]=9db0c2f6683099f86bfeea47f4134e915f382512278de95b2a0e625957594ff3
|
||||
[x86_64]=2cf10babba653310606f8b49876cfb679928669e7ddaa1fb41fb00ce73e64f66
|
||||
)
|
||||
|
||||
check_version() {
|
||||
|
||||
@@ -3,6 +3,7 @@ import os
|
||||
ZULIP_VERSION = "12.0-dev+git"
|
||||
|
||||
# Add information on number of commits and commit hash to version, if available
|
||||
ZULIP_VERSION_WITHOUT_COMMIT = ZULIP_VERSION
|
||||
zulip_git_version_file = os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)), "zulip-git-version"
|
||||
)
|
||||
@@ -49,4 +50,4 @@ API_FEATURE_LEVEL = 427
|
||||
# historical commits sharing the same major version, in which case a
|
||||
# minor version bump suffices.
|
||||
|
||||
PROVISION_VERSION = (353, 0) # bumped 2025-10-07 to rebuild emoji_names
|
||||
PROVISION_VERSION = (354, 0) # bumped 2025-10-23 to upgrade Python requirements
|
||||
|
||||
@@ -277,12 +277,17 @@ export function initialize_custom_date_type_fields(
|
||||
}
|
||||
}
|
||||
|
||||
let common_class_name = "modal_text_input";
|
||||
if (for_profile_settings_panel) {
|
||||
common_class_name = "settings_text_input";
|
||||
}
|
||||
|
||||
flatpickr($date_picker_elements, {
|
||||
altInput: true,
|
||||
// We would need to handle the altInput separately
|
||||
// than ".custom_user_field_value" elements to handle
|
||||
// invalid values typed in the input.
|
||||
altInputClass: "date-field-alt-input settings_text_input",
|
||||
altInputClass: "date-field-alt-input " + common_class_name,
|
||||
altFormat: "F j, Y",
|
||||
allowInput: true,
|
||||
static: true,
|
||||
|
||||
@@ -429,6 +429,7 @@
|
||||
border: 1px solid hsl(0deg 0% 80%);
|
||||
cursor: pointer;
|
||||
background-color: hsl(0deg 0% 100%);
|
||||
max-width: 100%;
|
||||
|
||||
&:disabled {
|
||||
cursor: not-allowed;
|
||||
@@ -456,6 +457,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
.modal__body,
|
||||
.modal__content {
|
||||
.dropdown-widget-button,
|
||||
.dropdown_widget_with_label_wrapper {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.modal_password_input,
|
||||
.modal_url_input,
|
||||
.modal_text_input {
|
||||
@@ -470,6 +479,7 @@
|
||||
margin-bottom: 10px;
|
||||
/* subtract padding (6px each side) and border (1px each side) */
|
||||
width: calc(var(--modal-input-width) - 14px);
|
||||
max-width: calc(100% - 14px);
|
||||
|
||||
&:focus {
|
||||
border-color: hsl(206deg 80% 62% / 80%);
|
||||
|
||||
@@ -607,6 +607,8 @@ ul.popover-group-menu-member-list {
|
||||
/* Override default modal input width, since that overflows.
|
||||
This is 185px (the default "width: unset" width) at 14px/em */
|
||||
width: 13.2142em;
|
||||
/* subtract padding (6px on left and 28px on right) and border (1px each side) */
|
||||
max-width: calc(100% - 36px);
|
||||
}
|
||||
|
||||
.group-search:placeholder-shown + #clear_groups_search,
|
||||
@@ -905,6 +907,9 @@ ul.popover-group-menu-member-list {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
/* Unset max-width set using modal_text_input selector as box-sizing
|
||||
is set to border-box here and we already set width to 100%. */
|
||||
max-width: unset;
|
||||
|
||||
&.empty-topic-display::placeholder {
|
||||
color: inherit;
|
||||
|
||||
@@ -813,6 +813,11 @@ input[type="checkbox"] {
|
||||
grid-template-columns: minmax(0, 1fr) 1.4285em; /* 20px at 14px em */
|
||||
align-items: center;
|
||||
width: var(--modal-input-width);
|
||||
|
||||
.flatpickr-wrapper {
|
||||
grid-column: datepicker-start / close-button-end;
|
||||
grid-row: close-button;
|
||||
}
|
||||
}
|
||||
|
||||
.control-label-disabled {
|
||||
@@ -1713,12 +1718,14 @@ label.preferences-radio-choice-label {
|
||||
#edit-user-form {
|
||||
.person_picker {
|
||||
/* Subtract (1px border and 2px of padding) on each side */
|
||||
min-width: calc(var(--modal-input-width) - 6px);
|
||||
width: calc(var(--modal-input-width) - 6px);
|
||||
max-width: calc(100% - 6px);
|
||||
}
|
||||
|
||||
& textarea {
|
||||
/* Subtract (1px border and 6px padding) on each side */
|
||||
width: calc(var(--modal-input-width) - 14px);
|
||||
max-width: calc(100% - 14px);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2109,12 +2116,6 @@ label.preferences-radio-choice-label {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#edit-user-form {
|
||||
.custom_user_field textarea {
|
||||
width: calc(100% - 25px);
|
||||
}
|
||||
}
|
||||
|
||||
.topic_date_updated {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -2861,17 +2861,17 @@ class ZulipSAMLIdentityProvider(SAMLIdentityProvider):
|
||||
result = super().get_user_details(attributes)
|
||||
|
||||
extra_attr_names = self.conf.get("extra_attrs", [])
|
||||
result["extra_attrs"] = {}
|
||||
extra_attrs = {}
|
||||
|
||||
if (groups_list := attributes.get("zulip_groups")) is not None:
|
||||
result["extra_attrs"]["zulip_groups"] = groups_list
|
||||
extra_attrs["zulip_groups"] = groups_list
|
||||
|
||||
for extra_attr_name in extra_attr_names:
|
||||
result["extra_attrs"][extra_attr_name] = self.get_attr(
|
||||
attributes=attributes, conf_key=None, default_attribute=extra_attr_name
|
||||
extra_attrs[extra_attr_name] = self.get_attr(
|
||||
attributes=attributes, conf_key="<extra>", default_attributes=(extra_attr_name,)
|
||||
)
|
||||
|
||||
return result
|
||||
return {**result, "extra_attrs": extra_attrs}
|
||||
|
||||
|
||||
class SAMLDocument:
|
||||
@@ -3062,11 +3062,18 @@ class SAMLAuthBackend(SocialAuthMixin, SAMLAuth):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@override
|
||||
def get_idp(self, idp_name: str) -> ZulipSAMLIdentityProvider:
|
||||
"""Given the name of an IdP, get a SAMLIdentityProvider instance.
|
||||
def get_idp(self, idp_name: str | None) -> ZulipSAMLIdentityProvider:
|
||||
"""Given the name of an IdP, get a SAMLIdentityProvider instance
|
||||
Forked to use our subclass of SAMLIdentityProvider for more flexibility."""
|
||||
idp_config = self.setting("ENABLED_IDPS")[idp_name]
|
||||
return ZulipSAMLIdentityProvider(idp_name, **idp_config)
|
||||
enabled_idps: dict[str, dict[str, str]] = self.setting("ENABLED_IDPS")
|
||||
if idp_name is None: # nocoverage
|
||||
# RelayState was missing, perhaps an IdP initiated flow
|
||||
if len(enabled_idps) != 1:
|
||||
raise AuthMissingParameter(self, "RelayState.idp")
|
||||
# Use the only configured IDP
|
||||
idp_name = next(iter(enabled_idps))
|
||||
idp_config = enabled_idps[idp_name]
|
||||
return ZulipSAMLIdentityProvider(self, idp_name, **idp_config)
|
||||
|
||||
@override
|
||||
def auth_url(self) -> str:
|
||||
@@ -3374,7 +3381,7 @@ class SAMLAuthBackend(SocialAuthMixin, SAMLAuth):
|
||||
# super().auth_complete expects to have RelayState set to the idp_name,
|
||||
# so we need to replace this param.
|
||||
post_params = self.strategy.request.POST.copy()
|
||||
post_params["RelayState"] = idp_name
|
||||
post_params["RelayState"] = orjson.dumps({"idp": idp_name}).decode()
|
||||
self.strategy.request.POST = post_params
|
||||
|
||||
# Call the auth_complete method of SocialAuthMixIn
|
||||
|
||||
Reference in New Issue
Block a user