feat: Add support for Hetzner Storage Box integration

- Introduced new source and destination forms for Hetzner Storage Box, allowing users to configure their storage settings.
- Updated configuration generation logic to handle Hetzner, including necessary parameters such as host, port, username, and authentication type.
- Enhanced user interface with clear instructions and security notes for Hetzner, improving user experience and security awareness.
- Updated existing logic to accommodate Hetzner in rclone configuration generation for both source and destination types.
This commit is contained in:
StarFleetCPTN
2025-04-08 20:24:13 -07:00
parent 417841b3d2
commit de97ad6b50
6 changed files with 294 additions and 31 deletions
+2 -2
View File
@@ -91,7 +91,7 @@ func (db *DB) GenerateRcloneConfig(config *TransferConfig) error {
sourceName := fmt.Sprintf("source_%d", config.ID)
// Generate rclone config using rclone CLI for source
switch config.SourceType {
case "sftp":
case "sftp", "hetzner":
args := []string{
"config", "create", sourceName, "sftp",
"host", config.SourceHost,
@@ -245,7 +245,7 @@ func (db *DB) GenerateRcloneConfig(config *TransferConfig) error {
destName := fmt.Sprintf("dest_%d", config.ID)
// Generate rclone config using rclone CLI for destination
switch config.DestinationType {
case "sftp":
case "sftp", "hetzner":
args := []string{
"config", "create", destName, "sftp",
"host", config.DestHost,
+11
View File
@@ -116,6 +116,17 @@ func TestRcloneConnection(config db.TransferConfig, providerType string, dbInsta
if keyFile != "" {
createArgs = append(createArgs, "key_file", keyFile)
}
case "hetzner":
createArgs = append(createArgs, "host", host, "user", user, "pass", pass, "key_file", keyFile)
if port != 0 {
createArgs = append(createArgs, "port", fmt.Sprintf("%d", port))
}
if pass != "" {
createArgs = append(createArgs, "pass", pass)
}
if keyFile != "" {
createArgs = append(createArgs, "key_file", keyFile)
}
case "s3":
createArgs = append(createArgs, "provider", "AWS", "env_auth", "false")
if accessKey != "" {