Commit Graph

1003 Commits

Author SHA1 Message Date
Dmitriy Zaporozhets 541f7675f9 Merge branch 'fix-diff-patch-public-mr' into 'master'
Fix downloading of patches on public merge requests when user logged out

### What does this MR do?

This MR makes it possible to download a diff patch on a public merge request when a user is logged out.

### Why was this MR needed?

An Error 500 would result when a user attempted to click on the "Email Patches" or "Plain Diff" button:

```
NoMethodError - undefined method `id' for nil:NilClass:
  lib/gitlab/backend/shell_env.rb:9:in `set_env'
  lib/gitlab/satellite/action.rb:20:in `in_locked_and_timed_satellite'
  lib/gitlab/satellite/merge_action.rb:49:in `diff_in_satellite'
  app/models/merge_request.rb:219:in `to_diff'
  app/controllers/projects/merge_requests_controller.rb:42:in `block (2 levels) in show'
```

### What are the relevant issue numbers?

* Closes #1225
* Closes #1854 (dup)
* Closes #1858 (dup)

See merge request !872
2015-06-23 15:03:00 +00:00
Stan Hu 555fd0cf4a Fix downloading of patches on public merge requests when user logged out
Closes #1225
Closes #1854
Closes #1858
2015-06-23 05:34:21 -07:00
Dmitriy Zaporozhets b21390936a
Make provider a select for identities form in admin area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-22 16:53:11 +02:00
Alex Lossent d96d9aae42 Fix behavior of ldap_person method in Gitlab::OAuth::User
Code tweaks in 45e9150a caused the ldap_person method to not return expected results.
Improved tests to cover the ldap_person method, which was previously stubbed.
2015-06-17 18:06:27 +02:00
Dmitriy Zaporozhets fe51fa26a7
Dont set checkout sha for removed branch/tag
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-15 17:54:22 +02:00
Robert Speicher 844d72716e Add Gitlab::Themes module; remove Gitlab::Theme
Now we can simply loop through all themes, among other things.

This also removes the `dark_theme` / `light_theme` classes and the
`theme_type` helper, since they weren't used anywhere.
2015-06-13 17:58:16 -04:00
Douwe Maan 9ea8dcb5e2 Merge branch 'feature-session-expire-seconds-ui' into 'master'
Add session expiration delay configuration through UI application

Setting is accessible by the administrator through the UI and defaults to 1 week (the current setting)

Answers the following suggestions:

  * http://feedback.gitlab.com/forums/176466-general/suggestions/6210719-make-session-length-configurable
  * http://feedback.gitlab.com/forums/176466-general/suggestions/6730512-automatic-logout-after-a-time-being-idle

See merge request !774
2015-06-12 13:50:40 +00:00
themaze75 1d080f5745 session_expire_seconds => session_expire_delay
delay is in seconds
more legible code in session_store
Added `GitLab restart required` help block to session_expire_delay
2015-06-10 22:10:00 -04:00
Robert Speicher 2f3ab0ab85 Define GITORIOUS_HOST only once 2015-06-10 01:31:27 -04:00
Jeroen van Baarsen 25a870a6d4 Revert "No need to check if `repository_ref` is present" 2015-06-09 15:18:15 +02:00
zenati c418261b2b No need to check if `repository_ref` is present
There is no need to check if `repository_ref` is present as:
```
      @repository_ref = if repository_ref.present?
                          repository_ref
                        else
                          nil
                        end
```

is as same as doing:

```
@repository_ref = repository_ref
```
2015-06-08 18:01:50 +02:00
Eric Maziade 84a414fe53 Add session expiration delay configuration through UI application
settings
2015-06-05 11:50:37 -04:00
Douwe Maan 3f59a8f0be Merge branch 'cernvcs/gitlab-ce-feature/auto_link_ldap_omniauth' 2015-06-05 13:34:25 +02:00
Douwe Maan 45e9150a51 Tweak code. 2015-06-05 12:32:01 +02:00
Dmitriy Zaporozhets 9287865599 Merge branch 'fix-upgrader-script' into 'master'
Fix upgrader script

