From 6b33d3d9f17aaa798598f833ec8974682a0389dd Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Thu, 12 Sep 2019 09:21:58 +0200 Subject: [PATCH] add version to the default server banner --- README.md | 2 +- config/config.go | 7 ++++--- sftpgo.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0a36748a..6f12566e 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ The `sftpgo` configuration file contains the following sections: - `idle_timeout`, integer. Time in minutes after which an idle client will be disconnected. 0 menas disabled. Default: 15 - `max_auth_tries` integer. Maximum number of authentication attempts permitted per connection. If set to a negative number, the number of attempts are unlimited. If set to zero, the number of attempts are limited to 6. - `umask`, string. Umask for the new files and directories. This setting has no effect on Windows. Default: "0022" - - `banner`, string. Identification string used by the server. Default "SFTPGo" + - `banner`, string. Identification string used by the server. Leave empty to use the default banner. Default "SFTPGo_version" - `upload_mode` integer. 0 means standard, the files are uploaded directly to the requested path. 1 means atomic: files are uploaded to a temporary path and renamed to the requested path when the client ends the upload. Atomic mode avoids problems such as a web server that serves partial files when the files are being uploaded. In atomic mode if there is an upload error the temporary file is deleted and so the requested upload path will not contain a partial file. - `actions`, struct. It contains the command to execute and/or the HTTP URL to notify and the trigger conditions - `execute_on`, list of strings. Valid values are `download`, `upload`, `delete`, `rename`. On folder deletion a `delete` notification will be sent for each deleted file. Actions will be not executed if an error is detected and so a partial file is uploaded or downloaded. Leave empty to disable actions. diff --git a/config/config.go b/config/config.go index 1deea29f..40d47ebe 100644 --- a/config/config.go +++ b/config/config.go @@ -13,12 +13,12 @@ import ( "github.com/drakkan/sftpgo/dataprovider" "github.com/drakkan/sftpgo/logger" "github.com/drakkan/sftpgo/sftpd" + "github.com/drakkan/sftpgo/utils" "github.com/spf13/viper" ) const ( - logSender = "config" - defaultBanner = "SFTPGo" + logSender = "config" // DefaultConfigName defines the name for the default config file. // This is the file name without extension, we use viper and so we // support all the config files format supported by viper @@ -28,7 +28,8 @@ const ( ) var ( - globalConf globalConfig + globalConf globalConfig + defaultBanner = fmt.Sprintf("SFTPGo_%v", utils.GetAppVersion().Version) ) type globalConfig struct { diff --git a/sftpgo.json b/sftpgo.json index 5e002dad..125397af 100644 --- a/sftpgo.json +++ b/sftpgo.json @@ -5,7 +5,7 @@ "idle_timeout": 15, "max_auth_tries": 0, "umask": "0022", - "banner": "SFTPGo", + "banner": "", "upload_mode": 0, "actions": { "execute_on": [],