Commit Graph

315 Commits

Author SHA1 Message Date
Tim Abbott 9cb2cb07d5 populate_db: Tweak the humbughq.com realm's default streams.
(imported from commit c13e68e4e3de9d689eb494709c7de54c5a063060)
2013-07-09 14:35:02 -04:00
Luke Faraone 09249ffa3b knight should dry-run unless you specify -f
(imported from commit fd0e5af1d941c6fadcbc14ff7f86f71a170a503e)
2013-07-08 17:07:55 -04:00
Luke Faraone 2daf8db3a5 Add a parameter to knight.py to remove user rights.
(imported from commit 4527955f688298ba56296e9f24d42e33f7d04948)
2013-07-08 17:07:55 -04:00
Luke Faraone f22abf2b8a Add a management command to create realm administrators.
(imported from commit ab2dd580a206f29086c0d5a4e717c1bfd65a7435)
2013-07-08 17:07:55 -04:00
Luke Faraone 6988490980 Add a management command to create objects for newly defined permissions
This script does not remove permissions that already exist.

(imported from commit 15d18266a05a84b9cac6cc7d2104668b41b48f35)
2013-07-08 17:07:55 -04:00
Luke Faraone 6a49e8aa1b Deactivate bots in deactivate_user.py
Closes trac #1434.

(imported from commit d60e338f77b5ee38a43c6cd3edb9b3de0cd0cacf)
2013-07-08 14:30:20 -04:00
Luke Faraone 573bb8e5fd Add populate_db support for deactivating users.
Prior to this commit, populate_db would crash if you had ever deactivated
a user in your development instance's message log.

