From 40a022dcc3a4a3f747adf69a220d865960057d5f Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 12 Sep 2025 13:32:21 -0700 Subject: [PATCH] zephyr: Remove Zephyr mirroring support. Signed-off-by: Anders Kaseorg --- .../commands/populate_analytics_db.py | 8 +- corporate/urls.py | 3 - docs/THIRDPARTY | 4 - docs/production/security-model.md | 2 +- package.json | 2 - pnpm-lock.yaml | 16 -- puppet/kandra/files/krb5.conf | 100 -------- templates/corporate/zephyr-mirror.html | 99 -------- templates/corporate/zephyr.html | 79 ------- templates/zerver/app/index.html | 18 -- tools/lib/capitalization.py | 3 - tools/linter_lib/custom_check.py | 2 - tools/test-backend | 2 - version.py | 2 +- web/src/activity.ts | 8 - web/src/base_page_params.ts | 1 - web/src/buddy_data.ts | 6 +- web/src/compose_banner.ts | 1 - web/src/compose_validate.ts | 32 +-- web/src/filter.ts | 58 +---- web/src/gear_menu.ts | 61 ----- web/src/people.ts | 4 +- web/src/popover_menus_data.ts | 2 - web/src/stream_data.ts | 1 - web/src/stream_edit.ts | 4 - web/src/stream_settings_ui.ts | 30 +-- web/src/stream_ui_updates.ts | 2 +- web/src/sub_store.ts | 1 - web/src/user_group_edit.ts | 2 +- web/src/user_pill.ts | 4 +- .../navbar/navbar_gear_menu_popover.hbs | 10 +- .../stream_settings/stream_members.hbs | 2 - web/tests/activity.test.cjs | 4 - web/tests/buddy_data.test.cjs | 6 - web/tests/compose_pm_pill.test.cjs | 2 +- web/tests/compose_validate.test.cjs | 33 +-- web/tests/filter.test.cjs | 42 ---- web/tests/lib/compose_banner.cjs | 1 - web/tests/lib/example_realm.cjs | 1 - web/tests/lib/example_stream.cjs | 1 - web/tests/pill_typeahead.test.cjs | 1 - web/tests/typeahead_helper.test.cjs | 1 - zerver/actions/create_user.py | 5 +- zerver/actions/message_send.py | 71 ++---- zerver/actions/streams.py | 9 +- zerver/actions/users.py | 16 -- zerver/decorator.py | 2 +- zerver/forms.py | 18 -- zerver/lib/bulk_create.py | 7 +- zerver/lib/ccache.py | 216 ------------------ zerver/lib/events.py | 2 +- zerver/lib/exceptions.py | 5 - zerver/lib/home.py | 5 - zerver/lib/markdown/__init__.py | 32 --- zerver/lib/message.py | 4 +- zerver/lib/narrow.py | 88 ------- zerver/lib/presence.py | 2 +- zerver/lib/stream_traffic.py | 4 - zerver/lib/streams.py | 31 +-- zerver/lib/subscription_info.py | 4 +- zerver/lib/test_helpers.py | 15 -- zerver/lib/zephyr.py | 23 -- zerver/middleware.py | 2 - zerver/models/messages.py | 5 +- zerver/models/realms.py | 10 +- zerver/models/streams.py | 11 +- zerver/models/users.py | 11 +- zerver/openapi/zulip.yaml | 7 - zerver/tests/test_channel_access.py | 11 - zerver/tests/test_channel_creation.py | 39 ---- zerver/tests/test_channel_fetch.py | 45 ---- zerver/tests/test_decorators.py | 4 +- zerver/tests/test_external.py | 50 +--- zerver/tests/test_home.py | 2 - zerver/tests/test_invite.py | 2 +- zerver/tests/test_markdown.py | 28 --- zerver/tests/test_message_fetch.py | 134 ++--------- zerver/tests/test_message_send.py | 96 +------- zerver/tests/test_message_topics.py | 18 -- zerver/tests/test_middleware.py | 2 - zerver/tests/test_mirror_users.py | 29 +-- zerver/tests/test_presence.py | 48 +--- zerver/tests/test_signup.py | 19 +- zerver/tests/test_subs.py | 111 +-------- zerver/tests/test_zephyr.py | 108 --------- zerver/tornado/event_queue.py | 4 +- zerver/views/message_send.py | 32 +-- zerver/views/presence.py | 18 +- zerver/views/registration.py | 13 -- zerver/views/streams.py | 22 +- zerver/views/zephyr.py | 77 ------- zilencer/management/commands/populate_db.py | 4 +- zproject/default_settings.py | 4 - zproject/urls.py | 2 - 94 files changed, 121 insertions(+), 2067 deletions(-) delete mode 100644 puppet/kandra/files/krb5.conf delete mode 100644 templates/corporate/zephyr-mirror.html delete mode 100644 templates/corporate/zephyr.html delete mode 100644 zerver/lib/ccache.py delete mode 100644 zerver/lib/zephyr.py delete mode 100644 zerver/tests/test_zephyr.py delete mode 100644 zerver/views/zephyr.py diff --git a/analytics/management/commands/populate_analytics_db.py b/analytics/management/commands/populate_analytics_db.py index a77f269bf2..e4cce0550e 100644 --- a/analytics/management/commands/populate_analytics_db.py +++ b/analytics/management/commands/populate_analytics_db.py @@ -283,14 +283,14 @@ class Command(ZulipBaseCommand): react_native, created = Client.objects.get_or_create(name="ZulipMobile") flutter, created = Client.objects.get_or_create(name="ZulipFlutter") API, created = Client.objects.get_or_create(name="API: Python") - zephyr_mirror, created = Client.objects.get_or_create(name="zephyr_mirror") + irc_mirror, created = Client.objects.get_or_create(name="irc_mirror") unused, created = Client.objects.get_or_create(name="unused") long_webhook, created = Client.objects.get_or_create(name="ZulipLooooooooooongNameWebhook") stat = COUNT_STATS["messages_sent:client:day"] user_data = { website.id: self.generate_fixture_data(stat, 2, 1, 1.5, 0.6, 8), - zephyr_mirror.id: self.generate_fixture_data(stat, 0, 0.3, 1.5, 0.6, 8), + irc_mirror.id: self.generate_fixture_data(stat, 0, 0.3, 1.5, 0.6, 8), } insert_fixture_data(stat, user_data, UserCount) realm_data = { @@ -301,7 +301,7 @@ class Command(ZulipBaseCommand): react_native.id: self.generate_fixture_data(stat, 5, 5, 10, 0.6, 3), flutter.id: self.generate_fixture_data(stat, 5, 5, 10, 0.6, 3), API.id: self.generate_fixture_data(stat, 5, 5, 5, 0.6, 3), - zephyr_mirror.id: self.generate_fixture_data(stat, 1, 1, 3, 0.6, 3), + irc_mirror.id: self.generate_fixture_data(stat, 1, 1, 3, 0.6, 3), unused.id: self.generate_fixture_data(stat, 0, 0, 0, 0, 0), long_webhook.id: self.generate_fixture_data(stat, 5, 5, 2, 0.6, 3), } @@ -314,7 +314,7 @@ class Command(ZulipBaseCommand): flutter.id: self.generate_fixture_data(stat, 5, 5, 10, 0.6, 3), react_native.id: self.generate_fixture_data(stat, 5, 5, 10, 0.6, 3), API.id: self.generate_fixture_data(stat, 50, 50, 5, 0.6, 3), - zephyr_mirror.id: self.generate_fixture_data(stat, 10, 10, 3, 0.6, 3), + irc_mirror.id: self.generate_fixture_data(stat, 10, 10, 3, 0.6, 3), unused.id: self.generate_fixture_data(stat, 0, 0, 0, 0, 0), long_webhook.id: self.generate_fixture_data(stat, 50, 50, 2, 0.6, 3), } diff --git a/corporate/urls.py b/corporate/urls.py index ab67995647..05a70c3c9a 100644 --- a/corporate/urls.py +++ b/corporate/urls.py @@ -91,9 +91,6 @@ from zerver.lib.rest import rest_path from zerver.lib.url_redirects import LANDING_PAGE_REDIRECTS i18n_urlpatterns: Any = [ - # Zephyr/MIT - path("zephyr/", TemplateView.as_view(template_name="corporate/zephyr.html")), - path("zephyr-mirror/", TemplateView.as_view(template_name="corporate/zephyr-mirror.html")), path("jobs/", TemplateView.as_view(template_name="corporate/jobs.html")), # Billing path("billing/", billing_page, name="billing_page"), diff --git a/docs/THIRDPARTY b/docs/THIRDPARTY index 6f709f01ea..89dea58a87 100644 --- a/docs/THIRDPARTY +++ b/docs/THIRDPARTY @@ -697,10 +697,6 @@ Files: zerver/decorator.py zerver/management/commands/runtornado.py scripts/setu Copyright: Django Software Foundation and individual contributors License: BSD-3-Clause -Files: zerver/lib/ccache.py -Copyright: 2013 David Benjamin and Alan Huang -License: Expat - Files: zerver/lib/markdown/fenced_code.py Copyright: 2006-2008 Waylan Limberg License: BSD-3-Clause diff --git a/docs/production/security-model.md b/docs/production/security-model.md index b0fb667d1d..9da9b653d0 100644 --- a/docs/production/security-model.md +++ b/docs/production/security-model.md @@ -195,7 +195,7 @@ strength allowed is controlled by two settings in - Bots with the `can_forge_sender` permission can send messages that appear to have been sent by another user. They also have the ability to see the names of all channels, including private channels. This is important for implementing - integrations like the Jabber, IRC, and Zephyr mirrors. + integrations like the Jabber and IRC mirrors. These bots cannot be created by Zulip users, including organization owners. They can only be created on the command diff --git a/package.json b/package.json index ab6a4bd2b8..f5629478d4 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,6 @@ "webpack": "^5.61.0", "webpack-bundle-tracker": "^3.0.1", "webpack-cli": "^6.0.1", - "winchan": "^0.2.1", "zod": "^4.1.5" }, "devDependencies": { @@ -125,7 +124,6 @@ "@types/throttle-debounce": "^5.0.2", "@types/tinycolor2": "^1.4.5", "@types/turndown": "^5.0.1", - "@types/winchan": "^0.2.0", "@typescript-eslint/eslint-plugin": "^8.2.0", "@typescript-eslint/parser": "^8.2.0", "@typescript-eslint/utils": "^8.25.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ebd856bcc6..b3a98ed4bd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -296,9 +296,6 @@ importers: webpack-cli: specifier: ^6.0.1 version: 6.0.1(webpack-dev-server@5.2.2)(webpack@5.101.3) - winchan: - specifier: ^0.2.1 - version: 0.2.2 zod: specifier: ^4.1.5 version: 4.1.5 @@ -396,9 +393,6 @@ importers: '@types/turndown': specifier: ^5.0.1 version: 5.0.5 - '@types/winchan': - specifier: ^0.2.0 - version: 0.2.0 '@typescript-eslint/eslint-plugin': specifier: ^8.2.0 version: 8.42.0(@typescript-eslint/parser@8.42.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2) @@ -2822,9 +2816,6 @@ packages: '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} - '@types/winchan@0.2.0': - resolution: {integrity: sha512-1NyyjFkmpFf9T5hpyB1KgS4kljPwy45nxaq/I6CndEU2kw6BpxzFIAa0SXs620EtnEsvkFljquX+yRdlLxqDkA==} - '@types/ws@8.18.1': resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} @@ -9737,9 +9728,6 @@ packages: wildcard@2.0.1: resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} - winchan@0.2.2: - resolution: {integrity: sha512-pvN+IFAbRP74n/6mc6phNyCH8oVkzXsto4KCHPJ2AScniAnA1AmeLI03I2BzjePpaClGSI4GUMowzsD3qz5PRQ==} - winston-transport@4.9.0: resolution: {integrity: sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==} engines: {node: '>= 12.0.0'} @@ -12415,8 +12403,6 @@ snapshots: '@types/unist@3.0.3': {} - '@types/winchan@0.2.0': {} - '@types/ws@8.18.1': dependencies: '@types/node': 22.18.1 @@ -21364,8 +21350,6 @@ snapshots: wildcard@2.0.1: {} - winchan@0.2.2: {} - winston-transport@4.9.0: dependencies: logform: 2.7.0 diff --git a/puppet/kandra/files/krb5.conf b/puppet/kandra/files/krb5.conf deleted file mode 100644 index b3fd7a251d..0000000000 --- a/puppet/kandra/files/krb5.conf +++ /dev/null @@ -1,100 +0,0 @@ -[libdefaults] - default_realm = ATHENA.MIT.EDU - -# The following krb5.conf variables are only for MIT Kerberos. - kdc_timesync = 1 - ccache_type = 4 - forwardable = true - proxiable = true - -# The following encryption type specification will be used by MIT Kerberos -# if uncommented. In general, the defaults in the MIT Kerberos code are -# correct and overriding these specifications only serves to disable new -# encryption types as they are added, creating interoperability problems. -# -# The only time when you might need to uncomment these lines and change -# the enctypes is if you have local software that will break on ticket -# caches containing ticket encryption types it doesn't know about (such as -# old versions of Sun Java). - -# default_tgs_enctypes = des3-hmac-sha1 -# default_tkt_enctypes = des3-hmac-sha1 -# permitted_enctypes = des3-hmac-sha1 - -# The following libdefaults parameters are only for Heimdal Kerberos. - fcc-mit-ticketflags = true - -[realms] - ATHENA.MIT.EDU = { - kdc = kerberos.mit.edu - kdc = kerberos-1.mit.edu - kdc = kerberos-2.mit.edu - admin_server = kerberos.mit.edu - master_kdc = kerberos.mit.edu - } - CSAIL.MIT.EDU = { - kdc = kerberos-1.csail.mit.edu - kdc = kerberos-2.csail.mit.edu - admin_server = kerberos.csail.mit.edu - } - ZONE.MIT.EDU = { - kdc = casio.mit.edu - kdc = seiko.mit.edu - admin_server = casio.mit.edu - } - IHTFP.ORG = { - kdc = kerberos.ihtfp.org - admin_server = kerberos.ihtfp.org - } - 1TS.ORG = { - kdc = kerberos.1ts.org - admin_server = kerberos.1ts.org - } - ANDREW.CMU.EDU = { - admin_server = kerberos.andrew.cmu.edu - default_domain = andrew.cmu.edu - } - CS.CMU.EDU = { - kdc = kerberos-1.srv.cs.cmu.edu - kdc = kerberos-2.srv.cs.cmu.edu - kdc = kerberos-3.srv.cs.cmu.edu - admin_server = kerberos.cs.cmu.edu - } - DEMENTIA.ORG = { - kdc = kerberos.dementix.org - kdc = kerberos2.dementix.org - admin_server = kerberos.dementix.org - } - stanford.edu = { - kdc = krb5auth1.stanford.edu - kdc = krb5auth2.stanford.edu - kdc = krb5auth3.stanford.edu - master_kdc = krb5auth1.stanford.edu - admin_server = krb5-admin.stanford.edu - default_domain = stanford.edu - } - UTORONTO.CA = { - kdc = kerberos1.utoronto.ca - kdc = kerberos2.utoronto.ca - kdc = kerberos3.utoronto.ca - admin_server = kerberos1.utoronto.ca - default_domain = utoronto.ca - } - -[domain_realm] - .exchange.mit.edu = EXCHANGE.MIT.EDU - exchange.mit.edu = EXCHANGE.MIT.EDU - .mit.edu = ATHENA.MIT.EDU - mit.edu = ATHENA.MIT.EDU - .win.mit.edu = WIN.MIT.EDU - win.mit.edu = WIN.MIT.EDU - .csail.mit.edu = CSAIL.MIT.EDU - csail.mit.edu = CSAIL.MIT.EDU - .media.mit.edu = MEDIA-LAB.MIT.EDU - media.mit.edu = MEDIA-LAB.MIT.EDU - .whoi.edu = ATHENA.MIT.EDU - whoi.edu = ATHENA.MIT.EDU - .stanford.edu = stanford.edu - .slac.stanford.edu = SLAC.STANFORD.EDU - .toronto.edu = UTORONTO.CA - .utoronto.ca = UTORONTO.CA diff --git a/templates/corporate/zephyr-mirror.html b/templates/corporate/zephyr-mirror.html deleted file mode 100644 index 6223bcf3aa..0000000000 --- a/templates/corporate/zephyr-mirror.html +++ /dev/null @@ -1,99 +0,0 @@ -{% extends "zerver/portico.html" %} - -{% block title %} -Zephyr mirroring information | Zulip -{% endblock %} - -{# Zephyr mirroring information page #} - -{% block portico_content %} -

The Zephyr mirror script (not recommended)

- -

- Webathena is the easiest way to use Zulip. With Webathena, you don't need - to run any software in a screen session. Your Athena password never leaves - your computer and the only access that any Zulip computer ever receives is the - ability to send/receive zephyrs as you. -

- -

- We recommend that you use Webathena instead of following these instructions. - Please only follow these instructions if you know that you want to run the zephyr - mirror script instead of using Webathena. -

- -

Running the Zephyr mirror script

- -

- On an Athena dialup - (linerva.mit.edu, - athena.dialup.mit.edu, - etc.), run the Zephyr mirroring script inside a screen - session. -

- -

- IMPORTANT: You must keep the Zephyr mirroring script - always running in a session with unexpired Kerberos - tickets. The script forwards personals you receive on - Zephyr to Zulip, and forwards messages you send in Zulip to - Zephyr. If it is not running, only other Zulip users - will receive messages you send from Zulip! The Zulip - web application will warn you if the Zephyr mirroring script is - not running. -

- -

- If you already have BarnOwl running in screen/tmux somewhere, - you can just run: -

- -

/mit/tabbott/zulip/zephyr_mirror.py

- -

inside that screen session.

- -

Mirroring without a BarnOwl session

- -

- If you are not already running a screen/tmux for BarnOwl, you - can set up a screen session to run the Zephyr mirroring script by - running the following on a dialup such - as linerva.mit.edu: -

- -
    -
  1. kinit -l7d && aklog
  2. -
  3. (Type your password to create 7-day renewable Kerberos tickets)
  4. -
  5. - env ZEPHYR_SCREEN_CLIENT=/mit/tabbott/zulip/zephyr_mirror.py - SCREEN_SESSION_NAME=zulip athrun kchen owl-screen - -
  6. -
- -

- This will run the Zephyr mirroring script inside a screen - session, and use `/mit/kchen/bin/cont-renew-notify` to continually - renew your Kerberos tickets for up to a week; each week, it will - send you a Zephyr/Zulip letting you know that you need to renew - your tickets. To do so, log in to the server that you set up the - screen session on and use the following procedure: -

- -
    -
  1. - Run screen -x zulip to connect to the mirroring - screen session created above. -
  2. -
  3. The first time, you'll need to type Ctrl-A c to switch to a new terminal in your screen session.
  4. -
  5. kinit -l7d && aklog
  6. -
  7. (Type your password to renew your Kerberos tickets).
  8. -
- -

- Don't run multiple copies of the Zephyr mirroring script; - doing so will result in messages you sent being forwarded to - Zephyr twice. -

- -{% endblock %} diff --git a/templates/corporate/zephyr.html b/templates/corporate/zephyr.html deleted file mode 100644 index 62ab9910e6..0000000000 --- a/templates/corporate/zephyr.html +++ /dev/null @@ -1,79 +0,0 @@ -{% extends "zerver/portico.html" %} -{% set entrypoint = "landing-page" %} - -{% block title %} -Zephyr for MIT | Zulip -{% endblock %} - -{% block customhead %} - -{% endblock %} - -{% block portico_content %} - -{% include 'zerver/landing_nav.html' %} -
-
-

Zulip for MIT Zephyr

-
-
-
-
-

If you have an MIT Athena account, you can start using Zulip for Zephyr in a couple of minutes.

- -

First time setup

-
    -
  1. Activate your account here: https://zephyr.zulipchat.com/register/

  2. -
  3. Log in to Zulip here: https://zephyr.zulipchat.com

  4. -
  5. Follow the on-screen instructions for linking Zulip with Webathena

  6. -
  7. (Optional) Get the Zulip desktop and/or mobile apps here: https://zephyr.zulipchat.com/apps/

  8. -
- -

You're done!

-

If you have any questions, please e-mail us at {{ support_email }}

- -

If you want to automatically transfer your existing Zephyr subscriptions

- -
    -
  1. -

    - Get your Zulip API key from the Zulip "Settings" panel and put it in a file in your - Athena home directory called ~/Private/.zulip-api-key. -

    -
  2. - -
  3. -

    - Run the following command to copy over all of your subscriptions:
    - /mit/tabbott/zulip/zephyr_mirror.py --sync-subscriptions -

    - -

    - NOTE: Zulip supports several ways to control what messages you want to read - right now, but Zulip does not yet have a direct equivalent to BarnOwl filters. - If you have more subscriptions than you generally read, we recommend that you use - Zulip's "Mute" option to hide those subscriptions from your - home view that you less commonly read. You can still easily access those channels - from Zulip when you want to read them. You can control your subscriptions - and what's in your home view by clicking the gear in the upper right-hand corner - and then selecting "Channels". -

    -
  4. -
- -

If you subscribe to any encrypted Zephyr classes

- -

- You can get set up to participate on an encrypted Zephyr class using Zulip by either: -

- -
    -
  1. E-mailing us at {{ support_email }} to get set up, or

  2. -
  3. Someone who is already set up to participate on that encrypted Zephyr class using Zulip can use Zulip to invite you

  4. -
-
-
-
-
- -{% endblock %} diff --git a/templates/zerver/app/index.html b/templates/zerver/app/index.html index fc9f4210bf..e6a8295b1e 100644 --- a/templates/zerver/app/index.html +++ b/templates/zerver/app/index.html @@ -170,24 +170,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1943053 -->