Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Account Service
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Eclipse Projects
xfsc
Personal Credential Manager - Cloud
Account Service
Commits
5df5dbb8
Commit
5df5dbb8
authored
6 months ago
by
Steffen Schulze
Browse files
Options
Downloads
Patches
Plain Diff
backup link modification for upload/download
parent
83cb296f
No related branches found
No related tags found
No related merge requests found
Pipeline
#51585
passed with warnings with stages
in 3 minutes and 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
internal/handlers/backup.go
+4
-2
4 additions, 2 deletions
internal/handlers/backup.go
with
4 additions
and
2 deletions
internal/handlers/backup.go
+
4
−
2
View file @
5df5dbb8
...
...
@@ -263,12 +263,14 @@ func GenerateBackupLink(ctx *gin.Context, e common.Env) (any, error) {
name
:=
ctx
.
Query
(
"name"
)
var
bid
string
var
dbOperation
func
(
*
gorm
.
DB
,
string
,
string
,
string
,
[]
byte
)
error
var
prefix
=
"xfscpcmbackup"
if
mode
==
common
.
ModeUpload
{
bid
=
e
.
GetRandomId
()
dbOperation
=
model
.
CreateBackupDBEntry
prefix
=
prefix
+
"upload"
}
else
if
mode
==
common
.
ModeDownload
{
bid
=
ctx
.
Query
(
"bindingId"
)
prefix
=
prefix
+
"download"
if
bid
==
""
{
return
nil
,
common
.
ErrorResponseBadRequest
(
ctx
,
"queryParam `bindingId` required"
,
nil
)
}
...
...
@@ -280,7 +282,7 @@ func GenerateBackupLink(ctx *gin.Context, e common.Env) (any, error) {
}
path
:=
getOneTimePath
(
ctx
,
bid
,
user
)
res
:=
BackupLinkOutput
{
Path
:
"xfscpcmbackup
://"
+
path
.
String
(),
TTL
:
config
.
ServerConfiguration
.
BackupLinkTTL
.
Seconds
()}
res
:=
BackupLinkOutput
{
Path
:
prefix
+
"
://"
+
path
.
String
(),
TTL
:
config
.
ServerConfiguration
.
BackupLinkTTL
.
Seconds
()}
return
res
,
dbOperation
(
e
.
GetDB
(),
bid
,
user
.
ID
(),
name
,
[]
byte
{})
}
...
...
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