Commit graph

2291 commits

Author SHA1 Message Date
Tim Abbott d706057ed8 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
acrefoot a56cdac823 Make call_on_each_{message,event} examples more clear
Before these examples weren't obviously blocking calls (they seemed
more like a callback registration, which may make more sense in the future)

(imported from commit 78fdf98d791b19843526437c710901d8dff62e8c)
2013-09-24 16:19:54 -04:00
Zev Benjamin 5b83144e1f Replace configuration references to trac.humbughq.com with trac.zulip.net
(imported from commit aa042a10ada3f04205fd8d3e94c2b13f12a5a1a7)
2013-09-05 15:43:08 -04:00
acrefoot 8934724b26 Fixup 484bc12681a43cd01fe0189c072ab4230eb32c22 typo
(imported from commit ff4043b6ea0c2389560114dcda6269fd64932cd5)
2013-08-29 18:07:49 +00:00
acrefoot 5d2e155309 Basecamp mirroring script
This mirrors all the "events" in a Basecamp account onto a stream in Zulip
(default "basecamp"); it sets the topic as the calendar or project that the
event belongs to.

Unfortunately, Basecamp will not host hooks, and neither do we, so this script
is currently intended to be run by our customers, much like the Trello mirror.

(imported from commit 484bc12681a43cd01fe0189c072ab4230eb32c22)
2013-08-30 20:00:07 +00:00
Tim Abbott 94c74c0f9b zephyr_mirror: Make Webathena work for golem.
(imported from commit 6f8bf1f44c521b22c9fc990711d2821e5a60761d)
2013-08-28 18:56:54 -04:00
Zev Benjamin 4a8311b77b zephyr_mirror: Tweak error text
(imported from commit 7bb9d42a261e08d3abe5d80b9ba2e88f1d0b03bf)
2013-08-28 10:41:53 -04:00
Tim Abbott 92731d0a95 zephyr_mirror: Require zcrypt when mirroring to invite-only streams.
(imported from commit 1b88a8fc9bc26f2f9b1bb3f037093f85255feb17)
2013-08-27 18:26:12 -04:00
Tim Abbott 5e5e35924c 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 86737d3398 zephyr_mirror: Use the new reasonable --log-path option.
(imported from commit 2208e4c47cf49e3005cc3b93314b8c2a0ffc23c6)
2013-08-27 14:21:26 -04:00
Tim Abbott 0d59d15781 zephyr_mirror: Rename confusing log path variables.
(imported from commit a120f653c1b9283b91f339cccea52bd5ad89b69f)
2013-08-27 14:21:26 -04:00
Tim Abbott adc20eb3fe zephyr_mirror: Stop logging to the old resend log.
We were intending to just be directing the logger logs, not logging
every message for potentially resending.

(imported from commit 9dd53e3968880745a8c01244db5d2c2247dfe85c)
2013-08-27 14:21:26 -04:00
Tim Abbott fd96a0b694 zmirror: Add monitoring for personals mirrors.
(imported from commit acb7f2222076d2f3884a2e52c7032cb48fde1757)
2013-08-26 18:17:26 -04:00
Tim Abbott 2249b18081 zephyr_mirror: Ignore expired Kerberos tickets for personals mirror.
(imported from commit 094755feacd299255f078432465f11a609df9aef)
2013-08-26 18:17:26 -04:00
Tim Abbott 9223f6b2e8 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 43ca7b3d3b Add webathena authentication button for Zephyr users.
This shows up when you're not running a Zephyr mirroring bot and lets
you use Webathena to have us run it.  Obviously needs more docs.

Current problems include:

* supervisorctl reload ends up recreating /var/run/supervisor.sock
  with the wrong permissions, so it only works once in a row before
  you need to chmod that.

* /etc/supervisor/conf.d needs to be humbug-writeable; this is a clear
  local root vulnerability

* This uses SSH and thus is kinda slow.

(imported from commit 7029979615ffd50b10f126ce2cf9a85a5eefd7a2)
2013-08-26 18:17:25 -04:00
Tim Abbott 2ee0b3a079 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 0b9ea4db05 [manual] Extend /api/v1/streams API endpoint.
Previously it only provided the list of all public streams; now it
allows one to specify any union of some of the following:
* all public streams
* all streams the user subscribed to

