Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Mastodon
Commits
ae64c5b7
Commit
ae64c5b7
authored
2 years ago
by
Claire
Browse files
Options
Downloads
Patches
Plain Diff
Fix user archive takeout when using OpenStack Swift or S3 providers with no ACL support (#24200)
parent
3c82c4e7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/backups_controller.rb
+5
-1
5 additions, 1 deletion
app/controllers/backups_controller.rb
app/models/backup.rb
+1
-1
1 addition, 1 deletion
app/models/backup.rb
config/initializers/paperclip.rb
+1
-0
1 addition, 0 deletions
config/initializers/paperclip.rb
with
7 additions
and
2 deletions
app/controllers/backups_controller.rb
+
5
−
1
View file @
ae64c5b7
...
@@ -13,7 +13,11 @@ class BackupsController < ApplicationController
...
@@ -13,7 +13,11 @@ class BackupsController < ApplicationController
when
:s3
when
:s3
redirect_to
@backup
.
dump
.
expiring_url
(
10
)
redirect_to
@backup
.
dump
.
expiring_url
(
10
)
when
:fog
when
:fog
redirect_to
@backup
.
dump
.
expiring_url
(
Time
.
now
.
utc
+
10
)
if
Paperclip
::
Attachment
.
default_options
.
dig
(
:storage
,
:fog_credentials
,
:openstack_temp_url_key
).
present?
redirect_to
@backup
.
dump
.
expiring_url
(
Time
.
now
.
utc
+
10
)
else
redirect_to
full_asset_url
(
@backup
.
dump
.
url
)
end
when
:filesystem
when
:filesystem
redirect_to
full_asset_url
(
@backup
.
dump
.
url
)
redirect_to
full_asset_url
(
@backup
.
dump
.
url
)
end
end
...
...
This diff is collapsed.
Click to expand it.
app/models/backup.rb
+
1
−
1
View file @
ae64c5b7
...
@@ -17,6 +17,6 @@
...
@@ -17,6 +17,6 @@
class
Backup
<
ApplicationRecord
class
Backup
<
ApplicationRecord
belongs_to
:user
,
inverse_of: :backups
belongs_to
:user
,
inverse_of: :backups
has_attached_file
:dump
,
s3_permissions:
'private'
has_attached_file
:dump
,
s3_permissions:
->
(
*
)
{
ENV
[
'S3_PERMISSION'
]
==
''
?
nil
:
'private'
}
do_not_validate_attachment_file_type
:dump
do_not_validate_attachment_file_type
:dump
end
end
This diff is collapsed.
Click to expand it.
config/initializers/paperclip.rb
+
1
−
0
View file @
ae64c5b7
...
@@ -124,6 +124,7 @@ elsif ENV['SWIFT_ENABLED'] == 'true'
...
@@ -124,6 +124,7 @@ elsif ENV['SWIFT_ENABLED'] == 'true'
openstack_domain_name:
ENV
.
fetch
(
'SWIFT_DOMAIN_NAME'
)
{
'default'
},
openstack_domain_name:
ENV
.
fetch
(
'SWIFT_DOMAIN_NAME'
)
{
'default'
},
openstack_region:
ENV
[
'SWIFT_REGION'
],
openstack_region:
ENV
[
'SWIFT_REGION'
],
openstack_cache_ttl:
ENV
.
fetch
(
'SWIFT_CACHE_TTL'
)
{
60
},
openstack_cache_ttl:
ENV
.
fetch
(
'SWIFT_CACHE_TTL'
)
{
60
},
openstack_temp_url_key:
ENV
[
'SWIFT_TEMP_URL_KEY'
],
},
},
fog_file:
{
'Cache-Control'
=>
'public, max-age=315576000, immutable'
},
fog_file:
{
'Cache-Control'
=>
'public, max-age=315576000, immutable'
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment