Commit Graph

1597 Commits

Author SHA1 Message Date
Luke Faraone af02e45a17 [manual] Support authentication and profile prefilling via LDAP
The latter doesn't depend on the former; we can still fill in your full
name even if you didn't authenticate via LDAP.

This commit requires django_auth_ldap to be installed. On Debian
systems, you can do so via APT:
    sudo apt-get install python-django-auth-ldap

On OS X, use your favourite package manager. For pip, I believe this
will work:
    pip install django_auth_ldap

django_auth_ldap depends on the "ldap" Python package, which should be
installed automatically on your system.

(imported from commit 43967754285990b06b5a920abe95b8bce44e2053)
2013-11-22 16:51:26 -05:00
acrefoot 9f3ab73fa4 register, login-sso, or signup depending on deploy type
(imported from commit 28fac6b626b7d3dda6f3ce0bd4ed748e0a6a7761)
2013-11-22 13:50:24 -05:00
acrefoot 3a982c7c06 Modify /hello to go to register instead of signup on Enterprise
Also move the urls.py lines to the right place

(imported from commit f9d9805fe599ceffb6cdd1ed572d8656cb0d6d95)
2013-11-22 13:50:24 -05:00
Tim Abbott ca8225cf47 [manual] Add endpoint to cleanup a finished events queue.
This requires a puppet apply on each of staging and prod0 to update
the nginx configuration to support the new URL when it is deployed.

(imported from commit a35a71a563fd1daca0d3ea4ec6874c5719a8564f)
2013-11-20 18:34:15 -05:00
Tim Abbott 6c7489ed88 logging: Log management commands that are run.
This could potentially help with debugging exactly what happened with
some issue down the line.

(imported from commit cc7321d742875b644d4727a084b462dcd01dcf10)
2013-11-20 14:31:08 -05:00
Zev Benjamin 25c63f08de Use ujson instead of pickle for serializing event queues
(imported from commit 2d90574ae97cc973c9686c2bd557cc199d4b0850)
2013-11-20 14:25:36 -05:00
Tim Abbott d44c6636c6 Add setting to enable profiling of all requests.
This is useful for the occasional case where we cannot figure out what
is causing a particular problem, but it can be easily reproduced on
staging.

(imported from commit 8b51184a8b686814f2c6ff103ba355538463ceb0)
2013-11-18 18:05:19 -05:00
Tim Abbott 3a5d930ede Clean up compatability code from Django 1.6 transition.
(imported from commit a83bd3340f5488fd687f045e2143c32f9385fa88)
2013-11-18 13:57:01 -05:00
Kevin Mehall b78fa0857f Allow overriding the default avatar image
(imported from commit 66d413682a822e0019f28033f19908bdd9fa0156)
2013-11-18 11:48:53 -05:00
Kevin Mehall a63f4284f0 Allow enterprise deployments to disable the use of Gravatar.
(imported from commit 49c14cc7629f2ffe6cedaab5d42ad5bf7f6569a4)
2013-11-18 11:48:53 -05:00
Steve Howell 0b16dfc999 Add /json/users/<email>/reactivate endpoint.
(imported from commit 7afa29f7718430ea2df7c489ab2af4d93d4ce497)
2013-11-16 11:35:25 -05:00
acrefoot e77d534e78 remove ALLOW_ARBITRARY_SENDERS_LOCAL_EMAIL
(imported from commit 7a374959516d8505685466293f146d95094a7ea7)
2013-11-15 21:31:37 -05:00
acrefoot ccb7446d5c move Enterprise Email options into better places
(imported from commit f205c29b224f31474e2983c7f2bdb1ee5e2c754b)
2013-11-15 21:31:37 -05:00
Tim Abbott f941644099 Don't cache templates in development.
(imported from commit 986df6aecb7e638eb0e017654553e812ac6e0ed2)
2013-11-15 18:13:09 -05:00
Kevin Mehall fe0dcd4313 Disable camo on enterprise.
CUSTOMER13 doesn't want it, and there's currently no nginx config
or configurable Camo URI, so it wouldn't work if image preview
were enabled.

(imported from commit 615d4a32acbc4d4d590f88cf4e7d45d8f49db1d3)
2013-11-15 14:27:16 -05:00
Leo Franchi 7f2936a985 Allow enterprise customers to disable name changes
(imported from commit 1f2039f3e88a4ec0cc48dba75f714563c1de4af8)
2013-11-15 11:26:10 -05:00
Kevin Mehall 53c76aa657 Move enterprise-registration to zilencer/ from zerver/
(imported from commit d8a58913040376dbdbc9dcee13ab8a7910733da7)
2013-11-15 11:21:52 -05:00
Tim Abbott 66bbf40b5a Simplify deployment role configuration.
(imported from commit f9a9cf0ae33e7a74517255f944c91fa9aba14e33)
2013-11-14 13:01:51 -05:00
acrefoot 4a74425f37 derive DEFAULT_FROM_USER from EMAIL_HOST_USER
(imported from commit 2358f00a8eddb744392cd8f8f02cbed406e25013)
2013-11-14 12:57:47 -05:00
Tim Abbott c24addf2d5 Build internal bots in the zulip.com domain.
Otherwise do_create_realm can't actually send the notifications.

(imported from commit 4fa9a53f1d3d8a2e26d7b89401e7dfa77f2f7533)
2013-11-14 11:16:16 -05:00
Tim Abbott 870ae09aae Add setting for disabling inline image preview.
(imported from commit 2321390eb14cfe5701347861b9ae5ad6fdac0cbb)
2013-11-14 08:47:11 -05:00
Tim Abbott 9a0ddb644d Improve the copy a bit on local_settings_template.py
(imported from commit e9f8a87dc824b5c51178be87999e27ed79897388)
2013-11-14 08:19:21 -05:00
Tim Abbott b2798385ac Organize local_settings_template.py a bit better.
(imported from commit c880b1237504e81ce828ccaf58dcc383ac0231b6)
2013-11-14 08:19:21 -05:00
Tim Abbott 042f5a3959 Improve documentation of SSO_APPEND_DOMAIN.
(imported from commit b91893924c1f64958c361aa83bd042509c8beec6)
2013-11-14 08:19:21 -05:00
Tim Abbott 7e64e19cc2 settings: Set ONLY_SSO to False when not enabled.
(imported from commit fcfe8462aae70dbdff55d245cfd5a6b723cd8378)
2013-11-14 08:19:20 -05:00
Kevin Mehall 15da532faf Don't include metrics.js on enterprise builds.
It throws an exception when the mixpanel library is not present. This
exception breaks emoji autocomplete, among other things.

(imported from commit 6ae2a69d40282701b8717b60d887836416c85a6c)
2013-11-13 18:35:12 -05:00
Luke Faraone 79bbb9b0d0 Add settings.ONLY_SSO which will be true if no other auth sources are enabled
(imported from commit 608cc32754ef8e4925995564b5e05a8ff9fd94c5)
2013-11-13 17:57:32 -05:00
Zev Benjamin fdc63b48d5 Add a setting for whether we're using SSO
(imported from commit 76b450d9ebba2828a63f08be61a3b998a1cd7680)
2013-11-13 16:57:00 -05:00
acrefoot f5199081d5 Add the deliver_email management command
This command should be run continuously via supervisor. It periodically
checks for new email messages to send, and then sends them. This is for
sending email that you've queued via the Email table, instead of mandrill
(as is the case for our localserver/development deploys).

(imported from commit a2295e97b70a54ba99d145d79333ec76b050b291)
2013-11-13 16:41:36 -05:00
acrefoot f7b5a10da0 [schema] Add ScheduledJob table, and update mandrill related code
ScheduledJobs with type Email displace the usual mandrill codepaths
in the Zulip Enterprise deploys

* Email-specific helper functions will appear in deliver_email.py
* 0058_auto__add_scheduledjob.py

(imported from commit 8db08d8a279600322acfdbed792dc1a676f7a0ab)
2013-11-13 16:41:36 -05:00
Jessica McKellar b69cc46be6 Add back the ability to do local email mirror testing against the Test folder.
(imported from commit 01f1f58bb365a9827f25329446f4b2c2666fb92a)
2013-11-13 16:28:29 -05:00
Kevin Mehall 98caa8eaf1 Add option to disable error reporting
(imported from commit 3621aa6e7a5badd21b22891026285099db393df0)
2013-11-13 16:22:21 -05:00
Kevin Mehall 08cc6378af Remove old email error reporting handler
Broken out into an independent commit for easy revert if necessary.

(imported from commit d83619c431a0e656f2e644d1eccb156a63c2169c)
2013-11-13 16:22:21 -05:00
Jessica McKellar 76e1c80ac5 Add an enterprise registration page.
(imported from commit 5888f588ad219ba25b235477a7137853e5954bb5)
2013-11-13 16:20:42 -05:00
Tim Abbott c66556381a Set the ADMINS to be the ZULIP_ADMINISTRATOR by default.
(imported from commit 6ff4e611bb2e145e49ea6f477d79415816372a16)
2013-11-13 15:35:45 -05:00
Steve Howell 2238807e59 Add /avatar/<email> URL.
The /avatar/<email> URL redirects to the appropriate
avatar URL for an email, whether it's hosted by Gravatar
or Zulip.  (This will work even for external users, as
it falls through to Gravatar.)

(imported from commit 7e6f226659cb2e5a7f6426da0be8aa9bae9cff14)
2013-11-13 13:45:08 -05:00
Tim Abbott 7d61a57822 Change HOME_NOT_LOGGED_IN if SSO is the only auth enabled.
(imported from commit a6b41a83d53ac1a87547f005c26ea970fe7508f6)
2013-11-13 12:07:15 -05:00
Tim Abbott 2fff9f94ab Fix example configuration for ZulipRemoteUserBackend.
(imported from commit 9f78901d24fc88dc149af5d4db23b24e9b9859fd)
2013-11-13 12:07:15 -05:00
Tim Abbott 729f7460d4 Reorganize local_settings_template to put mandatory fields near top.
(imported from commit b5d447962a5e7c008e9aba44388f244359520fb4)
2013-11-13 12:02:50 -05:00
Tim Abbott 6bcd5a7ffc Update installation instructions to include configuring the app.
(imported from commit 89395815c32416ec0636efcff12eb76f5d890bbd)
2013-11-13 12:02:50 -05:00
Tim Abbott 939cd864eb Fix postgres configuration to use local socket.
(imported from commit 1835e712b2fe4578cf6381891844bb3abe2b767e)
2013-11-13 12:02:50 -05:00
Luke Faraone a7237938c8 Set FEEDBACK_TARGET for enterprise case.
(imported from commit 478033bf3eefb8406d93fb2f0225420812dee7b0)
2013-11-13 12:02:49 -05:00
Tim Abbott cb9931110f Automatically configure EMAIL_GATEWAY_BOT as a superuser.
(imported from commit 1e74ae458e446edec59eb1ab238cede969c4dbbc)
2013-11-13 12:02:49 -05:00
Tim Abbott e18a08c69e settings: Move hardcoded API super users into local_settings.py.
(imported from commit fea7550a771c837db0fb948238488f778bedf73a)
2013-11-13 12:02:49 -05:00
Leo Franchi 300cceb3e4 Create feedback bot in enterprise installs
(imported from commit 0c0a6919bd29e12484d520f80789b39b203099b0)
2013-11-13 11:18:03 -05:00
Leo Franchi 6274c33f86 Allow disabling of feedback system in UI
(imported from commit ce16b2916784e9cf10a230cb47515ffc65888778)
2013-11-13 11:18:02 -05:00
Leo Franchi 306ce65ea3 Only create initial passwords for local dev setups
(imported from commit 2ef33ebbab0fe21486acbb1a3a78ed434abac2db)
2013-11-12 22:42:05 -05:00
Luke Faraone 20dcc2e036 Import zerver.models in wsgi.py
Because import_module does not correctly handle safe circular imports we
need to import zerver.models first before the middleware tries to import it.

(imported from commit 1afebd8c950c44c8d136b0b63a09319ccef02555)
2013-11-12 19:18:35 -05:00
Tim Abbott 3dadb5b76a Update comments to rename Local Server => Enterprise.
(imported from commit 82bf89aa1148a78ce11ead203a0bc16243d1fca8)
2013-11-12 15:57:02 -05:00
Tim Abbott 966fde261a puppet: Rename local_server => enterprise.
(imported from commit 5faa269df5937f6db99098e44aaea7d0a4f2c14a)
2013-11-12 15:57:02 -05:00
Tim Abbott 5293cdebe8 Rename LOCAL_SERVER to ENTERPRISE.
(imported from commit 7edf353eefe6c9e7aac74b7bbc37b923cac1b913)
2013-11-12 15:57:01 -05:00
Tim Abbott 5d5e662c08 Disable event logs on local server.
(imported from commit eafbd645ae7ce8d868de2fb8c6548325a05b1340)
2013-11-12 15:57:01 -05:00
Kevin Mehall e6ca5d265d Include handlebars templates in build-local-server-tarball
update-prod-static needs DEBUG=False. This also replaces our
local_settings.py before generating anything included in the tarball.

(imported from commit 890cd9d1a44acfd2c20e1662e0c68132c633d1b3)
2013-11-12 15:50:07 -05:00
Zev Benjamin 32ed5f9f42 Move flushing the display recipient cache to its own middleware
(imported from commit 27a6935a5830ef986b18de169d66dd86d273d064)
2013-11-12 15:24:30 -05:00
Leo Franchi ffbadf61df Restore original desktop_home redirect
Without it, a reverse lookup on zerver.views.home would return /desktop_home

(imported from commit 037bd532162441ca070bcb90a86d372048518cd4)
2013-11-12 15:02:18 -05:00
Jeff Arnold d877ec0e7f Add enterprise terms
(imported from commit e8e9600797bea6e5c2f6fcd06dccebe69721034e)
2013-11-12 10:49:29 -05:00
Kevin Mehall 0d27d88a49 Put Django cookie expiry options in local_settings_template.py
(imported from commit 1e24f4c326cef1333a8d9706528324f6be1cd32a)
2013-11-12 10:37:33 -05:00
Kevin Mehall 4a6b7cb20b Disable password change when SSO is the only login option
(imported from commit fd1a14237e2d6ea574331ed178bfc0db5beb18c6)
2013-11-12 10:37:33 -05:00
Leo Franchi cc2d17d7c0 Allow omission of EMAIL_GATEWAY_BOT and stream emails
(imported from commit 51412d2a46bbacd6537ef892e7b6bdf33ac94079)
2013-11-12 10:32:34 -05:00
Jessica McKellar 3adb9c6d80 Add a basic Freshdesk webhook.
The Freshdesk API is bonkers, but we do the best we can with it to
support notifications on ticket creation and ticket updates.

(imported from commit 2023622b274ef83f4e1544d0df286fe2e68581b3)
2013-11-12 10:24:26 -05:00
Tim Abbott 676b14fb15 test_settings: Don't hardcode LOCAL_DATABASE_PASSWORD.
(imported from commit 5bf4ae48d490fafbc8e2ae7f63783473b3a4e8a9)
2013-11-12 09:38:43 -05:00
Tim Abbott 4b86d2a03b Don't require LOCAL_DATABASE_PASSWORD on local server.
(imported from commit d2bdd25ba9d472cb7cff3fa344cf0d7bb2799c6a)
2013-11-12 09:38:43 -05:00
Tim Abbott b0dc882f7e localserver: Add support for not having an APNS_CERT_FILE.
(imported from commit 42d8caebb3035bd9e6e19db6359cc33e8ab4f317)
2013-11-12 09:34:25 -05:00
Tim Abbott 3963eef723 local_settings_template: Add ADMIN_DOMAIN.
(imported from commit a133bd754bfaf696ff7e18bd2c00854d7fe391b4)
2013-11-12 09:34:25 -05:00
Tim Abbott 828917cac8 Enabled the Django cached template loader.
This was recommended by:

https://docs.djangoproject.com/en/dev/howto/deployment/checklist/

Since we don't change our deployments without restarting Django and
don't use any custom template magic, this should be a free performance
win.

(imported from commit fd498ab97d0669c3a14b342b2d2f01994a1f1ee1)
2013-11-08 15:36:31 -05:00
Tim Abbott 98ad49c866 Use persistent connections to our database.
I figure we can start with 600s as a maximum age -- our threads do
many dozens of requests per minute, so I figure we'll get most of the
benefit of permanently persisting connections this way.  I could also
be convinced to do just 60s, though the impact will likely to be less
visible on staging.  600s seems to be what Django originally had for
this parameter before they disabled it by default.  See:

https://groups.google.com/forum/#!msg/django-developers/rH0QQP7tI6w/yBusiFTNBR4J

for discussion, which also suggests we might have issues with
runserver that we should watch out for.

(imported from commit 0ae09fa4f1b39cc88c76fa58258aaf20ab168dcf)
2013-11-08 15:36:31 -05:00
Leo Franchi d13500ac0d Add a email-only sso login page that redirects to a deployment-specific domai
(imported from commit 7134ad71f01b3c22c61c6c0e65f7196efaf92237)
2013-11-08 14:33:12 -05:00
Leo Franchi 4070a95735 Add a desktop-specific landing page, in case we change the behaviour of / in the future
(imported from commit aac1e5495cdae0c797b22d0aeee1eb05f22f9b37)
2013-11-08 14:32:41 -05:00
Leo Franchi 7126610298 Add a generate_204 method to our backend for the desktop app
(imported from commit 3fa61b7e09884c83a27740087abba25dbcd8a9cb)
2013-11-08 14:13:44 -05:00
Tim Abbott f8208263ec [Django 1.6] Make pre-1.6 password reset links still work.
We can revert this commit once any previously valid password reset
links would have expired.

(imported from commit ffac4d36e914e77ad1516ccfac26318c79ba0f7f)
2013-11-08 08:22:04 -05:00
Tim Abbott 402547fa3f [Django 1.6] Update password reset form for Django 1.6.
(imported from commit caa37216333c4750146146ce9baed59461546220)
2013-11-08 08:22:04 -05:00
Tim Abbott c03050f2b9 [Django 1.6] Use the legacy PickleSerializer for sessions.
This is for backwards compatible.  Later we should actually switch to
the JSON serializer, because it means having our SECRET_KEY stolen
isn't an immediate arbitrary code execution vulnerability.

(imported from commit e68ba5cfdb79c0c1f7b178279ecd0307016f5eff)
2013-11-08 08:22:04 -05:00
acrefoot 4c88a909cb If EMAIL_HOST is unset or blank, don't send email via django.core.mail
It will instead use the dummy EmailBackend

(imported from commit 6faec7f3e087901226a120b9268cf687ed165c05)
2013-11-06 17:36:41 -05:00
Steve Howell bdbd8d006a Exclude analytics and zilencer from LOCAL_SERVER INSTALLED_APPS.
(imported from commit f055ff18166d73b3531d27ccef7f5d457cd89017)
2013-11-06 16:56:10 -05:00
Steve Howell 64fb17f9c2 Move management commands to the analytics app.
Move commands related to stats collection and reporting from
zilencer to analytics.  To do this, we had to make "analytics"
officially an app.

(imported from commit 63ef6c68d1b1ebb5043ee4aca999aa209e7f494d)
2013-11-06 16:51:08 -05:00
Leo Franchi 83679b14a6 Fix settings.py to work when no args are passed to manage.py
(imported from commit bdcfa78464322624c36fc59797906f2dd3624aef)
2013-11-06 13:39:00 -05:00
Steve Howell f5bb2409ef Create "analytics" app with activity reports.
(imported from commit 6385935c3d7894fe52bcc265faecc30b07629717)
2013-11-06 12:07:32 -05:00
Steve Howell c3d176a480 Move marketing pages to corporate app.
(imported from commit 70528b544ceb4be12fb02be32889e1b9ca8caeb4)
2013-11-06 12:07:32 -05:00
Steve Howell 6193f60d45 Move static MIT-related pages to corporate app.
(imported from commit e2c5f72d3f3e4d8f8fa888326b2ba455beb9156c)
2013-11-06 12:07:31 -05:00
Steve Howell a827d727cc Create non-localserver "corporate" app with jobs pages.
The corporate "app" is not a full-fledged Django app, but it has
a urls.py and a templates directory.  This commit creates the app
and moves the jobs pages into it.  Localserver deployments will
not see any of the corporate code.

(imported from commit 35889c3cf92329258c30741fdfa564769a4fac1a)
2013-11-06 12:07:31 -05:00
Luke Faraone c11b65590b SSO / REMOTE_USER support
(imported from commit 4f4fad7af5d3c6099cac95d7708338c182626d72)
2013-11-05 16:14:13 -05:00
Luke Faraone a34731ed00 Factor out get_user in zproject/backends.py
(imported from commit d60b5440722ed596ffbcb81086b2f62d535288dd)
2013-11-05 16:14:13 -05:00
Steve Howell 5ff6bc7330 Move activity reports to zilencer.
This commit moves the view code and the URLs.  It doesn't touch
the templates yet.

(imported from commit dbef5eafe4956b29154c1134c05aa586c9e417b2)
2013-11-05 15:41:03 -05:00
Tim Abbott e06722657a [manual] Remove /messages/latest API and related legacy code.
This requires doing a puppet apply on our servers to take effect
properly.

