Skip to content
Snippets Groups Projects
Commit 7e9b8464 authored by Phil Hughes's avatar Phil Hughes
Browse files

Merge branch 'master' into xlsx-renderer

Former-commit-id: 42296234
parents bfd9f80e 3dea8620
No related branches found
No related tags found
No related merge requests found
Showing
with 114 additions and 65 deletions
Loading
Loading
@@ -523,7 +523,6 @@
}
 
.content-block {
border-top: 1px solid $border-color;
padding: $gl-padding-top $gl-padding;
}
 
Loading
Loading
Loading
Loading
@@ -118,6 +118,10 @@ module BlobHelper
blob && blob.text? && !blob.lfs_pointer? && !blob.only_display_raw?
end
 
def blob_rendered_as_text?(blob)
blob_text_viewable?(blob) && blob.to_partial_path(@project) == 'text'
end
def blob_size(blob)
if blob.lfs_pointer?
blob.lfs_size
Loading
Loading
Loading
Loading
@@ -42,12 +42,16 @@ class Blob < SimpleDelegator
size && truncated?
end
 
def extension
extname.downcase.delete('.')
end
def svg?
text? && language && language.name == 'SVG'
end
 
def pdf?
name && File.extname(name) == '.pdf'
extension == 'pdf'
end
 
def xlsx?
Loading
Loading
@@ -59,11 +63,15 @@ class Blob < SimpleDelegator
end
 
def sketch?
binary? && extname.downcase.delete('.') == 'sketch'
binary? && extension == 'sketch'
end
 
def stl?
extname.downcase.delete('.') == 'stl'
extension == 'stl'
end
def markup?
text? && Gitlab::MarkupHelper.markup?(name)
end
 
def size_within_svg_limits?
Loading
Loading
@@ -81,8 +89,10 @@ class Blob < SimpleDelegator
else
'text'
end
elsif image? || svg?
elsif image?
'image'
elsif svg?
'svg'
elsif pdf?
'pdf'
elsif ipython_notebook?
Loading
Loading
@@ -91,8 +101,18 @@ class Blob < SimpleDelegator
'sketch'
elsif stl?
'stl'
elsif markup?
if only_display_raw?
'too_large'
else
'markup'
end
elsif text?
'text'
if only_display_raw?
'too_large'
else
'text'
end
elsif xlsx?
'xlsx'
else
Loading
Loading
Loading
Loading
@@ -407,8 +407,6 @@ class Repository
# Runs code after a repository has been forked/imported.
def after_import
expire_content_cache
expire_tags_cache
expire_branches_cache
end
 
# Runs code after a new commit has been pushed.
Loading
Loading
Loading
Loading
@@ -32,4 +32,10 @@
= link_to 'Fork', fork_path, method: :post, class: 'btn btn-grouped btn-inverted btn-new'
%button.js-cancel-fork-suggestion.btn.btn-grouped{ type: 'button' }
Cancel
= render blob.to_partial_path(@project), blob: blob
- if blob.empty?
.file-content.code
.nothing-here-block
Empty file
- else
= render blob.to_partial_path(@project), blob: blob
Loading
Loading
@@ -13,7 +13,7 @@
 
.file-actions.hidden-xs
.btn-group{ role: "group" }<
= copy_blob_content_button(blob) if !blame && blob_text_viewable?(blob)
= copy_blob_content_button(blob) if !blame && blob_rendered_as_text?(blob)
= open_raw_file_button(namespace_project_raw_path(@project.namespace, @project, @id))
= view_on_environment_button(@commit.sha, @path, @environment) if @environment
 
Loading
Loading
.file-content.image_file
- if blob.svg?
- if blob.size_within_svg_limits?
-# We need to scrub SVG but we cannot do so in the RawController: it would
-# be wrong/strange if RawController modified the data.
- blob.load_all_data!(@repository)
- blob = sanitize_svg(blob)
%img{ src: "data:#{blob.mime_type};base64,#{Base64.encode64(blob.data)}", alt: "#{blob.name}" }
- else
.nothing-here-block
The SVG could not be displayed as it is too large, you can
#{link_to('view the raw file', namespace_project_raw_path(@project.namespace, @project, @id), target: '_blank', rel: 'noopener noreferrer')}
instead.
- else
%img{ src: namespace_project_raw_path(@project.namespace, @project, tree_join(@commit.id, blob.path)), alt: "#{blob.name}" }
%img{ src: namespace_project_raw_path(@project.namespace, @project, @id), alt: blob.name }
- blob.load_all_data!(@repository)
.file-content.wiki
= render_markup(blob.name, blob.data)
- if blob.size_within_svg_limits?
-# We need to scrub SVG but we cannot do so in the RawController: it would
-# be wrong/strange if RawController modified the data.
- blob.load_all_data!(@repository)
- blob = sanitize_svg(blob)
.file-content.image_file
%img{ src: "data:#{blob.mime_type};base64,#{Base64.encode64(blob.data)}", alt: blob.name }
- else
= render 'too_large'
- if blob.only_display_raw?
.file-content.code
.nothing-here-block
File too large, you can
= succeed '.' do
= link_to 'view the raw file', namespace_project_raw_path(@project.namespace, @project, @id), target: '_blank', rel: 'noopener noreferrer'
- else
- blob.load_all_data!(@repository)
- if blob.empty?
.file-content.code
.nothing-here-block Empty file
- else
- if markup?(blob.name)
.file-content.wiki
= render_markup(blob.name, blob.data)
- else
= render 'shared/file_highlight', blob: blob, repository: @repository
- blob.load_all_data!(@repository)
= render 'shared/file_highlight', blob: blob, repository: @repository
.file-content.code
.nothing-here-block
The file could not be displayed as it is too large, you can
#{link_to('view the raw file', namespace_project_raw_path(@project.namespace, @project, @id), target: '_blank', rel: 'noopener noreferrer')}
instead.
---
title: Keep webpack-dev-server process functional across branch changes
merge_request: 10581
author:
---
title: Fix redundant cache expiration in Repository
merge_request: 10575
author: blackst0ne
Loading
Loading
@@ -374,3 +374,27 @@
:why: https://github.com/fb55/entities/blob/master/LICENSE
:versions: []
:when: 2017-04-07 16:19:23.900571000 Z
- - :approve
- ansi-html
- :who: Mike Greiling
:why: https://github.com/Tjatse/ansi-html/blob/master/LICENSE
:versions: []
:when: 2017-04-10 05:42:12.898178000 Z
- - :approve
- map-stream
- :who: Mike Greiling
:why: https://github.com/dominictarr/map-stream/blob/master/LICENCE
:versions: []
:when: 2017-04-10 06:27:52.269085000 Z
- - :approve
- pause-stream
- :who: Mike Greiling
:why: https://github.com/dominictarr/pause-stream/blob/master/LICENSE
:versions: []
:when: 2017-04-10 06:28:39.825894000 Z
- - :approve
- undefsafe
- :who: Mike Greiling
:why: https://github.com/remy/undefsafe/blob/master/LICENSE
:versions: []
:when: 2017-04-10 06:30:00.002555000 Z
Loading
Loading
@@ -6,6 +6,7 @@ var webpack = require('webpack');
var StatsPlugin = require('stats-webpack-plugin');
var CompressionPlugin = require('compression-webpack-plugin');
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');
 
