Commit Graph
824 Commits
Author SHA1 Message Date
Douwe Maan 99abbe7dbe Use Projects::CreateService to create imported projects so hooks are executed. 2015-04-06 14:51:09 +02:00
Douwe Maan 317206300d Merge branch 'configurable-attachment-size' into 'master'
Support configurable attachment size in Application Settings page

### What does this MR do?

This MR provides the ability to configure the maximum size of an attachment inside a note. A parameter has been added to the Application Settings page.

### Are there points in the code the reviewer needs to double check?

What should be done with the legacy note attachment validation? I added code to make the validation work with the configurable setting. I could see an issue where an admin lowers the limit from 10 megabytes to 5 megabytes, which could cause an existing model to be invalid.

### Why was this MR needed?

We often have attachments that exceed 10 MB, and it would be nice to be able to override the defaults.

### What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/)?

See Issue #1258

### Screenshots

Before:

![Screen_Shot_2015-03-29_at_3.06.53_PM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/6013a1dbc8cf61a63e93744149937fa0/Screen_Shot_2015-03-29_at_3.06.53_PM.png)

After:

![Screen_Shot_2015-03-29_at_3.12.34_PM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/f3518af7e8653ba40f0a3579456da6ad/Screen_Shot_2015-03-29_at_3.12.34_PM.png)

See merge request !407
2015-04-03 08:47:55 +00:00
Dmitriy Zaporozhets 0d0042d274 Merge branch 'import-current-user' into 'master'
Import GitHub, Bitbucket or GitLab.com projects owned by authenticated user into current namespace.

Addresses #1347.

Untested since I'm in a bit of a hurry. Will definitely have time to test and add unit tests before the 7.10 release :)

See merge request !481
2015-04-02 20:34:52 +00:00
Dmitriy Zaporozhets f8f9750323 Merge branch 'username-period' into 'master'
Don't allow username to end in period.

The current behavior doesn't do username referencing and mentioning in sentences like "I discussed with with @douwe." since `douwe.` is matched as a username.

Addresses private issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2174.

See merge request !438
2015-04-02 20:28:23 +00:00
Stan Hu dfd256f29e Support configurable attachment size via Application Settings
Fix bug where error messages from Dropzone would not be displayed on the issues page

Closes #1258
2015-04-02 00:04:08 -07:00
Marin Jankovski d77f333f9c Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
Conflicts:
	lib/gitlab/markdown.rb
2015-03-31 19:03:54 -07:00
Dmitriy Zaporozhets dc3b4321ff Merge branch 'group-information-leak' into 'master'
Don't leak private group existence by redirecting from namespace controller to group controller.

See merge request !440
2015-04-01 01:01:38 +00:00
Douwe Maan 737f322e41 Import GitHub, Bitbucket or GitLab.com projects owned by authenticated user into current namespace. 2015-03-31 16:34:13 +02:00
Douwe Maan 5f93b0e3da Don't allow username to end in period. 2015-03-27 11:10:56 +01:00
Douwe Maan dfe0f9eedf Use more specific regexes. 2015-03-27 11:09:29 +01:00
Douwe Maan 3f7531d6f2 Move User.cleanup_username to Namespace.cleanup_path. 2015-03-27 11:09:29 +01:00
Douwe Maan e08d947e77 Use relative URL for Markdown references, except in mails. 2015-03-27 10:39:05 +01:00
Dmitriy Zaporozhets 99fcb80eb7 Merge pull request #9021 from nicklegr/faster_auto_merge
Faster merge request processing for large repository
2015-03-25 12:18:03 -07:00
Dmitriy Zaporozhets 6199da0cb4 Merge pull request #8007 from mr-vinn/markdown-tags
Allow HTML tags in user Markdown input
2015-03-25 10:21:03 -07:00
Dmitriy Zaporozhets f729f60447 Merge branch 'more-rubocop-styles' into 'master'
More rubocop styles

See merge request !449
2015-03-25 15:37:04 +00:00
nicklegr a30011372f Reset parking branch to HEAD everytime
* Reduces overhead of git checkout
2015-03-25 21:05:06 +09:00
Dmitriy Zaporozhets 8f3f6e9efb Merge branch 'api-internal-errors' into 'master'
Respond with full GitAccess error if user has project read access.

Should help with debugging #1236.

cc @marin

See merge request !437
2015-03-25 04:16:45 +00:00
Vinnie Okada 057c8c344b Merge branch 'master' into markdown-tags 2015-03-24 20:03:22 -06:00
Dmitriy Zaporozhets 69454e36f7 Style/RedundantReturn enabled 2015-03-24 18:35:57 -07:00
Dmitriy Zaporozhets 6ec8ff069c Enable more rubocop style checks 2015-03-24 18:28:10 -07:00
Dmitriy Zaporozhets fc4af9b197 Merge branch 'git-auth-rack-attack-improvements' into 'master'
Reduce Rack Attack false positives causing 403 errors during HTTP authentication

### What does this MR do?

This MR reduces false positives causing `403 Forbidden` messages after HTTP authentication.

A Git client may attempt to access a repository without a password. If it receives a 401 error, the client often will try again, this time supplying a password. The problem is that `grack_auth.rb` considers a blank password an authentication failure and increases a Redis counter each time this happens. With enough requests, an IP can be banned temporarily even though previous attempts may have been successful. This leads users to see `403 Forbidden` errors until the ban times out (default: 1 hour).

To reduce the chance of a false positive, this MR resets the counter upon a successful authentication from an IP.

In addition, this MR logs when a user has been banned and introduces the ability to disable Rack Attack via a config variable.

### Are there points in the code the reviewer needs to double check?

rack-attack v4.2.0 doesn't support the ability to clear counters out of the box, so `rack_attack_helpers.rb` includes a number of monkey patches to make it work. It looks like this functionality may be added in v4.3.0. I've also sent pull requests to rack-attack to add the functionality necessary to delete a key.

Each time an authentication is successful, the Redis counter for that IP is cleared. I deemed it better to clear the counter than to allow for blank passwords, since the latter seems like a security risk.

### Why was this MR needed?

It was quite difficult to figure out why users were seeing `403 Forbidden`, which is why the log message was added. Users were getting a lot of false positives when accessing repositories with HTTPS. Including the username in the HTTPS URL (e.g. `https://username@mydomain.com/account/repo.git`) caused authentication failures because while the git client provided the username, it left the password blank, leading to an authentication failure.

### What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/)?

See Issue #1171

https://github.com/kickstarter/rack-attack/issues/113

See merge request !392
2015-03-24 21:51:40 +00:00
Dmitriy Zaporozhets b8ad3647ad Merge branch 'fix-nested-tasks' into 'master'
Fix nested task lists

When nesting task list items, the parent item is wrapped in a `<p>` tag.  Update the task list parser to handle these paragraph wrappers.

cc @sytse

See merge request !413
2015-03-24 20:57:35 +00:00
Douwe Maan 61e8ca8ce0 Don't leak private group existence by redirecting from namespace controller to group controller. 2015-03-24 15:55:12 +01:00
Douwe Maan 4830b2be5e Refactor GitAccess to use instance variables. 2015-03-24 14:11:48 +01:00
Stan Hu 56d87db32c Reduce Rack Attack false positives by clearing out auth failure count upon
successful Git over HTTP authentication.

Add logging when a ban goes into effect for debugging.

Issue #1171
2015-03-24 00:36:46 -07:00
Dmitriy Zaporozhets 2bb4ea8542 Merge branch 'notes-count-without-system' into 'master'
Don't include system notes in issue/MR comment count.

Addresses private issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2163.

See merge request !430
2015-03-24 00:10:25 +00:00
Dmitriy Zaporozhets 81d603e2c1 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-03-23 09:44:28 -07:00
Dmitriy Zaporozhets e24da35984 Merge branch 'improve-contributions-calendar' into 'master'
Replace commits calendar with contributions calendar

* count opening of issues and merge requests
* dont trigger git repository - use events from database
* count pushes instead of commits for faster and easier counting
* much-much faster since does not affected by repository size

See merge request !420
2015-03-23 16:40:55 +00:00
Douwe Maan 6b92236eeb Don't include system notes in issue/MR comment count. 2015-03-23 16:43:08 +01:00
Douwe Maan d4d0852d2d Merge pull request #8995 from MichaelAlt/patch-1
Faulty LDAP DN name escaping removed
2015-03-23 08:23:19 +01:00
Vinnie Okada 637ca0b388 Merge branch 'master' into markdown-tags 2015-03-22 21:50:28 -06:00
Vinnie Okada a7afc06342 Fix SanitizationFilter bugs
Return a `SafeBuffer` instead of a `String` from the `#gfm_with_options`
method so that Rails doesn't escape our markup.

Also add `<span>` to the sanitization whitelist to avoid breaking syntax
highlighting in code blocks.
2015-03-22 20:17:56 -06:00
Stan Hu 5cce0645b0 Fix OAuth2 issue importing a new project from GitHub and GitLab
Closes #1268
2015-03-22 18:16:48 -07:00
Dmitriy Zaporozhets fb30039668 Merge branch 'disable-ref-generation-in-code-blocks' into 'master'
Disable reference generation in preformatted/code blocks

### Summary