(imported from commit 19dc56f071f07a5d2571eef49dd835121b2e82b6)
2013-11-05 14:19:40 -05:00
Zev Benjamin 0073014ea9 Remove redundant EXTERNAL_HOST settings
(imported from commit dcf9709bc5c2a2c3f00410fd1b2849d3ab879fb9)
2013-11-05 14:14:19 -05:00
Zev Benjamin 787215d743 [manual] Switch over to new /etc/zulip/zulip.conf config file
Run the following commands as root before deploying this branch:
 # /root/zulip/tools/migrate-server-config
 # rm /etc/zulip/machinetype /etc/zulip/server /etc/zulip/local /etc/humbug-machinetype /etc/humbug-server /etc/humbug-local

(imported from commit aa7dcc50d2f4792ce33834f14761e76512fca252)
2013-11-05 14:14:19 -05:00
Tim Abbott 792b283dcd Report end-to-end sending times as experienced by clients.
This should help with determining the prevalence of slow sends as
experienced by users.

(imported from commit f00797679315c928af3c87ad8fdf0112f1dfa900)
2013-11-04 18:32:34 -05:00
Leo Franchi 6765ec0795 Use a site-specific Zulip Admin email in django error pages
(imported from commit 2d5415d7cd81befc3051b5de3835c0cd258b6375)
2013-11-04 16:35:50 -05:00
Kevin Mehall 78b45b61fb Minify JS in the localserver upgrade tarball.
This moves the list of removed files from .gitattributes to
tools/build-local-server-tarball because static/ and tools/ are
necessary for update-prod-static, and it seemed best to keep the
entire list in one place.

(imported from commit 2a447cbde29e90d776da43bb333650a40d4d363c)
2013-11-04 13:40:43 -05:00
Tim Abbott 68dcc760c3 Clean up some unused imports.
(imported from commit 0c5d8e2a55ba1b8909ba807fee3afe863dcdc226)
2013-11-04 11:51:17 -05:00
Tim Abbott 2844a8fb97 Enable postgres database-level autocommit.
This is something we'll want to do before we switch to Django 1.6,
since it's the default there, and I'm not aware of any significant
problems this switch will cause.

(imported from commit fadea41f09e2179735328f99a3ec55b46c92041e)
2013-11-04 07:31:11 -05:00
Leo Franchi ca8187b8cf Email gateway bot variable name changed to EMAIL_GATEWAY_BOT
(imported from commit 01c430bd9b916c9bb152ee821214495333f1d37e)
2013-11-01 16:46:17 -04:00
Leo Franchi 9b4491db6a Don't use hardcoded bots in nagios' check_send_receive
(imported from commit 82add135bf5b819bcc992af8420eec14cf829ccc)
2013-11-01 14:13:05 -04:00
Leo Franchi db6550e99a Make built-in bots come from settings.py, and allow localserver-specific ones
(imported from commit e21933e37487314ac986147562817a19227e8960)
2013-11-01 14:13:05 -04:00
Steve Howell 95dc0894d8 Add /realm_activity report.
This report will eventually replace the per-realm report that is
now accessible through /activity.  In order not to disrupt Waseem,
I'm leaving the old reports around until we've polished the new
ones.

The old report does 24 different queries to get per-realm user data.
The new approach gets all the data at once, and it slices and dices
the data in Python to accomodate our slightly quirky data model.

On localhost, this is a typical query:

LOG:  duration: 5.668 ms  statement: SELECT "zerver_useractivity"."id", "zerver_useractivity"."user_profile_id", "zerver_useractivity"."client_id", "zerver_useractivity"."query", "zerver_useractivity"."count", "zerver_useractivity"."last_visit", "zerver_userprofile"."id", "zerver_userprofile"."email", "zerver_client"."id", "zerver_client"."name" FROM "zerver_useractivity" INNER JOIN "zerver_userprofile" ON ("zerver_useractivity"."user_profile_id" = "zerver_userprofile"."id") INNER JOIN "zerver_realm" ON ("zerver_userprofile"."realm_id" = "zerver_realm"."id") INNER JOIN "zerver_client" ON ("zerver_useractivity"."client_id" = "zerver_client"."id") WHERE "zerver_realm"."domain" = 'zulip.com'  ORDER BY "zerver_userprofile"."email" ASC, "zerver_useractivity"."last_visit" DESC

(imported from commit 0c71f4e32fe5a40f4496749dc29ad3463868d55e)
2013-11-01 11:46:26 -04:00
Steve Howell 3577ba7585 Add /user_activity page.
This page shows aggregate activity for a user on various
clients.  This allows Waseem to troubleshoot things like users
switching between website and desktop, etc.

This particular page probably won't be used too much, but some of the
logic is gonna be reused in the per-realm activity pages.

(imported from commit b8c1fad5bfa45daab40954f92319f6f89a3fa433)
2013-11-01 11:46:26 -04:00
Tim Abbott 21663601b4 Remove obsolete zulip.com/what-is-humbug page.
(imported from commit 0e2f317cf0bf262eb113caa7daab7d71ce564e9e)
2013-10-31 15:29:49 -04:00
Tim Abbott 0e35424a7c Rename humbug => zulip in some log file names.
(imported from commit 0bb5284566861e5a2f260cc66dcb53ebac0d7b97)
2013-10-31 15:29:49 -04:00
Jessica McKellar f1e90086f5 Remove the onboarding checklist.
Looking at the historical data, fewer than 50% of active users have
completed the checklist, which means that it is just persistent
clutter. We also have other better ways of encouraging people to send
traffic and get the apps now.

This commit removes both the frontend UI and backend work but leaves
the db row for now for the historical data.

(imported from commit e8f5780be37bbc75f794fb118e4dd41d8811f2bf)
2013-10-31 11:34:15 -04:00
Steve Howell d7d1888ce0 Add TestWorker queue processor.
TestWorker is for troubleshooting, and it simply appends lines to a file
in /tmp.

(imported from commit 96b646a193a5474f3222b41725742e359b5301ec)
2013-10-30 16:47:16 -04:00
Zev Benjamin 57bef07832 [manual] Move /etc/humbug-* files into /etc/zulip
The moved files are:
humbug-server
humbug-local
humbug-machinetype

Their new names are their old names with 'humbug-' removed.

zulip-puppet-apply must be run before this commit is deployed

(imported from commit f4eb523244d3409b5809c279301225d3fdf0c230)
2013-10-30 15:42:25 -04:00
Jessica McKellar 8e838f4db3 Add a first pass at Stash integration via their webhook mechanism.
(imported from commit 6173379f72aeef318550b35e51d4aa1fd69997ed)
2013-10-29 22:40:42 -04:00
Steve Howell 884e602185 [puppet] Handle exceptions from queue workers.
Subclasses of QueueProcessingWorker that don't override start() will
have their consume() functions wrapped by consume_wrapper(), which
will catch exceptions and log data from troublesome events to a log
file.

We need to do a puppet apply to create /var/log/zulip/queue_error.

