Tim Abbott
506eac99d6
send-nagios-notification: Use a codeblock rather than a block quote.
...
This ensures that Humbug receives the verbatim text of the Nagios
body, rather than a slightly modified version. Tested by running
manually.
(imported from commit 7e0eea0b230fd8c5552860acfb7372099598f036)
2013-01-02 10:24:35 -05:00
Tim Abbott
f65b130b45
zmirror: Fix printing of list of stream failures.
...
(imported from commit 0d573b412809263dbbacdf1b475adac440dae352)
2013-01-02 10:22:08 -05:00
Tim Abbott
2919ce2544
zephyr_mirror: Cancel Zephyr subscriptions on graceful restart.
...
(imported from commit 39737bbf7ea76181ab25a0eaacf230906cba3d87)
2012-12-21 12:44:19 -05:00
Tim Abbott
25bb86d2d0
zephyr_mirror: Fix killing duplicate zephyr_mirror processes.
...
The refactoring that we did a couple weeks ago to make the zephyr
mirror script restart itself automatically (by splitting it into
zephyr_mirror.py and zephyr_mirror_backend.py) had a poor interaction
with our code for killing old zephyr_mirror processes (to prevent
double-mirroring). If you manually ran two copies of the outer
mirroring script (zephyr_mirror.py), then the second one would on
startup kill the first one's zephyr_mirror_backend.py children (for
being duplicate zephyr_mirror_backend.py processes that would result
in double-mirroring). However, importantly, it did not kill the first
mirroring script's zephyr_mirror.py parent process, so the first
mirroring script would then proceed to startup up new children. The
process then repeats, with the two scripts' roles reversed.
This issue didn't affect the sharded mirroring case, where I had been
doing the testing of the kill code with that refactoring, because we
don't have a version of the outer zephyr_mirror.py loop for that
situation (a consequence of it being hard to restart the threads
properly with the run_parallel API that we're using to spawn all the
children).
(imported from commit d4886ac77312a6b0ebd0d612f6fb084970bf23a2)
2012-12-21 12:44:19 -05:00
Tim Abbott
a22f94633b
zephyr_mirror: Fix insecure temporary file for log.
...
This is probably a lot more annoying to use, in that e.g. there are
separate log files for the two directions of the mirror, but we
haven't used these logs for much, so whatever.
(imported from commit d3bc407d90099214d242526c01cd3d3cd9d9d9bd)
2012-12-20 14:30:20 -05:00
Tim Abbott
e609692e33
zephyr_mirror: Add a few more restricted-access classes.
...
(imported from commit 6690e5dcd6a313ac4e4ef2351e300306ca7fb3c5)
2012-12-19 08:49:14 -05:00
Tim Abbott
6aa8257102
check-mirroring: Fix spurious double-sent messages due to ACK failures.
...
(imported from commit 9010bd08779ce3bf9ce1dca761910be504b6463a)
2012-12-18 13:13:43 -05:00
Waseem Daher
a3fba04fdd
Don't consider hyphens to be an acceptable place to wordwrap.
...
Otherwise, URLs like this one from catherio:
http://www.sadiemagazine.com/issue-no-11/arts-letters/comic/i-think-i-am-in-friend-love-with-you
don't go to zephyr as one line, which makes them really
annoying to click on barnowl, etc.
(imported from commit d14f0af7d24a6cb8bc7cb0582f60116308f59923)
2012-12-18 11:03:18 -05:00
Tim Abbott
10f8eac0e5
check-mirroring: Fix hardcoded logging path.
...
(imported from commit 93b0d27285f79ecd7286cc07bc7727f754bc8012)
2012-12-14 17:34:37 -05:00
Tim Abbott
706e37faf9
check_mirroring: Fix sharded stream names and add test for them.
...
The original ones were incorrectly computed with a trailing newline
character.
(imported from commit 8f4e4e436104aec33e858fa7a65583a1dbc2eaff)
2012-12-14 17:34:37 -05:00
Tim Abbott
aba1ca871c
check-mirroring: Try receiving zephyrs multiple times to avoid large queues.
...
(imported from commit 08c08df46794cd89db19748c3d5adfa4097de4cb)
2012-12-14 17:34:37 -05:00
Jessica McKellar
9d41da3625
feedback-bot: fix display_recipient typo that crashes the bot.
...
(imported from commit 79ec561fe60074b0eec23780c6d6977a64c86a00)
2012-12-11 10:22:52 -05:00
Tim Abbott
80075923ae
check-mirroring: 'Detected server failure' notices go to stdout, not stderr.
...
(imported from commit 9118b59130aaad274180c3c639ec897bc5634b9f)
2012-12-11 08:55:17 -05:00
Tim Abbott
08f165e3ac
zephyr_mirror: Add comment explaining why we drop the @ATHENA.MIT.EDU in zwrite -C.
...
(imported from commit b591e2e0d6c607ef04e3c0005091078cfe23e3ff)
2012-12-10 17:05:04 -05:00
Tim Abbott
8e0aabc730
zephyr_mirror: Improve debugging output on outgoing messages.
...
Previously all that we logged was the sender, which turns out to be a
constant for humbug=>zephyr mirroring.
(imported from commit 527a3ac4b9b815a2b4d6b63c3ad92d9d5ad99a6e)
2012-12-10 17:05:04 -05:00
Tim Abbott
69c1b8beca
check_mirroring: Retry automatically on 'Detected server failure' errors.
...
(imported from commit 2f834218bd492876749dd8953e522725935a7a1d)
2012-12-10 17:05:04 -05:00
Tim Abbott
d451cf3dc0
check-mirroring: Use zwrite -n to not send PINGs.
...
(imported from commit e345f1b86c7f8850ac4eb4ae092cc83717e2cbe8)
2012-12-10 17:05:04 -05:00
Tim Abbott
bb80b86e25
zephyr_mirror: Fix handling of Humbug=>Zephyr personals.
...
(imported from commit 149f8aaf9076583499392bcb09a0250b05c3dea6)
2012-12-08 13:05:44 -05:00
Tim Abbott
94a553f0f1
zephyr_mirror: Use a variable for humbug_account_email.
...
(imported from commit 90da406a5eab67d20b42243e96b8afb3e5b5f342)
2012-12-08 13:00:22 -05:00
Tim Abbott
28d98729a5
zephyr_mirror: Fix detection of personals.
...
(imported from commit 1fc9050bad36dc15e76f65bdb6532e3e7e601a40)
2012-12-05 12:50:14 -05:00
Tim Abbott
37c837904f
Don't send zwrite pings.
...
(imported from commit 8dd7894eda6315ab52e61489e21ec1d201e86cc9)
2012-12-05 12:04:18 -05:00
Zev Benjamin
b945113867
[manual] Unify huddles and personals into private messages on the receive path
...
feedback-bot and zephyr_mirror will need to be updated and restarted
when this is deployed to prod.
(imported from commit fe2b524424c174bcb1b717a851a5d3815fda3f69)
2012-12-04 18:01:51 -05:00
Keegan McAllister
6d8519bc5d
Add a Tddium post-build notification task for CUSTOMER1
...
Resolves #502 .
(imported from commit b88fa55ea6561b601a3d6519c84d56ba3098c3fe)
2012-12-04 14:25:44 -05:00
Tim Abbott
1f99e40a7d
zephyr-mirror-crontab: Fix truncation races.
...
(imported from commit f50f34b3a739e67f2dffb442ac01e50eb7c9e4b8)
2012-12-03 17:56:38 -05:00
Keegan McAllister
b971ce4683
mirroring: Fix import by putting 'api' path first
...
(imported from commit b35d962d6456f01b97deeeaa328faa03b65494f8)
2012-12-03 17:50:29 -05:00
Keegan McAllister
ac9e3d6483
zephyr_mirror_backend: Rename variable 'humbug'
...
(imported from commit 2e278e4d2452f750cb874510a762fc9616e7dfb3)
2012-12-03 17:49:27 -05:00
Keegan McAllister
b1218ee829
gcal-bot: Rename variable 'humbug'
...
It's weird to clobber the module, although it works.
(imported from commit 160d6e1c596ba6618c3da9c8cdc2f5cd3ca43dc6)
2012-12-03 17:49:27 -05:00
Tim Abbott
e4f2adaef6
Add zmirror's crontab to git.
...
(imported from commit 37c96933a507c661c2ca252c78e5cd9e8a699ba2)
2012-12-03 16:20:19 -05:00
Tim Abbott
24b8a7eccc
zephyr_mirror: Fix case issue in subscriptions syncing.
...
(imported from commit e87ddab3684f4acae940ee831caadbc346458a11)
2012-12-03 16:20:19 -05:00
Keegan McAllister
b7c1e02ede
gcal-bot: Remove .humbug-api-key reading
...
This behavior is part of api/humbug.py now.
(imported from commit 8a9722c8ad05391160cbb98387f34ef9924d81de)
2012-12-03 15:54:54 -05:00
Keegan McAllister
b9325a09fa
Rename class HumbugAPI to Client
...
(imported from commit 4270f31fc5febcd9c444d0d133a1dad3860618f0)
2012-12-03 15:54:54 -05:00
Keegan McAllister
f9f8a6e603
Rename api.common to humbug
...
Fixes #482 .
(imported from commit 1bd6a7fd993d8d5e225e0311c288dbce0c369a40)
2012-12-03 15:54:54 -05:00
Tim Abbott
4bfd784423
Rewrite check-mirroring to be more robust and flexible.
...
Features include:
* Not forking into two processes (shells out to zwrite to send
instead). This makes life easier since we're not doing concurrent
programming.
* Eliminated a lot of hard-to-read or unnecessary debugging output.
* Adding explanatory test suggesting the likely problem for some
common sets of received messages.
* Much less code duplication.
* Support for testing a sharded zephyr_mirror script (--sharded).
* Use of the logging module to print timestamps -- makes debugging
some issues a lot.
* Only one sleep, and for only 10 seconds, between sending the
outgoing messages and checking that they were received.
* Support for running two copies of this script at the same time, so that
running it manually doesn't screw up Nagios.
* Passed running 100 tests run in a row.
(imported from commit a3ec02ac1d1a04972e469ca30fec1790c4fb53bc)
2012-11-30 17:57:52 -05:00
Tim Abbott
abb95fca04
zephyr_mirror: Move class name canonicalization earlier.
...
We should be canonicalizing stream names to class names in
update_subscriptions_from_humbug, before we even decide which classes
to subscribe to; otherwise deduplication and tracking of which classes
we're already subscribed to won't work.
(imported from commit a751b6fca1022390a087516a0730ff77f13d7edf)
2012-11-29 13:57:06 -05:00
Tim Abbott
8683613e76
zephyr_mirror: Add options to run class mirror without sharding for debugging.
...
(imported from commit 4fcc403504d93e30aca6046cba9f1fe5342faac6)
2012-11-29 13:57:06 -05:00
Tim Abbott
18bbd02074
zephyr_mirror: Don't leak zephyr_mirror processes on send_humbug failures.
...
(imported from commit be005018672369683d9e3bdbf144f96f58af6b6c)
2012-11-29 13:57:06 -05:00
Tim Abbott
074316105b
zephyr_mirror: Replace bare excepts with 'except Exception'.
...
(imported from commit 857212e0e5116471e418d37845550108c0a47d2b)
2012-11-29 13:57:05 -05:00
Tim Abbott
ab68503fcf
zephyr_mirror: Compare zephyr subs from server after normalization.
...
(imported from commit eea290698e83c7d26f23ab3bb0201914417f0e09)
2012-11-28 22:26:10 -05:00
Tim Abbott
c61567b67a
zephyr_mirror: Add two more restricted access classes.
...
(imported from commit 06ff0e19c1522ade018aea66f152fdfa55c18e1d)
2012-11-28 22:26:10 -05:00
Tim Abbott
13ebd229c1
get_updates: Replace the "mirror" argument with checking "client".
...
(imported from commit bd84c2c7a456de8ea7ec35eaf76b5bf8647ca61a)
2012-11-28 17:41:38 -05:00
Tim Abbott
2b2398b712
zephyr_mirror: Pass an encoded stream to hashlib for sharding.
...
(imported from commit cc57b3956198b66c9cfc84423434a71b8200d819)
2012-11-28 15:44:35 -05:00
Tim Abbott
de14210a4d
zephyr_mirror: Validate zephyr subscriptions happened successfully.
...
(imported from commit 494895b87eb9b555175c9890c5c2046cf4ce40ac)
2012-11-28 15:44:35 -05:00
Tim Abbott
121c3cb9c8
zephyr_mirror: Fix display of personals on non-message classes.
...
(imported from commit 42ff030d2d78c530428dcede406d46fc71521fef)
2012-11-27 14:12:19 -05:00
Keegan McAllister
30f234d42d
send-nagios-notification: Expand "\n" escape sequences that we get from Nagios
...
(imported from commit 3e8efbfe8bbd5a2f13a8e02d9f44442b035113ba)
2012-11-27 14:08:49 -05:00
Tim Abbott
305a8ce569
zephyr_mirror: Run the class mirror in 16 parallel shards.
...
(imported from commit cb17ef999e94cc57d5b01114479728b04475c9c4)
2012-11-27 12:09:57 -05:00
Tim Abbott
bfec56661e
zephyr_mirror: Add a --no-forward-from-humbug option.
...
We'll use this to only have one of our shards forward from Humbug.
(imported from commit a6f3c2180b49c1fa826baf1ae9e7e3ba252a5bfa)
2012-11-27 12:09:57 -05:00
Tim Abbott
975c8ef5b0
zephyr_mirror: Clean up unnecessary logic in process_notice.
...
(imported from commit 28599789016fd1006c2de4d5ddc3cf1f10baa47f)
2012-11-27 12:09:57 -05:00
Tim Abbott
dbeb107aaf
zephyr_mirror: Fix the check for whether a Zephyr is a personal.
...
(imported from commit 609b6339fa82ecbd6435a386d24bf555e75a8120)
2012-11-27 12:09:57 -05:00
Tim Abbott
b081d2fa5a
zephyr_mirror: Reorder process_notice to log fewer "Skipping" messages.
...
Previously, we were sending "Skipping message we got from Humbug!"
for messages we wouldn't have forwarded anyway.
(imported from commit 36df85a61336ac00e3d7913d5a417d6b42764350)
2012-11-27 12:09:57 -05:00
Tim Abbott
f45a8bebf2
zephyr_mirror: Don't display/log some useless "Skipping" notices.
...
In this case, if we're configured to not forward personals, there's no
point in logging a decision not to forward one.
(imported from commit 62c37591c6a70afb6235de626b0c6a3502cbcb27)
2012-11-27 12:09:56 -05:00
Tim Abbott
333573f06b
zephyr_mirror: Simplify optparse usage.
...
(imported from commit d7cce4236dae6f369ea1cc4e12f89c2011718b7f)
2012-11-27 12:09:56 -05:00
Tim Abbott
ca34a2a02f
check-mirroring: Fix some issues with startup process timing.
...
It seems that check-mirroring was reporting a lot of spurious failures
due to it sometimes taking more than 3 seconds for the setup phase of
check-mirroring's receive path to run. So fix this:
(1) Wait a bit more than 3 seconds for the receiver to subscribe to
messages
(2) Subscribe to Humbug messages before forking (we can't do this with
zephyr.init() because python-zephyr gets totally messed up if you use
it from multiple processes with a shared initialization)
(3) Get rid of the old time.sleep(0.x) values that were intended to
make messages arrive in order -- since we're now checking that
messages correctly arrived using set(), they aren't needed.
(4) Use a single request to subscribe to both zephyr classes we need
to subscribe to (saves 1 RTT).
(imported from commit d96aef05405ce43e9a4a549de189da9a2e393875)
2012-11-26 17:10:15 -05:00
Tim Abbott
ba33df97bb
zephyr_mirror: Don't use @(@color(blue)) in zsigs.
...
(imported from commit e4b594e3c22c25fa4f87baaad09227396bb92a0d)
2012-11-26 16:19:09 -05:00
Tim Abbott
135f7f1b57
zephyr_mirror: Use default format to indicate what came from Humbug.
...
(imported from commit 5c2fdccb08d605a37d6c87c37f023c06a0a9a760)
2012-11-26 16:18:05 -05:00
Tim Abbott
111a9bc0e6
zephyr_mirror: Refactor zwrite_args handling a bit.
...
(imported from commit 4923c90dc546022d48f226c2a204e9d09717b563)
2012-11-26 14:58:34 -05:00
Keegan McAllister
84d73db4f3
Send Nagios alerts to Humbug
...
Fixes #385 .
(imported from commit 7dac013debd6ccff031fc4da0dd7185e198b4498)
2012-11-26 14:42:55 -05:00
Tim Abbott
fcf24e30f5
check-mirroring: Add subscriptions inside IOError check.
...
(imported from commit d3b00ce9d91a0bcffcef58436a4b90770155fce9)
2012-11-26 12:25:39 -05:00
Tim Abbott
9d6ce4ee0b
api: Add copyright and MIT license notices to distributed tools.
...
(imported from commit 9f93050f988549dc363f5a7c798c8a9fa1c01d29)
2012-11-26 12:25:38 -05:00
Tim Abbott
27d597d686
zephyr_mirror: Don't break long words/urls when mirroring.
...
(imported from commit df2b6a6969fc54016eeee4996df317e2843844c8)
2012-11-21 15:55:18 -05:00
Tim Abbott
27b02176bc
zephyr_mirror: Fix running --sync-subscriptions repeatedly.
...
(imported from commit 15bead790590c91cd4a1d794799f94341d31c181)
2012-11-20 17:17:40 -05:00
Jessica McKellar
34abe48f62
nagios: Increase the timeout on MIT zephyr forwarding functioning.
...
Sometimes messages are delayed passed the allowed 10 seconds. We may
eventually decide that that amount of latency is unacceptable, but the
latency is not what this script is supposed to be checking.
(imported from commit d83a6a83d60e9eac13b3b87fb31de7f9881acabf)
2012-11-20 15:32:06 -05:00
Tim Abbott
244ff8459e
zephyr_mirror: Add exception handling around all main loop code.
...
(imported from commit 5dc46decf882302a6c58f3bb788362f82f293b35)
2012-11-19 12:44:12 -05:00
Tim Abbott
36280c2769
zephyr_mirror: Use minimal wrapper script that is hard to accidentally break.
...
(imported from commit 45967b8b806df616b0480b217dd5db82c5a2cabd)
2012-11-19 12:44:06 -05:00
Tim Abbott
70e7c9fd14
zephyr_mirror: Move parse_args into its own function.
...
(imported from commit b56ca627e3d34b8dcefead2cfecfa77bb428b0ec)
2012-11-19 12:30:15 -05:00
Tim Abbott
99f90762d3
zephyr_mirror: Get rid of extra_mirror code -- it is no longer used.
...
(imported from commit ab2a9cfcfa6a8c7615523ebb16864e9a4db05f3a)
2012-11-19 12:11:07 -05:00
Tim Abbott
ff80f7df71
zephyr_mirror: Improve robustness when killing child processes.
...
(imported from commit f212b87ffb1fc814d289c14d3854fb1f2f6e2cf3)
2012-11-19 11:46:05 -05:00
Tim Abbott
ce279d48ae
zephyr_mirror: Fix restart_stamp functionality.
...
(imported from commit a79db110d3372ab88fabfc0b7013c5fd3ad07f8e)
2012-11-19 11:20:33 -05:00
Tim Abbott
5411e5c360
zephyr_mirror: Improve zwrite error handling.
...
(imported from commit a6b5b9c0c9bd6ffde0b2b783c87528bdcae03566)
2012-11-16 17:08:51 -05:00
Tim Abbott
584743eca8
[manual] Uniformize the subscriptions API method names.
...
This requires a zephyr_mirror deployment when it is pushed to prod.
(imported from commit 6543441fb264b518f8705d7989d068a1d50ce5d6)
2012-11-16 17:06:01 -05:00
Jessica McKellar
5b285f2321
nagios: print more information on check-mirroring errors.
...
(imported from commit 6ea149d939ae309745ce8c5b2ab7ae2237007d97)
2012-11-16 11:25:22 -05:00
Tim Abbott
6727e9dbd9
[manual] send_message: Rename recipient/stream fields to 'to'.
...
This commit changes APIs and requires and update of all zephyr
mirroring bots to deploy properly.
(imported from commit 2672d2d07269379f7a865644aaeb6796d54183e1)
2012-11-15 15:30:06 -05:00
Tim Abbott
fb59f15099
check-mirroring: Use consistent ordering for keys.
...
(imported from commit 7deaf55ccb4b47a11dbd30c9239893a42eb39e00)
2012-11-15 14:56:10 -05:00
Tim Abbott
4ca1572283
zephyr_mirror: Improve error handling getting public streams list.
...
(imported from commit 06f9c00f19056bfe7db3c02955e3a29ad270de6e)
2012-11-15 14:51:05 -05:00
Tim Abbott
c751cc97db
zephyr_mirror: Send Humbugs in child processes.
...
This improves the throughput of mirroring a large number of zephyrs in
a row from about 1.5/second to about 9/second, which is basically
satisfactory.
(imported from commit 5f72680d6290eaa02ef8ced5b3792fb3efc1db41)
2012-11-15 14:50:59 -05:00
Waseem Daher
ca351f3ddc
Ask user to reload Humbug after running sync-subscriptions.
...
(imported from commit d374d5b8eefd4240b8b11f83080fcdf2ff3cadaf)
2012-11-15 10:40:10 -05:00
Jessica McKellar
c571c997b3
If a zwrite fails, retry unauthenticated and warn the user.
...
(imported from commit a8a516d59f4af72ed2eaebb6bfa65e2f359fc2a6)
2012-11-14 17:38:42 -05:00
Tim Abbott
7514390190
zephyr_mirror: Don't use the /mit symlink for use on systems without automounters.
...
(imported from commit b376e6da6c971d887f2d75194a8ed0d3adaddfea)
2012-11-14 15:03:49 -05:00
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
Keegan McAllister
e42097a723
gcal-bot: Get API key from ~/.humbug-api-key
...
(imported from commit 63d63ad0d299c300d28de61069ada8ea2c8eb839)
2012-11-14 10:38:36 -05:00
Keegan McAllister
11cdc959e6
gcal-bot: Fix sys.path for new location under api/bots/
...
(imported from commit 9f5b90d5e0cd2134f2f0210980ad49fd8062a9c4)
2012-11-14 10:38:36 -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
ef065d112f
check-mirroring: Move some prints to be conditional on "verbose".
...
(imported from commit 90db591f5fc3e4d1f830ed16bca9380a3a9dddd3)
2012-11-08 13:47:02 -05:00
Tim Abbott
6aad2946a1
check-mirroring: Make root_path and option (with new default).
...
(imported from commit df15d089f234bfe5373fc3fed95eb2f3b3ee42b2)
2012-11-08 13:34:32 -05:00
Tim Abbott
f3cdfd2e4d
check-mirroring: Don't fail when messages get reordered.
...
This happens sometimes (especially when our server is restarting), and
isn't a _real_ problem -- it's much more important that we have a
completely reliable test that we can put a Nagios alert against.
(imported from commit 0add0b3dfc5447307014bbb9137366bd7141ade0)
2012-11-08 13:34:29 -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
Keegan McAllister
f6fe157d3d
check-mirroring: Get the max_message_id from get_profile()
...
(imported from commit 95f457b91563a92eee24c4487c00abe7132b4ff8)
2012-11-07 15:34:44 -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
2bdc02a10f
feedback-bot: Only forward messages sent directly to feedback@.
...
(imported from commit 4a4d1e4a3ba00deb929647f7f35f2982c2b4add6)
2012-11-06 16:59:28 -05:00
Tim Abbott
db0a064c80
Bots: Send messages through staging.humbughq.com.
...
(imported from commit d9859bfe5f5b3b7c5efa5ef930d6cfaa5c0d1fc2)
2012-11-06 16:59:28 -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
Tim Abbott
fb4e45e644
zephyr_mirror: Rename humbug_username to to_humbug_username.
...
(imported from commit 764673b9ccf2f58f88e1d6eec173a1c49ac15cad)
2012-11-04 06:50:51 -05:00
Tim Abbott
53f75affe7
zephyr_mirror: Use %me% rather than guessing the current Zephyr user.
...
(imported from commit 8c04581c4327a44515b9ce1b938c69675964c6c0)
2012-11-04 06:50:51 -05:00
Tim Abbott
97722d5eb3
zephyr_mirror: Don't let a single bad message break humbug=>zephyr forwarding.
...
(imported from commit 9b20f5e9c661fe0850c119309f4fe6f2c5d40679)
2012-11-02 14:15:46 -04:00
Tim Abbott
86ef645444
zephyr_mirror: Shell out to zwrite instead of using python-zephyr to send.
...
This eliminates the problems with python-zephyr not being able to
handle non-ascii characters in instances and class names.
(imported from commit c9f295cb18bc5043cd8efecbe6996ff373f66c9a)
2012-11-02 14:15:46 -04:00
Tim Abbott
2b7007fc1b
Use the empty string rendered in blue as the zsig loop avoidance token.
...
(imported from commit 10610b25b006f85b6557592ce73899381b520e3b)
2012-11-02 13:49:30 -04:00
Tim Abbott
6d8a6ebeab
zephyr_mirror: Support the empty string in blue as our loop detection technique.
...
(imported from commit 4f9c77df7479bfa485dac381514ee2c591ce09ef)
2012-11-02 13:49:29 -04:00
Tim Abbott
dc0bc84d4d
Add copyright notice to zephyr mirroring bots.
...
(imported from commit f3d27a032a461cf3eb92822feee3f8e790d630dd)
2012-11-02 13:49:29 -04:00
Tim Abbott
68e96c0617
humbug_trac: Don't send some updates without a comment.
...
(imported from commit 2cf5e8c2fc1cefcbfe440b2e29d89b78f19205e6)
2012-11-02 10:50:59 -04:00
Tim Abbott
f3646d9c56
humbug_trac: Remove redundant 'Trac ' in subjects.
...
(imported from commit 309b477963cd0d3cca06eef2a685b1143c144455)
2012-10-31 14:06:35 -04:00
Tim Abbott
1fc6248725
humbug_trac: Try to compress the rest of the changes.
...
(imported from commit a7bdf3cb8243d43837705d4c9eb00d5e6d75d4b5)
2012-10-31 14:06:35 -04:00
Tim Abbott
a75348cb71
Include the trac summary in the Humbug subject.
...
(imported from commit 23298d8455e2b0e8c4947f2d2e76874b66a8e28c)
2012-10-31 14:06:35 -04:00
Tim Abbott
0cb9a8321b
zephyr_mirror: Append our elements to the start of sys.path.
...
(imported from commit 674848bcac71d5bd28549f14a5da0f72c6c59d69)
2012-10-31 14:06:35 -04:00
Tim Abbott
205ad41a22
zephyr_mirror: More reliable killing of other zephyr_mirror processes.
...
(imported from commit ae00299114a74ebd582aec835ffd5f8127d8f55f)
2012-10-30 16:59:25 -04:00
Tim Abbott
0267275cfd
Move trac bot to the trac stream.
...
(imported from commit 7c05062d73d6bd4de4b9329f1f2b7baa705c9d2b)
2012-10-30 16:59:25 -04:00
Keegan McAllister
5be42f128e
zephyr_mirror: Remove 'continue' at the end of a loop
...
(imported from commit 5d6143828f1a6946b67ae23342c0bc2185ebee07)
2012-10-29 23:21:00 -04:00