(imported from commit 227b2c0226a46ef5680443d3dbf62a13ce961e64)
2013-07-08 14:00:19 -04:00
acrefoot b6bd54b350 If your event_log is empty, finish (don't fail) with more helpful message
(imported from commit b08e8fc32438fba16fbe1c3f01afc99a1b62d583)
2013-07-03 11:15:09 -04:00
Leo Franchi a2294c05d5 Send the proper Content-Type header on our Tornado responses
(imported from commit 574d2421541449fae0f91509dc3bc018e49bd24d)
2013-07-02 11:46:10 -04:00
Scott Feeney 83cd963c49 Remove unused imports
(imported from commit 9e3050c72a2d1137b9096c6cfa1c3945341b9a56)
2013-06-27 16:22:39 -04:00
Steve Howell 2bacaf2213 Fix % formatting style in miscellaneous places.
(imported from commit 917196024c981f879355c728da9b4590e964eeef)
2013-06-27 14:41:17 -04:00
Tim Abbott 08ba672c34 process_user_activity: Fix incorrect format string for unknown event type.
(imported from commit 6ca2d1126b61c8f881d5e52478eeef974005757f)
2013-06-27 12:56:08 -04:00
Kevin Mehall 953e195be1 Refactor update_message_flags to do the query in the django process.
Trac #1398.

(imported from commit c001747d8e6d78a12fe535c36a81c12592976840)
2013-06-25 15:25:25 -04:00
Tim Abbott 222ef672b5 [manual] Use ujson instead of simplejson.
This saves something like 15ms on our 1000 message get_old_messages
queries, and will save even more when we start sending JSON dumps into
our memcached system.

We need to install python-ujson on servers and dev instances before
pushing this to prod.

(imported from commit 373690b7c056d00d2299a7588a33f025104bfbca)
2013-06-24 10:17:10 -04:00
Tim Abbott 678dd502ef Add command-line tool to profile get_old_messages requests.
(imported from commit bd7fc27b0c6fc1ae4f82bb74763736f9163b90bf)
2013-06-24 10:17:09 -04:00
Scott Feeney scott@humbughq.com 0fde644417 Fix typos in "No ~/.humbugrc found" error message
(imported from commit b0c8aab4668751d9b1d12792d249645498a95932)
2013-06-18 17:47:03 -04:00
Steve Howell e753fd8088 Simplify setup for Humbug internal users.
I moved the list of internal users out of populate_db.py and
into settings.py, and I removed some dead code related to sqlite.

(imported from commit 1e080716dc296c05f51cdd229911082469de64bd)
2013-06-12 11:42:18 -04:00
Leo Franchi 72295b0c15 Fix case where redis-py returns an int instead of a string from TTL
(imported from commit ad1d9b43e4776cd6ce0c51573799767b2cf9bd96)
2013-06-05 16:56:25 -04:00
Leo Franchi 21b1090f39 Warn if TTL of redis key is -1
(imported from commit f44ccef6dee190f531537fc8f3af9354c737a17f)
2013-06-05 16:49:30 -04:00
Zev Benjamin 300e57fcbd Fill memcached caches synchronously before restarting the server
(imported from commit a45fa845e94a1fc6e96a1aafca31e9a6fc2b7526)
2013-06-05 16:33:43 -04:00
Leo Franchi 23b4ad3b02 Add a redis_check management command
(imported from commit 04a272ca8d8288f7e3b1a54fd5d73629bde938a0)
2013-06-04 09:43:09 -04:00
Leo Franchi 0b5b1dafc4 Add a rate limiting system to our backend
(imported from commit a1218618918b4dedc77307e2f277665e7dd8fa22)
2013-06-04 09:43:09 -04:00
Jessica McKellar bd5bc4fcf7 create_realm: be able to specify an open realm.
(imported from commit 227b89c51c45b2a3fcd343b2a6a986f5212c1b9c)
2013-06-02 15:12:27 -04:00
Luke Faraone 905cf9b3ff Always create a new PreregistrationUser in generate_invite_links
Previously if you had been invited twice to use the app this management
command would fail with your address, since the email address was no longer
unique.

Now by unconditionally generating a new PreregistrationUser object we avoid
this problem.

To test, invite a user to Humbug via the webapp twice, then generate an
invite link for them manually. The latter operation used to produce a
traceback, but now works.

(imported from commit b6c816187e6302b3cb3eea2928565b3a12046c4b)
2013-05-31 12:24:30 -04:00
Leo Franchi 3979b4379d Fix activity checking by message flag updating
(imported from commit 3c534ba674f5ff2fe8a7cdafe0e80bde6fea7d79)
2013-05-29 15:39:53 -04:00
Tim Abbott f79ebeb92d active_user_stats: Track user reading.
(imported from commit 3e8ff76c1f355686af74b1dc4081a7c130deb2e9)
2013-05-29 15:39:53 -04:00
Tim Abbott 7927edb374 Ensure your dev environment API key matches your ~/.humbugrc.
(imported from commit d4d0699ce912685ede445ed677c46dfeefa68b42)
2013-05-29 15:11:24 -04:00
Tim Abbott abd9e4e635 Use proper randomization when generating new API keys.
Previously we were generating API keys deterministically using a hash
of the user's email address; this is clearly not a good long-term
approach.

(imported from commit 14d0c7c9edbc45b3ae1d17a43765ad9726338d4d)
2013-05-29 15:11:24 -04:00
Leo Franchi 65b247edec Add a event_queue gc hook for missed messages
(imported from commit a799abb35a9622e6aa59e9499cab3281ccb6859f)
2013-05-24 21:23:59 -04:00
Tim Abbott 6d5350d54d populate_db: Add stream notifications support.
(imported from commit 86464b9ce7084de116019491eb8697fd6cd7fa54)
2013-05-22 12:10:16 -04:00
Tim Abbott ce65bdce2e populate_db: Add stubs for remaining known event types.
(imported from commit 6721c9303e153a072d6aaf572dd7760c7b3202f3)
2013-05-20 23:29:55 -04:00
Tim Abbott 665a58b639 populate_db: Fix buggy subscription property event parsing.
(imported from commit 58b1ea62819c633bb5621d8d5b4ade1278f2104f)
2013-05-20 23:29:55 -04:00
Tim Abbott 0cf2626f3d populate_db: Fix typo in password change handling.
(imported from commit 046a106e5778695223e634bf9aff15f4123ba3ce)
2013-05-20 23:29:55 -04:00
Tim Abbott 5195451519 populate_db: Fix parsing of user_email_changed events.
Note that this doesn't actually handle them properly -- it just parses
them.

(imported from commit eca061c9657a970ae6c0d622958a16097ed99ac5)
2013-05-20 23:29:55 -04:00
Tim Abbott d45f840140 Send automated humbug error notifications to the 'errors' stream.
(imported from commit 6aa1ec59b2902b0f806b4caf77cbf76e6b7dfbec)
2013-05-10 17:52:45 -04:00
Leo Franchi cb8e1147e2 Log which missedmessage events are received
(imported from commit b0b662e97fd9199644c7cf1ac7bc11e6c4d25376)
2013-05-09 10:35:48 -04:00
Leo Franchi 065e6de420 Add management command to handle & email notifications about missed messages
(imported from commit 5b1479bc91d559e96467aa09405d823f9b2bbdf6)
2013-05-09 10:35:48 -04:00
Leo Franchi 4173862833 Send notification with missed message to users if they received a PM while offline
This is configurable in the user's settings on Humbug

(imported from commit 80bf6d7a6f0dc3811117548e2225865db8b533d9)
2013-05-09 10:35:48 -04:00
Luke Faraone 6bc2d21b87 Make audible notifications a tunable.
This decouples from Chrome notifications, which gives us cross-platform
support in at least modern browsers.

We log this action so its replayable in our message logs.

This implements the model change indicated by the previous schema commit.

(imported from commit b21213cdde54f43670bbb0bf1f607147fc732b38)
2013-05-03 15:08:49 -07:00
Leo Franchi 2e00749b31 Also collect 10min active user stats
(imported from commit 63b0dbd94022e6d35ceb28952c30a4c25be6a88f)
2013-05-03 10:36:00 -04:00
Jessica McKellar 4a01b7a95c realm_stats: report on features like starred messages and home view.
(imported from commit ee026ee48f9038c0cb9456bd3b0e1a89460b4968)
2013-05-01 21:59:29 -04:00
Jessica McKellar cc7fddedbc Add a new stream_stats management command.
(imported from commit 7a8e94459ac7402f27ae45598eb113496672b9bf)
2013-05-01 21:59:29 -04:00
Jessica McKellar f4dd598330 realm_stats: since we now auto-color, remove colorized streams reporting.
(imported from commit a051f3077dd0746bfca7944c2369fd90c1db80f7)
2013-05-01 21:59:28 -04:00
Jessica McKellar ce218dec48 realm_stats: only count active (not deactivated) users.
(imported from commit e35838d5bb6260efb33290ab63fdbd10a3d9d879)
2013-05-01 21:59:28 -04:00
Jessica McKellar 5fb65712af realm_stats: only include streams with subscribers (ie not tutorial streams).
(imported from commit 870ce51df191611569bdd7c2509cc679748ea201)
2013-05-01 21:59:28 -04:00
Jessica McKellar cc321636b1 Add a management command to bankrupt users.
(imported from commit 58fbd08fc31a69c9ee7fb73b9302d44eb87db1fa)
2013-05-01 21:16:40 -04:00
Leo Franchi 5ef7c4e6db Add a management command for active user stats
(imported from commit a4227858b422c48e272700880e0c21889c7ce566)
2013-05-01 11:17:18 -04:00
Tim Abbott 5e22778843 Use a function for stopping/restarting time logging for longpolling.
(imported from commit 11b772deaa126fcc7e7605d467022b22d9e98cb0)
2013-04-24 10:44:56 -04:00
Luke Faraone 71a91197fa Enable absolute imports.
See PEP 328[1] for details. This feature was introduced in Python 2.5 and
will become mandatory in Python 3.

[1]: http://www.python.org/dev/peps/pep-0328

(imported from commit 7444eeba8a08d5f91b94c7921848f2274979bd76)
2013-04-23 09:51:17 -07:00
Leo Franchi 29ad205b01 Add a management command to send a statsd message
(imported from commit 25ead4a0dee185a139eb5401e109c9cbe937c7bf)
2013-04-18 18:05:52 -04:00