(imported from commit 3bd7751da5fdef449eeec3f7dd29977df11e2b9c)
2013-10-29 17:45:31 -04:00
Leo Franchi 8e05f76511 Only enable analytics and dropbox on non-LOCAL_SERVER
(imported from commit 1ba877550b3afde51bec6f344762ea998800c5b6)
2013-10-29 17:33:36 -04:00
Kevin Mehall 06590f4332 Upload to local filesystem on local server.
(imported from commit 6c38a8cae721b2e7a0863470692cc56425006ecb)
2013-10-29 16:19:04 -04:00
Kevin Mehall 209ff75af8 Remove duplicate MANDRILL_API_KEY setting
(imported from commit c71928b5bfd71e9fcda1f5d57e9c7b99361ce070)
2013-10-29 15:47:13 -04:00
Steve Howell 7cf66b5bb8 Allow users to upload avatars on the Settings page.
We were using Gravatar for user avatars, but now users can
upload their avatars directly to Zulip, and we will store
their avatar for them.  This removes the old Gravatar-related
interface and polling code.

This commit does not attempt to update the avatars in
messages that have already been loaded, either for the user
making the change or other users.

(imported from commit 301dc48f96f83de0136c93de57055638c79e0961)
2013-10-29 10:59:41 -04:00
Steve Howell 68942a8f3a Properly split up "Your Account" and "Notifications".
The "Your Account" and "Notifications" boxes on the Settings
page each had their own border and their own "Save changes"
button, but they were within the same form and sending to the
same back end point.

This commit creates a separate form and endpoint for each
of the two boxes.

(imported from commit 04d4d16938f20749a18d2c6887da3ed3cf21ef74)
2013-10-29 10:59:41 -04:00
Tim Abbott 56e9ad230e [manual] Move our deployment scripts to scripts/.
This will require updating the post-receive code on git.zulip.net to
work.

(imported from commit 2e51fa2d7b891c1138d3f22ae534cfb8a6cf174c)
2013-10-28 10:54:48 -04:00
Tim Abbott 0a44ba2a28 Move servers/configure-rabbitmq to scripts/setup/.
(imported from commit 2b4d5ccb88675447ae744fb985246211deef7486)
2013-10-28 10:54:48 -04:00
Steve Howell 09979252dd Add Steve's laptop to USING_RABBITMQ list.
(imported from commit 3527edd27e3f386eb8b668fe8ee7e3875282ead8)
2013-10-27 11:27:27 -04:00
Zev Benjamin cdcbe61cb0 [manual] Change references to the humbug_test user, schema, and database to zulip_test
This requires no changes in production, but is tagged as manual to
remind developers that they need to edit and run the tools/migrate-db
script to fix up their local database instances.

(imported from commit fbf764fb61592ef994d6d2ad56edad65ff01f14b)
2013-10-26 04:16:28 -04:00
Zev Benjamin 7b6f6823a5 [manual] Change references to the humbug user, schema, and database to zulip
This commit must be simultaneously deployed on both staging and
prod0.  It also requires completely taking down the app.

To deploy these changes, do:
* check out this commit at /root/zulip on postgres0, postgres1, staging, and prod0

* stop the process_fts_updates job on postgres0 and postgres1
* stop the app on staging and prod0

* do a puppet apply on postgres0, postgres1, staging, and prod0
* move the new client certificates into place on staging and app
* move the new server certificates into place on postgres0 and postgres1
* reload the database config on postgres0 and postgres1 (this might
  actually require a restart)
* run tools/migrate-db on postgres0 as root

* do a deploy through this commit on staging and prod0
* start the process_fts_updates job on postgres0 and postgres1

* do a puppet apply on nagios

(imported from commit 819bdd14326c1425e2d3041a491a8ca3b9716506)
2013-10-26 04:16:27 -04:00
Waseem Daher 66f48288b4 Rename LOCALSERVER -> LOCAL_SERVER.
(imported from commit b3abdd10d54d2ad7a9c463af9a291d2e2127707f)
2013-10-25 17:37:06 -04:00
Leo Franchi 8e21d70afe Disable statsd on local server
(imported from commit cac2c95c2de18b613a0900fe1c04fd97963b9350)
2013-10-25 16:37:29 -04:00
Leo Franchi c12a97577e Rework local_settings_template.py to be clear about what the user needs to do
(imported from commit f69ea0d57e885509abc70dc4f2bee6e36169691f)
2013-10-25 16:35:27 -04:00
Luke Faraone 238d19e1f1 Include a rest_dispatch in tornadoviews and call it from urls.py
(imported from commit aefe66b44be60b39d0f6bb3076502e964f1ed6bd)
2013-10-25 14:13:31 -04:00
Luke Faraone e552307511 Send feedback to a queue to be forwarded to staging.
(imported from commit 4a9a1bfc6c95763a816263a726cc61b3ca90bf15)
2013-10-25 14:13:30 -04:00
Luke Faraone 81d7dd1fda [schema] Support for authenticating Deployments via the API.
Here we introduce a new Django app, zilencer. The intent is to not have
this app enabled on LOCALSERVER instances, and for it to grow to include
all the functionality we want to have in our central server that isn't
relevant for local deployments.

