diff --git a/README.md b/README.md index 3e28035a..c43d359f 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,22 @@ 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. +Maintaing 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. @@ -321,14 +337,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 AGPL-3.0-only diff --git a/config/config.go b/config/config.go index 4dea5b51..822f70f1 100644 --- a/config/config.go +++ b/config/config.go @@ -369,6 +369,7 @@ func Init() { InstallationCode: "", InstallationCodeHint: defaultInstallCodeHint, }, + HideSupportLink: false, }, HTTPConfig: httpclient.Config{ Timeout: 20, @@ -1931,9 +1932,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 fc2d5e22..8a811540 100644 --- a/docs/full-configuration.md +++ b/docs/full-configuration.md @@ -327,6 +327,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 e0d164c9..0287abd5 100644 --- a/httpd/httpd.go +++ b/httpd/httpd.go @@ -233,6 +233,7 @@ var ( webOpenAPIPath string // max upload size for http clients, 1GB by default maxUploadFileSize = int64(1048576000) + hideSupportLink bool installationCode string installationCodeHint string fnInstallationCodeResolver FnInstallationCodeResolver @@ -604,6 +605,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 { @@ -745,6 +748,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 1a3fe389..90fd0a00 100644 --- a/httpd/webadmin.go +++ b/httpd/webadmin.go @@ -260,6 +260,7 @@ type setupPage struct { Username string HasInstallationCode bool InstallationCodeHint string + HideSupportLink bool Error string } @@ -740,6 +741,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 f7a03e18..d3a8fd91 100644 --- a/sftpgo.json +++ b/sftpgo.json @@ -333,7 +333,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..21b87ea7 100644 --- a/templates/webadmin/adminsetup.html +++ b/templates/webadmin/adminsetup.html @@ -69,6 +69,12 @@ Create admin + {{if not .HideSupportLink}} +
+
+ SFTPGo needs your help +
+ {{end}}