Commit Graph

304 Commits

Author SHA1 Message Date
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
Leo Franchi d7a33485ad Register a tornado atexit handler to disconnect from rabbitmq
(imported from commit b70650070f1df548794a9e3ff2948d134fd0c5de)
2013-04-16 11:49:03 -04:00
Jessica McKellar 7175dc534a Send invitation e-mails asynchronously through RabbitMQ.
This avoids 10s of seconds of delay when you invite several people at
once through the web UI.

(imported from commit 75acdbdb04caf62bbb08affc7796330246d8a00e)
2013-04-10 16:57:49 -04:00
Zev Benjamin a2010871e3 Make subscription properties less free-form
(imported from commit eda607c2abfa51d2dadddc7b9ecba3e2d0b5be4d)
2013-04-10 16:11:27 -04:00
Leo Franchi 57974787b3 Set messages to read in populate_db
(imported from commit 726d2015dbb446f56e5a640b44107a3713917ed5)
2013-04-09 09:59:31 -04:00
Tim Abbott 807b6396e0 realm_stats: Only count messages sent by humans in most stats.
For our primary measures of user engagement, messages sent by bots can
confuse the picture (e.g. a realm could be dead, but not appear to be,
because they didn't bother uninstalling their github and jenkins
hooks).  So it's best to leave those out of our main stats.

(imported from commit 4d0f0e6442093daab164d0ed016fff1d1aa906c7)
2013-04-05 17:28:04 -04:00
Tim Abbott e1173b08df Fix check for non-default Subscription colors.
(imported from commit b904220f7b1a013081b1d680d98b15a7532f0839)
2013-04-05 17:28:04 -04:00
Luke Faraone f4d00b6af9 [manual] Push new users' data to MailChimp.
This creates a new management command, subscribe_new_users, which should be
run as a daemon process. When new users are created, an event is passed to
RabbitMQ including the following data:
 * Email
 * Full name
 * IP address of the person who confirmed registration
 * Time of registration confirmation

MailChimp strongly encourages the collection of the last two to enable
responses to abuse requests, and providing more data lowers the chance that
we could get banned from their service if complaints do occur.

To use this commit, you need to install the "postmonkey" module from
PyPI.

(imported from commit 20c628c3fa8bb985aaead85a80ad3b38bf94b9dc)
2013-04-05 10:22:26 -07:00
Tim Abbott fdefa06190 Eliminate use of old StreamColor model.
(imported from commit c72a06bdc44f30fb6bca299463e259262367e8c2)
2013-04-04 17:48:51 -04:00
Tim Abbott 0ee684a4b5 [schema] [manual] Add colors to the subscription model.
This is preparatory for removing the StreamColor model, so we also set
things up so anything changing the StreamColor model changes the
Subscription model too.

The manual task is to run the copy_colors.py management command after
deployment to each of staging and prod.

(imported from commit 1be7523ca59f5266eb2c4dc2009e31209ed49635)
2013-04-04 14:17:01 -04:00
Tim Abbott 1a4047cb95 Remove User migration tools.
(imported from commit 928124d5a8056d5cb1736cfc4c7158c228437c1b)
2013-04-02 12:57:15 -04:00
Tim Abbott 1cec86eb2d [manual] Remove now-unused User model.
I think all that one needs to do to deploy this commit is on developer
laptops, run `generate-fixtures --force`.

(imported from commit 34916341435fef0875b5a2c7f53c2f5606cd16cd)
2013-04-02 12:57:10 -04:00