Commit Graph

3101 Commits

Author SHA1 Message Date
Leo Franchi 6d30793a02 Add tests for XSS and emails
(imported from commit 9441f65218fa5b102658d0dd48b88fdf826eeef2)
2013-02-01 18:42:27 -05:00
Leo Franchi 3569e8e9b2 Sanitize links to prevent XSS, and handle emails
(imported from commit 622396efde50d9f5e3501f5d780c344ad0692662)
2013-02-01 18:42:27 -05:00
Tim Abbott eb4930591d Send review requests to stream review.
(imported from commit 6e2e5ad2a4fadd2693341cb044c3e2152c787952)
2013-02-01 16:48:35 -05:00
Tim Abbott df5cef6a0d review: Use a more information Humbug message content.
(imported from commit 1c6ecce9920287b07527002421861dfe24817409)
2013-02-01 16:48:35 -05:00
Leo Franchi ea2e816c4c Add tests for auto linkify
(imported from commit 395fc679ffa835f48044fce1e9c1f818581c23c3)
2013-02-01 16:14:29 -05:00
Leo Franchi cc58044234 Rework linkify regex to match more urls
(imported from commit 0e1a1df88363374ffbc802f83f43eb0fac8c99ea)
2013-02-01 16:14:29 -05:00
Tim Abbott a7281f7e5a Add notes to puppet config about manually deployed symlinks.
(imported from commit 219f3b407bd83e0728f049820ad06092d6eed12a)
2013-02-01 16:04:11 -05:00
Luke Faraone a18d6ff9c7 Update build-api-tarball to use setup.py.
This comes at the expense of only functioning on the current working tree.

(imported from commit a92dd47f0cc4d47858c2ea678d86ceb9458a6fe5)
2013-02-01 15:52:29 -05:00
Luke Faraone 8e0ed8eb07 Update README to document new layout and installation instructions.
(imported from commit ba4d8c4db31ef572b53f49b6792b926236bea553)
2013-02-01 15:52:28 -05:00
Luke Faraone 0e4f1b6d24 Basic setup.py script for API
Refer to the API version via an import.

(imported from commit ef28f4edc0d519b4c6a49ef414279685a3d38202)
2013-02-01 15:52:28 -05:00
Luke Faraone 57e0d37249 Move files around in the API.
Bots are not part of what we distribute, so put them in the repo root.

We also updated some of the bots to use relative path names.

(imported from commit 0471d863450712fd0cdb651f39f32e9041df52ba)
2013-02-01 15:52:28 -05:00
Keegan McAllister 1622f53cb1 test-backend: Allow running a subset of tests
This now allows e.g.

    ./tools/test-backend zephyr.BugdownTest

or

    ./tools/test-backend zephyr.BugdownTest --verbosity=2

but unfortunately not

    ./tools/test-backend --verbosity=2 zephyr.BugdownTest

(imported from commit 95302db3efe45182d789c40c2a2899230a06b091)
2013-02-01 15:38:56 -05:00
Keegan McAllister 27b82c205f test-backend: Allow passing command arguments to manage.py test
This allows e.g.

    ./tools/test-backend --verbosity=2

(imported from commit 68979731e6d4ddba2bda62daa5f3206e633b54da)
2013-02-01 15:33:24 -05:00
Tim Abbott fe100d0047 Log a message with details on any 40x responses.
(imported from commit d1c3cf28ec55cb507f4a0c17168b352323b11d5c)
2013-02-01 14:50:28 -05:00
Tim Abbott 3c6dc21b05 Add pagerduty_nagios.cfg to git.
(imported from commit 2f7110d5ab65893afcb83e6f38944bf065abedff)
2013-02-01 14:50:28 -05:00
Tim Abbott 26aece90b8 nagios: Enable the Nagios commands feature.
This allows us to in particular reschedule a Nagios check to run
immediately, which I've in the past found super useful when trying to
figure out whether we actually fixed a problem.

Unfortunately, Nagios config sucks and there's no easy way to create a
group containing all of us as people able to issue commands; you have
to list them in like 8 different places.

(imported from commit 2c1e53330eff1e47e09d0b1917136f101d64e86a)
2013-02-01 14:50:28 -05:00
Tim Abbott 1fe6045288 nagios: add check that process_user_activity is running.
This fixes trac #670, and also adds the "-u humbug" parameter on the
other check_procs run, since that is a good practice move to help
avoid the check counting its parent process as one of the matches.

(imported from commit 43ae9b4863ba67579a21c86a910b73019f85a538)
2013-02-01 14:50:28 -05:00
Tim Abbott 2dd2bc8759 nagios: Make default contact_groups not page.
This will help us avoid making things accidentally pageable.

Also, explicitly set contact_groups for all our services, to help
encourage making explicit decisions about which new items are
pageable.

(imported from commit 740c6550d4a7091e58681435eeb7aaabf98df75c)
2013-02-01 14:50:28 -05:00
Waseem Daher 3e28cbc545 Make 'narrow to messages containing x' the default.
As it currently stands, after the introduction of operators, narrowing
to messages that contained X would also trigger a find-in-page.

