From 378995147b2fe2372ce5cea1f96fd16ad2d1b0cc Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sat, 16 Jul 2022 20:29:10 +0200 Subject: [PATCH] try to better highlight donations and sponsorships options ... ... and to better explain why they are required. Please don't say "someone else will help the project, I'll just use it" Signed-off-by: Nicola Murino --- README.md | 27 +++++++++++++++++++-------- config/config.go | 4 +++- docs/full-configuration.md | 1 + httpd/httpd.go | 4 ++++ httpd/webadmin.go | 2 ++ sftpgo.json | 3 ++- templates/webadmin/adminsetup.html | 6 ++++++ version/version.go | 2 +- 8 files changed, 38 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a8002597..6269737f 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,25 @@ Fully featured and highly configurable SFTP server with optional HTTP/S, FTP/S and WebDAV support. Several storage backends are supported: local filesystem, encrypted local filesystem, S3 (compatible) Object Storage, Google Cloud Storage, Azure Blob Storage, SFTP. +## Sponsors + +If you find SFTPGo useful please consider supporting this Open Source project. + +Maintaining and evolving SFTPGo is a lot of work - easily the equivalent of a full time job - for me. + +I'd like to make SFTPGo into a sustainable long term project and would not like to introduce a dual licensing option and limit some features to the proprietary version only. + +If you use SFTPGo, it is in your best interest to ensure that the project you rely on stays healthy and well maintained. +This can only happen with your donations and [sponsorships](https://github.com/sponsors/drakkan) :heart: + +If you just take and don't return anything back, the project will die in the long run and you will be forced to pay for a similar proprietary solution. + +More [info](https://github.com/drakkan/sftpgo/issues/452). + +Thank you to our sponsors! + +[7digital logo](https://www.7digital.com/) + ## Features - Support for serving local filesystem, encrypted local filesystem, S3 Compatible Object Storage, Google Cloud Storage, Azure Blob Storage or other SFTP accounts over SFTP/SCP/FTP/WebDAV. @@ -310,14 +329,6 @@ We are very grateful to all the people who contributed with ideas and/or pull re Thank you [ysura](https://www.ysura.com/) for granting me stable access to a test AWS S3 account. -## Sponsors - -I'd like to make SFTPGo into a sustainable long term project and your [sponsorship](https://github.com/sponsors/drakkan) will really help :heart: - -Thank you to our sponsors! - -[7digital logo](https://www.7digital.com/) - ## License GNU AGPLv3 diff --git a/config/config.go b/config/config.go index c392e8c9..c972b0ca 100644 --- a/config/config.go +++ b/config/config.go @@ -375,6 +375,7 @@ func Init() { InstallationCode: "", InstallationCodeHint: defaultInstallCodeHint, }, + HideSupportLink: false, }, HTTPConfig: httpclient.Config{ Timeout: 20, @@ -1946,9 +1947,10 @@ func setViperDefaults() { viper.SetDefault("httpd.cors.allowed_headers", globalConf.HTTPDConfig.Cors.AllowedHeaders) viper.SetDefault("httpd.cors.exposed_headers", globalConf.HTTPDConfig.Cors.ExposedHeaders) viper.SetDefault("httpd.cors.allow_credentials", globalConf.HTTPDConfig.Cors.AllowCredentials) + viper.SetDefault("httpd.cors.max_age", globalConf.HTTPDConfig.Cors.MaxAge) viper.SetDefault("httpd.setup.installation_code", globalConf.HTTPDConfig.Setup.InstallationCode) viper.SetDefault("httpd.setup.installation_code_hint", globalConf.HTTPDConfig.Setup.InstallationCodeHint) - viper.SetDefault("httpd.cors.max_age", globalConf.HTTPDConfig.Cors.MaxAge) + viper.SetDefault("httpd.hide_support_link", globalConf.HTTPDConfig.HideSupportLink) viper.SetDefault("http.timeout", globalConf.HTTPConfig.Timeout) viper.SetDefault("http.retry_wait_min", globalConf.HTTPConfig.RetryWaitMin) viper.SetDefault("http.retry_wait_max", globalConf.HTTPConfig.RetryWaitMax) diff --git a/docs/full-configuration.md b/docs/full-configuration.md index cf3aba68..abf0fb78 100644 --- a/docs/full-configuration.md +++ b/docs/full-configuration.md @@ -331,6 +331,7 @@ The configuration file contains the following sections: - `setup` struct containing configurations for the initial setup screen - `installation_code`, string. If set, this installation code will be required when creating the first admin account. Please note that even if set using an environment variable this field is read at SFTPGo startup and not at runtime. This is not a license key or similar, the purpose here is to prevent anyone who can access to the initial setup screen from creating an admin user. Default: blank. - `installation_code_hint`, string. Description for the installation code input field. Default: `Installation code`. + - `hide_support_link`, boolean. If set, the link to the [sponsors section](../README.md#sponsors) will not appear on the setup screen page. Default: `false`. - **"telemetry"**, the configuration for the telemetry server, more details [below](#telemetry-server) - `bind_port`, integer. The port used for serving HTTP requests. Set to 0 to disable HTTP server. Default: 0 - `bind_address`, string. Leave blank to listen on all available network interfaces. On \*NIX you can specify an absolute path to listen on a Unix-domain socket. Default: `127.0.0.1` diff --git a/httpd/httpd.go b/httpd/httpd.go index 8bc5eaab..0b7e8125 100644 --- a/httpd/httpd.go +++ b/httpd/httpd.go @@ -234,6 +234,7 @@ var ( webOpenAPIPath string // max upload size for http clients, 1GB by default maxUploadFileSize = int64(1048576000) + hideSupportLink bool installationCode string installationCodeHint string fnInstallationCodeResolver FnInstallationCodeResolver @@ -605,6 +606,8 @@ type Conf struct { Cors CorsConfig `json:"cors" mapstructure:"cors"` // Initial setup configuration Setup SetupConfig `json:"setup" mapstructure:"setup"` + // If enabled, the link to the sponsors section will not appear on the setup screen page + HideSupportLink bool `json:"hide_support_link" mapstructure:"hide_support_link"` } type apiResponse struct { @@ -746,6 +749,7 @@ func (c *Conf) Initialize(configDir string, isShared int) error { } csrfTokenAuth = jwtauth.New(jwa.HS256.String(), getSigningKey(c.SigningPassphrase), nil) + hideSupportLink = c.HideSupportLink exitChannel := make(chan error, 1) diff --git a/httpd/webadmin.go b/httpd/webadmin.go index 5b662f52..57b04570 100644 --- a/httpd/webadmin.go +++ b/httpd/webadmin.go @@ -238,6 +238,7 @@ type setupPage struct { Username string HasInstallationCode bool InstallationCodeHint string + HideSupportLink bool Error string } @@ -643,6 +644,7 @@ func (s *httpdServer) renderAdminSetupPage(w http.ResponseWriter, r *http.Reques Username: username, HasInstallationCode: installationCode != "", InstallationCodeHint: installationCodeHint, + HideSupportLink: hideSupportLink, Error: error, } diff --git a/sftpgo.json b/sftpgo.json index f78f0703..fc385577 100644 --- a/sftpgo.json +++ b/sftpgo.json @@ -339,7 +339,8 @@ "setup": { "installation_code": "", "installation_code_hint": "Installation code" - } + }, + "hide_support_link": false }, "telemetry": { "bind_port": 0, diff --git a/templates/webadmin/adminsetup.html b/templates/webadmin/adminsetup.html index 6cd54898..a143d5aa 100644 --- a/templates/webadmin/adminsetup.html +++ b/templates/webadmin/adminsetup.html @@ -69,6 +69,12 @@ Create admin + {{if not .HideSupportLink}} +
+ + {{end}} diff --git a/version/version.go b/version/version.go index b9dce716..c049a87c 100644 --- a/version/version.go +++ b/version/version.go @@ -2,7 +2,7 @@ package version import "strings" -const version = "2.3.1" +const version = "2.3.1-dev" var ( commit = ""