hooks
doing something like this:
err = provider.updateUser(u)
...
return provider.userExists(username)
could be racy if another update happen before
provider.userExists(username)
also pass a pointer to updateUser so if the user is modified inside
"validateUser" we can just return the modified user without do a new
query
Config name is a Viper concept used for searching a specific file
in various paths with various extensions.
Making it configurable is usually not a useful feature
as users mostly want to define a full or relative path
to a config file.
This change replaces config name with config file.
also gcs credentials are now encrypted, both on disk and inside the
provider.
Data provider is automatically migrated and load data will accept
old format too but you should upgrade to the new format to avoid future
issues
When true, users' Google Cloud Storage credentials will be written to
the data provider instead of disk.
Pre-existing credentials on disk will be used as a fallback
Fixes#201
The common package defines the interfaces that a protocol must implement
and contain code that can be shared among supported protocols.
This way should be easier to support new protocols
profiling is now available via the HTTP base URL /debug/pprof/
examples, use this URL to start and download a 30 seconds CPU profile:
/debug/pprof/profile?seconds=30
use this URL to profile used memory:
/debug/pprof/heap?gc=1
use this URL to profile allocated memory:
/debug/pprof/allocs?gc=1
Full docs here:
https://golang.org/pkg/net/http/pprof/
we try to remove the trailing double quote for user input such as this one
sftpgo.exe serve -c "C:\ProgramData\SFTPGO\"
the value for the -c flag is parsed as:
C:\ProgramData\SFTPGO"
this is what the user specified, but the user want this value:
C:\ProgramData\SFTPGO
so we try to remove the trailing double quote.
Please note that we cannot do anything for something like this:
-c "C:\ProgramData\SFTPGO\" -l "sftpgo.log"
in this case the -l flag will be ignored and the value for the c flag is:
C:\ProgramData\SFTPGO" -l sftpgo.log
and so probably it is invalid. This is definitely a bad user input