Commit Graph

2595 Commits

Author SHA1 Message Date
Ben Boeckel dd4fee5fdb api: add 'system', 'upvote', and 'downvote' fields to note queries 2015-07-09 11:24:28 -04:00
Dmitriy Zaporozhets 1bf3e1578a
Properly render plain readme
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-09 11:36:09 +02:00
Francesco Coda Zabetta 6d56bd8690 use teaspoon instead of jasmine for testing javascript 2015-07-08 17:46:51 +02:00
Dmitriy Zaporozhets b9452d7bcd Merge branch 'improve-postgres-restore-cleaning' into 'master'
Use native Postgres database cleaning during backup restore

We were using hacks to drop tables etc during a Postgres backup
restore. With this change, we let pg_dump insert the DROP TABLE
statements it needs at the start of the SQL dump.

See merge request !1891
2015-07-07 23:02:48 +00:00
Jacob Vosmaer 90ab5a59bb Use native Postgres database cleaning during backup restore
We were using hacks to drop tables etc during a Postgres backup
restore. With this change, we let pg_dump insert the DROP TABLE
statements it needs at the start of the SQL dump.
2015-07-07 15:34:06 +02:00
Kamil Trzciński 474d798c42 Merge branch 'compress-db' into 'master'
Compress database backup

Restore handles both cases: uncompressed and compressed backup. As an improvement `IO.popen` can be used.

/cc @jacobvosmaer

See merge request !873
2015-07-07 10:58:27 +00:00
Dmitriy Zaporozhets f76092c06d Merge branch 'settings-via-api' into 'master'
API to set application settings for admin

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

See merge request !934
2015-07-07 10:57:41 +00:00
Jacob Vosmaer bb50b7fcd0 Allow custom backup archive permissions
This change helps system administrators who want to replicate
GitLab backup files without needing root permissions.
2015-07-06 18:43:17 +02:00
Kamil Trzcinski 69c659ebd3 Compress database backup 2015-07-06 17:14:17 +02:00
Dmitriy Zaporozhets 603ceea21a
Add tests and improve logic
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-06 16:47:19 +02:00
Valery Sizov 111ebe5471 Fork visibility level fix 2015-07-06 17:40:33 +03:00
Dmitriy Zaporozhets b28714b6a9
Add docs and empty specs for applicaiton settings API
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-06 15:53:08 +02:00
Dmitriy Zaporozhets b2e2444436 Merge pull request #9430 from gitlabhq/fix-rake-test-ci
Use teaspoon instead of jasmine:ci
2015-07-06 15:50:37 +02:00
Dmitriy Zaporozhets c2ee6862c8
API to set application settings for admin
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-03 16:50:21 +02:00
Steve Norman b3a751112d Allow user to be blocked and unblocked via the API 2015-07-03 11:17:57 +00:00
Dmitriy Zaporozhets 18ef9befc0
Use teaspoon instead of jasmine:ci
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-03 10:51:44 +02:00
Stan Hu 9add3e6eb5 Extract the longest-matching ref from a commit path when multiple matches occur
Closes #1839
2015-07-01 07:01:59 -07:00
Kamil Trzcinski a34c61d9c6 Reuse HTML Pipeline object in Markdown parser
The patches reduces pressure on GC and reduces markdown processing time
2015-06-30 13:59:27 +02:00
Stan Hu e3dbaa7027 Merge branch '1791-fix-github-issue-order' into 'master'
Fix wrong order of issues when importing from github

### 1. What does this MR do?

The order of issues imported from GitHub is fixed.

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

Nothing.

### 3. Why was this MR needed?

The default behaviors of GitHub API at listing issues are sort: :created and direction: :desc.

See GitHub API details at https://developer.github.com/v3/issues/#list-issues.

### 4. What are the relevant issue numbers / Feature requests?

Fixes #1791

### 5. Screenshots (if relevant)

Nothing

See merge request !898
2015-06-29 14:15:47 +00:00
Robert Speicher 60c7d35543 Remove jasmine:ci task, execute teaspoon directly on CI 2015-06-28 16:27:40 -04:00
Hiroyuki Sato 4a203aab57 Fix wrong order of issues when importing from github
See API details at https://developer.github.com/v3/issues/.
Refs #1791
2015-06-28 04:02:21 +09:00
Dmitriy Zaporozhets 9f166a8649 Merge branch 'rename-abilities' into 'master'
Rename abilities to correspond contoller/model action names