This is a fix for upgrader script not guessing the latest version correctly.

Upgrader now handles versions where a version part (major/minor/patch) can have multi-digit number, also ensures that the latest version is chosen from git tags by converting tag to Gitlab::VersionInfo and than selecting the latest/greatest version.

Fixes: #1476

See merge request !695
2015-06-04 16:01:13 +00:00
Dmitriy Zaporozhets e414463d9e
Merge branch 'repo-remove'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	spec/features/projects_spec.rb
2015-06-03 16:17:36 +02:00
Dmitriy Zaporozhets 97ff86e07c Move repository when project is removed
Ths commit does next:

* When we remove project we move repository to path+deleted.git
* Then we schedule removal of path+deleted with sidekiq
* If repository move failed we abort project removal

This should help us with NFS issue when project get removed but
repository stayed. The full explanation of problem is below:

* rm -rf project.git
* rm -rf removes project.git/objects/foo
* NFS server renames foo to foo.nfsXXXX because some NFS client (think
* Unicorn) still has the file open
* rm -rf exits, but project.git/objects/foo.nfsXXX still exists
* Unicorn closes the file, the NFS client closes the file (foo), and the
* NFS server removes foo.nfsXXX
* the directory project.git/objects/ still exists => problem

So now we move repository and even if repository removal failed

Repository directory is moved so no bugs with project removed but
repository directory taken. User still able to create new project with
same name. From administrator perspective you can easily find stalled
repositories by searching `*+deleted.git`

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-03 13:05:43 +02:00
Alex Lossent dfcea8ed51 Add option to automatically link omniauth and LDAP identities
Until now, a user needed to first sign in with his LDAP identity and then manually
link his/her account with an omniauth identity from their profile.
Only when this is done can the user authenticate with the omniauth provider and at
the same time benefit from the LDAP integration (HTTPS authentication with LDAP
username/password and in EE: LDAP groups, SSH keys etc.).
This feature automates the process by looking up a corresponding LDAP person when a
user connects with omniauth for the first time and then automatically linking the LDAP
and omniauth identities (of course, like the existing allow_single_sign_on setting,
this is meant to be used with trusted omniauth providers).
The result is identical to a manual account link.

Add config initializers for other omniauth settings.
2015-06-03 11:46:20 +02:00
Dmitriy Zaporozhets 79aac2c128 Merge branch 'ignore-references' into 'master'
Don't notify users mentioned in code blocks or blockquotes.

cc @rspeicher

See merge request !753
2015-06-02 18:39:18 +00:00
Robert Speicher 9e7a9c63a5 Further limit the limited whitelist for project/group descriptions 2015-06-02 13:41:12 -04:00
Robert Speicher 023dd2907b Add a `pipeline` context option for SanitizationFilter
When this option is `:description`, we use a more restrictive whitelist.
This is used for Project and Group description fields.
2015-06-02 13:04:10 -04:00
Douwe Maan 94919c7ef6 Ignore references in blockquotes. 2015-06-02 13:17:21 +02:00
Douwe Maan fe78984f20 Actually ignore references in code blocks etc. 2015-06-02 13:17:11 +02:00
Dmitriy Zaporozhets d684b11054
Remove unnecessary satellite files and add CHANGELOG item
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-02 12:07:00 +02:00
Dmitriy Zaporozhets 8ad5f08483
Remove now unnecessary satelittes logic for creating and editing file with web editor
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-02 10:56:22 +02:00
Robert Speicher 7424d2fa5b Add ExternalLinkFilter to Markdown pipeline
Forces a `rel="nofollow"` attribute on all external links.
2015-05-27 15:39:08 -04:00
Robert Speicher 5a9c5520d9 Make use of to_reference in more specs 2015-05-26 15:49:22 -04:00
Robert Speicher 81a09bc74c Support only double quotes for multi-word label references 2015-05-26 15:49:20 -04:00
Robert Speicher b88da58cb6 Add `reference_pattern` to Referable models 2015-05-26 15:48:32 -04:00
Robert Speicher 9d032cddf5 Correct the ReferenceFilter html/pipeline/filter require 2015-05-26 15:48:31 -04:00
Dmitriy Zaporozhets 08102ad748 Merge branch 'rs-issue-1690' into 'master'
Better handle label references that aren't actually references

Fixes #1690

See merge request !705
2015-05-26 14:35:54 +00:00
Robert Speicher b263a33c80 Better handle label references that aren't actually references
Fixes #1690
2015-05-25 16:06:34 -04:00
Martins Polakovs cfc9bff45e Fix upgrader script 2015-05-23 13:11:23 +03:00
Stan Hu 3b22cfe600 Remove Rack Attack monkey patches and bump to version 4.3.0 2015-05-22 16:25:03 -04:00
Robert Speicher 212fe14c65 Customize the sanitization whitelist only once
Fixes #1651
2015-05-20 21:16:11 -04:00
Robert Speicher 8ee382087d Subclass TaskList::Filter to fix a bug
Instead of using a fork, we subclass the filter and only apply the
`task-list` class to list items that actually are task lists.

Closes #1645

See https://github.com/github/task_list/pull/60
2015-05-20 12:08:33 -04:00
Jakub Jirutka b0659c1b07 Simplify and unify helpers for rendering markup 2015-05-18 22:52:13 +02:00
Jakub Jirutka daa0925016 Rename MarkdownHelper to MarkupHelper 2015-05-18 22:51:56 +02:00
Jakub Jirutka 8dbc4746fe Handle AsciiDoc better, reuse HTML pipeline filters (fixes #9263) 2015-05-18 20:48:03 +02:00
Nikita Verkhovin 241f5971ba Add search issues/MR by number 2015-05-18 13:09:13 +06:00
Dmitriy Zaporozhets 9c6f4a2351 Merge branch 'dashboard-references' into 'master'
Fix reference links in dashboard activity and ATOM feeds.

References like `@user` were not linked on the dashboard activity feed and in Atom feeds, because the reference parser depends on `@project` which isn't set in those situations.

This MR passes the project in question to the reference parsers in an option.

cc @rspeicher

See merge request !653
2015-05-15 09:59:26 +00:00
Dmitriy Zaporozhets 947231a461 Merge branch 'rs-relative-link-filter' into 'master'
Minor RelativeLinkFilter cleanup

See merge request !649
2015-05-14 14:37:43 +00:00
Douwe Maan cd52cef1c0 Fix reference links in dashboard activity and ATOM feeds. 2015-05-14 13:05:33 +02:00
Robert Speicher 7f2fb72a0a Minor RelativeLinkFilter cleanup 2015-05-13 14:08:37 -04:00
Jacob Vosmaer c291ff9c6f Use SIGKILL by default in Sidekiq::MemoryKiller
This makes the memory growth-triggered Sidekiq restarts more reliable by
reducing the chance that Sidekiq ends up in a state where it is not
accepting new jobs but also not shutting down: SIGKILL is more likely to
work than SIGTERM.
2015-05-13 17:09:12 +02:00
Dmitriy Zaporozhets 8ad91d5840 Merge branch 'text-batch-1' into 'master'
Batch 1 of text improvements

Batch 1 of changes from my effort at !635 to walk through every piece of text in GitLab and see if it can be improved.

This batch includes:

- Improve text on error pages.
- Improve Git access error messages.
- Improve description of branch protection levels.
- Improve OAuth signup error message.
- Improve OAuth application flash messages.

cc @rspeicher

See merge request !642
2015-05-13 12:05:17 +00:00
Dmitriy Zaporozhets 740716afd1 Merge pull request #9276 from jirutka/relative_link_filter
Extract handling of relative file links to its own HTML filter
2015-05-13 14:09:57 +03:00
Douwe Maan c5e4b443ff Fix GitAccess. 2015-05-13 09:46:22 +02:00
Douwe Maan 17a41547a0 Improve OAuth signup error message. 2015-05-13 09:41:56 +02:00
Douwe Maan 9eb45ccd55 Improve description of branch protection levels. 2015-05-13 09:41:55 +02:00