Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7f054676
Commit
7f054676
authored
Aug 16, 2021
by
Jonas Wälter
Committed by
Heinrich Lee Yu
Aug 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend /help/instance_configuration with package file size limits
parent
0f757067
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
0 deletions
+110
-0
app/models/instance_configuration.rb
app/models/instance_configuration.rb
+17
-0
app/views/help/instance_configuration.html.haml
app/views/help/instance_configuration.html.haml
+1
-0
app/views/help/instance_configuration/_package_registry.html.haml
...s/help/instance_configuration/_package_registry.html.haml
+48
-0
locale/gitlab.pot
locale/gitlab.pot
+9
-0
spec/models/instance_configuration_spec.rb
spec/models/instance_configuration_spec.rb
+35
-0
No files found.
app/models/instance_configuration.rb
View file @
7f054676
...
@@ -14,6 +14,7 @@ class InstanceConfiguration
...
@@ -14,6 +14,7 @@ class InstanceConfiguration
host:
host
,
host:
host
,
gitlab_pages:
gitlab_pages
,
gitlab_pages:
gitlab_pages
,
gitlab_ci:
gitlab_ci
,
gitlab_ci:
gitlab_ci
,
package_file_size_limits:
package_file_size_limits
,
rate_limits:
rate_limits
}.
deep_symbolize_keys
rate_limits:
rate_limits
}.
deep_symbolize_keys
end
end
end
end
...
@@ -44,6 +45,22 @@ class InstanceConfiguration
...
@@ -44,6 +45,22 @@ class InstanceConfiguration
default:
100
.
megabytes
})
default:
100
.
megabytes
})
end
end
def
package_file_size_limits
Plan
.
all
.
to_h
{
|
plan
|
[
plan
.
name
.
capitalize
,
plan_file_size_limits
(
plan
)]
}
end
def
plan_file_size_limits
(
plan
)
{
conan:
plan
.
actual_limits
[
:conan_max_file_size
],
maven:
plan
.
actual_limits
[
:maven_max_file_size
],
npm:
plan
.
actual_limits
[
:npm_max_file_size
],
nuget:
plan
.
actual_limits
[
:nuget_max_file_size
],
pypi:
plan
.
actual_limits
[
:pypi_max_file_size
],
terraform_module:
plan
.
actual_limits
[
:terraform_module_max_file_size
],
generic:
plan
.
actual_limits
[
:generic_packages_max_file_size
]
}
end
def
rate_limits
def
rate_limits
{
{
unauthenticated:
{
unauthenticated:
{
...
...
app/views/help/instance_configuration.html.haml
View file @
7f054676
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
=
render
'help/instance_configuration/ssh_info'
=
render
'help/instance_configuration/ssh_info'
=
render
'help/instance_configuration/gitlab_pages'
=
render
'help/instance_configuration/gitlab_pages'
=
render
'help/instance_configuration/gitlab_ci'
=
render
'help/instance_configuration/gitlab_ci'
=
render
'help/instance_configuration/package_registry'
=
render
'help/instance_configuration/rate_limits'
=
render
'help/instance_configuration/rate_limits'
%p
%p
%strong
=
_
(
"Table of contents"
)
%strong
=
_
(
"Table of contents"
)
...
...
app/views/help/instance_configuration/_package_registry.html.haml
0 → 100644
View file @
7f054676
-
package_file_size_limits
=
@instance_configuration
.
settings
[
:package_file_size_limits
]
-
content_for
:table_content
do
-
if
package_file_size_limits
.
present?
%li
=
link_to
_
(
'Package Registry'
),
'#package-registry'
-
content_for
:settings_content
do
-
if
package_file_size_limits
.
present?
%h2
#package-registry
=
_
(
'Package Registry'
)
%p
=
_
(
'There are several file size limits in place for the Package Registry.'
)
.table-responsive
%table
%thead
%tr
%th
=
_
(
'Package type'
)
-
package_file_size_limits
.
each_key
do
|
title
|
%th
=
title
%tbody
%tr
%td
=
'Conan'
-
package_file_size_limits
.
each_value
do
|
limits
|
%td
=
instance_configuration_human_size_cell
(
limits
[
:conan
])
%tr
%td
=
'Maven'
-
package_file_size_limits
.
each_value
do
|
limits
|
%td
=
instance_configuration_human_size_cell
(
limits
[
:maven
])
%tr
%td
=
'npm'
-
package_file_size_limits
.
each_value
do
|
limits
|
%td
=
instance_configuration_human_size_cell
(
limits
[
:npm
])
%tr
%td
=
'NuGet'
-
package_file_size_limits
.
each_value
do
|
limits
|
%td
=
instance_configuration_human_size_cell
(
limits
[
:nuget
])
%tr
%td
=
'PyPI'
-
package_file_size_limits
.
each_value
do
|
limits
|
%td
=
instance_configuration_human_size_cell
(
limits
[
:pypi
])
%tr
%td
=
'Terraform Module'
-
package_file_size_limits
.
each_value
do
|
limits
|
%td
=
instance_configuration_human_size_cell
(
limits
[
:terraform_module
])
%tr
%td
=
_
(
'Generic'
)
-
package_file_size_limits
.
each_value
do
|
limits
|
%td
=
instance_configuration_human_size_cell
(
limits
[
:generic
])
locale/gitlab.pot
View file @
7f054676
...
@@ -14705,6 +14705,9 @@ msgstr ""
...
@@ -14705,6 +14705,9 @@ msgstr ""
msgid "Generate site and private keys at"
msgid "Generate site and private keys at"
msgstr ""
msgstr ""
msgid "Generic"
msgstr ""
msgid "Generic package file size in bytes"
msgid "Generic package file size in bytes"
msgstr ""
msgstr ""
...
@@ -23652,6 +23655,9 @@ msgstr ""
...
@@ -23652,6 +23655,9 @@ msgstr ""
msgid "Package recipe already exists"
msgid "Package recipe already exists"
msgstr ""
msgstr ""
msgid "Package type"
msgstr ""
msgid "Package type must be Conan"
msgid "Package type must be Conan"
msgstr ""
msgstr ""
...
@@ -33562,6 +33568,9 @@ msgstr ""
...
@@ -33562,6 +33568,9 @@ msgstr ""
msgid "There are running deployments on the environment. Please retry later."
msgid "There are running deployments on the environment. Please retry later."
msgstr ""
msgstr ""
msgid "There are several file size limits in place for the Package Registry."
msgstr ""
msgid "There are several rate limits in place to protect the system."
msgid "There are several rate limits in place to protect the system."
msgstr ""
msgstr ""
...
...
spec/models/instance_configuration_spec.rb
View file @
7f054676
...
@@ -97,6 +97,41 @@ RSpec.describe InstanceConfiguration do
...
@@ -97,6 +97,41 @@ RSpec.describe InstanceConfiguration do
end
end
end
end
describe
'#package_file_size_limits'
do
let_it_be
(
:plan1
)
{
create
(
:plan
,
name:
'plan1'
,
title:
'Plan 1'
)
}
let_it_be
(
:plan2
)
{
create
(
:plan
,
name:
'plan2'
,
title:
'Plan 2'
)
}
before
do
create
(
:plan_limits
,
plan:
plan1
,
conan_max_file_size:
1001
,
maven_max_file_size:
1002
,
npm_max_file_size:
1003
,
nuget_max_file_size:
1004
,
pypi_max_file_size:
1005
,
terraform_module_max_file_size:
1006
,
generic_packages_max_file_size:
1007
)
create
(
:plan_limits
,
plan:
plan2
,
conan_max_file_size:
1101
,
maven_max_file_size:
1102
,
npm_max_file_size:
1103
,
nuget_max_file_size:
1104
,
pypi_max_file_size:
1105
,
terraform_module_max_file_size:
1106
,
generic_packages_max_file_size:
1107
)
end
it
'returns package file size limits'
do
file_size_limits
=
subject
.
settings
[
:package_file_size_limits
]
expect
(
file_size_limits
[
:Plan1
]).
to
eq
({
conan:
1001
,
maven:
1002
,
npm:
1003
,
nuget:
1004
,
pypi:
1005
,
terraform_module:
1006
,
generic:
1007
})
expect
(
file_size_limits
[
:Plan2
]).
to
eq
({
conan:
1101
,
maven:
1102
,
npm:
1103
,
nuget:
1104
,
pypi:
1105
,
terraform_module:
1106
,
generic:
1107
})
end
end
describe
'#rate_limits'
do
describe
'#rate_limits'
do
before
do
before
do
Gitlab
::
CurrentSettings
.
current_application_settings
.
update!
(
Gitlab
::
CurrentSettings
.
current_application_settings
.
update!
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment