Commit Graph

79 Commits

Author SHA1 Message Date
Jacob Hurwitz eb1843fd37 [zephyr_mirror] add support for zcrypt'ed classes with colons
The regex used for parsing .crypt-table didn't allow colons in class
names. This commit changes the [^:] token with \S, meaning that class
names can now contain colons but can no longer contain whitespace.

I think this should be fine, since zcrypt is only used for MIT zephyr,
where (by convention) class names do not contain whitespace.

Additionally, it should not be possible for us to accidentally consume a
field-separating colon as part of the class capture group because the
regex enforces that all field-separating colons are followed by one or
more whitespace characters, whereas the class name cannot contain
whitespace.
2017-03-19 22:30:21 -07:00
Tim Abbott 9866124b78 mypy: Fix some new errors flagged by latest mypy master.
Mostly list -> List bugs in annotations.
2017-03-19 21:03:45 -07:00
Raghav Jajodia a3a03bd6a5 mypy: Added Dict, List and Set imports.
Fixed mypy errors associated with the upgrade.
2017-03-04 14:33:44 -08:00
Rishi Gupta 0218422e96 Use time.time() instead of datetime.now() to measure elapsed time.
Both because it is more idiomatic and because we will soon start enforcing
that all datetimes in Zulip are timezone aware.
2017-03-01 22:54:28 -08:00
Tim Abbott 22d1aa396b lint: Clean up W503 PEP-8 warning. 2017-01-23 20:50:04 -08:00
JefftheBest1 ff8639f9db Fixed typos with threshold. 2017-01-12 04:50:20 -08:00
Tommy Ip 011eac1d92 bots: Fix bare except clause. 2017-01-09 00:39:33 +00:00
reallyly 94b28e0afb pep8: Fix E128 violations.
With some line-wrapping tweaks by tabbott.
2016-12-13 10:50:14 -08:00
anirudhjain75 4bb6735e77 Annotate zephyr_mirror_backend.py.
With some tweaks by tabbott to update tuple->Tuple and update comments.
2016-12-07 15:57:55 -08:00
nikolay abc2ff4a06 pep8: Fix many rule E128 violations.
[Tweaked by tabbott to adjust some approaches used in wrapping]
2016-12-03 13:33:31 -08:00
bulat22101 a6f91064a2 pep8: Fix E129 violations 2016-12-03 10:56:36 -08:00
AZtheAsian 62494eeb97 pep8: fix E201 violations 2016-12-01 23:06:02 -08:00
AZtheAsian 7e14fe65ab pep8: fix E202 violations 2016-12-01 23:06:02 -08:00
AZtheAsian 1ba150fa85 pep8: Fix E203 violations 2016-12-01 20:37:57 -08:00
Bickio 6b0df43463 pep8: Fix E125. 2016-11-30 20:03:29 -08:00
Tim Abbott 2e2dee3396 lint: Ban lines longer than 140 characters without #ignorelongline. 2016-08-19 12:03:09 -07:00
Tim Abbott f999f63999 zephyr_mirror_backend: Update support email address.
Arguably we should figure out a way to make this fetch the support
email from the server (or something), but in the short term it seems
worth making the email address at least correct.
2016-08-17 22:39:08 -07:00
Eklavya Sharma 149938d468 Change shebangs from python2.7 to python. 2016-05-29 05:03:08 -07:00
Tim Abbott a1b306f9ce Finish purging 'fromt typing import *' from Zulip codebase. 2016-04-07 14:11:21 -07:00
Tim Abbott b437fe2924 Add PEP-484 annotations to bots/. 2016-04-03 15:40:23 -07:00
Eklavya Sharma 9e3c3e14f5 Partially apply Python 3 libmodernize.fixes.fix_dict_six.
Refer to #256
2016-03-19 15:52:58 -07:00
Tim Abbott 700055c194 Apply modernize transform libmodernize.fixes.fix_file.
This replaces use of file() with open() which is python 3 compatible,
and also adds it to our python 3 support test suite.
2016-01-26 21:09:42 -08:00
Tim Abbott f6f8f1fe36 Use new-style classes consistently for Python 3 support.
Also add the fixer for this to our list of fixers we check.
2015-11-04 08:01:52 -08:00
Tim Abbott f7878a61e1 Apply Python 3 futurize transform libmodernize.fixes.fix_xrange_six. 2015-11-01 09:35:06 -08:00
Tim Abbott cd6f8e9191 Apply Python 3 futurize transform libmodernize.fixes.fix_map. 2015-11-01 09:35:05 -08:00
Steven Oud d5435fad1d Consistently use /usr/bin/env python2.7 in shebangs and commands. 2015-10-21 22:58:21 +00:00
Tim Abbott 80a8725a03 Remove certain hardcoded email addresses in Zephyr mirroring.
(imported from commit 9fd492b5463f04741558687f27522d48a5dc795b)
2015-09-20 00:36:12 -07:00
Zev Benjamin b5f7ed037c zephyr_mirror: Specify a z_charset of utf-8
andersk reports that we are "incorrectly sending outgoing zephyrs with z_charset
= ZCHARSET_ISO_8859_1, which breaks zwgc (other clients tend to ignore
z_charset). I'm assuming you're shelling out to zwrite; you need to use zwrite
-x UTF-8, or export LC_ALL=en_US.UTF-8."