This stops that from happening, and then also makes the default action
of the search-bar-invoked-without-a-typeahead be 'narrow to messages
containing x' rather than 'find in page'.

(imported from commit 1beffce426c6b00449e7c1c803687a129747ed63)
2013-02-01 13:47:20 -05:00
Tim Abbott 72bc299af2 Add tool to analyze fraction of Zephyrs sent using Humbug.
(imported from commit b491961b21e845471b1c52eae2b7069cc5328103)
2013-02-01 13:37:40 -05:00
Waseem Daher 768725cb7c Provide visual feedback that we're working on your invitation request.
This is a tricky one because it's kind of hard to see locally, but
there's a bit of a delay between when you click "Invite" and when we
get back to you. So we give the button a "loading" state so you know
not to click again.

(imported from commit 9c3389a3d06def777427c846d6106f6d9b30cc8b)
2013-02-01 11:26:46 -05:00
Waseem Daher ca68ca58a9 Clear out any old status messages when showing the invite form.
(imported from commit 5961823a3429b419b8d699b6a04e0ccd1607249c)
2013-02-01 11:26:46 -05:00
Waseem Daher 7e2271dd18 Replace HTML comments with Django template comments, in the navbar.
(imported from commit 3c313f2f4a0014ff705332cf068c40a4baed968e)
2013-02-01 10:36:17 -05:00
Waseem Daher 2c954c8f82 Move navbar code into its own "navbar.html".
(imported from commit 4fa1c5d5ffa0af0ae8d608fad762470bf737205c)
2013-02-01 10:36:17 -05:00
Waseem Daher f3bbb7b294 Move all of the "alerts" into a row in our navbar.
This is literally a pure "move HTML" operation; no actual code
changes.

This will make them always visible, even when we're in skinny mode
(and will also make more room for our list-of-streams-and-people
sidebar on the left.)

This does have the side-effect that the errors cover up the rest of
the application (in particular, the floating narrowbar). I don't view
this as the end of the world, though the more robust solution would be
for navbar-spacer to grow when the navbar does, and for everything
else to be correspondingly pushed down.

You can visualize an extreme version of what this looks like with
   $(".alert").show()
in the Javascript console.

This fixes Trac #720.

(imported from commit 7a3b12aebcca389465bd1e5852cef5d08fafe3e7)
2013-02-01 10:32:51 -05:00
Jacob Hurwitz c3c79f5423 This magically makes the gear not move when the search box is focused
(imported from commit b562c358f3ba80877e8f03199638c236823d184c)
2013-01-31 19:07:13 -05:00
Zev Benjamin d5fdfd7be2 Make searching for multiple words be treated as the boolean AND of those words
(imported from commit d9e47dd25553cc31eeda615e3a5709436e883ab3)
2013-01-31 18:10:54 -05:00
Waseem Daher 6d5424c910 Put "find in page" as the last option.
Leo points out that if you type a stream name, we probably want
to offer to narrow you to that stream more than we should offer
to find that stream name in the page.

(imported from commit 803ac681ec2f759f4dabb68a40722a07b86a0cab)
2013-01-31 17:50:53 -05:00
Waseem Daher 6cefbde820 Make "Find" option read "Find x in page".
(imported from commit 5d95b996f4d944c285ca6f5bc0f75ea359cb4df2)
2013-01-31 17:50:52 -05:00
Keegan McAllister 98a7d31374 Add tests for the bold / italic syntax
(imported from commit aaaf87e88d2db8e201d9f98b4e7411cfc56d50c2)
2013-01-31 16:28:57 -05:00
Keegan McAllister 5178c663ae Remove documentation of italic syntax
(imported from commit ca487e3b2d89890c55d2061e338210afad9e674b)
2013-01-31 16:28:57 -05:00
Keegan McAllister d348e0e9d6 bugdown: Disable italics and __foo__-style bold
(imported from commit c35d6980db6c59828514a90eec199a7494625495)
2013-01-31 16:28:57 -05:00
Zev Benjamin 97851a93c4 Use full text search when using Postgres
On my laptop, this cuts search time from several seconds down to
a few hundred milliseconds.

If we want even more speed, we could store the ts_vector as a column
on the message database.  The Postgres documentation says this will
make "searches [...] faster, since it will not be necessary to redo
the to_tsvector calls to verify index matches."  Going this route
requires creating a trigger to automatically insert the appropriate
column when new rows are inserted.

Note that the full text index must be fully created before this
commit is deployed.  Full text search without an index is actually
significantly slower than using the LIKE operator.

(imported from commit ae74083da20d33aa2425d3e44fcdc19b160002ba)
2013-01-31 15:57:45 -05:00
Zev Benjamin c6d196a22f [manual] Add South migration for creating a Postgres full text index of messages
This schema migration is only for use in automated migrations.  To
deploy on the production database (the migration only needs to be
done once for both of staging and prod because they share a
database), you should instead execute the following SQL manually:

$ ssh postgres.humbughq.com
$ psql
humbug=> CREATE INDEX CONCURRENTLY zephyr_message_full_text_idx ON zephyr_message USING gin(to_tsvector('english', subject || ' ' || content));

Note the addition of the "CONCURRENTLY" keyword.  The problem is that
creating the index takes non-trivial time and requires a write lock
on the table while the index is being created.  This would mean that
users would be unable to send messages while we were generating the
index, which isn't acceptable.  We can't create the index
concurrently in the South migration because concurrent index
creations can't happen inside of a transaction and South forces a
transaction on migration functions.

Also note that this index must be created before Postgres full text
search is deployed to the app because full text search without an index
is actually much slower than plain search using the LIKE operator.

(imported from commit 8b9445c27d0e427278de997b22342bffe6d855b7)
2013-01-31 15:57:45 -05:00
Zev Benjamin 1f4e27cf52 Pass the query object to NarrowBuilder
This is for allowing us to do things more complex than returning a Q
expression, needed for doing Postgres full text search.

(imported from commit 669ec71417c04baaf8ed1774bee147079b05b03d)
2013-01-31 15:57:45 -05:00
Keegan McAllister 638b8d29bc Enable testing minified files in dev
(imported from commit 257b8547849a85c447319d3d211f2c989616ce64)
2013-01-31 15:41:01 -05:00
Keegan McAllister 6990260b59 [manual] Minify JavaScript and CSS in production
Manual deployment steps: The same Nginx reload as for "Get rid of the
static-access-control mechanism".  If deploying both commits at once,
just do it once.

(imported from commit dd8dbbf14b95fce0a4b6f66f462fa0a6b50bfb8c)
2013-01-31 15:41:01 -05:00
Keegan McAllister ee6f668c4d puppet: Install django-pipeline on app servers
This is in Debian unstable but unfortunately not older versions.

(imported from commit b82654edef270ef06fcf5015dd5d20db1c5c92f5)
2013-01-31 15:34:13 -05:00
Keegan McAllister f57126d169 puppet: Install yui-compressor on app servers
We have lots of choices for JS / CSS minifier.  This one works fine
and is in Debian.

(imported from commit bb5a05a8e59d0821e746116af0ef7e3c8ad59aaa)
2013-01-31 15:34:12 -05:00
Keegan McAllister b9da0276e8 Add missing Glyphicons images
These are referenced from CSS, which was making Django staticfiles unhappy.

(imported from commit d2852eaad05777505ec165419140b474d59029df)
2013-01-31 15:34:12 -05:00
Keegan McAllister 5e9b0ba79d [manual] Get rid of the static-access-control mechanism
We will minify our code, rather than trying to restrict who can see the
un-minified code.  Removing access control first simplifies things.

Manual deployment steps:

    scp servers/puppet/files/nginx/humbug-include/app root@staging.humbughq.com:/etc/nginx/humbug-include/
    ssh root@staging.humbughq.com service nginx reload

and then the same for app.humbughq.com once deployed to prod.

(imported from commit 63788aa3fa7ba5fd97fcf85b05760abb5e7cae4b)
2013-01-31 15:34:12 -05:00
Leo Franchi 071ea3b9a4 Send humbug & email on markdown parse failure
(imported from commit c132ab91f1ff9ffdbe5f740980bf362b16c6bba6)
2013-01-31 14:48:40 -05:00
Leo Franchi 6e9b8d895c Add munin plugin for send-receive timing
(imported from commit e2ae0775379ce59ab43213e68ade4d3f88b578e6)
2013-01-31 13:02:57 -05:00
Leo Franchi 6e3e6f00bd Add a proof of concept polling twitter bot
(imported from commit ededca33bc74404075de343aad1ec3358f07fe92)
2013-01-31 13:02:29 -05:00
Tim Abbott 97aec279b3 Add deployment auto-restart for process_user_activity.
(imported from commit 7ff384629552e454a9b25577f17d06ac27ae5239)
2013-01-31 12:09:16 -05:00
Tim Abbott 9cc3e29de5 Split restart-server code out of update-deployment.
(imported from commit 3ae913b950be0a0c94fbaf0173012ea315f36d62)
2013-01-31 12:09:16 -05:00
Leo Franchi 54cfea9252 Use /usr/bin/env python in review script
(imported from commit a56c09e617ee89858fcac3d60deb549754d465f1)
2013-01-31 11:54:25 -05:00
Jacob Hurwitz 6e8a972dad MIT should not say create stream
(imported from commit b08de8fb5e73150032fa05bbab464a47e5a4220e)
2013-01-31 11:31:23 -05:00
Leo Franchi 187aec7b0d Fetch ala time travel when narrowing to a message not in the home view
(imported from commit e5449e00f15b1cf234e7fdeecfc94234eb89a799)
2013-01-31 11:10:29 -05:00
Waseem Daher 0eca9fa595 Put 'narrow to messages containing' before 'find in page'.
This fixes Trac #740.

(imported from commit e40ffa149eac3c7d954d6cac617935496d366ce4)
2013-01-30 22:38:56 -05:00