Commit 49901eb3 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ce_upstream1' into 'master'

Ce upstream

See merge request !349
parents c216a305 e3df22f2
...@@ -53,12 +53,15 @@ v 7.9.0 (unreleased) ...@@ -53,12 +53,15 @@ v 7.9.0 (unreleased)
- Starred projects page at dashboard - Starred projects page at dashboard
- Make email display name configurable - Make email display name configurable
- Improve json validation in hook data - Improve json validation in hook data
- Use Emoji One
v 7.8.4 v 7.8.4
- Fix issue_tracker_id substitution in custom issue trackers - Fix issue_tracker_id substitution in custom issue trackers
- Fix path and name duplication in namespaces - Fix path and name duplication in namespaces
v 7.8.3 v 7.8.3
- Bump version of gitlab_git fixing annotated tags without message - Bump version of gitlab_git fixing annotated tags without message
- Allow smb:// links in Markdown text.
v 7.8.2 v 7.8.2
- Fix service migration issue when upgrading from versions prior to 7.3 - Fix service migration issue when upgrading from versions prior to 7.3
......
...@@ -89,7 +89,7 @@ gem "six" ...@@ -89,7 +89,7 @@ gem "six"
gem "seed-fu" gem "seed-fu"
# Markup pipeline for GitLab # Markup pipeline for GitLab
gem 'html-pipeline-gitlab', '~> 0.1.0' gem 'html-pipeline-gitlab', '~> 0.1'
# Markdown to HTML # Markdown to HTML
gem "github-markup" gem "github-markup"
...@@ -196,7 +196,7 @@ gem "jquery-scrollto-rails" ...@@ -196,7 +196,7 @@ gem "jquery-scrollto-rails"
gem "raphael-rails", "~> 2.1.2" gem "raphael-rails", "~> 2.1.2"
gem 'bootstrap-sass', '~> 3.0' gem 'bootstrap-sass', '~> 3.0'
gem "font-awesome-rails", '~> 4.2' gem "font-awesome-rails", '~> 4.2'
gem "gitlab_emoji", "~> 0.0.1.1" gem "gitlab_emoji", "~> 0.1"
gem "gon", '~> 5.0.0' gem "gon", '~> 5.0.0'
gem 'nprogress-rails' gem 'nprogress-rails'
gem 'request_store' gem 'request_store'
......
...@@ -144,8 +144,6 @@ GEM ...@@ -144,8 +144,6 @@ GEM
email_spec (1.5.0) email_spec (1.5.0)
launchy (~> 2.1) launchy (~> 2.1)
mail (~> 2.2) mail (~> 2.2)
emoji (1.0.1)
json
enumerize (0.7.0) enumerize (0.7.0)
activesupport (>= 3.2) activesupport (>= 3.2)
equalizer (0.0.8) equalizer (0.0.8)
...@@ -193,6 +191,8 @@ GEM ...@@ -193,6 +191,8 @@ GEM
formatador (0.2.4) formatador (0.2.4)
gemnasium-gitlab-service (0.2.4) gemnasium-gitlab-service (0.2.4)
rugged (~> 0.21) rugged (~> 0.21)
gemojione (2.0.0)
json
gherkin-ruby (0.3.1) gherkin-ruby (0.3.1)
racc racc
github-markup (1.3.1) github-markup (1.3.1)
...@@ -211,8 +211,8 @@ GEM ...@@ -211,8 +211,8 @@ GEM
charlock_holmes (~> 0.6.6) charlock_holmes (~> 0.6.6)
escape_utils (~> 0.2.4) escape_utils (~> 0.2.4)
mime-types (~> 1.19) mime-types (~> 1.19)
gitlab_emoji (0.0.1.1) gitlab_emoji (0.1.0)
emoji (~> 1.0.1) gemojione (~> 2.0)
gitlab_git (7.1.0) gitlab_git (7.1.0)
activesupport (~> 4.0) activesupport (~> 4.0)
charlock_holmes (~> 0.6) charlock_holmes (~> 0.6)
...@@ -278,10 +278,11 @@ GEM ...@@ -278,10 +278,11 @@ GEM
html-pipeline (1.11.0) html-pipeline (1.11.0)
activesupport (>= 2) activesupport (>= 2)
nokogiri (~> 1.4) nokogiri (~> 1.4)
html-pipeline-gitlab (0.1.5) html-pipeline-gitlab (0.2.0)
actionpack (~> 4) actionpack (~> 4)
gitlab_emoji (~> 0.0.1) gitlab_emoji (~> 0.1)
html-pipeline (~> 1.11.0) html-pipeline (~> 1.11.0)
mime-types
sanitize (~> 2.1) sanitize (~> 2.1)
http_parser.rb (0.5.3) http_parser.rb (0.5.3)
httparty (0.13.0) httparty (0.13.0)
...@@ -712,7 +713,7 @@ DEPENDENCIES ...@@ -712,7 +713,7 @@ DEPENDENCIES
gitlab-flowdock-git-hook (~> 0.4.2) gitlab-flowdock-git-hook (~> 0.4.2)
gitlab-grack (~> 2.0.0.rc2) gitlab-grack (~> 2.0.0.rc2)
gitlab-linguist (~> 3.0.1) gitlab-linguist (~> 3.0.1)
gitlab_emoji (~> 0.0.1.1) gitlab_emoji (~> 0.1)
gitlab_git (= 7.1.0) gitlab_git (= 7.1.0)
gitlab_meta (= 7.0) gitlab_meta (= 7.0)
gitlab_omniauth-ldap (= 1.2.0) gitlab_omniauth-ldap (= 1.2.0)
...@@ -725,7 +726,7 @@ DEPENDENCIES ...@@ -725,7 +726,7 @@ DEPENDENCIES
guard-spinach guard-spinach
haml-rails haml-rails
hipchat (~> 1.4.0) hipchat (~> 1.4.0)
html-pipeline-gitlab (~> 0.1.0) html-pipeline-gitlab (~> 0.1)
httparty httparty
jasmine (= 2.0.2) jasmine (= 2.0.2)
jquery-atwho-rails (~> 0.3.3) jquery-atwho-rails (~> 0.3.3)
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
.collapse-nav a { .collapse-nav a {
left: 0px; left: 0px;
padding: 5px 23px 3px 22px; padding: 7px 23px 3px 22px;
} }
} }
} }
...@@ -155,12 +155,19 @@ ...@@ -155,12 +155,19 @@
.collapse-nav a { .collapse-nav a {
position: fixed; position: fixed;
top: 46px; top: 46px;
padding: 5px 13px 3px 13px; padding: 5px 13px 5px 13px;
left: 197px; left: 197px;
font-size: 13px; font-size: 13px;
background: #EEE; background: #EEE;
color: black; color: black;
border: 1px solid rgba(0,0,0,0.035); border-left: 1px solid rgba(0,0,0,0.035);
border-right: 1px solid rgba(0,0,0,0.035);
}
.collapse-nav a:hover {
text-decoration: none;
color: #333;
background: #eaeaea;
} }
@media (max-width: $screen-md-max) { @media (max-width: $screen-md-max) {
......
class Groups::ApplicationController < ApplicationController
private
def authorize_admin_group!
unless can?(current_user, :manage_group, group)
return render_404
end
end
end
class Groups::GroupMembersController < ApplicationController class Groups::GroupMembersController < Groups::ApplicationController
before_filter :group before_filter :group
# Authorize # Authorize
...@@ -75,12 +75,6 @@ class Groups::GroupMembersController < ApplicationController ...@@ -75,12 +75,6 @@ class Groups::GroupMembersController < ApplicationController
@group ||= Group.find_by(path: params[:group_id]) @group ||= Group.find_by(path: params[:group_id])
end end
def authorize_admin_group!
unless can?(current_user, :manage_group, group)
return render_404
end
end
def member_params def member_params
params.require(:group_member).permit(:access_level, :user_id) params.require(:group_member).permit(:access_level, :user_id)
end end
......
class GroupsController < ApplicationController class GroupsController < Groups::ApplicationController
skip_before_filter :authenticate_user!, only: [:show, :issues, :members, :merge_requests] skip_before_filter :authenticate_user!, only: [:show, :issues, :members, :merge_requests]
respond_to :html respond_to :html
before_filter :group, except: [:new, :create] before_filter :group, except: [:new, :create]
...@@ -134,12 +134,6 @@ class GroupsController < ApplicationController ...@@ -134,12 +134,6 @@ class GroupsController < ApplicationController
end end
end end
def authorize_admin_group!
unless can?(current_user, :manage_group, group)
return render_404
end
end
def set_title def set_title
@title = 'New Group' @title = 'New Group'
end end
......
...@@ -177,11 +177,11 @@ class ProjectsController < ApplicationController ...@@ -177,11 +177,11 @@ class ProjectsController < ApplicationController
end end
def autocomplete_emojis def autocomplete_emojis
Rails.cache.fetch("autocomplete-emoji-#{Emoji::VERSION}") do Rails.cache.fetch("autocomplete-emoji-#{Gemojione::VERSION}") do
Emoji.names.map do |e| Emoji.emojis.map do |name, emoji|
{ {
name: e, name: name,
path: view_context.image_url("emoji/#{e}.png") path: view_context.image_url("emoji/#{emoji["unicode"]}.png")
} }
end end
end end
......
...@@ -121,7 +121,7 @@ module GitlabMarkdownHelper ...@@ -121,7 +121,7 @@ module GitlabMarkdownHelper
end end
def ignored_protocols def ignored_protocols
["http://","https://", "ftp://", "mailto:"] ["http://","https://", "ftp://", "mailto:", "smb://"]
end end
def rebuild_path(file_path) def rebuild_path(file_path)
......
...@@ -50,6 +50,8 @@ module Gitlab ...@@ -50,6 +50,8 @@ module Gitlab
# Version of your assets, change this if you want to expire all your assets # Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0' config.assets.version = '1.0'
config.action_view.sanitized_allowed_protocols = %w(smb)
# Relative url support # Relative url support
# Uncomment and customize the last line to run in a non-root path # Uncomment and customize the last line to run in a non-root path
# WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this. # WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this.
......
...@@ -51,6 +51,7 @@ Xth: (5 working days before the 22nd) ...@@ -51,6 +51,7 @@ Xth: (5 working days before the 22nd)
Xth: (4 working days before the 22nd) Xth: (4 working days before the 22nd)
- [ ] Update GitLab.com with rc1 (#LINK) (https://dev.gitlab.org/cookbooks/chef-repo/blob/master/doc/administration.md#deploy-the-package) - [ ] Update GitLab.com with rc1 (#LINK) (https://dev.gitlab.org/cookbooks/chef-repo/blob/master/doc/administration.md#deploy-the-package)
- [ ] Update ci.gitLab.com with rc1 (#LINK) (https://dev.gitlab.org/cookbooks/chef-repo/blob/master/doc/administration.md#deploy-the-package)
- [ ] Create regression issues (CE, CI) (#LINK) - [ ] Create regression issues (CE, CI) (#LINK)
- [ ] Tweet about rc1 (#LINK) - [ ] Tweet about rc1 (#LINK)
...@@ -68,6 +69,7 @@ Xth: (1 working day before the 22nd) ...@@ -68,6 +69,7 @@ Xth: (1 working day before the 22nd)
- [ ] Create CE, EE, CI stable versions (#LINK) - [ ] Create CE, EE, CI stable versions (#LINK)
- [ ] Create Omnibus tags and build packages - [ ] Create Omnibus tags and build packages
- [ ] Update GitLab.com with the stable version (#LINK) - [ ] Update GitLab.com with the stable version (#LINK)
- [ ] Update ci.gitLab.com with the stable version (#LINK)
22nd: 22nd:
......
...@@ -51,6 +51,7 @@ CE=false be rake release['x.x.x'] ...@@ -51,6 +51,7 @@ CE=false be rake release['x.x.x']
1. [Build new packages with the latest version](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/release.md) 1. [Build new packages with the latest version](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/release.md)
1. Apply the patch to GitLab.com and the private GitLab development server 1. Apply the patch to GitLab.com and the private GitLab development server
1. Apply the patch to ci.gitLab.com and the private GitLab CI development server
1. Create and publish a blog post, see [patch release blog template](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/doc/patch_release_blog_template.md) 1. Create and publish a blog post, see [patch release blog template](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/doc/patch_release_blog_template.md)
1. Send tweets about the release from `@gitlab`, tweet should include the most important feature that the release is addressing and link to the blog post 1. Send tweets about the release from `@gitlab`, tweet should include the most important feature that the release is addressing and link to the blog post
1. Note in the 'GitLab X.X regressions' issue that the patch was published (CE only) 1. Note in the 'GitLab X.X regressions' issue that the patch was published (CE only)
......
...@@ -18,6 +18,7 @@ Please report suspected security vulnerabilities in private to <support@gitlab.c ...@@ -18,6 +18,7 @@ Please report suspected security vulnerabilities in private to <support@gitlab.c
1. Do the steps from [patch release document](doc/release/patch.md), starting with "Create an issue on private GitLab development server" 1. Do the steps from [patch release document](doc/release/patch.md), starting with "Create an issue on private GitLab development server"
1. The MR with the security fix should get a 'security' label and be assigned to the release manager 1. The MR with the security fix should get a 'security' label and be assigned to the release manager
1. Build the package for GitLab.com and do a deploy 1. Build the package for GitLab.com and do a deploy
1. Build the package for ci.gitLab.com and do a deploy
1. [Create new AMIs](https://dev.gitlab.org/gitlab/AMI/blob/master/README.md) 1. [Create new AMIs](https://dev.gitlab.org/gitlab/AMI/blob/master/README.md)
1. Create feature branches for the blog post on GitLab.com and link them from the code branch 1. Create feature branches for the blog post on GitLab.com and link them from the code branch
1. Merge and publish the blog posts 1. Merge and publish the blog posts
......
...@@ -11,6 +11,12 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML ...@@ -11,6 +11,12 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
super options super options
end end
def preprocess(full_document)
# Redcarpet doesn't allow SMB links when `safe_links_only` is enabled.
# FTP links are allowed, so we trick Redcarpet.
full_document.gsub("smb://", "ftp://smb:")
end
# If project has issue number 39, apostrophe will be linked in # If project has issue number 39, apostrophe will be linked in
# regular text to the issue as Redcarpet will convert apostrophe to # regular text to the issue as Redcarpet will convert apostrophe to
# #39; # #39;
...@@ -55,6 +61,8 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML ...@@ -55,6 +61,8 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
end end
def postprocess(full_document) def postprocess(full_document)
full_document.gsub!("ftp://smb:", "smb://")
full_document.gsub!("&rsquo;", "'") full_document.gsub!("&rsquo;", "'")
unless @template.instance_variable_get("@project_wiki") || @project.nil? unless @template.instance_variable_get("@project_wiki") || @project.nil?
full_document = h.create_relative_links(full_document) full_document = h.create_relative_links(full_document)
......
...@@ -713,19 +713,19 @@ describe GitlabMarkdownHelper do ...@@ -713,19 +713,19 @@ describe GitlabMarkdownHelper do
it "should generate absolute urls for emoji" do it "should generate absolute urls for emoji" do
expect(markdown(':smile:')).to( expect(markdown(':smile:')).to(
include(%(src="#{Gitlab.config.gitlab.url}/assets/emoji/smile.png)) include(%(src="#{Gitlab.config.gitlab.url}/assets/emoji/#{Emoji.emoji_filename('smile')}.png))
) )
end end
it "should generate absolute urls for emoji if relative url is present" do it "should generate absolute urls for emoji if relative url is present" do
allow(Gitlab.config.gitlab).to receive(:url).and_return('http://localhost/gitlab/root') allow(Gitlab.config.gitlab).to receive(:url).and_return('http://localhost/gitlab/root')
expect(markdown(":smile:")).to include("src=\"http://localhost/gitlab/root/assets/emoji/smile.png") expect(markdown(":smile:")).to include("src=\"http://localhost/gitlab/root/assets/emoji/#{Emoji.emoji_filename('smile')}.png")
end end
it "should generate absolute urls for emoji if asset_host is present" do it "should generate absolute urls for emoji if asset_host is present" do
allow(Gitlab::Application.config).to receive(:asset_host).and_return("https://cdn.example.com") allow(Gitlab::Application.config).to receive(:asset_host).and_return("https://cdn.example.com")
ActionView::Base.any_instance.stub_chain(:config, :asset_host).and_return("https://cdn.example.com") ActionView::Base.any_instance.stub_chain(:config, :asset_host).and_return("https://cdn.example.com")
expect(markdown(":smile:")).to include("src=\"https://cdn.example.com/assets/emoji/smile.png") expect(markdown(":smile:")).to include("src=\"https://cdn.example.com/assets/emoji/#{Emoji.emoji_filename('smile')}.png")
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment