Tim Abbott
e182bfcb98
zephyr_mirror: Don't try subscribing to an empty stream list.
...
(imported from commit c8155459b768dd1fc192246c1f584abb30a7bc02)
2012-11-14 15:03:49 -05:00
Tim Abbott
1a5f0648c5
zephyr_mirror: Don't send fullname data to server.
...
(imported from commit 743d0109f422fea5c4642e83448cd179f4e60827)
2012-11-14 15:03:49 -05:00
Zev Benjamin
1a4f97a874
zephyr_mirror: forward messages in test mode if the site is not the default one
...
(imported from commit 7d504a6d555866f12f1657b522b4e6eb380c64a3)
2012-11-13 20:22:37 -05:00
Zev Benjamin
73daa73887
Unify huddles and personals into private messages on the send path
...
Personals are now just private messages between two people (which
sometimes manifests as a private message with one recipient). The
new message type on the send path is 'private'. Note that the receive
path still has 'personal' and 'huddle' message types.
(imported from commit 97a438ef5c0b3db4eb3e6db674ea38a081265dd3)
2012-11-13 15:40:53 -05:00
Zev Benjamin
8a76560970
Use a JSON array for recipients in send_message
...
(imported from commit e2184f92b708cc2e8ef3e9ae79ee4241c0aa12a1)
2012-11-13 15:40:53 -05:00
Tim Abbott
4c2d56c10b
zephyr_mirror: Extend logging on subscribe failures.
...
(imported from commit ce54549a74935bb95cb68dd1e6db2a3eec6166c5)
2012-11-13 12:47:59 -05:00
Tim Abbott
dd07236eec
zephyr_mirror: Tweak linewrapping algorithm.
...
(imported from commit 1165a7680251f6bb365f44a60612fffe0fbbae42)
2012-11-13 12:43:37 -05:00
Tim Abbott
defaeb935e
zephyr_mirror: Use python logging module.
...
(imported from commit 3cd9506d46eb56fbd5a48c789160a45846332633)
2012-11-13 12:43:14 -05:00
Tim Abbott
c38587191e
zephyr_mirror: Support whitespace-only zephyr instances.
...
Previously messages sent to zephyr instance " " wouldn't be forwarded
zephyr=>humbug because the target instance is the null instance; I
learned this when we got a few tracebacks in the zephyr_mirror log, so
clearly this does happen.
(imported from commit 08bd7470e75ac6af24ac83696b6cf68d70654664)
2012-11-09 17:32:15 -05:00
Tim Abbott
2735c8410e
zephyr_mirror: Catch IOError from zephyr.init().
...
(imported from commit d657fede53ee3754e76edf66b10bef09ad1f9577)
2012-11-09 16:56:14 -05:00
Tim Abbott
35fbf350ae
Fix sending to cross-realm Zephyr users.
...
(imported from commit 1eebf286e149aa1242d6d26096003eb696fb18f2)
2012-11-09 16:56:13 -05:00
Tim Abbott
c3c3045e3d
zephyr_mirror: Forward messages sent to the empty instance more clearly.
...
(imported from commit 1fb5e4f8ce9941b3ca89688821d325d7ae49aee5)
2012-11-08 17:48:15 -05:00
Tim Abbott
8d27bcbad7
zephyr_mirror: Add a test mode that just prints messages.
...
This is useful for trying out new versions of the forwarding code
while the mirroring bot is still running in production.
(imported from commit bcdaf91fed55ac0974b1efe31dd13ed006b6fd06)
2012-11-08 17:48:15 -05:00
Tim Abbott
1dba0c0344
zephyr_mirror: Support subscribing to non-ascii Zephyr classes.
...
(imported from commit 85437f09c4738df11208e623db566a9409e501a3)
2012-11-07 16:42:06 -05:00
Keegan McAllister
3db339da35
zephyr_mirror: Don't open /dev/null to disable logging
...
(imported from commit 804e627d6d70bbf2ae1ee2f467b79ed0582ced0f)
2012-11-07 16:36:40 -05:00
Keegan McAllister
6329bb0a46
zephyr_mirror: Always pass a tuple to string %
...
(imported from commit 64a59e23c3aa3fceb350ed348812258c90ff09da)
2012-11-07 16:36:36 -05:00
Tim Abbott
d3066a46d3
The empty string shouldn't be a valid stream name.
...
(imported from commit 1fa878d7d51d3c3444ac75edf08b32f886683964)
2012-11-07 15:42:32 -05:00
Tim Abbott
1c1519109a
zephyr_mirror: Use zephyr's bulk subscription functionality.
...
Previously we were spending 15 seconds on linerva (and more like 2.5
minutes on the not-yet-operational zmirror.humbughq.com) to subscribe
to all of our streams.
(imported from commit c36cb1c26868f142683d9c92d4875fcd4931886e)
2012-11-07 15:37:55 -05:00
Tim Abbott
43b9510abd
zephyr_mirror: Eliminate the confusing "subs" global.
...
zephyr.Subscriptions() is a singleton class, intended to be accessed
as it is used.
(imported from commit f76c1b1129adb19ba96ed17f441492edf859a748)
2012-11-07 15:37:55 -05:00
Tim Abbott
4b2d45e9a9
zephyr_mirror: Fix missing api key file error message.
...
(imported from commit 3efe7fb8b2d593418c37dbab9389a8df9c27d003)
2012-11-07 15:37:55 -05:00
Tim Abbott
c945d60d16
zephyr_mirror: Make the logging options require the log path as an argument.
...
This is for supporting running the mirroring bot on a server without
AFS.
(imported from commit 400bf32f17aca984fa40c3b1222893214497eaa0)
2012-11-07 15:37:55 -05:00
Tim Abbott
6caf52867f
zephyr_mirror: Use os.path.join for constructing the root_path.
...
(imported from commit d894ab68430e42233a7aa6b289f01e790f8c8586)
2012-11-07 15:37:46 -05:00
Tim Abbott
1e50224ca2
zephyr_mirror: Add option to change the root path.
...
This is relevant for running not out of AFS on Linerva.
(imported from commit 28549830c99ad5a52349fbcc9e53dcb3c5ef25a1)
2012-11-07 15:35:26 -05:00
Jessica McKellar
c29eede9d0
For now, allow all characters in stream names.
...
We've had multiple requests from MIT zephyr users to allow
non-alphanumeric stream names, and we haven't decided what we want to
allow, so for now allow everything.
Note that the web client and mirror script limit stream names to 30
characters, which is our database limit.
(imported from commit 2acb5ee04e5ee7c40031ac831e12d09d04bbb2e6)
2012-11-07 15:12:03 -05:00
Tim Abbott
0489154cd7
zephyr_mirror: don't crash when the zephyr server returns SERVNAK errors.
...
Zephyr has this great property where a small fraction of the time, the
Zephyr server rejects your attempt to subscribe to something for no
particular reason, returning a "SERVNAK" error.
(imported from commit 6d5ed033d46d77a5b02539a816453724740f8fb0)
2012-11-07 13:56:21 -05:00
Tim Abbott
66640aefc6
zephyr_mirror: Remove remaining AFS reads when restarting automatically.
...
This does introduce a small security issue, in that a shell with
expired AFS tokens on the machine running the mirroring script will be
able to read the Humbug API key using /proc/pid/environ. I think this
is fine -- you can steal the API key from a running process using
ptrace anyway.
(imported from commit c6fdb798294fb32d640823b409f3e46274ca01f4)
2012-11-06 15:10:11 -05:00
Tim Abbott
45057fbf5d
zephyr_mirror: Zev's proposed fix to latest linewrapping problem.
...
(imported from commit 90fc4774e10255d0237a37b8af753059a66efb2d)
2012-11-06 11:31:37 -05:00
Tim Abbott
ff85226fee
zephyr_mirror: Add support for importing as a library.
...
(imported from commit 91dc7e8fae89ba8ade8dd98b747a25b46fca13e7)
2012-11-06 11:31:37 -05:00
Tim Abbott
a728f7936d
zephyr_mirror: Speed up retrying the restart process.
...
(imported from commit 7f7a2aaa8a7f872180400f57ad09c065ea2ababa)
2012-11-05 18:39:02 -05:00
Tim Abbott
a70fc5c5c1
zephyr_mirror: Also linewrap with extremely long strings.
...
(imported from commit cffa80f283fdac341942beb56ada9013cb8f7c39)
2012-11-05 18:39:02 -05:00
Tim Abbott
42e94b2684
zephyr_mirror: Only strip trailing whitespace.
...
(imported from commit f349778200e0c2fb410e5e2644c82ba4105f3634)
2012-11-05 18:39:02 -05:00
Tim Abbott
77bb41b3dd
zephyr_mirror: Improve different-paragraph detection algorithm.
...
(imported from commit 789651dd5b9af58bbc0e59a64dd565f06585134d)
2012-11-05 18:39:02 -05:00
Tim Abbott
403b728d3c
zephyr_mirror: Make paragraph break detection a bit less aggressive.
...
Because in the zephyr world, people often manually linewrap their
zephyrs, we need to relax the algorithm's assumption that every line
was wrapped to the same linewrapping threshhold. Otherwise messages
that look like this:
aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa
aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa aaaaa aaaaaa
aaaaa aaaaa aaaaa aaaaaaaaaa aaaaa aaaaa aaaaa aaaaa
might be treated as a paragraph break, even though that was unlikely
to have been the sender's intention.
(imported from commit e1144da2a3efc3241a8f15b0f19fea2ea6684254)
2012-11-05 18:39:02 -05:00
Tim Abbott
ee953c03fb
zephyr_mirror: Fix name of MIT Zephyr realm.
...
(imported from commit 2c4d269fee673171fcbacbd865135d266489559d)
2012-11-05 18:39:02 -05:00
Tim Abbott
07c190d94b
zephyr_mirror: Fix syncing instances of class message.
...
(imported from commit dfbbce336145ef6233eab27120a1ccefda055b13)
2012-11-05 18:39:02 -05:00
Tim Abbott
7ac10e626c
zephyr_mirror: Use SIGTERM to try to kill children.
...
It's generally best to first try killing with SIGTERM, and if we fail
to kill the child, we'll end up trying to kill them with SIGKILL
anyway when the new zephyr_mirror process starts up,
(imported from commit cfee2dd5f809f6e38d90a09be82719a8660d8377)
2012-11-05 18:39:02 -05:00
Tim Abbott
129c069a4a
zephyr_mirror: Use better line unwrapping algorithm.
...
(imported from commit e58ad67e98a9f2ec672162f955e49883d2dd3ab8)
2012-11-05 18:39:02 -05:00
Tim Abbott
15689a5158
zephyr_mirror: Encode the content as utf-8 before sending to zwrite.
...
(imported from commit 8bc578701a99f98eb5cc3e179fef696514da0066)
2012-11-05 10:20:40 -05:00
Zev Benjamin
2e69150790
zephyr_mirror: do case-insensitive compare when checking for instanced personals
...
Users were seeing "[-i PERSONAL]" prepended to mirrored zephyrs.
(imported from commit 82f1c93705f4000607ad8fd733c9fb5045619b10)
2012-11-05 00:48:00 -05:00
Tim Abbott
c68fb1f5ae
zephyr_mirror: Don't try to forward Humbug cross-realm messages to Zephyr.
...
(imported from commit b14174d79c88dcaec57207cd8467aa14d9cf02ba)
2012-11-04 06:50:52 -05:00
Tim Abbott
54ce5be16d
zephyr_mirror: Comment subject truncation.
...
(imported from commit eb292b47d74388d9c0065661c8b6fef9ab6f3554)
2012-11-04 06:50:52 -05:00
Tim Abbott
c783a52384
zephyr_mirror: Fix handling of cross-realm Zephyr users.
...
(imported from commit c3739bcd383e73ef7f5347f0665e990a0d121a47)
2012-11-04 06:50:52 -05:00
Tim Abbott
eaf69717c1
zephyr_mirror: Small logic fix in add_humbug_subscriptions.
...
(imported from commit bbcb7710310186612a8e7661a20b8b6558614758)
2012-11-04 06:50:52 -05:00
Tim Abbott
e112db6702
zephyr_mirror: Clean up old mirroring duplicate suppression.
...
(imported from commit ada8b4747d329da8b84acc8d3ff4fa2a4d653938)
2012-11-04 06:50:52 -05:00
Tim Abbott
b69201455c
zephyr_mirror: Parse zsig/body in its own function.
...
(imported from commit b692fa692d24d79f797852acffa0472d68930c88)
2012-11-04 06:50:52 -05:00
Tim Abbott
cf92525270
zephyr_mirror: Don't force-lower-case instance names.
...
(imported from commit 5b9b450ae7666a9c74704a7bd494c57a47578fe7)
2012-11-04 06:50:51 -05:00
Tim Abbott
ad6cc113a3
zephyr_mirror: Reduce code dupliation in process_notice.
...
(imported from commit f0d371cfcd3f4f5443dea5dc8f96f53df160d179)
2012-11-04 06:50:51 -05:00
Tim Abbott
942a9fd661
zephyr_mirror: Clean up send_humbug() interface.
...
(imported from commit 76d53e83eacedead2dabbf921e240afc4e4d09db)
2012-11-04 06:50:51 -05:00
Tim Abbott
f077cb81f0
zephyr_mirror: Remove an unnecessary username parsing.
...
(imported from commit 56c27a6cd923f13e23b70914f85dd73661e27651)
2012-11-04 06:50:51 -05:00
Tim Abbott
e0a71e7d6c
zephyr_mirror: Use a function to compute Zephyr usernames.
...
(imported from commit 73c066944942169d5a37fada110ed95aa2c10c94)
2012-11-04 06:50:51 -05:00