Commit Graph

27855 Commits

Author SHA1 Message Date
Cynthia Lin cdbb38096a night_mode: Fix broken background color for user profile. 2018-07-31 17:06:11 -07:00
Tim Abbott 6f7e12ea19 docs: Add subsystem documentation for caching. 2018-07-31 17:00:45 -07:00
Joshua Pan 47aaa73f96 events: Fix buggy update starred event.
Fixes #10111.
2018-07-31 14:47:36 -07:00
Akash Nimare cc6af84a08 portico: Redesign download button on apps page.
This PR updates the styling of download button so
that it matches with the other buttons on portico pages.

Partially fixes #10104.
2018-07-31 14:18:28 -07:00
Tim Abbott da56449c65 thumbor: Fix exceptions if LOCAL_UPLOADS_DIR is not set.
This is the typical configuration in /etc/zulip/settings.py for a site
using S3, since there's no obligation to set the setting to None
directly, and we're not importing the main `settings.py` (and thus not
getting DEFAULT_SETTINGS applied).
2018-07-31 13:56:41 -07:00
Tim Abbott b564976ce4 upgrade-zulip: Fix unicode issues with detecting early migrations.
Apparently, our Python 3 conversion for the early-migrations logic
here was incorrect, and as a result we never set
need_create_large_indexes to True (because we were checking whether a
`bytes` was inside a list of `str`s).

The simplest fix would be to just add a `.decode()` in one place, but
this refactor to just decode at the beginning is a lot more readable.
2018-07-31 13:46:06 -07:00
Vishnu Ks 70de33384e requirements: Upgrade stripe to 2.3.0. 2018-07-31 11:13:22 -07:00
Vishnu Ks 680c2100e3 requirements: Upgrade Pillow to 5.2.0. 2018-07-31 11:13:22 -07:00
Vishnu Ks cb4e0d32e2 requirements: Upgrade uWSGI to 2.0.17.1.
TLSv1 is now disabled by default. Can be re-enabled
with ssl-enable-tlsv1 at our own risk.

https://uwsgi-docs.readthedocs.io/en/latest/
Changelog-2.0.17.1.html
2018-07-31 11:13:22 -07:00
Vishnu Ks 22f4828dc9 requirements: Upgrade thumbor dependencies. 2018-07-31 11:13:22 -07:00
Shubham Padia 3e6eb360c4 stream edit: Remove bottom margin from `sub_settings_title`. 2018-07-31 11:12:09 -07:00
Shubham Padia 7d6ee2e10a stream_edit: Display server error message when subscribing other users. 2018-07-31 11:12:09 -07:00
Tim Abbott 1b2a26ca83 events: Fix missing empty custom profile data dict for new users.
We were getting event-handling exceptions in JS in production if a new
user was created and then went and set a custom profile field, because
there was no `.profile_data` on their user object.  We were able to
trace the issue down to the fact that our events didn't include that
field when creating a new user.
2018-07-31 11:08:11 -07:00
Tim Abbott d377ac5768 people: Fix blueslip errors for late-added users.
This was supposed to be suppressed when a reload is in progress,
however, the logic was accidentally checking that
reload.is_in_progress was a defined function, not whether a reload was
actually in progress.
2018-07-31 10:41:33 -07:00
Tim Abbott f71316edd0 presence: Suppress some unnecessary blueslip errors for presence.
There was previously a race condition where reload.is_in_progress was
set after `activity.js` sent the presence request to the server, but
before we process the response; in that race condition, we still
shouldn't send blueslip errors to the server.
2018-07-31 10:40:34 -07:00
Akash Nimare 57ed871800 pill: Fix broken width of input-pill.
This PR fixes a UI bug which was caused by removing
the width of pill-container.

This issue was only visible in night mode.
2018-07-31 09:45:12 -07:00
Roman Godov c0806917ec models: Rename Realm.restricted_to_domain field.
This renames Realm.restricted_to_domain field to
emails_restricted_to_domains, for greater clarity as to what it does
just from seeing the setting name, without having to look it up.