write_ was renamed to create_
modify_  was renamed to update_

So now in update action we have next code

```
def create
  can?(current_user, :create_issue, @issue)
end

def update
  can?(current_user, :update_issue, @issue)
end
```

See merge request !896
2015-06-26 16:39:17 +00:00
Dmitriy Zaporozhets 58ceb8e950
Only people who can manage issue can assign labels to it
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-26 16:02:57 +02:00
Dmitriy Zaporozhets 342d553709
Rename abilities to correspond contoller/model action names
write_ was renamed to create_
modify_  was renamed to update_

So now in update action we have next code

def create
  can?(current_user, :create_issue, @issue)
end

def update
  can?(current_user, :update_issue, @issue)
end

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-26 15:55:56 +02:00
Stan Hu 6548e9b48c Add 2FA status to user admin API
Closes https://github.com/gitlabhq/gitlabhq/issues/9391
2015-06-23 22:41:59 -07:00
Dmitriy Zaporozhets b902a9b83d Merge branch 'split-tests' into 'master'
Split rspec and spinach tests in parallel

For https://dev.gitlab.org/gitlab/gitlabhq/issues/2386

See merge request !874
2015-06-23 15:17:11 +00:00
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
Dmitriy Zaporozhets b8f12d1917 Replace GITLAB with GitLab in rake task descriptions 2015-06-23 16:52:40 +02:00
Dmitriy Zaporozhets 12e0998635 Refactor rake tasks for tests 2015-06-23 16:48:52 +02:00
Dmitriy Zaporozhets 94f130cbfc Merge branch 'admin-edit-identities' into 'master'
Admin can see, edit and remove user identities

Related to #1415 and https://dev.gitlab.org/gitlab/gitlabhq/issues/2224

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

See merge request !843
2015-06-23 14:24:16 +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
Stan Hu e80d7a804f Fix error when deleting a user who has projects
Closes #1856
Closes https://github.com/gitlabhq/gitlabhq/issues/9394
2015-06-23 04:39:49 -07:00
Dmitriy Zaporozhets 73e003013f
Merge branch 'master' into admin-edit-identities
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	app/views/admin/users/show.html.haml
2015-06-22 18:00:11 +02: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
Dmitriy Zaporozhets bcb07929fe Merge branch 'nginx_defaulthost_documentation' into 'master'
Close #178 Nginx conf default_host documentation

This closes #178
We're just making it clear that some nginx installs such as by default on recent Ubuntu's, the /etc/nginx/sites-enabled/default file will conflict the listen line of the gitlab nginx conf's due to the default_server directive.

changed installation.md to identify the issue to a user
added notes to both nginx configs for gitlab and gitlab-ssl
[ci-skip

See merge request !225
2015-06-22 13:22:58 +00:00
Dmitriy Zaporozhets 0214a21db5 Merge branch 'restore_uploads_fix' into 'master'
Avoid "cannot copy directory ... to itself" error on restore (on Docker?)

rake gitlab:backup:restore fails for me in my Docker-hosted Gitlab-CE instance; during the restore, any existing "uploads" directory is backed up by [this code](https://gitlab.com/gitlab-org/gitlab-ce/blob/833bc30/lib/backup/uploads.rb#L23) --

```ruby
    def backup_existing_uploads_dir
      timestamped_uploads_path = File.join(app_uploads_dir, '..', "uploads.#{Time.now.to_i}")
      if File.exists?(app_uploads_dir)
        FileUtils.mv(app_uploads_dir, timestamped_uploads_path)
      end
    end
```

When this executes for me, the ```FileUtils.mv``` parameters are "/home/git/gitlab/public/uploads" and "/home/git/gitlab/public/uploads/../uploads.1407019546"; an exception is raised, producing this double stacktrace:

```
ArgumentError: cannot copy directory /home/git/gitlab/public/uploads to itself /home/git/gitlab/public/uploads/../uploads.1407019546
/home/git/gitlab/lib/backup/uploads.rb:26:in `backup_existing_uploads_dir'
/home/git/gitlab/lib/backup/uploads.rb:18:in `restore'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:73:in `block (4 levels) in <top (required)>'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:30:in `block (3 levels) in <top (required)>'
Errno::EXDEV: Invalid cross-device link @ sys_fail2 - (/home/git/gitlab/public/uploads, /home/git/gitlab/public/uploads/../uploads.1407019546)
/home/git/gitlab/lib/backup/uploads.rb:26:in `backup_existing_uploads_dir'
/home/git/gitlab/lib/backup/uploads.rb:18:in `restore'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:73:in `block (4 levels) in <top (required)>'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:30:in `block (3 levels) in <top (required)>'
Tasks: TOP => gitlab:backup:uploads:restore
(See full trace by running task with --trace)
```

I'm guessing from the first message that ```mv``` walks the destination path to ensure that we're not moving the source into itself -- it doesn't get as far as interpreting the '..', but throws when it sees that the destination appears to start with the source path.

The second stacktrace I have no clue about - maybe it's AUFS- or Docker-related?

I attempted to reproduce this separately with the omnibus distribution in a fresh Ubuntu 14.04 install without Docker involved, and was unable to - backup and restore worked fine. I then tested my theory by FileUtils.expand_path-ing the destination in my own Docker setup code, and that made the problem go away, so that's what this merge request does.

(I'm using backups created and restored on gitlab-ce 7-1-stable, at facfec4b2; this is on Ubuntu 14.04 with Docker 1.1.1)

I know I'd look askance at a PR without tests for an unreproducable problem, but even if this is rejected, I'm submitting it anyway because maybe someone else will Google it and find it useful. I'm happy to do more work to improve this if you have suggestions.

See merge request !165
2015-06-22 09:52:42 +00:00
Antonio Huete Jimenez e9ef274bb2 Use whoami instead of $USER
- Use whoami instead of relying on the existence of $USER enviroment variable which is not always present
2015-06-19 09:01:35 +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
Dmitriy Zaporozhets 9522a710e5 Merge branch 'update_ssl_ciphers' into 'master'
Update ssl ciphers

Removing all DHE suites from Nginx template SSL ciphers.

This will deny forward secrecy for Android 2.3.7, Java 6 and OpenSSL 0.9.8. but will give A+ rating on SSL labs.

Google sites also do not have DHE suites, [source](https://community.qualys.com/blogs/securitylabs/2013/06/25/ssl-labs-deploying-forward-secrecy)

> Google's sites, for example, tend to not have any DHE suites in their configuration. [2013]

See merge request !814
2015-06-15 11:50:21 +00:00
Marin Jankovski 86d35ed3d4 Update SSL ciphers per logjam vulnerability recommendations. 2015-06-15 11:40:00 +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
Dmitriy Zaporozhets b07cf1182f Merge branch 'note_about_omnibus_changes' into 'master'
Add a note that changing example configuration files requires changing omnibus-gitlab.

Keeping track of changes in these files is not easy and they usually require change in omnibus-gitlab.

Added a note so everyone is aware of this.

Similar is added to gitlab-shell and gitlab-ci.

Discussed in gitlab-org/omnibus-gitlab#605

See merge request !800
2015-06-12 09:02:48 +00:00
Dmitriy Zaporozhets c69ca9912e Merge pull request #9371 from zenati/patch-2
An `in_namespace` scope is already present
2015-06-11 23:09:41 +02:00
Marin Jankovski df346e9507 Add a note that changing example configuration files requires changing omnibus-gitlab. 2015-06-11 15:11:37 +02: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
Dmitriy Zaporozhets e407a481f2 Merge branch 'rs-pre-rspec-3' into 'master'
Changes back-ported from rspec3 branch

This is just breaking up the large `road-to-rspec-3` branch a bit. Each of these commits have been cherry-picked and would be good to have in place before the upgrade.

See merge request !792
2015-06-10 14:04:12 +00:00
Dmitriy Zaporozhets 8eadfd2df7 Merge branch 'master' into 'master'
update fog to 1.25.0 and add multipart upload support

This merge will fix backup uploading problems to s3, closing gitlab-org/gitlab-ce#1059

See merge request !789
2015-06-10 12:30:44 +00:00
Robert Speicher 2f3ab0ab85 Define GITORIOUS_HOST only once 2015-06-10 01:31:27 -04:00
Jeroen Nijhof a7047569db use gitlab not gitlabci 2015-06-09 18:30:38 +02:00
Jeroen Nijhof bf7315cb13 update fog to 1.25.0 and add multipart upload support 2015-06-09 17:56:37 +02:00
Jeroen van Baarsen 25a870a6d4 Revert "No need to check if `repository_ref` is present" 2015-06-09 15:18:15 +02:00
zenati b0de6e9ae2 An `in_namespace` scope is already present 2015-06-09 13:42:01 +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
Dmitriy Zaporozhets 87f9c475db Merge branch 'refactor-web-editor' into 'master'
Refactor web editor

* fix problem with editing non-master branch
* before commit make sure branch exists
* dont allow user change file in one branch and commit to another existing branch
* remove a lot of code duplication
* remove outdated statellite errors

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

Fixes #1761

See merge request !773
2015-06-05 16:14:34 +00:00
Eric Maziade 84a414fe53 Add session expiration delay configuration through UI application
settings
2015-06-05 11:50:37 -04:00
Dmitriy Zaporozhets 7bde6ae540
Fix editing files via API
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-05 17:16:51 +02: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 b7d20f14c6 Merge branch 'maser/gitlab-ce-order-commit-comments-in-api' into 'master'
Order commit comments in API chronologically

When fetching commit comments via API, the comments were not ordered,
but just returned in the order Postgresql finds them. Now the API always
returns comments in chronological order.

Same as !628 but with CI

See merge request !768
2015-06-05 08:38:19 +00: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 b9219469f7 Merge branch 'make-namespaces-api-available-to-all-users' into 'master'
Make namespace API available to all users

### What does this MR do?

This MR makes it possible for a user to query namespaces to which he/she has access. Also, it adds documentation for the existing API.

### Why was this MR needed?

Even though the `groups` API exists, it might still be useful to have an endpoint that tells the namespace type (e.g. `user` vs. `group`), especially if a user has access to a number of different projects.

### What are the relevant issue numbers?

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

See merge request !708
2015-06-04 15:59:17 +00:00
Dmitriy Zaporozhets e063c8f3e2 Merge branch 'trigger_hooks_create_on_backup_restore' into 'master'
Trigger hooks create on backup restore

Number of users migrating from installation from source to omnibus get this issue. This can be fixed with a bash one liner but we already have a script that creates hooks in gitlab-shell. Added to gitlab🐚install task call to `bin/create-hooks`. This script is idempotent which means it will only rewrite hooks if something changed.

Fixes https://dev.gitlab.org/gitlab/gitlabhq/issues/2208, https://github.com/gitlabhq/gitlabhq/issues/9101 and for the most part https://github.com/gitlabhq/gitlabhq/issues/8161

See merge request !762
2015-06-04 14:46:24 +00:00
Dmitriy Zaporozhets fb59f04fdf Merge branch 'fix-group-remove' into 'master'
Group improvements

* remove projects before removing group
* execute all hooks/events from project destroy when group removed
* log group create/remove
* delay remove of namespace directory (to prevent NFS issues)

Inspired by !759

See merge request !761
2015-06-03 15:02:33 +00:00
Dmitriy Zaporozhets 8046b69761 Merge branch 'remove_unecessary_rake_task' into 'master'
Remove gitlab:env:check task.

Rake task that checks for git user git settings is a leftover from early days.

It is not being used by the web editor(and web editor is also being redone atm) so this rake task just causes confusion.

Adresses internal issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2362

See merge request !758
2015-06-03 14:59:38 +00:00
Marin Jankovski a1be236c87 Trigger hooks-create on gitlab backup restore. 2015-06-03 16:24:37 +02: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
Marin Jankovski 7044d649a3 Add autocrlf back to installation docs, add a check for it. 2015-06-03 15:42:22 +02:00
Dmitriy Zaporozhets 7bab4817f7
Merge branch 'repo-remove' into fix-group-remove
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	spec/features/projects_spec.rb
2015-06-03 15:15:46 +02:00
Dmitriy Zaporozhets 61cfd1d273
Wrap group removal into service
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-03 14:07:20 +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
Marin Jankovski 5f7d6c7d74 Remove gitlab:env:check task. 2015-06-03 11:26:57 +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
Marin Jankovski c4cb563e98 Merge pull request #8730 from drunkard/master
Specify shell while run me as git user
2015-06-02 16:19:31 +02:00
Douwe Maan 1f908dc481 Fix typo. 2015-06-02 13:21:34 +02: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
Stan Hu 85145d1d77 Disable changing of the source branch in merge request update API 2015-05-29 09:40:35 -07:00
Robert Speicher 330c25385b Update jasmine:ci task to use teaspoon 2015-05-28 18:22:33 -04:00
Stan Hu 67992b9be6 Make namespace API available to all users
Closes https://github.com/gitlabhq/gitlabhq/issues/9328
2015-05-28 11:39:12 -07:00
Dmitriy Zaporozhets 05a44dcb8b Merge branch 'user-destroy-wo-groups' into 'master'
You can not remove user if he/she is an only owner of group

To prevent loose of group data you need to transfer or remove group
first before you can remove user

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

See merge request !730
2015-05-28 13:14:58 +00:00
Dmitriy Zaporozhets 499154518a
You can not remove user if he/she is an only owner of group
To prevent loose of group data you need to transfer or remove group
first before you can remove user

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-05-28 12:00:02 +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
Douwe Maan 9bb00cd77f Merge branch 'get-monkey-off-my-rack-attack' into 'master'
Remove Rack Attack monkey patches and bump to version 4.3.0

I finally got these monkey patches into Rack Attack v4.3.0, so GitLab no longer needs them. Hooray!

See: https://github.com/kickstarter/rack-attack/pull/128

See merge request !693
2015-05-26 07:43:57 +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
Stan Hu deeff56967 Add support for Webhook note events
Closes https://github.com/gitlabhq/gitlabhq/issues/6745
2015-05-21 23:48:16 -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
Marin Jankovski 509a32f466 Merge branch 'shell-secret-path' of https://github.com/jirutka/gitlabhq into jirutka-shell-secret-path 2015-05-19 14:37:35 +02: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
Jakub Jirutka ed3298fc01 Allow to configure gitlab_shell_secret location 2015-05-16 21:46:06 +02:00
Fotis Gimian d74673fd43 Ensure that the first added admin performs repository imports 2015-05-15 13:01:10 +02: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 740dc41250 Merge branch 'project_api_order' into 'master'
Add order option for projects API

https://dev.gitlab.org/gitlab/gitlab-ci/issues/222

See merge request !656
2015-05-14 20:25:39 +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
Dmitriy Zaporozhets c2ee828c19 Merge branch 'omniauth-csrf' into 'master'
Protect OmniAuth request phase against CSRF.

Addresses #2268.

See merge request !1793
2015-05-14 14:22:26 +00:00
Valery Sizov 7c3ca86370 Add order option for projects API 2015-05-14 15:49:09 +03: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 63403019d2 Merge branch 'master' of github.com:gitlabhq/gitlabhq 2015-05-13 14:26:39 +03:00
Dmitriy Zaporozhets f32a045ef4 Merge branch 'version-check' into 'master'
Version check

See merge request !1509
2015-05-13 11:17:16 +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
Douwe Maan 1f72c387c9 Improve Git access error messages. 2015-05-13 09:41:55 +02:00
Dmitriy Zaporozhets 8b9e3af8bf Merge branch 'ad-block_auto_created_users' into 'master'
Don't accidentally unblock auto created users from Active Directory.

Fixes #1581.

See merge request !638
2015-05-12 13:28:33 +00:00
Dmitriy Zaporozhets ff13fb0ab5 Merge branch 'brakeman-level'
Conflicts:
	lib/tasks/brakeman.rake
2015-05-12 13:21:11 +03:00
Douwe Maan 125cb9b866 Don't accidentally unblock auto created users from Active Directory. 2015-05-12 11:26:43 +02:00
Jakub Jirutka b3276661f7 RelativeLinkFilter: refactor according to suggestions by @tsigo 2015-05-11 20:43:18 +02:00
Jacob Vosmaer cae978a9e8 We would like to pass 'brakeman -w2' 2015-05-11 18:11:09 +02:00
Dmitriy Zaporozhets b3f5c679b6
Replace host with real one
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-05-11 18:21:45 +03:00
Jacob Vosmaer 0a47d8f3f4 Follow shell command guidelines in Brakeman task
There is no real issue here because the shell command is completely
static, but it is still nicer to just follow the guidelines in
doc/development/shell_commands.md .
2015-05-11 11:11:03 +02:00
Jakub Jirutka f7adac87fe Extract handling of relative file links to RelativeLinkFilter 2015-05-11 02:07:26 +02:00
Robert Speicher 70bbf093aa Remove class and id attributes from SanitizationFilter whitelist 2015-05-08 12:31:34 -04:00
Valeriy Sizov f682a6adb9 Merge pull request #9214 from Bugagazavr/hook-events
Added X-GitLab-Event header for web hooks
2015-05-08 17:17:01 +03:00
bugagazavr acac788902 Added X-GitLab-Event header for web hooks 2015-05-08 16:49:03 +03:00
Dmitriy Zaporozhets c3cf32e863
Merge branch 'version-check' into gl-version-check
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	app/controllers/admin/application_settings_controller.rb
	app/views/admin/application_settings/_form.html.haml
	db/schema.rb
2015-05-08 16:05:00 +03:00
Dmitriy Zaporozhets edf0a0715b
Remove unnecessary public key
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-05-08 15:59:34 +03:00
Martin Luder 55f91f3d43 Order commit comments in API chronologically
When fetching commit comments via API, the comments were not ordered,
but just returned in the order Postgresql finds them. Now the API always
returns comments in chronological order.
2015-05-08 14:34:10 +02:00
Dmitriy Zaporozhets f38ce01bc3
Remove encryption
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-05-08 15:14:56 +03:00
Dmitriy Zaporozhets 6c32abc5f7 Merge branch 'rs-task_list' into 'master'
Use task_list gem for task lists

Task Lists can now be used in comments, and they'll render in previews. 👏

Closes internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2271

See merge request !599
2015-05-08 09:39:48 +00:00
Dmitriy Zaporozhets 5b8712e4c2 Merge branch 'master' of github.com:gitlabhq/gitlabhq 2015-05-08 12:26:58 +03:00
Jacob Vosmaer 1c1f18b416 Add SIDEKIQ_MEMORY_KILLER_SHUTDOWN_SIGNAL env var
It looks like SIGTERM may not be enough to shut down a Sidekiq process
when its RSS has gotten too big. This change will allow us to experiment
with sending SIGKILL instead of SIGTERM to Sidekiq processes on
gitlab.com.
2015-05-07 18:47:03 +02:00
Robert Speicher cca28c7920 Update Markdown help docs for latest changes 2015-05-06 21:04:33 -04:00
Robert Speicher 0a99e6e2fa Remove 'jasmine' gem
jasmine-rails still requires it as a dependency, but for some reason
running `rake jasmine:ci` produced test failures but
`rake spec:javascript` didn't.
2015-05-06 15:31:24 -04:00
Robert Speicher 6883e6e084 Remove all references to `parse_tasks` 2015-05-06 12:58:28 -04:00
Robert Speicher 61c73575c3 Add TaskList::Filter to pipeline 2015-05-06 12:58:27 -04:00
Dmitriy Zaporozhets 317ed1fa90 Revert "Allow to configure smtp and sendmail in gitlab.yml" 2015-05-06 17:39:18 +03:00
Jakub Jirutka b4be7aed77 Allow to configure smtp and sendmail in gitlab.yml 2015-05-06 13:15:33 +02:00
quodos b953796ac8 Update authentication.rb
correct spelling
2015-05-04 14:09:03 +02:00
Drunkard Zhang ef351f4cf4 Improve comments for shell_path 2015-05-04 16:46:16 +08:00