(imported from commit 8abb28bf8acbe0b5aa99ca13faab24e1e554a031)
2014-05-20 17:29:29 -07:00
Zev Benjamin 7ed182c08f Move backoff classes to the Zulip API
(imported from commit 76c5d499874f0397c505ab3fcda631a1a46847b6)
2014-04-23 11:31:03 -07:00
Zev Benjamin bf17ea0ee4 zephyr_mirror: Fix comment
(imported from commit aed76ecc3b4fd8bb01c299169a8e4eefd35f7cd8)
2014-03-03 17:29:53 -05:00
Tim Abbott 2bc4e14a72 zephyr_mirror: Update maximum length of stream names when syncing.
(imported from commit 6ab7f5ae47c9dfe9edf411e73ac9e5ab22d375a7)
2013-11-12 09:38:43 -05:00
Zev Benjamin 16a8bce60c Remove redundant return statement
(imported from commit eac3298f3004d2dd519c5444755e729111d13482)
2013-10-22 13:19:00 -04:00
Zev Benjamin b961c16265 zephyr_mirror: Make outgoing zephyrs to ctl instead go to golem
This makes zulips to ctl@mit.edu cause the mirroring system to zephyr
golem@mit.edu.

(imported from commit 9059a92ba51fa87e45feae2f0d5549b36b048e8b)
2013-10-17 23:20:57 -04:00
Zev Benjamin 630ce40e29 zephyr_mirror: Hack to let golem receive mirrored personals
(imported from commit 68539e45dbdfd70a037405dd2760474bf46dff76)
2013-10-11 17:50:19 -04:00
Tim Abbott e11ae77ba6 [manual] Rename /home/humbug to /home/zulip.
This may require just doing an mv on the home directory, plus changing
the home directory in /etc/passwd.  It should of course be done carefully.

(imported from commit 660997d897ee6d33563af74f0fc5d4267a911755)
2013-10-08 08:57:29 -04:00
Tim Abbott 2fab8ab8f5 Write zephyr mirroring logs to /var/log/zulip rather than ~/.
(imported from commit 7b76fa7834fb82fe3967f9e5ef963f26b7ff7184)
2013-09-25 16:52:41 -04:00
Tim Abbott d38b8364a8 zephyr_mirror: Clear all notices from the queue before selecting.
We were having problems where we were suspiciously processing notices
at a rate of 1 notice per 15s, which suggests that we the select was
timing out even though there were notices to be fetched immediately.
We fix this by clearing the queue each time our select loop ends.

