From b9c381e26f9070fe5cd7f2d7d878622bcf923efb Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sun, 6 Sep 2020 11:40:31 +0200 Subject: [PATCH] sftpd: update pkg/sftp The patch to open a file in read/write mode is now merged --- go.mod | 5 ++-- go.sum | 9 +++---- httpd/schema/openapi.yaml | 48 ++++++++++++++++++++++++++++++++++---- main.go | 7 ++++-- service/service_windows.go | 2 +- 5 files changed, 56 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index e5b6c1b2..b6a766c1 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/otiai10/copy v1.2.0 github.com/pelletier/go-toml v1.8.0 // indirect github.com/pires/go-proxyproto v0.1.3 - github.com/pkg/sftp v1.12.0 + github.com/pkg/sftp v1.12.1-0.20200905201520-7a079e8e55f7 github.com/prometheus/client_golang v1.7.1 github.com/prometheus/common v0.13.0 // indirect github.com/rs/cors v1.7.1-0.20200626170627-8b4a00bd362b @@ -43,7 +43,7 @@ require ( go.uber.org/automaxprocs v1.3.0 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a golang.org/x/net v0.0.0-20200822124328-c89045814202 - golang.org/x/sys v0.0.0-20200828194041-157a740278f4 + golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f golang.org/x/tools v0.0.0-20200828161849-5deb26317202 // indirect google.golang.org/api v0.30.0 google.golang.org/genproto v0.0.0-20200829155447-2bf3329a0021 // indirect @@ -54,7 +54,6 @@ require ( replace ( github.com/jlaffaye/ftp => github.com/drakkan/ftp v0.0.0-20200730125632-b21eac28818c - github.com/pkg/sftp => github.com/drakkan/sftp v0.0.0-20200830084022-ea67d57ce589 golang.org/x/crypto => github.com/drakkan/crypto v0.0.0-20200824205004-9f5ce89c1796 golang.org/x/net => github.com/drakkan/net v0.0.0-20200824204746-8b31adf087bf ) diff --git a/go.sum b/go.sum index 6de6a96f..b846d7ad 100644 --- a/go.sum +++ b/go.sum @@ -113,8 +113,6 @@ github.com/drakkan/ftp v0.0.0-20200730125632-b21eac28818c h1:QSXIWohSNn0negBVSKE github.com/drakkan/ftp v0.0.0-20200730125632-b21eac28818c/go.mod h1:2lmrmq866uF2tnje75wQHzmPXhmSWUt7Gyx2vgK1RCU= github.com/drakkan/net v0.0.0-20200824204746-8b31adf087bf h1:MbeUXErR+xQ1Yvk+E6wYBKvgK8nvDiXk00jNEyDRvE8= github.com/drakkan/net v0.0.0-20200824204746-8b31adf087bf/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -github.com/drakkan/sftp v0.0.0-20200830084022-ea67d57ce589 h1:iM/xecWdhSbPHaFnsnTsZg0trWuCFxQ9GUE7ZPstvko= -github.com/drakkan/sftp v0.0.0-20200830084022-ea67d57ce589/go.mod h1:fUqqXB5vEgVCZ131L+9say31RAri6aF6KDViawhxKK8= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= @@ -369,6 +367,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.12.1-0.20200905201520-7a079e8e55f7 h1:E5bPgs8zO49KEnjlJNAMAQgFmdBkvy/KEwjo/IIWNto= +github.com/pkg/sftp v1.12.1-0.20200905201520-7a079e8e55f7/go.mod h1:fUqqXB5vEgVCZ131L+9say31RAri6aF6KDViawhxKK8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -581,8 +582,8 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200828194041-157a740278f4 h1:kCCpuwSAoYJPkNc6x0xT9yTtV4oKtARo4RGBQWOfg9E= -golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f h1:Fqb3ao1hUmOR3GkUOg/Y+BadLwykBIzs5q8Ez2SbHyc= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/httpd/schema/openapi.yaml b/httpd/schema/openapi.yaml index ba25cd0b..0e84e79c 100644 --- a/httpd/schema/openapi.yaml +++ b/httpd/schema/openapi.yaml @@ -1,8 +1,8 @@ -openapi: 3.0.1 +openapi: 3.0.3 info: title: SFTPGo description: 'SFTPGo REST API' - version: 1.9.6 + version: 1.9.7 servers: - url: /api/v1 @@ -21,9 +21,17 @@ paths: content: application/json: schema: - type: array - items: - $ref : '#/components/schemas/VersionInfo' + $ref : '#/components/schemas/VersionInfo' + 400: + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + status: 400 + message: "" + error: "Error description if any" 401: description: Unauthorized content: @@ -71,6 +79,16 @@ paths: status: 200 message: "Alive" error: "" + 400: + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + status: 400 + message: "" + error: "Error description if any" 401: description: Unauthorized content: @@ -116,6 +134,16 @@ paths: type: array items: $ref : '#/components/schemas/ConnectionStatus' + 400: + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + status: 400 + message: "" + error: "Error description if any" 401: description: Unauthorized content: @@ -235,6 +263,16 @@ paths: type: array items: $ref : '#/components/schemas/QuotaScan' + 400: + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + example: + status: 400 + message: "" + error: "Error description if any" 401: description: Unauthorized content: diff --git a/main.go b/main.go index 976d0408..d9f8cdc2 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,8 @@ -// Full featured and highly configurable SFTP server. -// For more details about features, installation, configuration and usage please refer to the README inside the source tree: +// Fully featured and highly configurable SFTP server with optional +// FTP/S and WebDAV support. It can serve local filesystem, S3 or +// Google Cloud Storage. +// For more details about features, installation, configuration and usage +// please refer to the README inside the source tree: // https://github.com/drakkan/sftpgo/blob/master/README.md package main // import "github.com/drakkan/sftpgo" diff --git a/service/service_windows.go b/service/service_windows.go index ba0a0d31..1cbb5e74 100644 --- a/service/service_windows.go +++ b/service/service_windows.go @@ -20,7 +20,7 @@ import ( const ( serviceName = "SFTPGo" - serviceDesc = "Full featured and highly configurable SFTP server" + serviceDesc = "Fully featured and highly configurable SFTP server with optional FTP/S and WebDAV support" rotateLogCmd = svc.Cmd(128) acceptRotateLog = svc.Accepted(rotateLogCmd) )