If a user adds text in code or preformatted text via Markdown or HTML that contains `#XXX`, the system adds a note that issue `XXX` was mentioned. This is particularly annoying because we often list gdb backtrace dumps into our issues, and many issues get mentioned as a result. For example:

```
(gdb) bt
#0  0x00000000004004c4 in second () at main.cc:6
#1  0x00000000004004d2 in first () at main.cc:11
#2  0x00000000004004dd in main () at main.cc:17
(gdb)
```

### Steps to reproduce

1. In an issue, write the above text using Markdown or HTML tags (e.g. `<code>`, `<pre>`).
2. Observe that [issue 1](https://gitlab.com/gitlab-org/gitlab-ce/issues/1) and [issue 2](https://gitlab.com/gitlab-org/gitlab-ce/issues/2) have a note that says they were mentioned.

### Expected behavior

Everything enclosed in the code blocks should be ignored as references.

### Observed behavior

Issues get referenced unnecessarily.

### Fix

I've made `reference_extractor.rb` strip out HTML and Markdown blocks before processing. I considered running the raw text through the entire Markdown processor, but this seems overkill and perhaps could lead to some unintended side effects.

See merge request !365
2015-03-22 23:36:07 +00:00
Dmitriy Zaporozhets 8494170550 Improve contribution calendar per day info 2015-03-22 14:52:44 -07:00
Dmitriy Zaporozhets 54aca18cf8 Contribution calendar will use events instead of commits to count contributions 2015-03-22 14:35:27 -07:00
Dmitriy Zaporozhets 43afe46bbd Refactor contributions events and write tests for calendar 2015-03-22 13:55:00 -07:00
Dmitriy Zaporozhets 64891c6c40 Replace commits calendar with contributions calendar
* count opening of issues and merge requests
* dont trigger git repository - use events from database
* much-much faster since does not affected by repository size
2015-03-21 23:48:08 -07:00
Michael Alt 1502fed795 Faulty LDAP DN name escaping removed
The Net::LDAP::Filter.escape function can not be used to escape the DN name because the backslash is required to escape special chars in the DN name. This leads to the error message "Access denied for your LDAP account." and prevents the user from logging in to gitlab.

Example DN: 
CN=Test\, User,OU=Organization,DC=Company
CN=Test User,OU=Organization,DC=Company

http://www.ietf.org/rfc/rfc4514.txt
2015-03-21 22:57:55 +01:00
Vinnie Okada f5e65e2e50 Merge branch 'master' into markdown-tags
Merge updated CHANGELOG entries
2015-03-21 09:03:35 -06:00
Vinnie Okada 1dc90fc455 Fix nested task lists
When nesting task list items, the parent item is wrapped in a `<p>` tag.
Update the task list parser to handle these paragraph wrappers.
2015-03-21 08:45:28 -06:00
Vinnie Okada cc29ce4917 Don't allow style attributes in inline HTML 2015-03-21 08:39:54 -06:00
Kamil Trzcinski 5b432e7671 Extend push_tag event to include tag message and last commit 2015-03-21 11:25:27 +01:00
Vinnie Okada 52bf95ae38 Change HTML sanitization
Use the `SanitizationFilter` class from the html-pipeline gem for inline
HTML instead of calling the Rails `sanitize` method.
2015-03-19 21:24:07 -06:00
Dmitriy Zaporozhets efd8491d49 Revert "Increase timeout for Git-over-HTTP requests."
This reverts commit 516bcabbf4.

Conflicts:
	Gemfile
2015-03-19 18:29:20 -07:00
Stan Hu 83d552d50d Disable reference creation for comments surrounded by code/preformatted blocks 2015-03-19 14:37:35 -07:00
Douwe Maan a5a5ec970e Fewer constants, more helpers. 2015-03-19 10:34:04 +01:00
Marin Jankovski 63f7129483 Move application setting to separate variable. 2015-03-18 13:55:41 -07:00
Vinnie Okada e535d21768 Handle nil restricted visibility settings
Return `true` from `non_restricted_level?` when the
`restricted_visibility_levels` setting is nil.
2015-03-18 12:50:27 -06:00
Dmitriy Zaporozhets fec5f807bb Merge branch 'new-branch-commits' into 'master'
List new commits for newly pushed branch in activity view.

When someone pushes commits, I want to see them, regardless if it's a new or existing branch. If it's a new branch, we compare with the default branch (usually master).

![Screen_Shot_2015-03-17_at_15.49.13](https://dev.gitlab.org/gitlab/gitlabhq/uploads/4cb7e0d833bc83a30197db81d4b273bc/Screen_Shot_2015-03-17_at_15.49.13.png)

See merge request !1711
2015-03-18 17:47:02 +00:00