Fixes part of #10042.
2018-07-31 09:28:33 -07:00
Joshua Pan 28d04f6960 tests: Test composing scheduling reminder indicator. 2018-07-31 11:23:20 -04:00
Joshua Pan bf8aa2a1d7 tests: Remove unnecessary jQuery stub.
$().is(':visible') is already implemented in zjquery.
2018-07-31 11:23:20 -04:00
Rishi Gupta 4554b564f7 billing: Rename RealmAuditLog.REALM_PLAN_QUANTITY_UPDATED. 2018-07-31 10:56:31 -04:00
Cynthia Lin 29442ffb93 zcommand: Add light/dark mode command aliases for day/night mode.
Fixes #10095.
2018-07-31 07:12:31 -04:00
Anders Kaseorg 510c97d861 scripts: Use shell quoting when displaying commands to be run.
This way, commands with arguments containing whitespace or
metacharacters are unambiguously readable.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-07-30 22:39:08 -07:00
Anders Kaseorg de5e3d3fbd tools/review: Don’t pretend to emulate shell=True either.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-07-30 22:39:08 -07:00
Anders Kaseorg 9a99d76296 tools: Remove pointless uses of shell=True.
Which, not coincidentally, is all of them.  Don’t use shell=True.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-07-30 22:39:06 -07:00
Tim Abbott e04156eef3 export: Fix error messages for stream list mismatches.
The previous error messages for this were written for a tool only to
be used by a couple people, and didn't make clear what potential
causes were.  Tweak these to provide greater clarity about what's
going on.

The main cause of these errors appearing in practice was fixed in
7ea5987e5d, but nothing strongly
prevents a similar issue from being introduced in the future.

Fixes #10078.
2018-07-30 22:32:26 -07:00
Tim Abbott 6317064210 unminify: Fix source map extraction for hash-named files.
Apparently, our old unminify logic relied on the fact that the
filenames displayed in tracebacks were of the form "app.js" (and the
`app.js` copy of the source map in the appropriate
`/home/zulip/deployments/`).  The correct behavior is to just look up
the source map for the appropriate hash-named
`app.a40806b10565c1dee5bf.js` type file.

We fix this with a few small tweaks to the regular expressions.  I
wish this file had reasonable unit tests.
2018-07-30 22:09:37 -07:00
Tim Abbott 7ea5987e5d errors: Use a setting to control the stream for slow-query logs.
We already had a setting for whether these logs were enabled; now it
also controls which stream the messages go to.

As part of this migration, we disable the feature in dev/production by
default; it's not useful for most environments.

Fixes the proximal data-export issue reported in #10078 (namely, a
stream with nobody ever subscribed to having been created).
2018-07-30 17:40:20 -07:00
Tim Abbott a8e5551395 restart-server: Ensure we restart process-fts-updates.
This is mostly important in that if you're running this as part of a
follow-up to a failed upgrade, and you don't do this,
process-fts-updates will be left not running, resulting in full-text
search not updating.
2018-07-30 16:27:53 -07:00
Tim Abbott 7853254df7 puppet: Run thumbor by default on voyager systems.
With this change, all that one needs to do to start using thumbor in
production is to set the `THUMBOR_URL` setting.

Since without THUMBOR_URL enabled, the thumbor service doesn't
actually do anything, this is pretty safe.
2018-07-30 16:16:52 -07:00
Shubham Padia bf6dc4472b models: Add is_private flag to UserMessage and add index for it.
The is_private flag is intended to be set if recipient type is
'private'(1) or 'huddle'(3), otherwise i.e if it is 'stream'(2), it
should be unset.

This commit adds a database index for the is_private flag (which we'll
need to use it). That index is used to reset the flag if it was
already set. The already set flags were due to a previous removal of
is_me_message flag for which the values were not cleared out.

For now, the is_private flag is always 0 since the really hard part of
this migration is clearing the unspecified previous state; future
commits will fully implement it actually doing something.

History: Migration rewritten significantly by tabbott to ensure it
runs in only 3 minutes on chat.zulip.org.  A key detail in making that
work was to ensure that we use the new index for the queries to find
rows to update (which currently requires the `order_by` and `limit`
clauses).
2018-07-30 15:43:55 -07:00
Shubham Padia 28589c5563 search pills: Backspace should remove a search pill with typeahead open.
Fixes part of #10026.

Typeaheads stopped propogation of keydown and keyup events for any
key except tab and enter. If stopAdvance was true even tab and enter
were not allowed.

