Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: UploadPartSize not available for GCS VFS's when in portable mode. #1850

Open
2 tasks done
rgardam opened this issue Dec 23, 2024 · 2 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@rgardam
Copy link

rgardam commented Dec 23, 2024

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration issue.
  • This issue is not already reported on Github (I've searched it).

Bug description

You can only define this for S3 and Azure VFS's when in portable mode.

Steps to reproduce

unknown flag: --gcs-upload-part-size

Expected behavior

There would be a way to configure this when in portable mode.

SFTPGo version

SFTPGo 2.6.99-dev +metrics +azblob +gcs +s3 +bolt +mysql +pgsql +sqlite -unixcrypt +portable

Data provider

sqllite

Installation method

Other

Configuration

config

Relevant log output

No response

What are you using SFTPGo for?

Enterprise

Additional info

No response

@rgardam rgardam added the bug Something isn't working label Dec 23, 2024
@rgardam
Copy link
Author

rgardam commented Dec 23, 2024

I have created a patch that enables this.

> cat patch
diff --git a/internal/cmd/portable.go b/internal/cmd/portable.go
index 0a39fb20..853b6d21 100644
--- a/internal/cmd/portable.go
+++ b/internal/cmd/portable.go
@@ -71,6 +71,7 @@ var (
 	portableGCSAutoCredentials         int
 	portableGCSStorageClass            string
 	portableGCSKeyPrefix               string
+	portableGCSULPartSize              int
 	portableFTPDPort                   int
 	portableFTPSCert                   string
 	portableFTPSKey                    string
@@ -251,6 +252,7 @@ Please take a look at the usage below to customize the serving parameters`,
 								AutomaticCredentials: portableGCSAutoCredentials,
 								StorageClass:         portableGCSStorageClass,
 								KeyPrefix:            portableGCSKeyPrefix,
+								UploadPartSize:       int64(portableGCSULPartSize),
 							},
 							Credentials: kms.NewPlainSecret(portableGCSCredentials),
 						},
@@ -393,6 +395,8 @@ file`)
 	portableCmd.Flags().IntVar(&portableGCSAutoCredentials, "gcs-automatic-credentials", 1, `0 means explicit credentials using
 a JSON credentials file, 1 automatic
 `)
+	portableCmd.Flags().IntVar(&portableGCSULPartSize, "gcs-upload-part-size", 16, `The buffer size for multipart uploads
+(MB)`)
 	portableCmd.Flags().StringVar(&portableFTPSCert, "ftpd-cert", "", "Path to the certificate file for FTPS")
 	portableCmd.Flags().StringVar(&portableFTPSKey, "ftpd-key", "", "Path to the key file for FTPS")
 	portableCmd.Flags().StringVar(&portableWebDAVCert, "webdav-cert", "", `Path to the certificate file for WebDAV

@drakkan
Copy link
Owner

drakkan commented Dec 23, 2024

Hello,

Portable mode is intended to be a quick way to share files and test SFTPGo, not to be as fully featured as server mode.

I'm not saying this change can't be added, but if you want to contribute some code to make it, send a PR or otherwise accept our CLA. We prefer to have a CLA even for trivial code as this. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants