Skip to content

Commit 3b664a4

Browse files
authored
Merge pull request #241 from moov-io/sftp-skip-chmod-upload
upload: pass SkipChmodAfterUpload for SFTP
2 parents c3d677a + aeadb0d commit 3b664a4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

internal/service/model_upload.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ type SFTP struct {
148148
// SkipDirectoryCreation will configure achgateway to create
149149
// directories on the remote server prior to uploading files.
150150
SkipDirectoryCreation bool
151+
152+
// SkipChmodAfterUpload will not chmod files after uploading them.
153+
// Some SFTP servers need uploads to be left alone once they're put on the server.
154+
SkipChmodAfterUpload bool
151155
}
152156

153157
func (cfg *SFTP) MarshalJSON() ([]byte, error) {

internal/upload/sftp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func newSFTPTransferAgent(logger log.Logger, cfg *service.UploadAgent) (*SFTPTra
5858
PacketSize: cfg.SFTP.MaxPacketSize,
5959

6060
SkipDirectoryCreation: cfg.SFTP.SkipDirectoryCreation,
61+
SkipChmodAfterUpload: cfg.SFTP.SkipChmodAfterUpload,
6162
})
6263
if err != nil {
6364
return nil, err

0 commit comments

Comments
 (0)