advanceKeyCodes option was added to typeahead which allowed to specify
key codes for which propogation of keydown and keyup events should not
stop. advanceKeyCodes does not respect the stopAdvance option.
As the backspace key code is added to advanceKeyCodes in search.js,
the backspace key deletes pill on pressing backspace if input is empty
or only consists of spaces.
2018-07-30 14:33:06 -07:00
Shubham Dhama 4186ebe56a settings_user: Don't render bot_owner_select for user list.
This optimize the case when the user-info-form modal is opened
in user-list by not rendering bot_owner_select handlebar.
This bug is before changing form to modal.
2018-07-30 13:48:36 -07:00
Shubham Dhama 8f115c8291 settings_user: Refactor `open-user-form` click handler. 2018-07-30 13:48:36 -07:00
Shubham Dhama 5506f74084 settings_user: Remove redundant verbose check of owner value. 2018-07-30 13:48:36 -07:00
Shubham Dhama e08daf9a00 settings_user: Add modal for user info and roles form.
Advantages of changing it to modal is that now it doesn't render
form for every row i.e. form is rendered only for row edit button
is clicked.
2018-07-30 13:48:36 -07:00
Shubham Dhama 2b738d02c3 org settings: Refactor modal "partials" to a seperate file. 2018-07-30 13:48:36 -07:00
Shubham Dhama 2bcd21aeca org settings: Use people.get_active_human_persons to get active humans. 2018-07-30 13:48:36 -07:00
Shubham Dhama 16357fc84a people: Add common function for getting active human users. 2018-07-30 13:48:36 -07:00
Tim Abbott fd71f7282d docs: Clean up the new thumbnailing docs. 2018-07-30 13:46:32 -07:00
Tim Abbott b53463d6a4 docs: Remove use of multi-line 'su zulip' in docs.
It turns out this confused people into trying to run both pieces in
one line.
2018-07-30 13:38:55 -07:00
Tim Abbott aa5959396d docs: Add some basic subsystem documentation for thumbnailing. 2018-07-30 13:20:54 -07:00
Aditya Bansal 77651ece39 thumbnails: Rename size value 'original' to 'full'. 2018-07-30 13:00:23 -07:00
Aditya Bansal 5b5d8bb310 thumbnails: Rename data-original to data-src-fullsize. 2018-07-30 13:00:23 -07:00
Tim Abbott d49cee3050 manage.py: Catch issue with users running manage.py as the wrong user.
Apparently, if you tried running manage.py as a non-root user that
isn't the main zulip user, you'll get a confusing Django exception
about `SECRET_KEY` not being configured.

This change provides a clean, understandable exception for this case.
2018-07-30 12:34:48 -07:00
Tim Abbott 02ae71f27f api: Stop using API keys for Django->Tornado authentication.
As part of our effort to change the data model away from each user
having a single API key, we're eliminating the couple requests that
were made from Django to Tornado (as part of a /register or home
request) where we used the user's API key grabbed from the database
for authentication.

Instead, we use the (already existing) internal_notify_view
authentication mechanism, which uses the SHARED_SECRET setting for
security, for these requests, and just fetch the user object using
get_user_profile_by_id directly.

Tweaked by Yago to include the new /api/v1/events/internal endpoint in
the exempt_patterns list in test_helpers, since it's an endpoint we call
through Tornado. Also added a couple missing return type annotations.
2018-07-30 12:28:31 -07:00
Tim Abbott 07af59d4cc tornado: Split get_events_backend into two functions.
The lower-layer function, now called get_events_backend, is intended
to be called by multiple code paths (including the upcoming
get_events_internal).
2018-07-30 12:28:31 -07:00
Harshit Bansal 8aabce5a5f hotkeys: Use canonical name for reacting with `+` hotkey.
This is sort of a temporary fix to bring the state back to how it
was in commit: ef4337edcb. However,
long-term we will need to fix our local echo feature to do merging
of names just like we do on backend.
2018-07-30 12:18:33 -07:00
Tim Abbott 906718f154 node tests: Fix minor linter error.
I'm not sure how this slipped in.
2018-07-30 12:17:27 -07:00
Tim Abbott 00f6fc2559 subs: Limit editing subscribers for waiting period users.
Does not let you subscribe other users if you are a guest or a
waiting period user.

Co-authored-by: Shubham Padia <shubhamapadia@gmail.com>
2018-07-30 12:12:51 -07:00
Shubham Padia 1015b2fc44 subs: Refactor and add tests for UserProfile.can_create_streams.
This is a preparatory refactor for adding
UserProfile.can_subscribe_other_users.
Although there existed a test for limiting users from creating
streams at `test_subs.test_user_settings_for_adding_streams`,
it did not test the logic inside can_add_streams, tests have
been added to solve that issue.
2018-07-30 12:12:51 -07:00