Commit Graph
2786 Commits
Author SHA1 Message Date
Artem V. NavrotskiyandArtem V. Navrotskiy 8ec59bd18b Add API method for get user by ID of an SSH key 2015-09-03 15:47:22 +03:00
Dmitriy Zaporozhets 28219ea921 Merge branch 'fix-raw-controller-disposition' into 'master'
Remove the filename argument from Content-Disposition header

This MR removes the filename argument from the `Content-Disposition` header to avoid RFC 5987 and RFC 6266 encoding issues. Some browsers (e.g. Internet Explorer) do not properly decode a Unicode string properly, and this can lead to odd filenames in the raw file download. This change allows the browser to determine the filename based on the URL.

For example, if I have a file called `한글한글.pptx` and click to download it with the "Raw" button in the Files section, IE11 will ask:

![image](https://gitlab.com/stanhu/gitlab-ce/uploads/fdb688282c0d4564872deadb44c58b2c/image.png)

If you look at the `Content-Disposition` field, you see this:

![image](https://gitlab.com/stanhu/gitlab-ce/uploads/2b342b83ae1ec61fd31937163ace8ec5/image.png)

Chrome, Firefox, and Safari seem to be able to handle UTF-8 encoded filenames, even though this is not standard.

See: http://greenbytes.de/tech/tc2231/

Closes https://github.com/gitlabhq/gitlabhq/issues/9595

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/1829

I've also submitted a pull request to Rails to support RFC 6266: https://github.com/rails/rails/pull/21461

See merge request !1235
2015-09-02 12:25:28 +00:00
Stan Hu 551157960e Remove the filename argument from Content-Disposition header to avoid
RFC 5987 and RFC 6266 encoding issues. This change allows the browser
to determine the filename based on the URL.

See: http://greenbytes.de/tech/tc2231/

Closes https://github.com/gitlabhq/gitlabhq/issues/9595

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/1829
2015-09-02 00:20:05 -07:00
Kirilll Zaitsev 263abda3fd Drone CI service 2015-09-02 05:52:16 +03:00
Douwe Maan afb2e6f485 Merge branch 'rs-cleanup-redcarpet-renderer' into 'master'
Decouple Gitlab::Markdown from the GitlabMarkdownHelper

This module is now the sole source of knowledge for *how* we render
Markdown (and GFM).

See merge request !1223
2015-09-01 20:13:44 +00:00
Douwe Maan 2236e9d617 Merge branch 'fix-bitbucket-import-issue-order' into 'master'
Import all Bitbucket issues and sort issues by creation date

Previously only the first 15 Bitbucket issues would be imported. Other issues in the API return call also calls import errors.

Tested by importing 400+ issues from this repo: https://bitbucket.org/ned/coveragepy

API reference here: https://bitbucket.org/site/master/issues/3571/api-issues-sorting-bb-3518

Closes https://github.com/gitlabhq/gitlabhq/issues/9519

See merge request !1226
2015-09-01 17:29:08 +00:00
Stan Hu 2e9c922dd1 Fix bug where only the first 15 Bitbucket issues would be imported.
Also fix a number of issues where author/reporter names were not available.
2015-09-01 08:50:20 -07:00
Valery Sizov bb86df1bd2 Merge branch 'fix-branches-cache-after-merge' into 'master'
Expire cache when merge request source branch was removed

Re-implement !1160 for 8.0. Also we have tests for MergeWorker now! Yay 

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

See merge request !1224
2015-09-01 09:09:03 +00:00
Robert Speicher 2930041886 Make sure the gfm helper passes the required options
This adds some duplication, but this helper is temporary.
2015-08-31 18:09:18 -04:00
Robert Speicher 805693bfea Remove invalid spec for GitlabMarkdownHelper 2015-08-31 16:22:14 -04:00
Robert Speicher 8c0565b7ca Merge branch 'dont-notify-users-without-project-access' into 'master'
Don't notify users without access to the project when they are (accidentally) mentioned in a note.

Addresses #2366.

See merge request !1216
2015-08-30 23:56:34 +00:00
Douwe Maan fe86c8dfbd Merge branch 'master' into joelkoglin/gitlab-ce-feature_fix_ldap_auth_issue_993 2015-08-29 11:49:14 -07:00
Dmitriy Zaporozhets 39ee52f1b1 Expire cache when merge request source branch was removed
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-28 10:23:56 +02:00
Robert Speicher 8e7111f79d Reference filters no longer take a custom class context option 2015-08-27 15:36:26 -07:00
Robert Speicher a4e4fde3e6 Restore the forwarded HTML options in link_to_gfm 2015-08-27 14:28:45 -07:00
Robert Speicher 4340dd3eeb Decouple Gitlab::Markdown from the GitlabMarkdownHelper
This module is now the sole source of knowledge for *how* we render
Markdown (and GFM).
2015-08-27 14:17:26 -07:00
Douwe Maan 30555c1d24 Merge branch 'rs-remove-user-color-scheme-class' into 'master'
Apply syntax highlighting to fenced code blocks client-side

Instead of applying the syntax highlighting scheme class to these blocks
server-side, we use Javascript and Gon to apply the user's color scheme
(or the default) client-side.

This will make it easier to cache these blocks in the future because
they're no longer state-dependent.

See merge request !1203
2015-08-27 16:24:51 +00:00
Douwe Maan ea5da30326 Don't notify users without access to the project when they are (accidentally) mentioned in a note. 2015-08-26 17:23:22 -07:00
Robert Speicher 7a81dc65d9 Re-add user_color_scheme helper
Update PreferencesHelper specs
2015-08-26 11:33:44 -07:00
Robert Speicher d6a145d4b0 Fix two more failing specs 2015-08-25 16:26:20 -07:00
Robert Speicher c401543d02 Fix failing spec 2015-08-25 15:57:55 -07:00
Robert Speicher 2c3e42e4a4 Remove user_color_scheme_class
Instead of rendering this value server-side, we use Javascript and Gon
to apply the user's color scheme (or the default) to any syntax
highlighted code blocks.

This will make it easier to cache these blocks in the future because
they're no longer state-dependent.
2015-08-25 15:32:38 -07:00
Robert Speicher 4344b8d2d4 Add Gitlab::ColorSchemes module
Very similar to Gitlab::Theme, this contains all of the definitions for
our syntax highlighting schemes.
2015-08-25 15:32:38 -07:00
Douwe Maan 2df94f9763 Merge branch 'rs-re-enable-user-reference-spec' into 'master'
Re-enable the "links with adjacent text" UserReferenceFilter spec

See merge request !1194
2015-08-25 16:44:14 +00:00
Dmitriy Zaporozhets c1b490d6ef Merge branch 'handle-smtp-input-errors' into 'master'
Gracefully handle SMTP user input errors (e.g. incorrect email addresses) to prevent Sidekiq retries

### What does this MR do?

This MR gracefully handles SMTP input errors (e.g. incorrect or invalid e-mail addresses) to prevent these types of exceptions from causing Sidekiq to retry the task. If these specific exceptions occur, they will be logged, and the e-mail will be dropped from the queue.

### Why was this MR needed?

If you include an author that has a misspelled e-mail address, Sidekiq will keep sending e-mail to all the recipients even if they have already received the e-mail. The only way to recover is to clear the Sidekiq queue.

Note that other exceptions can still be thrown (e.g. `IOError`, `Net::SMTPAuthenticationError`, `Net::SMTPServerBusy`, `Net::SMTPUnknownError`, and `TimeoutError`). If the worker encounters these, Sidekiq should retry the task.

### What are the relevant issue numbers?

Closes https://github.com/gitlabhq/gitlabhq/issues/9560

See merge request !1163
2015-08-25 09:23:43 +00:00
Robert Speicher 646c1f0324 Re-enable the "links with adjacent text" UserReferenceFilter spec 2015-08-24 18:56:01 -07:00
Stan Hu 19f478e00d Fix Error 500 in API when accessing a group that has an avatar
Closes #2340
2015-08-24 07:46:06 -07:00
Stan Hu ed1d4fa477 Remove user OAuth tokens stored in database for Bitbucket, GitHub, and GitLab
and request them each session. Pass these tokens to the project import data.

This prevents the need to encrypt these tokens and clear them in case they
expire or get revoked.

For example, if you deleted and re-created OAuth2 keys for Bitbucket, you would get
an Error 500 with no way to recover:

```
Started GET "/import/bitbucket/status" for x.x.x.x at 2015-08-07 05:24:10 +0000
Processing by Import::BitbucketController#status as HTML
Completed 500 Internal Server Error in 607ms (ActiveRecord: 2.3ms)

NameError (uninitialized constant Import::BitbucketController::Unauthorized):
  app/controllers/import/bitbucket_controller.rb:77:in `rescue in go_to_bitbucket_for_permissions'
  app/controllers/import/bitbucket_controller.rb:74:in `go_to_bitbucket_for_permissions'
  app/controllers/import/bitbucket_controller.rb:86:in `bitbucket_unauthorized'
```

Closes #1871
2015-08-23 09:23:44 -07:00
Maël Valais a9e409179b Create cross-reference for closing references on commits pushed to non-default branches.
I also revamped the tests on "closing reference commits" (= "Fixes #xxxx" for example).
Now, there are two different contexts:
- when the commits with "closing reference" are pushed to the default branch,
- when the commits with "closing reference" are pushed to a non-default branch.

Closes gitlab-org/gitlab-ce#2190.
2015-08-22 16:49:09 +02:00
Robert Speicher f0bdf7f810 Merge branch 'reply-by-email' into 'master'
Reply by email

Fixes #1360.

It's far from done, but _it works_.

See merge request !1173
2015-08-22 00:00:08 +00:00
Douwe Maan 15fc7bd613 No HTML-only email please 2015-08-21 16:09:55 -07:00
Douwe Maan 0daa21ed8c Merge branch 'fix-email-autocomplete' into 'master'
Fix bug preventing invite by e-mail

This was broken in 70f5291808 as a result of introducing the ability to filter by current user.

Closes #2320

See merge request !1181
2015-08-21 22:25:59 +00:00
Stan Hu 3715a0f29b Fix bug preventing invite by e-mail
This was broken in 70f5291808 as a result of introducing the ability to filter by current user.

Closes #2320
2015-08-21 13:47:56 -07:00
Douwe Maan 1cfc4af31e Merge branch 'rs-dev-issue-2550' into 'master'
Remove trailing HTML entities from non-Rinku autolinks as well.

Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2550

See merge request !1179
2015-08-21 18:48:18 +00:00
Douwe Maan 69708dab9f Block blocked users from replying to threads by email. 2015-08-21 10:14:45 -07:00
Joel KoglinandJoel Koglin 4d2f36118a Issue #993: Fixed login failure when extern_uid changes 2015-08-21 09:36:27 -07:00
Dmitriy Zaporozhets d43d7ffd6f Merge branch 'hide-recent-push' into 'master'
Only show recent push event if the branch still exists or a recent merge request has not been created

Closes #2277

See merge request !1167
2015-08-21 14:54:53 +00:00
Dmitriy Zaporozhets 59525d6b28 Merge branch 'comment-case-insensetive-search' into 'master'
Case-insensitive search for comments

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

See merge request !1174
2015-08-21 14:53:36 +00:00
Robert Speicher 747fe7520b Remove trailing HTML entities from non-Rinku autolinks as well. 2015-08-20 18:25:16 -07:00
Douwe Maan afb765ad9e Fix markdown specs again. Apparently development and test behave differently. 2015-08-20 15:41:34 -07:00
Douwe Maan 99ef8c8159 Fix markdown specs. 2015-08-20 15:37:43 -07:00
Douwe Maan 48e25a019a Add stub_reply_by_email_setting helper. 2015-08-20 13:21:22 -07:00
Douwe Maan 6110e175dc Use heredocs. 2015-08-20 13:10:55 -07:00
Douwe Maan 54b04f1c5b Add fixture_file helper. 2015-08-20 12:41:47 -07:00
Douwe Maan ac268674ed Update spec. 2015-08-20 12:34:45 -07:00
Douwe Maan e1eb09dd0e Remove more unused fixtures. 2015-08-20 12:33:33 -07:00
Douwe Maan 2b5a2b8f39 Removed unused fixtures. 2015-08-20 12:29:03 -07:00
Douwe Maan 3d51a6d435 Merge branch 'master' into reply-by-email 2015-08-20 12:19:19 -07:00
Douwe Maan 8ec5fb138d Test Gitlab::Email::Receiver. 2015-08-20 12:17:59 -07:00
Douwe Maan e44936f3ed Test EmailReceiverWorker. 2015-08-20 11:47:09 -07:00