Commit Graph

26504 Commits

Author SHA1 Message Date
Umair Khan a2d3aea027 2FA: Add two-factor related code.
This commit adds a view which will be used to process login requests,
adds an AuthenticationTokenForm so that we can use TextField widget for
tokens, and activates two factor authentication code path whenever user
tries to login.
2018-05-23 15:46:56 -07:00
Umair Khan 9502cbbfab 2FA: Enable Django template backend.
The only purpose of this commit is to make the django templates
of Two Factor Auth work. We probably won't need this commit once
we upgrade the admin backend of Two Factor Auth to use handlebar
templates.
2018-05-23 15:46:56 -07:00
Shubham Dhama d1da4116ef node tests: Add `removeClass` to `stub_out_jquery`. 2018-05-23 15:29:34 -07:00
Utkarsh Patil b1295da72a left-sidebar: Remove non-clickable vertical space between topics.
Fixes #8952.
2018-05-23 14:44:57 -07:00
Tim Abbott d6fb47385b docs: Clean up the instructions for installing from Git.
This is now much more common, and deserves clearer discussion.
2018-05-23 14:34:28 -07:00
Joshua Pan dcee398622 onboarding: Redesign intro_reply hotspot in bottom whitespace.
This is a trial to have the first reply hotspot in the bottom
whitespace (and stick there until "Got it!"  is pressed).

Tweaked by tabbott to clean it up a bit.  Still needs more work on the
visuals.
2018-05-23 14:22:19 -07:00
Harshit Bansal 6ee32ee512 minor: Add a comment explaining the need of `stopPropagation()`. 2018-05-23 14:07:30 -07:00
Shubham Padia db69231e70 portico: Fix scrollbar appears for `not long` domain name.
Fixes #9516.
Scrollbar appeared in the subdomain input box while registering an
org. This is a hacky solution to the problem and doesn't work for
long domain names. A proper fix for the same should be provided in
the future.
2018-05-23 14:03:10 -07:00
Sivakar Sithamparanathan 311ddefd32 node tests: Change timezone for node tests.
The timezone environment variable was set to UTC initially. It was
changed to something other than UTC so that any local vs UTC
conversion issues will manifest in the tests.

Fixes: #5105.
2018-05-23 13:29:19 -07:00
Yashashvi Dave 958040b1fc user_pills: Extract generic functions for typeahead and pill creation.
This refactoring make it easier to use our user pill typeahead logic
in other parts of the app.

Two commits by Yashasvhi squashed together by Tim.
2018-05-23 12:07:16 -07:00
Sampriti Panda 8bf80f699f docker: Add PGroonga support to Postgresql Dockerfile.
Fixes #9466.
2018-05-23 11:53:32 -07:00
Tim Abbott 9c29592178 mypy: Fix rebase errors in create_user.py. 2018-05-23 11:36:28 -07:00
Vishnu Ks 8369e2b15e registration: Allow users to import settings from other realm.
This should significantly improve the user experience for creating
additional accounts on zulipchat.com.

Currently, disabled in production pending some work on visual styling.
2018-05-23 10:30:00 -07:00
Vishnu Ks 2a66818e2e registration: Add function to copy user settings.
This is intended to support our upcoming feature to support copying a
user's customization settings from an existing account that user owns
in another organization.
2018-05-23 10:12:14 -07:00
Rhea Parekh c24c249b8c export: Support export of Custom Profile Field. 2018-05-23 09:07:26 -07:00
Robert Hönig ac04553d67 outgoing_webhook.py: Fix incorrect variable type. 2018-05-23 08:57:56 -07:00
Aditya Bansal 8cfb437677 provision: Don't run create_realm_internal_bots management command.
We essentially stop running create_realm_internal_bots during
every provisioing and move its operations to run from populate db.
In fact to speed things up a bit we actually make populate db call the
funcs which create_realm_internal_bots calls behind the scenes.

Fixes: #9467.
2018-05-23 13:34:52 +05:30
Aditya Bansal d343f25cc6 create_realm_internal_bots: Refactor to extract main op as a function.
We extract the entire operations of the management command to a
function create_if_missing_realm_internal_bots in the
zerver/lib/onboarding.py. The logic for determining if there are any realm
internal bots which have not been created is extracted to a function
missing_any_realm_internal_bots in actions.py.
2018-05-23 11:53:22 +05:30
Aditya Bansal 528230df41 test_fixtures.py: Add check_settings to is_template_database_current.
In this commit we add a new param (Django settings) on which the
is_template_database_current decision will depend upon.
2018-05-23 11:53:20 +05:30
Aditya Bansal a27c9a08dd generate-fixtures: Export DJANGO_SETTINGS_MODULE=zproject.test_settings.
This is required because the --settings=zproject.test_settings param
doesn't work with migrate or the dumpdata management commands. Thus
untill now if one ran just this tool ended up with test database not
properly setup. We never noticed this because test-backend ran this
tool again (after exporting DJANGO_SETTINGS_MODULE) thus making the
tool work this time.
2018-05-23 11:32:40 +05:30
Sampriti Panda 51c71fd3fd provision: Add libfontconfig1 to bionic apt dependencies. 2018-05-22 22:37:04 -07:00
Shubham Dhama ec4e5e73ab org settings: Make time limit input elements inline to dropdown.
(To make the capitalization pass we added `N` to ignored phrases.)
2018-05-22 19:32:44 -07:00
Shubham Dhama b4bd299a34 settings: Make propagate_stream_notifications_change buttons look better. 2018-05-22 19:32:44 -07:00
Shubham Dhama edcb5f9b1c org settings: Fix the spacing/indentation of dependent input elements. 2018-05-22 19:32:44 -07:00
Greg Price 5e89c33e7f tools: Add push-to-pull-request tool.
I've often done this by hand -- basically typed out the last line,
with the variables found from looking at the PR page in a browser.
Seems nicer for both us maintainers and the contributor, in particular
because the PR gets marked as merged, instead of closed.  But it's a
bit of a pain, and I do it maybe half the time or less; plus it's kind
of a subtle GitHub feature, and as a result I think other maintainers
of Zulip repos do this approximately never.

I've always figured this couldn't be hard to automate; today I decided
to take the 45 minutes to look up how, write out the script, QA it,
write up a nice usage message and some comments, and commit it. :)
2018-05-22 18:33:51 -07:00
Steve Howell eb5763ee36 widgets: Prevent traceback for submessage event.
We can have this scenario:

    - somebody else creates a widget-ready message
    - message arrives in storage
    - (message is not yet in view, so no message.widget)
    - new submessage event arrives

We want to just ignore submessage events in that case.

(There's a more complete fix coming for this scenario, where
we at least update message.submessages for the eventuality
that we do render the message later.)
2018-05-22 22:39:24 +00:00
Tim Abbott 998e1048e8 test_bots: Add coverage for no-op changes to bot owner.
This isn't a complete long-term fix, in that ideally we'd be doing
this check at the view layer, but various structural things make that
annoying, and we'll want this test either way.
2018-05-22 15:04:27 -07:00
Tim Abbott 1b47b2e7cd populate_db: Fix an out-of-date mypy annotation. 2018-05-22 14:46:03 -07:00
Armaan Ahluwalia 1525e92058 logging/errors/webpack: Improve error stack traces with blueslip.
This commit improves the output that blueslip produces while
showing error stack traces on the front-end. This is done by
using a library called error-stack-parser to format the stack
traces.

This commit also edits the webpack config to use a different
devtool setting since the previous one did not support sourcemaps
within stack traces. It also removes a plugin that was obviated
by this change.
2018-05-22 14:36:41 -07:00
Tim Abbott 8a64d8ef06 populate_db: Fix stream colors being generated wrong.
Previously, the stream colors index i was accidentally a function only
of the user, so each user got the same color for all their streams.

This should provide a lot nicer-looking development environment
experience.
2018-05-22 14:29:43 -07:00
Tim Abbott 4c8a69e3fb populate_db: Add an initial stream for the default guest user. 2018-05-22 14:29:43 -07:00
Sampriti Panda 4ce5a85a49 populate_db: Make test_suite data generation more deterministic. 2018-05-22 14:07:55 -07:00
Shubham Dhama a001424a4b org settings: Use do_settings_change for auth method checkboxes.
Fixes: #9224.
2018-05-22 14:03:20 -07:00
Tim Abbott c843276196 nginx: Fix accidental load-balancing between IPv4 and IPv6.
Apparently, our nginx configuration's use of "localhost", combined
with the default in modern Linux of having localhost resolve to both
the IPv4 and IPv6 addresses on a given machine, resulted in `nginx`
load-balancing requests to a given Zulip server between the IPv4 and
IPv6 addresses.  This, in turn, resulted in irrelevant 502 errors
problems every few minutes on the /events endpoints for some clients.

Disabling IPv6 on the server resolved the problem, as does simply
spelling localhost as 127.0.0.1 for the `nginx` upstreams that we
declare for proxying to non-Django services on localhost.
2018-05-22 11:56:59 -07:00
Tim Abbott e420766f70 docs: Remove a dead link from our reading list.
This might have been a useful tutorial, but python.net has been down
long enough that it's unlikely to come back.
2018-05-22 11:35:30 -07:00
Tim Abbott 31045e281c docs: Remove the nginx section of life-of-a-request tutorial.
The link was broken, but more importantly, this seemed like the wrong
level of detail about this feature.
2018-05-22 11:34:11 -07:00
Tim Abbott 9aee4c8c8e docs: Add production documentation on deployment options.
This describes the basics of installing Zulip in more complex
production environments using multiple services.

Fixes #1235.
2018-05-22 11:31:48 -07:00
Eeshan Garg e0ef831993 webhooks: Migrate to UnexpectedWebhookEventType.
This improves test coverage for a lot of our webhooks that relied
on ad-hoc methods to handle unexpected event types.

Note that I have deliberately skipped github_legacy, it isn't
advertised and is officially deprecated.

Also, I have refrained from making further changes to Trello, I
believe further improvements to test coverage should be covered
in separate per-webhook commits/PRs.
2018-05-22 08:30:19 -07:00
Eeshan Garg 3ed20589f2 webhooks: Add generic exception for unexpected webhook events.
UnexpectedWebhookEventType is a generic exception that we may
now raise when we encounter a webhook event that is new or one
that we simply aren't aware of.
2018-05-22 08:30:19 -07:00
Umair Khan f38d6ac6fe ldap: Make Zulip compatible with django-auth-ldap==1.5.
In version 1.5, get_or_create_user method is not used. It exists just
for the compatibility. The main function to use now is
get_or_build_user.

See the changelog:
https://django-auth-ldap.readthedocs.io/en/latest/changes.html#id1

Fixes #9307
2018-05-22 08:13:41 -07:00
Shubham Dhama 03eb17c02f org settings: Show pointer on hovering labels of checkboxes.
Fixes: #9447.
2018-05-22 08:04:03 -07:00
Shubham Padia a5db885d62 search: Display invalid operand suggestion for `is` operator.
Fixes #9492.
`is` operator uses predefined categories. This commit
displays an invalid operand message if the operand does not fall into
any of these categories and the `is` operator is not at the last.
e.g. `is:abc sender:abc@zulipchat.com` will have `invalid abc operand
for has operator, sent by abc@zulipchat.com` as a prefix for all its
suggestions.
2018-05-22 18:27:50 +05:30
Shubham Padia e5b3fb332b search: Do not show default suggestion for `is` operator.
Fixes #9492.
Default suggestion e.g `abc messages` as a suggestion for `is:abc`
is not shown in a new suggestion. But if the is operator is already
present before any other operator, the default message text will be
used. e.g `is:abc sender:abc@zulipchat.com` will have all the suggestions
with the prefix `abc messages, sent by abc@zulipchat.com`.
2018-05-22 18:16:02 +05:30
Shubham Padia 30815b402c portico: Align ToS checkbox with full name input box.
Fixes #9328.
Makes the width on checkbox input-group same as full name input box
width and centers it horizontally.
2018-05-21 22:50:29 -07:00
Michael J. Sullivan c81b276c1c mypy: Add basic support for invoking dmypy to run-mypy. 2018-05-21 22:41:08 -07:00
Michael J. Sullivan fe9e017406 mypy: Update mypy to a version from master.
We want to be able to take advantage of some new features added
to dmypy.
2018-05-21 22:41:05 -07:00
Michael J. Sullivan c4bd0e5791 mypy: Switch to follow_imports = error.
The mypy daemon only supports error and skip. Choosing error
immediately surfaces when a file excluded from the build is
being imported, so that something can be done about it.
2018-05-21 22:41:02 -07:00
Michael J. Sullivan d5ee801d60 mypy: Set local_partial_types = True.
The daemon implicitly sets this flag, so set it explicitly and fix all
of the type errors.
2018-05-21 22:41:00 -07:00
Shubham Padia 4a78c00397 search: Rank "messages sent by" above "PMs with".
Fixes #9313.
2018-05-21 22:38:57 -07:00
Shubham Padia 17d4908667 search: Show negated suggestions for sent by me filters. 2018-05-21 22:38:14 -07:00