(imported from commit 7e7bfbb2126d1f4170d65d1483a0b799dcab80b9)
2013-09-25 15:40:21 -04:00
Tim Abbott 371654adb3 zephyr_mirror: Make Webathena work for golem.
(imported from commit 6f8bf1f44c521b22c9fc990711d2821e5a60761d)
2013-08-28 18:56:54 -04:00
Zev Benjamin 724ce3744c zephyr_mirror: Tweak error text
(imported from commit 7bb9d42a261e08d3abe5d80b9ba2e88f1d0b03bf)
2013-08-28 10:41:53 -04:00
Tim Abbott 77dbbe7f23 zephyr_mirror: Require zcrypt when mirroring to invite-only streams.
(imported from commit 1b88a8fc9bc26f2f9b1bb3f037093f85255feb17)
2013-08-27 18:26:12 -04:00
Tim Abbott 314d0fc053 zephyr_mirror: Subscribe to mail zephyrs even if we're not using them.
This should enabled us, in the future, to enable support for mail
zephyrs without requiring users to re-auth.

(imported from commit 2665743212da567fe85742d30cca42b902e41a0d)
2013-08-27 16:21:41 -04:00
Tim Abbott 6707ed4270 zephyr_mirror: Rename confusing log path variables.
(imported from commit a120f653c1b9283b91f339cccea52bd5ad89b69f)
2013-08-27 14:21:26 -04:00
Tim Abbott 7014a661d2 zmirror: Add monitoring for personals mirrors.
(imported from commit acb7f2222076d2f3884a2e52c7032cb48fde1757)
2013-08-26 18:17:26 -04:00
Tim Abbott 732de3faf1 zephyr_mirror: Ignore expired Kerberos tickets for personals mirror.
(imported from commit 094755feacd299255f078432465f11a609df9aef)
2013-08-26 18:17:26 -04:00
Tim Abbott af372b2401 zephyr_mirror: Allow running multiple zephyr mirroring scripts under one user.
(imported from commit ecec50ee0e51736487358ef9f5847000d35f327a)
2013-08-26 18:17:26 -04:00
Tim Abbott d584629971 zephyr_mirror: Add options to save/restore sessions.
The davidben-patched-for-roost Zephyr branch (available at
https://github.com/davidben/zephyr/tree/roost) adds Zephyr support for
these options.  We also patch python-zephyr to expose them.  These
basically let you save your Zephyr tickets and port number to a file,
so that you can later restore them (even potentially after the machine
rebooted).  Basically because Zephyr is UDP, the Zephyr server will
continue trying to deliver messages to a particular port number that
was registered for up to 20 minutes after getting an error; so we can
even have downtime and reboot and still get our packets so long as we
restore the sessions within 20 minutes.

(imported from commit 986cbb157ddfa57aa4b644cd826f8418e9876dc7)
2013-08-26 18:17:25 -04:00
Tim Abbott 0a0cb9e70e zephyr_mirror: Finish outgoing zcrypt.
(imported from commit dfef23feb8e0f6a0a8ba775b6cccd391cb307adb)
2013-08-22 12:29:04 -04:00
Tim Abbott 6253483003 zephyr_mirror: Send outgoing messages encrypted when zcrypt would.
Our .crypt-table parsing code isn't quite correct, in that we don't
handle either the "zcrypt default" or "zcrypt by class/instance" pair
options (for sending messages in either direction) -- you have to be
zcrypting for an entire class.  I think this makes sense given that on
the Zulip end we can only enforce anything on a stream level.

(imported from commit a7901b1dc025a04a23ee71ecdd499e3f150ba614)
2013-08-20 17:09:09 -04:00
Tim Abbott 605171d1da zephyr_mirror: Renew kerberos tickets when starting up class mirror.
(imported from commit 34b0a78558c6f20043efe986a16064387f36f1c0)
2013-08-20 15:27:24 -04:00
Tim Abbott b4adabfaf0 zephyr_mirror: Auto-detect Python version for pyzephyr path.
(imported from commit e2aca3a08f8aa12b43d71acffcc0e2249feb7ca7)
2013-08-20 15:27:23 -04:00