(the most relevant being the union of those two, which is what we want
for the "streams" page).

Or:
* all streams in realm (superuser only)

The manual task required is that when this is pushed to prod, we need
to also deploy the new sync-public-streams version to zmirror.

(imported from commit 27848b8bd136e2777f399b7d05b2fdcec35e4e21)
2013-08-22 12:29:04 -04:00
Tim Abbott 81aebf897b zephyr_mirror: Finish outgoing zcrypt.
(imported from commit dfef23feb8e0f6a0a8ba775b6cccd391cb307adb)
2013-08-22 12:29:04 -04:00
Tim Abbott 157fdb94d4 check-mirroring: Move log file under /home/humbug/logs/.
This is for consistency with where one goes for server logs on our
normal frontends.

(imported from commit 094f4cd1ca6c64497594827e12d8100bbb9bd6ab)
2013-08-20 17:09:09 -04:00
Tim Abbott 2c39d17120 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 a47b0e54c3 zephyr_mirror: Renew kerberos tickets when starting up class mirror.
(imported from commit 34b0a78558c6f20043efe986a16064387f36f1c0)
2013-08-20 15:27:24 -04:00
Tim Abbott ae2b181591 zephyr_mirror: Fix zephyr/zerver path conversion.
(imported from commit bb895bac50754a601a09639cba596ed65956dc9b)
2013-08-20 15:27:24 -04:00
Tim Abbott fceba5f056 [manual] puppet: Move rabbitmq cron jobs into puppet.
When we deploy this, we should remove the relevant jobs from root's
crontab on our app servers.

(imported from commit 749be952d504f5a4d243cf59f6430acc689fc821)
2013-08-20 15:27:24 -04:00
Tim Abbott 97be689411 zephyr_mirror: Auto-detect Python version for pyzephyr path.
(imported from commit e2aca3a08f8aa12b43d71acffcc0e2249feb7ca7)
2013-08-20 15:27:23 -04:00
Tim Abbott f51b5a5b0d puppet: Move zephyr_mirror crontab into /etc/cron.d.
(imported from commit e93e630704ce7e85346f54f095c642010058fc09)
2013-08-20 15:27:21 -04:00
Tim Abbott 264651c7b4 zephyr_mirror: De-zcrypt messages for which we have the key.
For now we only support the AES encryption type since the DES one is
probably not used anymore.

(imported from commit 222606db9f704917e74159e7d07a110187a236e6)
2013-08-20 15:02:07 -04:00
Tim Abbott 7f626d2bba zephyr_mirror: Handle syncing subs with invite-only streams.
(imported from commit ec8d0c0d13ff0a81fa4a5e1225e94e6dad997356)
2013-08-20 15:02:04 -04:00
Tim Abbott 9d55822cfb zephyr_mirror: Add option to control path to streams file.
This makes it easy to test the class mirror on just a single test
stream.

(imported from commit 3decb1ced54507683f1c0634df14f73e693104ef)
2013-08-20 14:57:13 -04:00
Tim Abbott 2c71f12ffe [manual] Bump API version to 0.2.0.
When we deploy this, we'll need to of course actually build and deploy
the new API tarball.

(imported from commit 03c853e8a9424a63f1c74bb83637d5a1e50a159a)
2013-08-09 15:34:57 -04:00
Waseem Daher b132a804b9 rss-bot: Linkify RSS entry title.
This makes our life a bit nicer if the message is super-long,
because then even when it's "condensed", we still get a link
to the actual article.

(imported from commit 32e70d29cb702ce73f6cd0c04dbc58457cd2e6b5)
2013-08-09 14:09:09 -04:00
Waseem Daher c44e6d80d2 Fix argument parsing for Twitter bots.
Even though we support a command-line option of --user=,
it gets stored in a field called 'email'.

