Commit Graph

279 Commits

Author SHA1 Message Date
Leo Franchi 748e5b6da6 Remove disabled summarization code
This experiment has been disabled for everyone for a while: if we
bring something like this back, it is not likely to be exactly the same,
and will be different enough to require a different implementation.

As it is, the summarization code was making a few code paths (rendering
especially) more complex, and is worth removing for simplicity's sake.

(imported from commit 6ac8cdc9f7077a5a1da01ab4268aba3db0bc43f8)
2014-02-27 20:25:23 -05:00
Jason Michalski 0244b50f0b Split bot deactivation from user deactivation
(imported from commit 153a870b244e040e3b5976f639866dbace5563f6)
2014-02-18 15:09:22 -05:00
Jason Michalski d177f49a96 Change the create bot API to use rest_dispatch
(imported from commit 0fac290be2ed04178c4df866f5bc958441b2d320)
2014-02-18 15:09:20 -05:00
Jason Michalski 9d973ff106 Change get_bots API to use rest_dispatch
(imported from commit 921895dd636ba118a0f57e60a7bcb9dca1c7c605)
2014-02-18 15:09:19 -05:00
Leo Franchi acec697fe7 Report unnarrow times as well as narrow times
(imported from commit b3a889aa11dc112508c5a1d213f68e5223a879fc)
2014-02-13 14:45:22 -05:00
Zev Benjamin 631783f3cd [manual] Use dedicated Redis server for staging
Before we deploy this commit, we must migrate the data from the staging redis
server to the new, dedicated redis server.  The steps for doing so are the
following:

* Remove the zulip::redis puppet class from staging's zulip.conf
* ssh once from staging to redis-staging.zulip.net so that the host key is known
* Create a tunnel from redis0.zulip.net to staging.zulip.net
  * zulip@redis0:~$ ssh -N -L 127.0.0.1:6380:127.0.0.1:6379 -o ServerAliveInterval=30 -o ServerAliveCountMax=3 staging.zulip.net
* Set the redis instance on redis0.zulip.net to replicate the one on staging.zulip.net
  * redis 127.0.0.1:6379> slaveof 127.0.0.1 6380
* Stop the app on staging
* Stop redis-server on staging
* Promote the redis server on redis0.zulip.net to a master
  * redis 127.0.0.1:6379> slaveof no one
* Do a puppet apply at this commit on staging (this will bring up the tunnel to redis0)
* Deploy this commit to staging (start the app on staging)
* Kill the tunnel from redis0.zulip.net to staging.zulip.net
* Uninstall redis-server on staging

The steps for migrating prod will be the same modulo s/staging/prod0/.

(imported from commit 546d258883ac299d65e896710edd0974b6bd60f8)
2014-02-10 13:23:28 -05:00
Luke Faraone ffdc254e2d Restore EMAIL_GATEWAY_BOT parameter
(imported from commit bda6b39c60b4e5b642db47fd3ba1be2ac8c19650)
2014-02-06 10:43:06 -05:00
Luke Faraone 24f8492236 [manual] Enable local email mirror on all frontends.
This removed the cronjob from all app_frontend servers and enables the
local Postfix mail server on the same.

This is a no-op on staging if the parent commit has already been
applied.

To deploy this commit, run a puppet-apply on prod.

(imported from commit 6d3977fd12088abcd33418279e9fa28f9b2a2006)
2014-02-06 10:26:56 -05:00
Luke Faraone 30a6fd3bd7 [manual] Enable postfix email mirror on staging
This will cause us to recieve messages sent to streams.staging.zulip.com
via the local Postfix daemon running on staging.

This commit does not impact prod. To deploy, a puppet-apply is needed on
staging.

(imported from commit 9eaedc28359f55a65b672a2e078c57362897c0de)
2014-02-04 10:38:17 -05:00
Luke Faraone cdffc5a418 Documentation improvements for email mirror
(imported from commit 01928f34d913e07135be81aee76f59b2b48844ce)
2014-02-04 10:38:17 -05:00
Tim Abbott 88fbd5d16a Split out new module message_store.js.
(imported from commit 57cf3f2b8e74d7c56e3baf75859d5b3646282225)
2014-01-31 15:57:28 -05:00
Tim Abbott c8d57fcafb Split out message_flags.js.
(imported from commit 52afa76fa71141630e325e558cb9c6955d8c03d5)
2014-01-31 14:59:03 -05:00
Tim Abbott e505583f52 Split out new module people.js for tracking people.
(imported from commit fb9b769819ade25d1d3d6e452e68c7ee8651cfdd)
2014-01-30 17:32:58 -05:00
Tim Abbott a7b1b29bf0 Move get_updates into a module.
(imported from commit 9a6c0ab1e76dd96abad8626bc5b1fdbd234b2645)
2014-01-30 15:57:28 -05:00
Steve Howell 12c095fd4b Extract test_runner.py
The file test_runner.py has our subclass of DjangoTestSuiteRunner
and various methods that help it work.