var ROOT_PATH = path.resolve(__dirname, '..');
var IS_PRODUCTION = process.env.NODE_ENV === 'production';
Loading
Loading
@@ -189,6 +190,10 @@ if (IS_DEV_SERVER) {
inline: DEV_SERVER_LIVERELOAD
};
config.output.publicPath = '//localhost:' + DEV_SERVER_PORT + config.output.publicPath;
config.plugins.push(
// watch node_modules for changes if we encounter a missing module compile error
new WatchMissingNodeModulesPlugin(path.join(ROOT_PATH, 'node_modules'))
);
}
 
if (WEBPACK_REPORT) {
Loading
Loading
Loading
Loading
@@ -20,8 +20,8 @@ the hardware requirements.
- [Docker](https://docs.gitlab.com/omnibus/docker/) - Install GitLab using Docker.
- [Installation on Google Cloud Platform](google_cloud_platform/index.md) - Install
GitLab on Google Cloud Platform using our official image.
- [Digital Ocean and Docker](digitaloceandocker.md) - Install GitLab quickly
on DigitalOcean using Docker.
- Testing only! [DigitalOcean and Docker Machine](digitaloceandocker.md) -
Quickly test any version of GitLab on DigitalOcean using Docker Machine.
 
## Database
 
Loading
Loading
# Digital Ocean and Docker
# Digital Ocean and Docker Machine test environment
## Warning. This guide is for quickly testing different versions of GitLab and
## not recommended for ease of future upgrades or keeping the data you create.
 
## Initial setup
 
Loading
Loading
Loading
Loading
@@ -143,7 +143,7 @@ into the password field.
To disable two-factor authentication on your account (for example, if you
have lost your code generation device) you can:
* [Use a saved recovery code](#use-a-saved-recovery-code)
* [Generate new recovery codes using SSH](#generate-new-recovery-codes-using-SSH)
* [Generate new recovery codes using SSH](#generate-new-recovery-codes-using-ssh)
* [Ask a GitLab administrator to disable two-factor authentication on your account](#ask-a-gitlab-administrator-to-disable-two-factor-authentication-on-your-account)
 
### Use a saved recovery code
Loading
Loading
Loading
Loading
@@ -53,12 +53,12 @@ module API
]
end
 
def parse_allowed_environment_variables
return if params[:env].blank?
def parse_env
return {} if params[:env].blank?
 
JSON.parse(params[:env])
rescue JSON::ParserError
{}
end
end
end
Loading
Loading
Loading
Loading
@@ -11,14 +11,16 @@ module API
# Params:
# key_id - ssh key id for Git over SSH
# user_id - user id for Git over HTTP
# protocol - Git access protocol being used, e.g. HTTP or SSH
# project - project path with namespace
# action - git action (git-upload-pack or git-receive-pack)
# ref - branch name
# forced_push - forced_push
# protocol - Git access protocol being used, e.g. HTTP or SSH
# changes - changes as "oldrev newrev ref", see Gitlab::ChangesList
post "/allowed" do
status 200
 
# Stores some Git-specific env thread-safely
Gitlab::Git::Env.set(parse_env)
actor =
if params[:key_id]
Key.find_by(id: params[:key_id])
Loading
Loading
@@ -30,18 +32,10 @@ module API
 
actor.update_last_used_at if actor.is_a?(Key)
 
access =
if wiki?
Gitlab::GitAccessWiki.new(actor, project, protocol, authentication_abilities: ssh_authentication_abilities)
else
Gitlab::GitAccess.new(actor,
project,
protocol,
authentication_abilities: ssh_authentication_abilities,
env: parse_allowed_environment_variables)
end
access_status = access.check(params[:action], params[:changes])
access_checker = wiki? ? Gitlab::GitAccessWiki : Gitlab::GitAccess
access_status = access_checker
.new(actor, project, protocol, authentication_abilities: ssh_authentication_abilities)
.check(params[:action], params[:changes])
 
response = { status: access_status.status, message: access_status.message }
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment