Commit Graph

8045 Commits

Author SHA1 Message Date
Tim Abbott ae6c17a87d puppet: Stop using /var/log/nginx/zulip.*.log.
It's confusing to have our log data on different files on different
systems (e.g. loadbalancer vs. app).

(imported from commit be701072ee05e2659f146b226a39f33cb4707180)
2013-12-17 16:22:08 -05:00
Tim Abbott 3b7bf691e7 Add tool to query our usage stats as of a given date.
This contains the various fixes that needed to be made in order to get
accurate statistics.

Most notably, the active_users_between function in the previous
version of zerver/lib/statistics.py was broken for end dates in the
past, because it used the UserActivity table to get its data -- so in
fact it really was querying "users last active between".

This commit isn't super clean, but I figure we're probably better off
having our latest code for historical usage data in git so it doesn't
bitrot and anyone can improve on it.

(imported from commit 24ff2f24a22e5bdc004ea8043d8da12deb97ff2f)
2013-12-17 15:34:44 -05:00
Tim Abbott 6ccf19bed6 Run log2zulip on load balancers too.
(imported from commit 74c8be20d2d03aa524f05b7681febe9a9be9cdff)
2013-12-17 13:46:00 -05:00
Steve Howell ea49e9d1b0 Rename check-handlebar-templates to check-templates.
(It's been checking Django templates too.)

(imported from commit e1a92210d07dfd68666a8c93642c4eb8d5ff081f)
2013-12-17 12:44:59 -05:00
acrefoot c30f2bbe3e slightly stricter linting of html templates
(imported from commit 5bd0aa3c49d6ff95559a73bd5f134cc50ae98ce9)
2013-12-17 12:05:23 -05:00
Steve Howell f174038100 Throttle user list updates to 5s intervals.
(imported from commit 908806d1ac00f14802f2a01a40d0abb66778a441)
2013-12-17 11:54:53 -05:00
Tim Abbott 8dcf7d4cc3 [puppet] Add log2zulip tool for sending log files to Zulip.
This tool is a little crude; it runs out of a cron job and will
forward to staging a notice about any new lines in the declared log
files, truncating if there are more than 10 lines.

(imported from commit 6748ddff1def0907b061dc278a3a848bd2e933f1)
2013-12-17 11:02:55 -05:00
Steve Howell 1c67fdb95d Move user list unread-count logic to templates.
When we rebuild the user list from scratch, set the unread
counts in the templates to avoid multiple DOM updates.

(imported from commit 2d0c9b0fb99b382332e464ba7c3caad95e05363e)
2013-12-17 10:59:25 -05:00
Jessica McKellar a8cd91d6c7 digest: send emails if you've been active for slightly less than a day.
That way if all you do is briefly check Zulip because you got the
email, we'll send you another one tomorrow.

(imported from commit fcbbd264c5e5fea7352f0fee6989e000af7b7bed)
2013-12-17 10:47:17 -05:00
Jessica McKellar 6b64ef6be3 digest: log when we enqueue emails.
(imported from commit 1b34e05bc2eebedb818673a4c9a3944e1db15c6d)
2013-12-17 10:47:17 -05:00
Jessica McKellar 71f5b4e0ae Enable digest emails for zulip.com.
(imported from commit f676f96c2b516b33269b8f5c72deaf5c985e8ccd)
2013-12-17 10:47:17 -05:00
Jessica McKellar 8bb1caec8f [manual] digest: add the cron job that will trigger digest emails.
Manual deployment instructions:

On staging, do a puppet apply.

No action needs to be taken for the prod deploy.

(imported from commit 0f6e5ab22aaeacfcc69d57de12f2bb6fac6f0635)
2013-12-17 10:47:16 -05:00
Jessica McKellar 1d11e2cce0 digest: don't show new users for MIT.
(imported from commit b7453cb30e6fcf5b36a5e3e53f67faeb17e74048)
2013-12-17 10:47:16 -05:00
Steve Howell 67b6b05f26 Remove colons after bot fields.
The rest of the Settings page seems to eschew the colon, so this
change makes the bot listing consistent.

(imported from commit d13ac811b230413f9bbc9718fb7ec35898bdf392)
2013-12-16 18:11:57 -05:00
Steve Howell 3418c1852f Fix copy/paste for bot user names and API keys.
You can now double click on a bot's API key to copy/paste it.

(imported from commit 4738cc3d98545b45c6f8bd201afd3882cfb63f4a)
2013-12-16 18:11:56 -05:00
Tim Abbott 321fa338e5 Improve tab bar for embedded narrowed widget.
(imported from commit 7cfc5d1966de8560db16c1807920f7600356abaa)
2013-12-16 17:46:02 -05:00
Tim Abbott 150ca939b1 Disable some buttons in embedded widget.
(imported from commit 7d6d4725b139ea71c579dfd7d19c38d7bb11ee44)
2013-12-16 17:46:02 -05:00
Tim Abbott 2276c6e524 Add support for loading a narrows-only embedded Zulip window.
Features:
* Only shows messages in the narrow
* New messages in the narrow will arrive as they are sent
* Works even for streams you're not subscribed to
* Automatically subscribes you to a stream on send
* Doesn't update your pointer
* All searches etc. automatically have the narrow added

(imported from commit 2e12b76849f6ca0f53dda5985dad477a04f7bbac)
2013-12-16 17:46:02 -05:00
Tim Abbott 8e6728f206 Clean up duplicate code in tab bar creation.
(imported from commit 83b9dfc66ce3e0e9af0c9580cc3c81728b649a20)
2013-12-16 17:46:02 -05:00
Tim Abbott 7c829c4024 Extract adding clients to the various dicts to a function.
(imported from commit 667e5736710c23becdf4ebe5688a31421ac632f5)
2013-12-16 17:46:02 -05:00
Tim Abbott af347acf99 Fix narrow stream event queues with all event types.
(imported from commit 69c2f6f1be3dd864b5da85104b83235f0dd4df50)
2013-12-16 17:46:02 -05:00
Tim Abbott 28c03e3f0d Simpify interface for editing/accessing unencoded page_params.
(imported from commit c7c7dce2ecc886f4bd9e5da798b1007887e77642)
2013-12-16 17:46:01 -05:00
Tim Abbott 827aa0e752 logging: Add a central log file that logs all errors.
(imported from commit a845c39be69330749475b8a8938bfb736198b953)
2013-12-16 15:59:35 -05:00
Steve Howell 751f400afb Add a --minimal option to run-dev.py.
This replaces the --noworkers option; the new --minimal option
starts a couple "essential" workers.

(imported from commit 4ca08709052c47257bc0448e51760edb4969d92e)
2013-12-16 14:36:06 -05:00
Tim Abbott b6acbe040c Fix missing nginx service notifications on configuration changes.
(imported from commit 0bfce276bab3704e508f6c8a58c9434e9fc224cd)
2013-12-16 13:44:50 -05:00
Tim Abbott c872866289 puppet: Fix nginx upstreams for staging.
(imported from commit eb1e6e3b2d35533af4a24015a91201e2414f8e28)
2013-12-16 11:32:05 -05:00
Waseem Daher 9b58aef815 Reindent settings page.
When examined with 'git diff -w', this should basically be a no-op.

(imported from commit 99bdaca61eae84772b4d5deb12adc2af73233e97)
2013-12-16 10:43:49 -05:00
Waseem Daher fa17fb0da1 Place "autoscroll" option in a "Zulip Labs" section.
(imported from commit 31e8d0b5c1454932398cf732c0c4ad0702e5274b)
2013-12-16 10:43:49 -05:00
Tim Abbott 1ca8804468 Fix renaming streams.
(imported from commit 63c41d7f1175f132dc835e76362d679f00800d3f)
2013-12-16 10:32:55 -05:00
Tim Abbott f8fe9d1dd4 Fix check_worker_memory process list computation.
(imported from commit 9ac58b894ecfd84da6ac8509c0dc2ceb60eedfce)
2013-12-16 10:09:59 -05:00
Steve Howell 3b0a563730 Use REQ(validator=) style for update_subscriptions_backend.
(imported from commit 48e16695f7ab9f32b10370751c528dc27583ada7)
2013-12-13 18:23:40 -05:00
Steve Howell cc2779c80e Use REQ(validator=) style for event_types in events_register_backend.
(imported from commit 3af787fcc87355866107d197ef2c9e9552151a8a)
2013-12-13 18:23:40 -05:00
Steve Howell a20270dbc7 Use REQ(validator=) style for principals in add_subscriptions_backend.
(imported from commit 307ce32cc0c56f8a226244cf1128b1c0633852f7)
2013-12-13 18:19:10 -05:00
Steve Howell bfb54b5a4d Add validator support to REQ and has_request_variables.
Validators are similar to converters, but they don't have
to parse JSON, and they are told the name of the request
variable to help format error messages.

(imported from commit 3c33e301892519c67e70675006d5686d9f013353)
2013-12-13 18:19:10 -05:00
Steve Howell 60917c83d6 Add test_REQ_converter.
(imported from commit 4425c68a532dc8a6db3b76397156c4e9d92a5b44)
2013-12-13 18:19:10 -05:00
Steve Howell 668c0ab529 Validate principals in add_subscriptions_backend.
Make sure that principles is a list a of strings (unless it
is None).  This includes a unit test.

(imported from commit c2e3f1c0cafc207ceca67d5a174ef4e29a32c6ca)
2013-12-13 18:19:10 -05:00
Steve Howell 7e04b205fa Add type checking to events_register_backend.
(imported from commit bb3ddbfc0e471f276858d47fbdb65c890af41606)
2013-12-13 18:19:09 -05:00
Steve Howell 0cdcf102a0 Validate parameters in update_subscriptions_backend.
w/unit tests added

(imported from commit a0c0d779279b35ffc5bf1fbe4c5c5a25af263c10)
2013-12-13 18:19:08 -05:00
Steve Howell 6b70e9ddb7 Add SubscriptionRestApiTest.test_basic_add_delete.
(imported from commit 735d6a0657952790de1d58c62cc983320ec402e8)
2013-12-13 18:19:08 -05:00
Steve Howell 4184b9d56f Add validators.py (with tests).
This sets up a scheme to validate complex data structures and
give specific error messages for improperly typed parameters.

(imported from commit 33b2f070d993da4ee929119dd41503bd0128c8eb)
2013-12-13 18:19:07 -05:00
Tim Abbott 7800a34d84 Fix json_unhandled_exception handling of JsonableError.
(imported from commit 16ed6c213cbda3b60a16a01af32c56d6802b7acc)
2013-12-13 18:13:43 -05:00
Waseem Daher 14a5c6bf66 twitter: Detect link styles more robustly.
* Deal with shorter tweet IDs
  (some old tweets don't have a full 18-character ID)
* Allow trailing slash
* Deal with old-style #! syntax
* Deal with links that link to a photo

(imported from commit 008a98c806f3b8dddd9e2f18a8f002af6932766f)
2013-12-13 18:13:23 -05:00
Luke Faraone 1370c014a5 Clean up logging and documentation in ec2 interfaces script
(imported from commit e55247931cdeb61563f2348ca09f3d7b9fc85f0c)
2013-12-13 18:07:08 -05:00
Luke Faraone 104c2a06ae Set iptables rules for each IP, not just each interface
(imported from commit c24d2123489dc384bf50e379d245807af3488ebf)
2013-12-13 18:07:08 -05:00
Luke Faraone 9329109391 Specify default for EXTERNAL_URI_SCHEME
Otherwise, build-enterprise-tarball FTBFS.

(imported from commit 14a9d9e843575e4b47a7bae5b6e618c207481fae)
2013-12-13 18:06:19 -05:00
Steve Howell 44b738ab75 Have rest_dispatch return JSON when exceptions are thrown.
(imported from commit 587a8f46d406c6358480db9e0ebd5afb69e12abf)
2013-12-13 17:38:20 -05:00
Kevin Mehall f929e51776 puppet: Make Camo Nagios check waste less bandwidth
Use http://www.google.com/favicon.ico instead of a 1.7MB animated gif from
imgur.

(imported from commit 94993af35bf87b0f22e6e743a9ba1cc1c5c9a78f)
2013-12-13 17:27:01 -05:00
Kevin Mehall ebab4a59c9 Don't proxy https images through Camo on MIT
These images at least load now, but that's because Camo redirects
the browser to the origin server, so the only effect is an extra
round-trip time.

(imported from commit 0d6b9c888a5cdfaa9299272d74a085e872dfa434)
2013-12-13 17:27:01 -05:00
acrefoot 11aec0104e fix bug where the composebox may obscure message editing
(imported from commit 905870706b8919a852f58cfc639483acab6fc28a)
2013-12-13 17:19:50 -05:00
acrefoot 29907f3c71 Fix javascript bug in maybe_autoscroll.
I'd check for bookends, but not daterows. Now, we just check if we can get
a message id out of it, rather than excluding specific types of rows.

(imported from commit 39ebc35e81dcec7fc83b603bf941f816fcd3d38d)
2013-12-13 17:19:50 -05:00