Commit Graph

2504 Commits

Author SHA1 Message Date
Zev Benjamin a92a35906c Reset favicon after setting window.location.hash
Firefox drops the favicon after modifying window.location.hash, so we
reset it after modifying it.  See
https://bugzilla.mozilla.org/show_bug.cgi?id=408415 and
https://bugzilla.mozilla.org/show_bug.cgi?id=519028

This fixes #422

(imported from commit 3d7ac5ba28a4fa94d2bd9a0f711db8cd538039d3)
2012-12-17 20:55:47 -05:00
Zev Benjamin 989cee3194 Only set the hash portion of the URL for future-proofing
(imported from commit b860e6c5dde0a75c54678d6a6798611497c1db39)
2012-12-17 20:54:32 -05:00
Zev Benjamin 339ef0f139 Set the favicon a little more portably
http://en.wikipedia.org/wiki/Favicon claims this will work across all major browsers.

(imported from commit ab849cf3c0ac263fdff358c1ab77e079ccf90704)
2012-12-17 20:54:30 -05:00
Tim Abbott 95f4087a06 Fix dump_pointers on last time.
(imported from commit c16686492e5acd699976268cb48c0290099688cc)
2012-12-15 09:28:22 -05:00
Tim Abbott 35226c352d Enable postgres on prod server.
(imported from commit 4cf25c4ffe685dcfeb8d6c87ade3fcca7a92a807)
2012-12-15 08:42:12 -05:00
Tim Abbott 15c83127ee Rename do-schema-change to something more scary.
(imported from commit e02b9e7a778d104fb0bdb346947f639622186aa7)
2012-12-14 17:57:23 -05:00
Zev Benjamin e6a26d1bb1 Adapt do-schema-change for Postgres
(imported from commit 3ab9054d110acf379c8d1686acaf56a92b4f90da)
2012-12-14 17:56:12 -05:00
Tim Abbott 6b85b76de9 check-mirroring: Fix hardcoded logging path.
(imported from commit 93b0d27285f79ecd7286cc07bc7727f754bc8012)
2012-12-14 17:34:37 -05:00
Tim Abbott cefd4baae9 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 bf95839e27 check-mirroring: Try receiving zephyrs multiple times to avoid large queues.
(imported from commit 08c08df46794cd89db19748c3d5adfa4097de4cb)
2012-12-14 17:34:37 -05:00
Tim Abbott 0dda71fb54 Fix website improperly submitting a last value of -1.
We were submitting a 'last' value of -1 to the server at startup,
which is invalid but normally ended up being OK because the user
usually had no messages whatsoever or had last be updated via
get_old_messages before the get_updates call went through.

(imported from commit df55ac1cdac443721c06ebed94a1c4b3ec7af2d1)
2012-12-14 17:15:32 -05:00
Tim Abbott aa0924f36b Switch Tim's laptop to use postgres.
(imported from commit e7f9d359843d23986ba25576531f0935f99f4c12)
2012-12-14 17:15:32 -05:00
Tim Abbott b2755472bb populate_db: Fix unnecessary import from zephyr.views.
Importing zephyr.views here has the unfortunate side effect of
creating Client ids 1 and 2 automatically (via decorators.py
instantiating the two client objects it makes), before we go ahead and
delete all objects in the database as part of the populate_db startup.

(imported from commit da03cb7606334d5926e42f422ab94d1c884937b9)
2012-12-14 17:15:32 -05:00
Tim Abbott dc2057ff73 dump_pointers and dump_passwords: Add error handling for deleted users.
(imported from commit 556c29133a4734014d4640d875c6d6fccc118668)
2012-12-14 17:15:32 -05:00
Keegan McAllister 197d0dcc01 Revert "Pause for 25 ms in between successful get_updates calls"
This was not totally effective, and with the previous commit it is no longer
needed.

This reverts commit e86c0b653669cf86b0d8956c2c85eb7610fc342f.

(imported from commit 0de5bfec87147b1336f6f79c33d4e32493e1e508)
2012-12-14 16:22:42 -05:00
Keegan McAllister 7c74017bc0 Decrease get_updates timeout for client test suite
Fixes #475.

