From 2c0cc2e1f69f5a90f586be0a14434047f33a9b83 Mon Sep 17 00:00:00 2001 From: Sabba Petri Date: Wed, 25 Feb 2015 13:34:04 -0800 Subject: [PATCH 01/10] Added hover state And also fixed it being one pixel off. --- app/assets/stylesheets/sections/nav_sidebar.scss | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/sections/nav_sidebar.scss b/app/assets/stylesheets/sections/nav_sidebar.scss index 335f137966..c4a9945d7c 100644 --- a/app/assets/stylesheets/sections/nav_sidebar.scss +++ b/app/assets/stylesheets/sections/nav_sidebar.scss @@ -147,19 +147,26 @@ .collapse-nav a { left: 0px; - padding: 5px 23px 3px 22px; + padding: 7px 23px 3px 22px; } } } .collapse-nav a { position: fixed; - top: 47px; - padding: 5px 13px 3px 13px; + top: 46px; + padding: 5px 13px 5px 13px; left: 197px; background: #EEE; 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) { From df31e0a88c5264046fbb0789f67529f023b3f810 Mon Sep 17 00:00:00 2001 From: Sabba Petri Date: Wed, 25 Feb 2015 13:41:35 -0800 Subject: [PATCH 02/10] Fixed up app_logo Pixel perfection. --- app/assets/stylesheets/sections/header.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/sections/header.scss b/app/assets/stylesheets/sections/header.scss index 26b4d04106..03ecd3913e 100644 --- a/app/assets/stylesheets/sections/header.scss +++ b/app/assets/stylesheets/sections/header.scss @@ -101,7 +101,7 @@ header { a { float: left; padding: 5px 0; - height: 46px; + height: 48px; width: 52px; text-align: center; From e4dc4390e57efa0b8207d63b4446c019580d00aa Mon Sep 17 00:00:00 2001 From: Sabba Petri Date: Wed, 25 Feb 2015 14:15:40 -0800 Subject: [PATCH 03/10] Reverting pixel change Breaks navbar --- app/assets/stylesheets/sections/header.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/sections/header.scss b/app/assets/stylesheets/sections/header.scss index 03ecd3913e..26b4d04106 100644 --- a/app/assets/stylesheets/sections/header.scss +++ b/app/assets/stylesheets/sections/header.scss @@ -101,7 +101,7 @@ header { a { float: left; padding: 5px 0; - height: 48px; + height: 46px; width: 52px; text-align: center; From ca9aca927970ec81387d7cd0d7372a11d03074de Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 10 Mar 2015 13:32:28 +0100 Subject: [PATCH 04/10] Allow smb:// links in Markdown text. --- app/helpers/gitlab_markdown_helper.rb | 2 +- config/application.rb | 2 ++ lib/redcarpet/render/gitlab_html.rb | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index ab30f498c0..0c69900839 100644 --- a/app/helpers/gitlab_markdown_helper.rb +++ b/app/helpers/gitlab_markdown_helper.rb @@ -119,7 +119,7 @@ module GitlabMarkdownHelper end def ignored_protocols - ["http://","https://", "ftp://", "mailto:"] + ["http://","https://", "ftp://", "mailto:", "smb://"] end def rebuild_path(file_path) diff --git a/config/application.rb b/config/application.rb index bd4578848c..fa399533e5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -50,6 +50,8 @@ module Gitlab # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' + config.action_view.sanitized_allowed_protocols = %w(smb) + # Relative url support # 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. diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb index 714261f815..4b33d691c5 100644 --- a/lib/redcarpet/render/gitlab_html.rb +++ b/lib/redcarpet/render/gitlab_html.rb @@ -10,6 +10,12 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML super options 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 # regular text to the issue as Redcarpet will convert apostrophe to # #39; @@ -54,6 +60,8 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML end def postprocess(full_document) + full_document.gsub!("ftp://smb:", "smb://") + full_document.gsub!("’", "'") unless @template.instance_variable_get("@project_wiki") || @project.nil? full_document = h.create_relative_links(full_document) From 11e966d7a93ec0a745cde65021fa79a6a6b24667 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Wed, 11 Mar 2015 17:43:40 +0100 Subject: [PATCH 05/10] Add changelog item. --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 81468d4013..7a5f115c67 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -35,6 +35,7 @@ v 7.9.0 (unreleased) - Move groups page from profile to dashboard - Starred projects page at dashboard - Blocking user does not remove him/her from project/groups but show blocked label + - Allow smb:// links in Markdown text. v 7.8.2 - Fix service migration issue when upgrading from versions prior to 7.3 From d2d709a252ec4c26894b269a03df871fe51e8b82 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 11 Mar 2015 16:05:01 -0700 Subject: [PATCH 06/10] Update html-pipeline and emoji --- Gemfile | 4 ++-- Gemfile.lock | 17 +++++++++-------- app/controllers/projects_controller.rb | 8 ++++---- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index 462c932584..506dedddb8 100644 --- a/Gemfile +++ b/Gemfile @@ -88,7 +88,7 @@ gem "six" gem "seed-fu" # Markup pipeline for GitLab -gem 'html-pipeline-gitlab', '~> 0.1.0' +gem 'html-pipeline-gitlab', '~> 0.1' # Markdown to HTML gem "github-markup" @@ -194,7 +194,7 @@ gem "jquery-scrollto-rails" gem "raphael-rails", "~> 2.1.2" gem 'bootstrap-sass', '~> 3.0' gem "font-awesome-rails", '~> 4.2' -gem "gitlab_emoji", "~> 0.0.1.1" +gem "gitlab_emoji", "~> 0.1" gem "gon", '~> 5.0.0' gem 'nprogress-rails' gem 'request_store' diff --git a/Gemfile.lock b/Gemfile.lock index cca8f59ac2..32bbfbdc2d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -144,8 +144,6 @@ GEM email_spec (1.5.0) launchy (~> 2.1) mail (~> 2.2) - emoji (1.0.1) - json enumerize (0.7.0) activesupport (>= 3.2) equalizer (0.0.8) @@ -193,6 +191,8 @@ GEM formatador (0.2.4) gemnasium-gitlab-service (0.2.5) rugged (~> 0.21) + gemojione (2.0.0) + json gherkin-ruby (0.3.1) racc github-markup (1.3.1) @@ -211,8 +211,8 @@ GEM charlock_holmes (~> 0.6.6) escape_utils (~> 0.2.4) mime-types (~> 1.19) - gitlab_emoji (0.0.1.1) - emoji (~> 1.0.1) + gitlab_emoji (0.1.0) + gemojione (~> 2.0) gitlab_git (7.0.1) activesupport (~> 4.0) charlock_holmes (~> 0.6) @@ -278,10 +278,11 @@ GEM html-pipeline (1.11.0) activesupport (>= 2) nokogiri (~> 1.4) - html-pipeline-gitlab (0.1.5) + html-pipeline-gitlab (0.2.0) actionpack (~> 4) - gitlab_emoji (~> 0.0.1) + gitlab_emoji (~> 0.1) html-pipeline (~> 1.11.0) + mime-types sanitize (~> 2.1) http_parser.rb (0.5.3) httparty (0.13.0) @@ -707,7 +708,7 @@ DEPENDENCIES gitlab-flowdock-git-hook (~> 0.4.2) gitlab-grack (~> 2.0.0.rc2) gitlab-linguist (~> 3.0.1) - gitlab_emoji (~> 0.0.1.1) + gitlab_emoji (~> 0.1) gitlab_git (= 7.0.1) gitlab_meta (= 7.0) gitlab_omniauth-ldap (= 1.2.0) @@ -720,7 +721,7 @@ DEPENDENCIES guard-spinach haml-rails hipchat (~> 1.4.0) - html-pipeline-gitlab (~> 0.1.0) + html-pipeline-gitlab (~> 0.1) httparty jasmine (= 2.0.2) jquery-atwho-rails (~> 0.3.3) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index fad692c7a3..0f28794b73 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -176,11 +176,11 @@ class ProjectsController < ApplicationController end def autocomplete_emojis - Rails.cache.fetch("autocomplete-emoji-#{Emoji::VERSION}") do - Emoji.names.map do |e| + Rails.cache.fetch("autocomplete-emoji-#{Gemojione::VERSION}") do + Emoji.emojis.map do |name, emoji| { - name: e, - path: view_context.image_url("emoji/#{e}.png") + name: name, + path: view_context.image_url("emoji/#{emoji["unicode"]}.png") } end end From d6dda952b8eea8f6b08df9a4d12e5991929de3d4 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 11 Mar 2015 17:52:02 -0700 Subject: [PATCH 07/10] Fix tests for emojione --- CHANGELOG | 2 ++ spec/helpers/gitlab_markdown_helper_spec.rb | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 90ed686448..fef266d2ee 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -52,6 +52,8 @@ v 7.9.0 (unreleased) - Starred projects page at dashboard - Make email display name configurable - Improve json validation in hook data + - Use Emoji One + v 7.8.4 - Fix issue_tracker_id substitution in custom issue trackers - Fix path and name duplication in namespaces diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb index 74a42932fe..fd80c61522 100644 --- a/spec/helpers/gitlab_markdown_helper_spec.rb +++ b/spec/helpers/gitlab_markdown_helper_spec.rb @@ -664,19 +664,19 @@ describe GitlabMarkdownHelper do it "should generate absolute urls for emoji" do 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 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') - 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 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") 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 From ccc2c6e762cba3b25ce8fe842b35aef837d7ffd0 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 11 Mar 2015 18:03:21 -0700 Subject: [PATCH 08/10] Fix Gemfile.lock --- Gemfile.lock | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 65c5b2e3a0..c847424a7c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -708,13 +708,8 @@ DEPENDENCIES gitlab-flowdock-git-hook (~> 0.4.2) gitlab-grack (~> 2.0.0.rc2) gitlab-linguist (~> 3.0.1) -<<<<<<< HEAD gitlab_emoji (~> 0.1) - gitlab_git (= 7.0.1) -======= - gitlab_emoji (~> 0.0.1.1) gitlab_git (= 7.1.0) ->>>>>>> master gitlab_meta (= 7.0) gitlab_omniauth-ldap (= 1.2.0) gollum-lib (~> 4.0.0) From 3f823068e1f6e3e88d6631de60d9aaf9ecd5e6f9 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Wed, 11 Mar 2015 21:11:32 -0700 Subject: [PATCH 09/10] Add deploy to ci.gitlab.com to release documents. --- doc/release/monthly.md | 2 ++ doc/release/patch.md | 1 + doc/release/security.md | 1 + 3 files changed, 4 insertions(+) diff --git a/doc/release/monthly.md b/doc/release/monthly.md index a7e5faf2a6..ec96be27f3 100644 --- a/doc/release/monthly.md +++ b/doc/release/monthly.md @@ -51,6 +51,7 @@ Xth: (5 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 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) - [ ] Tweet about rc1 (#LINK) @@ -68,6 +69,7 @@ Xth: (1 working day before the 22nd) - [ ] Create CE, EE, CI stable versions (#LINK) - [ ] Create Omnibus tags and build packages - [ ] Update GitLab.com with the stable version (#LINK) +- [ ] Update ci.gitLab.com with the stable version (#LINK) 22nd: diff --git a/doc/release/patch.md b/doc/release/patch.md index 5397343e71..68156ae9c0 100644 --- a/doc/release/patch.md +++ b/doc/release/patch.md @@ -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. 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. 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) diff --git a/doc/release/security.md b/doc/release/security.md index 6ed2526449..60bcfbb6da 100644 --- a/doc/release/security.md +++ b/doc/release/security.md @@ -18,6 +18,7 @@ Please report suspected security vulnerabilities in private to Date: Thu, 12 Mar 2015 17:08:48 +0200 Subject: [PATCH 10/10] group controller refactoring --- app/controllers/groups/application_controller.rb | 10 ++++++++++ app/controllers/groups/group_members_controller.rb | 8 +------- app/controllers/groups_controller.rb | 8 +------- 3 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 app/controllers/groups/application_controller.rb diff --git a/app/controllers/groups/application_controller.rb b/app/controllers/groups/application_controller.rb new file mode 100644 index 0000000000..7f27f2bb73 --- /dev/null +++ b/app/controllers/groups/application_controller.rb @@ -0,0 +1,10 @@ +class Groups::ApplicationController < ApplicationController + + private + + def authorize_admin_group! + unless can?(current_user, :manage_group, group) + return render_404 + end + end +end diff --git a/app/controllers/groups/group_members_controller.rb b/app/controllers/groups/group_members_controller.rb index ca88d03387..b083cf5d8c 100644 --- a/app/controllers/groups/group_members_controller.rb +++ b/app/controllers/groups/group_members_controller.rb @@ -1,4 +1,4 @@ -class Groups::GroupMembersController < ApplicationController +class Groups::GroupMembersController < Groups::ApplicationController before_filter :group # Authorize @@ -37,12 +37,6 @@ class Groups::GroupMembersController < ApplicationController @group ||= Group.find_by(path: params[:group_id]) end - def authorize_admin_group! - unless can?(current_user, :manage_group, group) - return render_404 - end - end - def member_params params.require(:group_member).permit(:access_level, :user_id) end diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index d011523c94..89f94fa0d4 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -1,4 +1,4 @@ -class GroupsController < ApplicationController +class GroupsController < Groups::ApplicationController skip_before_filter :authenticate_user!, only: [:show, :issues, :members, :merge_requests] respond_to :html before_filter :group, except: [:new, :create] @@ -132,12 +132,6 @@ class GroupsController < ApplicationController end end - def authorize_admin_group! - unless can?(current_user, :manage_group, group) - return render_404 - end - end - def set_title @title = 'New Group' end