(imported from commit 8eca39a7ed3f8312c986224a810d4951559e7a8b)
2014-01-29 10:55:59 -05:00
Steve Howell 1b987b0803 Add API for changing realm names.
(imported from commit 4bc117ae2ca4acb8896b45cd7058556317287ef8)
2014-01-29 10:16:57 -05:00
Leo Franchi daecc7993a Add a fenced code parser in javascript
(imported from commit 42b1dc18ca34cbbdf3cda6e833adde631a9d88f5)
2014-01-28 15:35:32 -05:00
Steve Howell 8aaf1cf8c2 Add API for removing default streams from a realm.
(imported from commit 06433126e31b372dff8a23eb8bbea14515138c85)
2014-01-28 14:30:37 -05:00
Steve Howell af9a1e967f Add API for adding default streams to a realm.
(imported from commit 0f48f722dd618c0d054aafdf3d931ef014a5c3ee)
2014-01-28 14:30:02 -05:00
Jason Michalski 1f98c4f4ce Add support for updating the stream description
The stream description can now be updated, but the UI is not yet updated
on success.

(imported from commit f45e0a9d5138d828ae98d6d49645ab3ddc966704)
2014-01-24 14:47:44 -05:00
Jessica McKellar a62c720e0e [manual] Add back json_tutorial_send_message endpoint.
Before deploying to staging, create the tutorial bot:

email: welcome-bot@zulip.com
name: Zulip Welcome Bot

(imported from commit 2f337a00ffac888b121975bdb95a89cf2f8ab3a7)
2014-01-23 17:06:27 -05:00
Leo Franchi 24cb5fb079 Add a localstorage.js module
(imported from commit 9f3ab248ce84ce296bb1fb918de3b2dd8cde1ded)
2014-01-23 16:28:58 -05:00
Leo Franchi 835e385b75 [third] Add marked.js, a javascript markdown parser
(imported from commit e85d9b50328ce7d31882464fcc283478f7a9f753)
2014-01-23 16:28:54 -05:00
Leo Franchi 0b2ba855f9 Add helper for rough determination of markdown client-side
(imported from commit 3b6439f54e55fbca0f586392d1a0add4d7f694b8)
2014-01-23 16:28:54 -05:00
Leo Franchi 4b7d061bbf Simplify conditional for APNS sandbox and feedback service
(imported from commit f7c15cd3eec93eda7152ea133e8008bc072d67d8)
2014-01-22 13:22:20 -05:00
Leo Franchi de1ec7ae43 Always use the apns-dist.pem cert for staging/prod
(imported from commit 9f01f971f1c3cbd500771c074e9dc7e8bc327b69)
2014-01-22 13:17:53 -05:00
Jason Michalski d4aece75a5 Add JS to for the inline subscribe button
Add javascript to handle the button clicks and update the status based
on the subscribe and unsubscribe events from the server.

(imported from commit 6b9c0b40d9084e3d8b64bed701ebc786bef6d432)
2014-01-22 11:28:31 -05:00
Luke Faraone c3eac38fa4 Make cookie domain configurable via zulip.conf
Adapted from a cherry-pick picked of Zev's
fda2d99d9e9a07951d11fcd9fc61cf229988f471.

(imported from commit 4701511d94f9ae34523202ca395e72ceb7a1adfb)
2014-01-16 16:29:49 -05:00
Steve Howell e837f8bf8b Add back end for admins to assign/remove admin.
Add back end for admins to assign/remove admin permissions for other users.
The /json/users/<email> endpoint allows you to PATCH is_admin.

(imported from commit bb5e6d44d759274cc2a7cb27e479ae96b2f271b5)
2014-01-16 13:41:53 -05:00
Zev Benjamin fa097a1201 Remove jquery.highlight
The one call we were making to it was actually unnecessary since highlighting is
no longer done client-side.

(imported from commit 7644a5961ca48cd57f4b65c6f698083677e0a130)
2014-01-15 16:07:20 -05:00
Tim Abbott 2ebb962114 Enable USING_RABBITMQ for all development systems.
(imported from commit ffe5f3f8210372479051b5f1908a7efc12398ef8)
2014-01-14 12:09:15 -05:00
Jason Michalski 4b86ef59f1 Added Zendesk webhook
Zendesk works a lot like desk.com, it has triggers which use targets.
The triggers have a user defined template. Targets can also have place
holders that are posted, we add the ticket id and title here so we can
always construct the message subject.

(imported from commit 04e8e5c7c0fc5568201f252546f6ed42f282fd00)
2014-01-14 12:01:54 -05:00
Zev Benjamin ced2f86fd7 Add an IS_WORKER setting that is True when the current process is a worker
(imported from commit f8976b8345e9c709c2336a17d18260130f3f2562)
2014-01-14 11:47:12 -05:00
Zev Benjamin db23674749 Do query time tracking at the psycopg2 level instead of the Django level
This allows us to track the query time of SQLAlchemy and raw queries.

(imported from commit 818a4ee41786ffc57b80d7ed1cfba075f29b6ee5)
2014-01-14 11:47:12 -05:00
Luke Faraone 000beafc7f Add default for GOOGLE_CLIENT_ID
(imported from commit 9ef9eea6629cf9257276e006ee8ac56d1136db9f)
2014-01-13 16:24:21 -05:00
Luke Faraone 3948e1673d [manual] Accept OAuth2 tokens for API login via Google Apps
This is used by the Android app to authenticate without prompting for a
password.

To do so, we implement a custom authentication backend that validates
the ID token provided by Google and then tries to see if we have a
corresponding UserProfile on file for them.

If the attestation is valid but the user is unregistered, we return that
fact by modifying a dictionary passed in as a parameter. We then return
the appropriate error message via the API.

This commit adds a dependency on the "googleapi" module. On Debian-based
systems with the Zulip APT repository:
    sudo apt-get install python-googleapi

For OS X and other platforms:
    pip install googleapi

(imported from commit dbda4e657e5228f081c39af95f956bd32dd20139)
2014-01-13 13:30:55 -05:00
Luke Faraone 2627f229c4 Clarifying comment for local_settings.py
(imported from commit 64c0f4d032515dbeee4565de8581ea68edd7cd1f)
2014-01-13 13:09:12 -05:00
Luke Faraone f971d36515 Fix typo in comment
(imported from commit c3947566aeec1f07c1597eec31c5447c0525e5b1)
2014-01-13 13:09:11 -05:00
Steve Howell 2504baf783 Use compiled.js in dev environments.
Make our dev setup more similar to prod by using compiled.js,
instead of AJAX-ing templates on the fly and compiling them
with non-node code.  This will make our dev environment more
consistent with prod (to avoid surprising bugs), plus it should
be faster (fewer AJAX calls).

This change also means we don't have to keep two copies
of static/third/handlebars/handlebars.js around.

(imported from commit d8d584b9aa13adcdcce7e424033610d77d2df79b)
2014-01-10 21:39:04 -05:00
Zev Benjamin 3720cb1c33 Move message-related views into their own file
(imported from commit 2c71cc1b5d3f0210c98767888c461d5c6d046b49)
2014-01-10 21:38:59 -05:00
Steve Howell 654ce3e0c7 Add make_stream_private endpoint.
(imported from commit b504c24fd651ecf8814e64725a9f303dc085b14e)
2014-01-06 11:59:47 -05:00
Steve Howell e0c62c5eda Add make_stream_public endpoint.
(imported from commit 03d4cff5587d0aa149997f2f6ae28ec4ede95d7a)
2014-01-06 11:59:47 -05:00
Leo Franchi 72bfc12f18 Expose a users/me/presence API endpoint
(imported from commit 770310284e91ae20d766cd9a52dd1005b5e47e6b)
2014-01-01 17:02:01 -06:00
Tim Abbott 795930c803 Add channel module wrapping our various JSON requests to the server.
(imported from commit 6489938678551ad8594822363ae6d1c9ae295496)
2013-12-19 16:52:47 -05:00
Tim Abbott 8c6ac1288d Add a couple more IP addresses to ALLOWED_HOSTS.
(imported from commit 472bfbb59169cea7a0730073319f262936c07185)
2013-12-19 16:52:35 -05:00
Tim Abbott b30afe432e Return a nice JSON error when CSRF errors happen in JSON views.
(imported from commit 916166c115f9b3ba0fdc93f8d917ff37ae22c2ae)
2013-12-19 16:48:51 -05:00
Luke Faraone 50e8d8b69a Specify default for EMAIL_GATEWAY_EXAMPLE
Otherwise the app would crash when it tried to build template context:

Traceback (most recent call last):
  [...]
  File ".../zerver/context_processors.py", line 23, in add_settings
    'email_gateway_example': settings.EMAIL_GATEWAY_EXAMPLE,
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 55, in __getattr__
    return getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'EMAIL_GATEWAY_EXAMPLE'

(imported from commit 6cc5d3f150326a55230ea91e6c228ae9b1e19df3)
2013-12-18 16:25:10 -05:00
Tim Abbott 411b0a8777 Fix EXTERNAL_API_PATH and friends for prod and localhost.
We were incorrectly manually setting EXTERNAL_API_PATH for localhost
in local_settings.py, but the exception case we should be setting it
manually for is prod.

(imported from commit cbdf75c87ffccdeb306407a59c6594880f4461eb)
2013-12-18 16:01:19 -05:00
Jessica McKellar 6b64ef6be3 digest: log when we enqueue emails.
(imported from commit 1b34e05bc2eebedb818673a4c9a3944e1db15c6d)
2013-12-17 10:47:17 -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