(imported from commit d8f908c55f2e519541e5383a742edbf23183539c)
2012-12-14 16:22:42 -05:00
Keegan McAllister 44b9925bfc Configure get_updates timeout in settings.py
(imported from commit 2a647bdd73c43ca5fed704925808efafc70da044)
2012-12-14 16:22:42 -05:00
Reid Barton f48e875d13 api: Pass along --site in init_from_options
(imported from commit a893c098b92690214a90a572ab54504d93da29e6)
2012-12-14 16:15:39 -05:00
Zev Benjamin 103eb5130d Authenticate to Postgres with client certificates and check the server's certificate
(imported from commit a3be2178d7675d409d81b9119815ac1f680d1388)
2012-12-14 11:38:18 -05:00
Tim Abbott ce40de14c9 Add a tool to save/restore user passwords.
(imported from commit 59bea04308bc0c42aeef840aa923dbef1919d31d)
2012-12-13 17:10:03 -05:00
Tim Abbott 434765d810 populate_db: Close database connections before shutting down.
This avoids some messages being logged by the postgres server.

(imported from commit 86aaa025a36dad6ec14d49b629cfb1ec326f929c)
2012-12-13 17:09:35 -05:00
Tim Abbott e330be7fc1 dump_pointers: Use timestamps, not IDs, for transmitting the pointer.
(imported from commit 9b51b9edc5b0bdfb2305c12a123d554811ec9e06)
2012-12-13 17:09:35 -05:00
Tim Abbott bda420a0f9 Fix email case issues when restoring user pointers.
(imported from commit 84d3288dffc1cb010d8cd2a749fe71aa2a4d0df3)
2012-12-13 17:09:34 -05:00
Tim Abbott 899cbabe23 populate_db: Make some more bits of memory possible for Python to free.
(imported from commit 2d8184d05f622475ffab1043a40251644a88c230)
2012-12-13 17:09:34 -05:00
Tim Abbott cfc3781841 populate_db: Fix StreamColor restore.
Previously, the StreamColor restore code didn't properly account for
the fact that most user subscriptions were in pending_subs and thus
not yet in the database.

(imported from commit 2e28c5a68aa045494b9336d7114c23f5c3706c28)
2012-12-13 17:09:34 -05:00
Tim Abbott 7707690231 Decrease memory usage in bulk_create for UserMessage objects.
By processing UserMessage objects in batches as we go, this avoids
consuming a large amount of memory that is linear in the size of the
messages log.

(imported from commit 0c42d97f0863da9c079836c60bebcbaeec59f849)
2012-12-13 17:09:34 -05:00
Tim Abbott 9811050a4f views: Add json_to_list and use it and json_to_dict more.
(imported from commit a6fdc85edb8066eab7ca7cfa5f6f5fdf53b10a8c)
2012-12-13 16:39:58 -05:00
Tim Abbott 2280e4a58a Rename from_json_to_dict to json_to_dict.
(imported from commit a96d29c5e9a700c54a29a8777d7a1e5a4ccbd77d)
2012-12-13 16:39:58 -05:00
Waseem Daher 7de057dcb0 Remove unescaped use of stream name in subscriptions page.
This was causing issues with our ability to unsubscribe from
streams with " in their names.

The solution here is a bit hacky, since it depends on the JavaScript
being fairly aware of the layout of the DOM, which is not great.
But it works.

This fixes Trac #328.

(imported from commit a1b6c8e1f3a9daacdc48920a195717aa89b3a9a9)
2012-12-13 15:46:30 -05:00
Waseem Daher 858d638960 Make subscriptions page slightly more robust to weird characters.
This fixes Trac #522, which previously prevented you from
subscribing to a stream named
    '"]'); alert('hi');

This does not fix #328, which is that you can't unsubscribe
from 'Waseem', among other things.

(imported from commit 869063cafa9e7e988aea993d072ca1ad880bcee1)
2012-12-13 15:46:30 -05:00
Waseem Daher 622bcb9ef4 Call the colorpicker drawing code just once, rather than in a tight loop.
Unfortunately, this doesn't actually give us much performance gain
either; it's not really the calls to 'find' that are taking any time.
But I do find this a little cleaner as well.

Simply initializing 100 colorpickers with our options takes about 700ms.
Initializing ~100 colorpickers with the total default set of options
shaves that down to about 300-400ms (though obviously doesn't quite
achieve what we want).

(imported from commit 7084b35fb6e77600edfcdcfcc2761a11e6f38c03)
2012-12-13 15:46:30 -05:00
Waseem Daher cd237c3429 Smarter template invocation on settings page.
Rather than calling the template generating code once per
subscription, let's just do it in a batch when possible.

With about 100 subscriptions, the "fetch" call takes about 800ms to
render (while testing locally) both before and after this change,
which is somewhat disappointing.

But this *is* cleaner!

(imported from commit 9ba8819524da86c00a2508349be0ea0ddd48606b)
2012-12-13 15:46:30 -05:00
Tim Abbott e7b74060d2 Log password change events via the password reset feature.
(imported from commit bbec7074229e8779c81d439d4eef373b5dac9fa7)
2012-12-13 15:22:35 -05:00
Luke Faraone 7ee945062d Add command to mark users as inactive.
This is useful when testing the sigup workflow, as this script enables you
to run through a MIT signup without manually creating a new inactive user
in the database.

(imported from commit c22649cc7c561c2fbe8682d1b17d7e5aba9ac04e)
2012-12-13 14:15:31 -05:00
Tim Abbott e6fef7d7ba Fix confusion of user / user_profile objects in MIT signup codepaths.
(imported from commit f39943bf31f705365ed9743c6d2e9239fed8c9e2)
2012-12-13 13:32:34 -05:00
Zev Benjamin 1aa825e6d0 puppet: Add generic nagios monitoring for postgres.humbughq.com
(imported from commit 9e732b69580bc3da8507a5fe6fdd81f044fb4443)
2012-12-13 11:30:02 -05:00
Zev Benjamin cd73e13601 puppet: Add python postgres module (python-psycopg2) to humbug_app_frontend packages
(imported from commit 3f41629d6f1e2c26458e223bc2135a53ac3bdd14)
2012-12-13 11:30:02 -05:00
Zev Benjamin dc6d48611d puppet: Accept traffic on port 5432 (postgresql)
(imported from commit bf30d0af2377209f3d5c10add3a526a1fee28dd8)
2012-12-13 11:30:02 -05:00
Zev Benjamin 4d2899b5f8 puppet: Add postgres config
(imported from commit ca932a1a1af7e7236ff1f47785acf4b412b16650)
2012-12-13 11:30:02 -05:00
Zev Benjamin 155e2c4943 install-server: Allow users to use an alternate humbug root
(imported from commit 1b5e57c1ec8c175733c8fb15343b096c46e6b6b2)
2012-12-13 11:30:02 -05:00
Zev Benjamin ab373d6457 install-server: Use "apt-get -y" instead of "yes '' | apt-get"
(imported from commit 0157f179928d69a5f0ff574a2d003187f28c1772)
2012-12-13 11:21:25 -05:00
Zev Benjamin 11f8dc644d install-server: Quote filenames in existance checks
(imported from commit ed17b65d875b5321c57fff4e16263282cccf4dff)
2012-12-13 11:21:20 -05:00
Zev Benjamin 16a5af0b8d install-server: Accept apt-get prompts
(imported from commit 2f69d047488d3d82689a4fc71777e3c4667b36d5)
2012-12-13 11:21:16 -05:00
Zev Benjamin b6b0ab80cb install-server: Check for humbug-self-signed.key before running
(imported from commit 0c5ab50fbb278db740690522e2354f33f1958cc7)
2012-12-13 11:21:11 -05:00
Zev Benjamin d90fb5d00f install-server: Use named constants for file paths
(imported from commit 6178f8110c6f79c642dd3c8cde149be6e4d72e16)
2012-12-13 11:21:05 -05:00
Zev Benjamin 4788443e60 Switch staging to use postgres
(imported from commit fde5bf54a42c6be95fe2436094d7ac1626c29683)
2012-12-12 18:24:22 -05:00
Waseem Daher 4108f2f817 Add a 'realm' column to the activity page.
This makes it easier for me to, e.g. check on all of CUSTOMER1.

(imported from commit 1970df29b08b299cd1d00013abecefd7efbffb48)
2012-12-12 18:05:54 -05:00
Luke Faraone f76ea63b77 Document humbug-send and humbugrc in README for API users
(imported from commit 9ca282d4d768f2d2a474da1209621f03147954fe)
2012-12-12 16:48:00 -05:00
Luke Faraone 2da0a2275c Switch to the option group pattern for API examples.
(imported from commit 67d0164df822a56f06d5f959297cc2efa9706001)
2012-12-12 16:48:00 -05:00
Luke Faraone 5a0f1897bc Add humbug-send, a more full-featured sending tool.
(imported from commit 631f3c7320192a502b60bc4c4838d068ed60ee76)
2012-12-12 16:48:00 -05:00