Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

templates: Clean up zephyr-mirror.html.

Steve Howell2134a268734b
diff --git a/templates/corporate/zephyr-mirror.html b/templates/corporate/zephyr-mirror.html
index de2c445cd95..07095e6b440 100644
--- a/templates/corporate/zephyr-mirror.html
+++ b/templates/corporate/zephyr-mirror.html
@@ -5,30 +5,45 @@
{% block portico_content %}
<h1 style="margin-top:30px;">The Zephyr mirror script (not recommended)</h1>
-<p>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.</p>
-
-<p>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.</p>
-
-<h3 id="mirror">Running the Zephyr mirror script</h3>
- <p>On an Athena dialup
- (<a href="https://linerva.mit.edu">linerva.mit.edu</a>,
- <a href="https://athena.dialup.mit.edu">athena.dialup.mit.edu</a>,
- etc.), run the Zephyr mirroring script inside a screen
- session.</p>
-
- <p><strong>IMPORTANT: You must keep the Zephyr mirroring script
- always running in a session with unexpired Kerberos
- tickets.</strong> The script forwards personals you receive on
- Zephyr to Zulip, and forwards messages you send in Zulip to
- Zephyr. <strong>If it is not running, only other Zulip users
- will receive messages you send from Zulip!</strong>. The Zulip
- web application will warn you if the Zephyr mirroring script is
- not running.</p>
+ <p>
+ 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.
+ </p>
+
+ <p>
+ 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.
+ </p>
+
+ <h3 id="mirror">Running the Zephyr mirror script</h3>
+
+ <p>
+ On an Athena dialup
+ (<a href="https://linerva.mit.edu">linerva.mit.edu</a>,
+ <a href="https://athena.dialup.mit.edu">athena.dialup.mit.edu</a>,
+ etc.), run the Zephyr mirroring script inside a screen
+ session.
+ </p>
+
+ <p>
+ <strong>
+ IMPORTANT: You must keep the Zephyr mirroring script
+ always running in a session with unexpired Kerberos
+ tickets.
+ </strong>
+ The script forwards personals you receive on
+ Zephyr to Zulip, and forwards messages you send in Zulip to
+ Zephyr.
+ <strong>
+ If it is not running, only other Zulip users
+ will receive messages you send from Zulip!
+ </strong>.
+ The Zulip web application will warn you if the Zephyr
+ mirroring script is not running.
+ </p>
<p>If you already have BarnOwl running in screen/tmux somewhere,
you can just run:</p>
@@ -39,36 +54,46 @@ mirror script instead of using Webathena.</p>
<h4>Mirroring without a BarnOwl session</h4>
- <p>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 <a href="https://linerva.mit.edu">linerva.mit.edu</a>:</p>
+ <p>
+ 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 <a href="https://linerva.mit.edu">linerva.mit.edu</a>:
+ </p>
- <ol>
- <li><code>kinit -l7d && aklog</code></li>
- <li>(Type your password to create 7-day renewable Kerberos tickets)</li>
- <li><code>env ZEPHYR_SCREEN_CLIENT=/mit/tabbott/zulip/zephyr_mirror.py
+ <ol>
+ <li><code>kinit -l7d && aklog</code></li>
+ <li>(Type your password to create 7-day renewable Kerberos tickets)</li>
+ <li>
+ <code>env ZEPHYR_SCREEN_CLIENT=/mit/tabbott/zulip/zephyr_mirror.py
SCREEN_SESSION_NAME=zulip athrun kchen owl-screen
- </code></li>
+ </code>
+ </li>
</ol>
- <p>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:</p>
+ <p>
+ 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:
+ </p>
<ol>
- <li>Run <code>screen -x zulip</code> to connect to the mirroring
- screen session created above.</li>
- <li>The first time, you'll need to type <code>Ctrl-A c</code> to switch to a new terminal in your screen session.</li>
- <li><code>kinit -l7d && aklog</code></li>
- <li>(Type type your password to renew your Kerberos tickets).</li>
+ <li>
+ Run <code>screen -x zulip</code> to connect to the mirroring
+ screen session created above.
+ </li>
+ <li>The first time, you'll need to type <code>Ctrl-A c</code> to switch to a new terminal in your screen session.</li>
+ <li><code>kinit -l7d && aklog</code></li>
+ <li>(Type type your password to renew your Kerberos tickets).</li>
</ol>
- <p>Don't run multiple copies of the Zephyr mirroring script;
- doing so will result in messages you sent being forwarded to
- Zephyr twice.</p>
+ <p>
+ Don't run multiple copies of the Zephyr mirroring script;
+ doing so will result in messages you sent being forwarded to
+ Zephyr twice.
+ </p>
{% endblock %}
diff --git a/tools/check-templates b/tools/check-templates
index d3809a14171..e8e985da85b 100755
--- a/tools/check-templates
+++ b/tools/check-templates
@@ -115,30 +115,11 @@ def check_html_templates(templates: Iterable[str], all_dups: bool, fix: bool) ->
sys.exit(1)
for fn in templates:
- # Many of our Django templates have strange indentation. The
- # indentation errors are often harmless, even stylistically
- # harmless, but they tend to be in files that might be old
- # and might eventually require more scrutiny for things like
- # localization. See GitHub #1236.
- bad_files = [
- # These use various whitespace-dependent formatting that
- # prevent cleaning them.
- "templates/corporate/zephyr-mirror.html",
- ]
- validate(fn=fn, check_indent=(fn not in bad_files))
-
- # Ignore these files since these have not been cleaned yet :/
- IGNORE_FILES = [
- # zephyr-mirror.html has some whitespace-dependent formatting
- # for code blocks that prevent cleaning it. Might make sense
- # to convert it to a /help/ Markdown article.
- "templates/corporate/zephyr-mirror.html",
- ]
- # TODO: Clean these files
+ validate(fn)
+
for fn in templates:
- if fn not in IGNORE_FILES:
- if not validate_indent_html(fn, fix):
- sys.exit(1)
+ if not validate_indent_html(fn, fix):
+ sys.exit(1)
def check_handlebar_templates(templates: Iterable[str], fix: bool) -> None:
@@ -146,7 +127,7 @@ def check_handlebar_templates(templates: Iterable[str], fix: bool) -> None:
templates = [fn for fn in templates if fn.endswith(".hbs")]
for fn in templates:
- validate(fn=fn, check_indent=True)
+ validate(fn)
for fn in templates:
if not validate_indent_html(fn, fix):
diff --git a/tools/lib/template_parser.py b/tools/lib/template_parser.py
index c829f3ceb4a..f5e9692c114 100644
--- a/tools/lib/template_parser.py
+++ b/tools/lib/template_parser.py
@@ -242,9 +242,7 @@ def indent_level(s: str) -> int:
return len(s) - len(s.lstrip())
-def validate(
- fn: Optional[str] = None, text: Optional[str] = None, check_indent: bool = True
-) -> None:
+def validate(fn: Optional[str] = None, text: Optional[str] = None) -> None:
assert fn or text
if fn is None:
@@ -318,7 +316,7 @@ def validate(
elif start_tag != end_tag:
problem = "Mismatched tag."
- if not problem and check_indent and (end_line > start_line + max_lines):
+ if not problem and (end_line > start_line + max_lines):
if end_col != start_col:
problem = "Bad indentation."
diff --git a/tools/tests/test_template_parser.py b/tools/tests/test_template_parser.py
index 09acbd68f39..11b7c89d472 100644
--- a/tools/tests/test_template_parser.py
+++ b/tools/tests/test_template_parser.py
@@ -20,10 +20,9 @@ class ParserTest(unittest.TestCase):
error: str,
fn: Optional[str] = None,
text: Optional[str] = None,
- check_indent: bool = True,
) -> None:
with self.assertRaisesRegex(TemplateParserException, error):
- validate(fn=fn, text=text, check_indent=check_indent)
+ validate(fn=fn, text=text)
def test_is_django_block_tag(self) -> None:
self.assertTrue(is_django_block_tag("block"))
@@ -93,7 +92,7 @@ class ParserTest(unittest.TestCase):
foo
</p>
"""
- self._assert_validate_error("Bad indentation.", text=my_html, check_indent=True)
+ self._assert_validate_error("Bad indentation.", text=my_html)
def test_validate_state_depth(self) -> None:
my_html = """