(imported from commit f2956524517a93187ed182caf8e2d85ccbc1a0f4)
2013-08-09 14:09:09 -04:00
Steve Howell 50cdc6853d Send the full first line of the commit message to Zulip.
(imported from commit accafb1cd2fa64ad1377d0fc72ff8f89c1806d3b)
2013-08-09 10:45:20 -04:00
Tim Abbott a9e8d1a2a2 Rename Humbug-based variables in check-mirroring.
(imported from commit cdfc9a1c15db7bd6de099e6403dc65bfaff337b0)
2013-08-08 10:22:32 -04:00
Tim Abbott bd133f6bd4 Rename /usr/local/share/humbug/ to /usr/local/share/zulip/.
(imported from commit 6b5d13b36f96c7174e70ce1391f1d66724c45a62)
2013-08-08 10:22:32 -04:00
Tim Abbott af771433d7 Rename Humbug-based variables/paths in twitter search plugin.
(imported from commit a5e1df1f6c58321974c34bacb7515672be55e88e)
2013-08-08 10:22:32 -04:00
Tim Abbott a003a1440a Rename Humbug-based variables/paths in twitter plugin.
(imported from commit fcb6332d0d1293044f17e841cd78e4f91de5dd30)
2013-08-08 10:22:31 -04:00
Tim Abbott cf35495c05 Rename Humbug-based variables/paths in rss plugin.
(imported from commit 40b71946752dc323eff8bfe9a03b167bd83c563d)
2013-08-08 10:22:31 -04:00
Tim Abbott a372fba2ac Rename Humbug-based variables/paths in jira plugin.
(imported from commit a4596acc5c2d8da5cecad772e9cda5a371189299)
2013-08-08 10:22:31 -04:00
Tim Abbott b90a936910 Rename Humbug-based variables/paths in svn plugin.
(imported from commit 43a9282ad86546fb59e91c36e97a595e51789d07)
2013-08-08 10:22:31 -04:00
Tim Abbott f36c132578 Rename Humbug-based variables/paths in git plugin.
(imported from commit e153c7a1a68e82dd3fa45251644be74c62770a9d)
2013-08-08 10:22:31 -04:00
Tim Abbott 4b0992ab94 Add Zulip Nagios integration to puppet.
(imported from commit 62b53e4f8a31ec8ab21d5bb5435a320c8e4eab95)
2013-08-08 10:22:31 -04:00
Tim Abbott 318ba3a50e Rename Humbug-based variables/paths in Nagios plugin.
(imported from commit fe8e33241215ea880f7351c3c86b0fb546faf8d3)
2013-08-08 10:22:31 -04:00
Tim Abbott 0c3eba5331 Rename Humbug-based variables in Trac plugin.
(imported from commit 5d406cb6c5fe7b1fbd4da706f7ac6bb6e381cadb)
2013-08-08 10:22:31 -04:00
Tim Abbott 4611b40b12 Rename humbug_*_config.py to zulip_*_config.py.
(imported from commit a1d4dd22c59f812f0eb4875dc70c89ce96a4b90c)
2013-08-08 10:22:31 -04:00
Tim Abbott 402701dc8e Rename humbug-send to zulip-send.
(imported from commit 61400841f8fffe4c706d867aaa012059bcba271d)
2013-08-08 10:22:31 -04:00
Tim Abbott 084847b0d7 Rename the 'humbug' API module to 'zulip'.
(imported from commit b3a3d7c05459cbb0110cd0fbe2197d779f3a6264)
2013-08-08 10:22:31 -04:00
Tim Abbott 9aaefde9b2 Rename ~/.humbugrc to ~/.zuliprc.
(imported from commit a0d53dd20097a56971874dc1d84c6f95267e84f2)
2013-08-08 10:22:31 -04:00
Tim Abbott cba5fbe125 Rename humbug_tools to zulip_tools.
(imported from commit 7f21fdc2c2d6ad0bdbd99eb616ffc75c347d8dcb)
2013-08-07 10:00:08 -04:00
Tim Abbott 4741258ca4 Change humbug => zulip in zephyr_mirror_backend internal variables.
(imported from commit 7cc5d78bfb5db8c9d5a44ed862da304d9e44ff0e)
2013-08-07 10:00:08 -04:00