Currently we have to modify functions in zerver/* to match; in the
future, it would be cool to have the relevant shared code broken out
into a separate library.

This commit inclues both the migration to create the models as well as a
data migration that (for non-LOCALSERVER) creates a single default
Deployment for zulip.com.

To apply this migration to your system, run:
   ./manage.py migrate zilencer

(imported from commit 86d5497ac120e03fa7f298a9cc08b192d5939b43)
2013-10-25 14:13:30 -04:00
Leo Franchi 0bc5b13648 Fix Zulip username of email gateway bot
(imported from commit f24c5fd3fc5888bf7dc4d9501723777ad8447704)
2013-10-25 11:51:13 -04:00
Leo Franchi a9b9c0ec7b Add Email Mirror default settings and error out with readable warning if not configured
(imported from commit adac321d09561b51277ec1e314a1d480dc01e0c8)
2013-10-25 11:51:13 -04:00
Leo Franchi 2d276179d0 Refactor email-mirror to handle running on any machine
(imported from commit 2971449ceaacb564770e66874fc095f77e68d445)
2013-10-25 11:37:34 -04:00
Kevin Mehall 3bad5acc71 Fix upload auth redirect for user_activity.
Use rest_dispatch for upload auth redirect so it doesn't send the
long URL to user_activity.

(imported from commit ab327bbd529412e43eee6d109f8550180544dbbb)
2013-10-24 17:33:12 -04:00
Kevin Mehall 0a3a22cb3d Support authenticated upload URLs.
Trac #1734

This is implemented by bouncing uploaded file links through a view
that checks authentication and redirects to an expiring S3 URL.

This makes file uploads return a domain-relative URI. The client converts
this to an absolute URI when it's in the composebox, then back to relative
when it's submitted to the server.

We need the relative URI because the same message may be viewed across
{staging,www,zephyr}.zulip.com, which have different cookies.

(imported from commit 33acb2abaa3002325f389d5198fb20ee1b30f5fa)
2013-10-24 17:01:06 -04:00
Zev Benjamin c13114c7e3 [manual] Change rabbitmq user to 'zulip'
Before deploying this commit, the following commands must be run:
  # rabbitmqctl add_user zulip $(tools/get-django-setting RABBITMQ_PASSWORD)
  # rabbitmqctl set_user_tags zulip administrator
  # rabbitmqctl set_permissions -p / zulip '.*' '.*' '.*'

(imported from commit 76d66fa6ac69aa39c91f55b9b5d5a954f9e94d73)
2013-10-24 16:54:27 -04:00
Zev Benjamin ec21275b19 Move rabbitmq username into settings.py
(imported from commit f9a8f80f53b8774781b8558444e601567cb59835)
2013-10-24 16:40:38 -04:00
Waseem Daher 94c0b2fe70 Comparison page.
(imported from commit 4e2ce843bd066fd20e5840b2fd5cd2d991be02e7)
2013-10-24 16:22:00 -04:00
Leo Franchi 410ee44eb6 Send users push notifications when they miss messages
(imported from commit 6c54fe44a82c5796268e56d3f5577bf4cfc8163a)
2013-10-24 14:54:31 -04:00
Leo Franchi a9bd2743f0 Initialize default settings if they are missing in the setting module
(imported from commit 97eb19c603436d460ad1832827dc3ec34c36bf31)
2013-10-24 10:19:24 -04:00
Tim Abbott 391de2d592 Add local settings template for local server instances.
(imported from commit 96f59e6a041992f5b2c467558a2fcc14a951a8a9)
2013-10-23 17:36:34 -04:00
Zev Benjamin ca16644152 Add client-side SockJS wrapper
The wrapper handles our RPC protocol, authentication scheme, and
reconnections.

(imported from commit 1fed2d160582c235a32de80a80b3e451c13a7b1c)
2013-10-22 18:45:11 -04:00
Zev Benjamin 5979af3a45 [manual] Add asynchronous message sender via sockjs-tornado
New dependency: sockjs-tornado

One known limitation is that we don't clean up sessions for
non-websockets transports.  This is a bug in Tornado so I'm going to
look at upgrading us to the latest version:
https://github.com/mrjoes/sockjs-tornado/issues/47

(imported from commit 31cdb7596dd5ee094ab006c31757db17dca8899b)
2013-10-22 18:45:11 -04:00
Steve Howell 0662300e9e Remove /json/subscriptions/list endpoint.
(imported from commit db2c38f6b12ebee5250737a6cdd193863a4605af)
2013-10-22 15:51:19 -04:00
Zev Benjamin 06390de20a Load underscore before blueslip
blueslip depends on underscore.

(imported from commit 13a379d62bdb9824c052d8695ec030c69f41a5db)
2013-10-22 15:39:17 -04:00
Steve Howell 8711f7450d Add History tab to /activity for realm pages.
(imported from commit 8d51da01ff8a9f4668aca7408b3ccbf9d862b81c)
2013-10-22 14:05:12 -04:00
Steve Howell 3be4641625 Subsume /queries into the main /activity report.
This moves the reports from /queries into six new tabs on the
main /queries report.

(imported from commit e4ccf6e7edfc900d929e85613f21437b40f046ae)
2013-10-22 11:11:54 -04:00
Steve Howell 1f4b70938f Add /sent_messages_report to show sent messages per realm per day.
This shows the number of messages sent by users in a realm going
back two weeks.

(imported from commit 9bf677b908f947efef4e00a43d323e1049a9157a)
2013-10-22 10:15:08 -04:00
Steve Howell f2be9f046a Create /queries page with canned queries for Waseem.
These are some queries on API usage, desktop usage, and
Android usage that would be of interest to Waseem.  These
will eventually be subsumed into /activity, but some interim
data issues may make them easier to keep separate for now.

(imported from commit 697a8496cbf4447d557a3fc89f64c1c4d3e67e70)
2013-10-16 23:40:04 -04:00
Jessica McKellar d4e2cdd09e Determine DEPLOYED only based on /etc/humbug-server.
The other zulip.net check was for a transition to using that file that
has now completed.

(imported from commit 991d9165515b5611865957255f9da7a69a75fd7b)
2013-10-16 13:18:49 -04:00
Leo Franchi f7386c3f58 [schema] Add support for keeping track of iOS APNS device tokens
In order to support iOS Push Notifications, we need to keep track
of a device's unique APNS Token. These are delivered to our iOS
code after registering for remote notifications

(imported from commit bbe34483e1380dc20a1c93e3ffa1fcfdb9087e67)
2013-10-16 12:54:28 -04:00
Jessica McKellar a7e35c0830 Fix /apps/ being a 404.
I looked around the Django docs for a more future-proof way of
addressing this problem of wanting both /apps and /apps/ to work. It
doesn't seem like there is.

Note that APPEND_SLASH is default True, so we're getting a / appended
automatically if there's no URL match without the /:

https://docs.djangoproject.com/en/dev/ref/settings/#append-slash

http://stackoverflow.com/a/11690144 points out making the slash
optional in the URL regex, but a commenter points out that this is bad
for SEO.

(imported from commit 8e883fb786c583fe5f561f14473211f6b100cecf)
2013-10-14 12:49:49 -04:00
acrefoot f8662c16f7 Add Mandrill decorators, credentials, actions
You can queue email for future delivery or send immediately via mandrill now

(imported from commit e6b6d11a2d94fcdeaffab80793e7ba31955b9031)
2013-10-10 19:32:21 -04:00
Luke Faraone 1d9391e867 Initial local server configuration.
(imported from commit ac9b9896b74b78c6ca03af7f411d0788ae402cff)
2013-10-10 14:14:14 -04:00
Luke Faraone 7d03614a1b Store the feedback bot key in local_settings.py
(imported from commit 3322d8976328db61cd382acb06775c6a6df3fea0)
2013-10-10 11:31:15 -04:00
Tim Abbott 70c666c3c6 [manual] Rename humbug@humbughq.com to zulip@zulip.com.
This requires renaming the account in Google Apps at the time we
deploy this; we'll probably want to do this during off hours to avoid
any user-visible downtime.

This also updates some related email addresses.

(imported from commit fce7629b359a4f278bbf7815c8d177a8fa0484fe)
2013-10-08 08:57:29 -04:00
Tim Abbott b8b0eb4508 Some zulip => humbug updates in comments and print statements.
(imported from commit 9253569a1df7f96fda81ab162d710cdda03f30ca)
2013-10-08 08:57:29 -04:00
Tim Abbott e11ae77ba6 [manual] Rename /home/humbug to /home/zulip.
This may require just doing an mv on the home directory, plus changing
the home directory in /etc/passwd.  It should of course be done carefully.

(imported from commit 660997d897ee6d33563af74f0fc5d4267a911755)
2013-10-08 08:57:29 -04:00
Tim Abbott 6d49a7c880 Move passwords for our localhost databases to local_settings.py.
(imported from commit 5f6dacdfdfd64fadc2995b393d7c59be0b049d79)
2013-10-08 08:57:28 -04:00
Tim Abbott e154877e26 Fix twitter access token secret for staging.
(imported from commit 2a567b06f4e811561f41a84bc000cf4e8694295a)
2013-10-01 13:58:55 -04:00
Leo Franchi 2614716fca Log slow queries to zulip so we notice them
(imported from commit 23f311ad881edda4c4495089ea3b55213470a059)
2013-09-30 17:41:56 -04:00
Steve Howell bbfc8c886a Remove force_minify flag for min/activity.js.
This has been deployed, so the current code is now properly
minified, and we don't need the force_minify flag any more.

(The flag is needed when you remove a JS file from JS_SPECS.)

(imported from commit 8b3c7ffdbc875011d59c2560034750f0077db616)
2013-09-29 11:00:26 -04:00
Jessica McKellar bbdf18b106 Remove the redmine URL and webhook.
The plugin will use the standard send_message path.

(imported from commit 36aba7298c07d77785b3cc19499519c1423ca8f1)
2013-09-27 16:35:14 -04:00
Zev Benjamin f6d8a01678 Move worker logging out of main server.log
(imported from commit 4590dd2a6adbf8e0e0a6bf08d90489246350cfb9)
2013-09-26 22:05:12 -04:00
Steve Howell 94cec018c0 Force-minify min/activity.js.
The minify logic doesn't have an easy way to detect that you
removed a file since the last deployment.

(imported from commit 50d05fcdad382a586073c06d29d279433d1bba81)
2013-09-26 13:55:45 -04:00
Steve Howell 9110ebd208 Improve the UI for /activity.
We are still showing the same data points, but the logic to drill
down on details for a particular realm is now all server side,
not client side, and we are smarter about omitting fields.  In
summary mode, we don't show empty Name or Email columns.  In
detailed mode, we show the realm as a headline instead of a column.

In this version you do lose the ability to see all system users in
the same view, but Waseem is ok with this.

(imported from commit edd2e646ab4cf5783ea64232d0cd621debece8d4)
2013-09-26 13:20:00 -04:00
Tim Abbott 939c5c0e00 Remove unused ERROR_LOG_DIR variable.
(imported from commit 03d054af4e74297c82e947e315f2dee954d03151)
2013-09-25 16:52:41 -04:00
Tim Abbott d7a3570c7e Move server logs to /var/log/zulip.
(imported from commit a65c4908c4a52c4abb57f299ad949c2a23dab715)
2013-09-25 16:52:41 -04:00
Tim Abbott e4496521e9 Update logging path for email-mirror.
(imported from commit 75f36dbb963b2b77ecda7ba138023f0f774047e0)
2013-09-25 16:52:41 -04:00
Tim Abbott 8a5fffa7cf Move twitter API credentials to local_settings.py.
(imported from commit 6b95db113b91816fbc5e91db4b1be90d3df8e028)
2013-09-25 15:40:21 -04:00
Tim Abbott fff4244b54 Move various settings into local_settings.py.
(imported from commit 03c4a61383f3f8cf8207050d68d5ce870e12fcca)
2013-09-25 15:40:21 -04:00
Steve Howell 4d5842cdcd Add summary view to the /activity report.
When you load the activity report, it will just show summary
counts for realms, but if you click on a realm, you will see
details about users in the realms.  You can also click "Show all"
to see an interleaved view of realms and users.

(imported from commit b106557b1fae64d525071afc124b5a8aed319086)
2013-09-25 11:33:11 -04:00
Jessica McKellar 4e74131008 Add a first pass at Redmine integration.
The integration supports events generated by creating and editing
issues.

(imported from commit 1988013d7a18df173623c0821e807fd4f42af3bc)
2013-09-24 16:19:52 -04:00
Leo Franchi 8e6c7146f4 Move alert_words and alert_words_ui to before zulip.js in load order
(imported from commit b169622bc615b3e96fb18724c57887b030aca6f7)
2013-09-20 14:59:42 -04:00
Zev Benjamin 3419619234 Include compiled handlebar templates before our code
I believe this was the source of the "Handlebars.compile is not a
function" errors, though I don't know why so few users got it.

(imported from commit f4a72e35bf25f679461d3c9e6938d118fec30278)
2013-09-18 14:19:12 -04:00
Jessica McKellar cfeaa2be9b Add backend support for realm admins to rename streams.
(imported from commit eaf419f1f68dfd350b8c99e8a5089ec316f0c409)
2013-09-16 16:16:13 -04:00
Leo Franchi f559d27190 Remove stale new-user and redirect to /hello
(imported from commit e32946dea1512fa2593f3e9023c40a5541289dcd)
2013-09-11 18:10:17 -04:00
Steve Howell b4b6fa14d3 Persist muting preferences to the back end
(imported from commit db2d4362a0601f35a75b798cf6945556e44532fb)
2013-09-11 16:47:37 -04:00
Steve Howell b7ef86bc34 Added /json/set_muted_topics
(imported from commit e9072cd273fabf0e072b6a5e9ed80b07142f1013)
2013-09-11 16:47:37 -04:00
Steve Howell 682414e13c Move code to alert_words_ui.js
(imported from commit 78797e690ced954fc79f854efebe5945dd360bde)
2013-09-09 12:06:45 -04:00
Tim Abbott b557b94d0b bugdown: Rewrite image urls to avoid mixed-content warnings.
(imported from commit fc0a41befb04f2a8aad2937a856366ac3cadb192)
2013-09-05 14:35:29 -04:00
Leo Franchi 897dd87b94 Add a span around alert words to mark them visually
(imported from commit 9b8fbbd957086f1eeaa3409e5830aa6d7974fbe8)
2013-09-05 10:18:40 -04:00
Leo Franchi b2ddd670e4 [schema] Add backend support for per-user alert words
(imported from commit 7a9c596a010cbedbddf594c5d9c68bb9ed46d122)
2013-09-05 10:18:40 -04:00
Scott Feeney 6adfed7f3d Add backend support for basic Desk.com webhook
(imported from commit 425a26b2ba5ffd4f4437e8d8438e8ef540d7b1ee)
2013-09-04 13:19:23 -04:00
Scott Feeney 549c644480 Move webhooks views to a separate file
(imported from commit 73db9f5ccc03d19024f35001b0805ca17eeadff7)
2013-08-30 10:18:49 -04:00
Jessica McKellar a7023cac17 Add a landing page just for new MIT users.
(imported from commit 023151e9d057b37f93c0a589e08429b14cc94225)
2013-08-28 16:30:18 -04:00
Jeff Arnold 2d0f8a9bba Update documentation for MIT zephyr
(imported from commit 96cbd71e5d574bf8a0fb2e7fe17c75e4ec4ebfdb)
2013-08-27 14:25:38 -04:00
Tim Abbott 134da30fdf Add webathena authentication button for Zephyr users.
This shows up when you're not running a Zephyr mirroring bot and lets
you use Webathena to have us run it.  Obviously needs more docs.

Current problems include:

* supervisorctl reload ends up recreating /var/run/supervisor.sock
  with the wrong permissions, so it only works once in a row before
  you need to chmod that.

* /etc/supervisor/conf.d needs to be humbug-writeable; this is a clear
  local root vulnerability

* This uses SSH and thus is kinda slow.

(imported from commit 7029979615ffd50b10f126ce2cf9a85a5eefd7a2)
2013-08-26 18:17:25 -04:00
Scott Feeney 95719a91cf [third] Add Lazyload.js
This is a small, MIT-licensed lib from https://github.com/rgrove/lazyload

(imported from commit c6e43c06dfe3fa8559b2a3d28a48d9e0a6848283)
2013-08-26 13:02:57 -04:00
Steve Howell 795248a1d0 Mute any topic named "muted" on zulip.com.
This change will allow us to test the muting feature on
staging.  Any topic named "muted" will automatically be
muted.  You can also mute any other topic on the console:

    muting.mute_topic('devel', 'ios');
    current_msg_list.rerender();

More UI around this experiment will be coming soon, as well
as support for muting entire streams.

The muting module keeps track of which topics are muted, but a
user can expand muted messages, and once that happens, the
messages are marked with the "force_expand" flag that gets
persisted to the back end.

Muted messages are rendered in similar fashion to the summarized
rows, and as part of unifying some of that code, we have
made it so that expanding a summarized section doesn't remove
individual flags related to summaries; instead, the messages
get the force_expand flag set.

(imported from commit acee4190e63813d46850415c41ff8ebfae4a6953)
2013-08-23 12:10:27 -04:00
Tim Abbott f5f95e5f43 [manual] Extend /api/v1/streams API endpoint.
Previously it only provided the list of all public streams; now it
allows one to specify any union of some of the following:
* all public streams
* all streams the user subscribed to

(the most relevant being the union of those two, which is what we want
for the "streams" page).

Or:
* all streams in realm (superuser only)

The manual task required is that when this is pushed to prod, we need
to also deploy the new sync-public-streams version to zmirror.

(imported from commit 27848b8bd136e2777f399b7d05b2fdcec35e4e21)
2013-08-22 12:29:04 -04:00
Leo Franchi 0f377a1277 Use stats.zulip.net instead of old stats internal IP
(imported from commit 1ec504b953272e2b52b80e202b099764dceb2be0)
2013-08-21 17:47:17 -04:00
Leo Franchi 8484cac5c9 Add a messages/flags POST api call to change a message's flags
(imported from commit b51ebd94c99f57f1cda19039023013209556e343)
2013-08-20 16:19:07 -04:00
Steve Howell 53f62bd71c Created MessageListView class.
(The code for MessageListView  was extracted from message_list.js.)

(imported from commit 60c0bac4c734d3850f8b8c047a978c292b19cc13)
2013-08-19 12:17:56 -04:00
Steve Howell 29c012dc74 Create stream_data.js module.
This pulls a lot of data-centric functions out of subs.js.

(imported from commit 0deed7d4bf5697e893af9bc9d888c2d5da8d9fa2)
2013-08-19 12:17:55 -04:00
Zev Benjamin f06c3c0aed Add BitBucket webhook integration
(imported from commit 50be72fb72d52e24b161f09b1d2314aaae5d636c)
2013-08-16 14:38:54 -04:00
Luke Faraone ecc42bc9f8 Add administrative panel to allow for user deactivations etc.
We now show a list of users and allow you to deactivate a user using the
same process as `python manage.py deactivate_user`.

We add a new menu item accessible from the gear icon which will eventually
have much more than just this, but we have a good start here.

Here we also add a property to UserProfile which determines whether you're
eligible to access the administration panel, and then have code which shows
the menu option if so.

This introduces a new JS file, admin.js.

(imported from commit 52296fdedb46b4f32d541df43022ffccfb277297)
2013-08-13 14:20:18 -04:00
Steve Howell d27feeed62 Extract code to summary.js.
(imported from commit 51d958b27e53555f5f77d6e6b661eade57190e23)
2013-08-13 11:26:12 -04:00
Waseem Daher 067bd390ac Remove kiosk mode.
We instead implemented the ~desired functionality here using the
API and a bot to make a totally read-only, static, slowly-updating
view into the Zuliverse.

This is the moral equivalent of reverting deb035b4c702fcdb0e660ed549fe74c682abb6d9

(imported from commit 9d743fe82f197b37f005e5a038f77cc4b8566024)
2013-08-12 16:19:53 -04:00
Luke Faraone 0cb741d7cc Removed confusing ALLOW_REGISTER setting.
ALLOW_REGISTER was no longer being used in determining whether you could
register for the app, so I've removed it to avoid additional local-dev /
production issues.

This closes #1613.

(imported from commit c928c6d350602d35f745ae1e60d734e4567885fc)
2013-08-12 16:16:26 -04:00
Steve Howell 878ee2b3fd Move Filter class to filter.js from narrow.js.
1) The class Filter now lives in its own module.
2) The function canonicalized_operators() is now a class method on Filter.
3) The function message_in_home moved to filter.js and became private.
4) Various calling code had to change, of course.
5) Splitting out Filter helped simplify a few tests.

(imported from commit e41d792b46d3d6a30d3bd03db0419f129d0a2a7b)
2013-08-12 13:58:32 -04:00
Steve Howell 37f8cc9294 Extracted code into compose_fade.js.
The compose_fade has three public exports:

    set_focused_recipient
    unfade_messages
    update_faded_messages

All code was pulled directly from compose.js, except for the
one-line setter of set_focused_recipient.  The focused_recipients
variable that used to be in compose.js was moved to compose_fade.js,
hence the need for the setter.

(imported from commit 462ca5d0d0bd58612d0197f3734a8c78de8c6d30)
2013-08-11 17:05:13 -04:00
Waseem Daher 0dcaf9ca3d Kiosk mode [unsafe].
"Kiosk mode" is a "read-only" Zulip suitable for embedding into
an iframe on another site. I say "read-only" in quotation marks,
because the account is still a fully-fledged active account on
the server, and we just tear out a bunch of stuff in Javascript
(that a malicious user could easily re-enable).

So in that sense, it's not actually safe in security-sensitive
environments -- malicious users logged in via kiosk mode
can do anything the kiosk-mode user can do.

(We need this functionality for the customer3 realm specifically;
 we'll possibly just tear this code back out once that experiment
 has run its course.)

(imported from commit deb035b4c702fcdb0e660ed549fe74c682abb6d9)
2013-08-11 15:57:21 -04:00
Zev Benjamin 0cfc8fae9f Add basic Javascript Dict implementation
(imported from commit 9f2fb089eb6e269549de26b37bd588355757d22c)
2013-08-09 17:20:14 -04:00
Steve Howell e36fd929bc Created stream_color.js.
This is a pure refactoring that mostly just moves code from
subs.js to the new stream_color.js and updates module references
accordingly.  In order to prevent introducing some exports,
update_stream_color was given an additional "sub" parameter
and update_stream_sidebar_swatch_color was given an "id"
parameter.

Killed off unused initial_color_fetch var.

(imported from commit b7644ce67f50d31fb46f564d758d661eea776aa6)
2013-08-08 18:22:44 -04:00
Steve Howell 164215bc78 Support API for changing user's API key.
(imported from commit b9f5594cf809965c996115c8420a359820dad3ff)
2013-08-08 13:03:09 -04:00
Tim Abbott 492a117292 Fix /zephyr page not being converted properly.
(imported from commit cf1e57b04a1dad4b33ace7705ed31075c48f2103)
2013-08-08 11:48:23 -04:00
Tim Abbott 7b9305b06f Rename Django project to zproject.
This includes a hack to preserve humbug/backends.py as a symlink, so
that we don't need to regenerate all our old sessions.

(imported from commit b7918988b31c71ec01bbdc270db7017d4069221d)
2013-08-07 11:04:03 -04:00