Commit Graph

2140 Commits

Author SHA1 Message Date
Tim Abbott 4b6f771be1 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 f05967034b 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 a9b938d7ac 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 09c5a5c06f zephyr_mirror: Simplify optparse usage.
(imported from commit d7cce4236dae6f369ea1cc4e12f89c2011718b7f)
2012-11-27 12:09:56 -05:00
Tim Abbott 08bbf889ed api: Extend documentation a bit.
(imported from commit fd435286e12ffebad8476cc8005303b2d8d70fd9)
2012-11-27 12:09:56 -05:00
Luke Faraone d270ff348f Save newly created users in the log so they aren't forgotten by populatedb.
(imported from commit a43aaf73576dcacf85c4ad662cbcf04b3fe2bbd7)
2012-11-27 11:16:38 -05:00
Tim Abbott 688525668e Correctly display the user count in registration process.
(imported from commit 24c8479c0730d1756c4e1bd0b818772914c20bd5)
2012-11-27 10:55:00 -05:00
Jessica McKellar cca39ca5e8 Add default subscriptions upon non-MIT user creation.
We'll probably eventually get fancier with this, suggesting various
default sets depending on the company or making it easy for one person
to create default subs for several people at once.

Until we know what we want, keep it simple.

(imported from commit 14319dd50c67fe33ac6f15288dba4916ce0a89ac)
2012-11-26 21:02:29 -05:00
Keegan McAllister 69801ce1db Remove link to change email address
We never implemented this; the link goes to a 404.  And it's unlikely that we
will get to it soon, because we currently use email address as the unique
identifier for a user.

Since it can't be changed, we remove it from the 'Settings' tab entirely.
It's still visible in the sidebar, anyway.

(imported from commit a18c0726fb67baf04429a90e36a383cacd03ad8a)
2012-11-26 18:16:25 -05:00
Tim Abbott 81672af751 mituser email: Emphasize the importance of mirroring script.
(imported from commit 00d2c6b4ba35ca40f414c295f41d0ea7bdb505d9)
2012-11-26 17:10:15 -05:00
Tim Abbott 9c7878164c 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
Keegan McAllister 41e43cb707 Flush memcached on every deploy
This uses pylibmc, the same memcached client library we use from Django.  If
that becomes a problem for whatever reason, all we really need to do is send
"flush_all\n" to TCP port 11211 on localhost.

(imported from commit 0b9736bd31b0549b5dabd4b735706351635a9cf2)
2012-11-26 16:59:37 -05:00
Keegan McAllister 0f20150a81 Nagios: move /var/lib/nagios/humbug-api to /usr/local/lib/humbug
(imported from commit ff3ff1e3cc54a4c556479e62e058002229143627)
2012-11-26 16:58:51 -05:00
Zev Benjamin 9de11f4df1 Use jQuery.one() instead of binding and unbinding a handler
(imported from commit 23b87ee500c0739b04e6fa3c89065d4af13ab9b5)
2012-11-26 16:49:11 -05:00
Tim Abbott 369f5e9d80 zephyr_mirror: Don't use @(@color(blue)) in zsigs.
(imported from commit e4b594e3c22c25fa4f87baaad09227396bb92a0d)
2012-11-26 16:19:09 -05:00
Tim Abbott 789a5c5e2d 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 e16e5f7e1a zephyr_mirror: Refactor zwrite_args handling a bit.
(imported from commit 4923c90dc546022d48f226c2a204e9d09717b563)
2012-11-26 14:58:34 -05:00
Keegan McAllister 9274ff20d5 examples/send-message: Remove default sender
(imported from commit 30ada075ac4f1b759fe787eef6a93275dbea584c)
2012-11-26 14:57:20 -05:00
Keegan McAllister 128302a7ff api/examples: Simplify optparse use
- The default 'default' is None
- The default 'dest' is the option name, with - replaced with _
- The default 'action' is 'store'

Not coincidentally, these defaults are correct for most of our existing code.

(imported from commit 9c6078bd778324e08e1ca214a97281a7bdce08c2)
2012-11-26 14:57:20 -05:00
Keegan McAllister ca723aed43 api/common.py: Ensure that the API key file is closed when we're done with it
(imported from commit 87a0feb52952aa76bec041d032027e7a272156fc)
2012-11-26 14:57:20 -05:00
Keegan McAllister a09c9de17c api/examples: Rework sys.path computation
(imported from commit 6e4c2a9b5f5ab6f6680704a1e06bd17fd95bd038)
2012-11-26 14:57:20 -05:00
Keegan McAllister c1994f3886 api/common.py: Reduce code duplication between API call methods
(imported from commit 4a0f1a8479c21366bf552edf98401b03bad72d9c)
2012-11-26 14:57:20 -05:00
Keegan McAllister 8576446791 Use a new-style class for HumbugAPI
(imported from commit a88366e0129dadb40b058ddd0ede64db3b6b206f)
2012-11-26 14:57:20 -05:00
Luke Faraone e57625d089 Submit form after the DOM is ready per trac #314
(imported from commit 8facaa097342c830353464989990edb853f2adf4)
2012-11-26 14:48:54 -05:00
Jeff Arnold 4cb0c6225e Add webkit desktop notifications
Partially addresses Trac #31

(imported from commit f1f04b5c50bf9f33b69c90926fd67015cd2dc219)
2012-11-26 14:43:55 -05:00
Jeff Arnold a6ec875268 [schema] Add enable_desktop_notifications to user profile
(imported from commit f5b543e8446263ce8855561441a6d4c1a8d41f4d)
2012-11-26 14:43:55 -05:00
Keegan McAllister d7b3afef6b Send Nagios alerts to Humbug
Fixes #385.

(imported from commit 7dac013debd6ccff031fc4da0dd7185e198b4498)
2012-11-26 14:42:55 -05:00
Keegan McAllister ec6ebd034b Add Nagios bot user
(imported from commit e36ea06908b488e4003463e1afa34181fd299316)
2012-11-26 14:42:55 -05:00
Zev Benjamin d8783cd0c0 Move reload in progress check from compose.show to compose.start
(imported from commit 8b84b24ca50a3bd149d67b868dd94908c0354022)
2012-11-26 14:42:27 -05:00
Zev Benjamin 85e2bf9030 Remove dead code. We keep the message type and client name in JS instead of the DOM now
(imported from commit 79834160c53a5f7d99918d629fde311aa99fe280)
2012-11-26 14:42:27 -05:00
Zev Benjamin 507a730f77 Make compose.show a private function
(imported from commit 32457fd7f045e9eb3febaed3de2dd1a4aebc9422)
2012-11-26 14:42:27 -05:00
Zev Benjamin 40b31f6f57 Remove dead code
(imported from commit 3893b95cc3c26596d580ea07286955c2ab19cddd)
2012-11-26 14:42:27 -05:00
Zev Benjamin e35ec6e022 Stop using Bootstrap tabs for compose
(imported from commit 39dfbf9c427aaf3a85507e26ffeb1257da3dc435)
2012-11-26 14:42:27 -05:00
Zev Benjamin 886bda2a45 Use accessors in compose.start
(imported from commit 82cc5dd5892b06a8490fcd40033212f28dca32b3)
2012-11-26 14:42:27 -05:00
Zev Benjamin 8367cec454 Fix indentation
(imported from commit 4735fd730eb74cff8d494fc3d440111733af505f)
2012-11-26 14:42:27 -05:00
Tim Abbott c86fd609e2 Add tool to build an API tarball for distribution.
(imported from commit eeaf9f526f243cc628eede603fe1b1691c34977f)
2012-11-26 12:25:39 -05:00
Tim Abbott 9c0e0844ef check-mirroring: Add subscriptions inside IOError check.
(imported from commit d3b00ce9d91a0bcffcef58436a4b90770155fce9)
2012-11-26 12:25:39 -05:00
Tim Abbott f7101aa3ef api: Add an extra send_message example.
(imported from commit fe5ab550fa862f587cdf7987c5b238dffab45672)
2012-11-26 12:25:39 -05:00
Tim Abbott 32f91f4ab0 api: Don't use 127.0.0.1:8000 as an example.
At least the zephyr.humbughq.com case is one our users might find
useful.  I imagine we'll end up hiding --site once we integrate the
zephyr and main site tornado servers.

(imported from commit a3a28492cf3f32b78eab6bbd48ba66be2f38a5f2)
2012-11-26 12:25:39 -05:00
Tim Abbott 3cc5973511 api: Add copyright and MIT license notices to distributed tools.
(imported from commit 9f93050f988549dc363f5a7c798c8a9fa1c01d29)
2012-11-26 12:25:38 -05:00
Tim Abbott e3f6a6a752 api: Remove hardcoded API keys from examples.
(imported from commit 64bf22298452a436d0aec796973a77f10d5e0bf9)
2012-11-26 12:25:38 -05:00
Tim Abbott 7314c12527 api: Read the API key from ~/.humbug-api-key by default.
(imported from commit 309469a0955969eafd78fbdf89d9651cb530010d)
2012-11-26 12:25:38 -05:00
Waseem Daher 6d2b2f897a Implement safari composebox workaround in a less fragile way.
If Javascript breaks or stops working, the previous hack means that
Tab-Enter stops working on Firefox and Chrome (since the tab key now
needs to select two divs before it gets to the Send button.)

By putting the one div *after* the Send button, we ensure that this
keeps working gracefully on Firefox and Chrome (and presumably IE), at
the expense of Safari in this specific case.

(imported from commit 9c9a613b1b1718ff8f0b9ef7497ebb13db0ddc64)
2012-11-26 12:15:14 -05:00
Keegan McAllister 545c1494f0 Configure the app to use memcached
Fixes #54.

(imported from commit c94f5b133143510289d410252340b9a4ab26709c)
2012-11-26 11:59:48 -05:00
Keegan McAllister b609840e82 puppet: Install memcached on app servers
We use the default Debian configuration, which listens on localhost only.

(imported from commit efa8333c7fa423e71a99ec06b2b420cae36fddfb)
2012-11-26 11:59:48 -05:00
Zev Benjamin da2c079503 Use Django's built-in @require_POST decorator
Theirs returns an actual 405

(imported from commit 31be790b0f53d7b63d7d3cd85972b16add3d8c74)
2012-11-26 11:52:50 -05:00
Tim Abbott fac24df233 Show a user-visible error message when mirroring is not working.
The main problem with this code is that the error message doesn't go
away until you reload.  To fix this, we need to add a noblock option
on get_updates.

(imported from commit dc45af397bcf06a218bda5dd224ebd5fdf3462db)
2012-11-26 11:49:29 -05:00
Tim Abbott eefa5b2d7b API: Add support for nonblocking get_updates requests.
(imported from commit bf2ab19a83765c177fbb93abc1a61dccf5b4b2b7)
2012-11-26 11:49:29 -05:00
Jessica McKellar be27ec1ad4 nagios: Change zephyr mirror liveness check to only care about aggregate statistics.
Too many individual users occasionally don't update their mirrors,
causing us to be permanently alerting; we have sufficient user
notification at this point (plus Waseem keeping an eye on /activity)
that we don't need to alert on individual users.

We do, however, still care if something happens (say, Linerva going
down) that causes many users' mirrors to go down.

(imported from commit 392952c95739e183d4a711120e3a963671cec289)
2012-11-26 10:31:29 -05:00
Keegan McAllister 75526a2c67 nagios: Drop ssh -o StrictHostKeyChecking=no
This is bad for security.

I've checked that all currently known hosts for nagios@nagios.humbughq.com
match one of our existing servers.  When adding servers to nagios in the
future, it will be necessary to do an initial manual ssh from nagios@ and check
the host key fingerprint.

(imported from commit adfd1d29f03343d4be04e87c5e26a018f31e5194)
2012-11-26 00:25:15 -05:00