Commit Graph
100 Commits
Author SHA1 Message Date
Nicola Murino 5c34d814d6 fix a possible nil pointer dereference
it can happen by upgrading from very old versions
2021-09-11 14:19:17 +02:00
Nicola Murino 0eca4f1866 update deps 2021-09-08 12:29:47 +02:00
Nicola Murino 8a4c21b64a add builtin two-factor auth support
The builtin two-factor authentication is based on time-based one time
passwords (RFC 6238) which works with Authy, Google Authenticator and
other compatible apps.
2021-09-04 12:11:04 +02:00
Nicola Murino bd9506da42 BaseConnection struct: ensure 64 bit alignment
Fixes #516
2021-08-28 10:06:49 +02:00
Nicola Murino b903a6e46f data provider: remove default admin
you need to load initial data or set "create_default_admin" to true
and the appropriate env vars if you don't want to use the web admin
setup screen to create the default admin
2021-08-20 10:37:51 +02:00
Nicola Murino 555dc3b0c0 transfer logs: add FTP mode 2021-08-10 13:07:38 +02:00
Nicola Murino 0de0d3308c improve error messages for generic failures 2021-08-08 19:30:21 +02:00
Nicola Murino a20373b613 add support for auth plugins 2021-08-08 17:09:48 +02:00
Nicola Murino a3c087456b ftpd: add some security checks 2021-08-05 18:38:15 +02:00
Nicola Murino c41ae116eb improve logging
Fixes #381
2021-07-24 20:11:17 +02:00
Nicola Murino c900cde8e4 notifiers plugin: add settings to retry unhandled events 2021-07-20 12:51:21 +02:00
Nicola Murino bd5191dfc5 add experimental plugin system 2021-07-11 15:26:51 +02:00
Nicola Murino 302ec2558c add notifications for mkdir/rmdir 2021-07-03 18:07:55 +02:00
Nicola Murino 04001f7ad3 FTP: try to return more specific error codes/messages for some errors
We now return 552 code for quota exceeded errors and 553 in the following
cases:

- filename denied by a filter
- no upload permission
- no overwrite permission
- pre upload hook error

Fixes #442
2021-06-28 19:40:04 +02:00
Nicola Murino 076b2f0ee0 modules: add v2 support 2021-06-26 07:31:41 +02:00
Nicola Murino e09bdd43d4 defender: fix GetHost for blocklist entries too 2021-06-20 21:57:19 +02:00
Nicola Murino 81aac15a6c defender: don't return expired hosts/banned ip in GetHost too 2021-06-19 18:51:33 +02:00
Nicola Murino c1b862394d move other errors to utils package 2021-06-19 13:06:01 +02:00
Nicola Murino f2f612b450 defender: don't return expired hosts/banned ip 2021-06-19 11:02:46 +02:00
Nicola Murino 9d3d7db29c azblob: store SAS URL as kms.Secret 2021-06-11 22:27:36 +02:00
Nicola Murino feec2118bb improve defender and quotas REST API 2021-06-07 21:52:43 +02:00
Nicola Murino 43182fc25e OpenAPI: add users API
These new APIs match the web client features.

I'm aware that some API do not follow REST best practises.

I want to avoid things likes "/user/folders/<path>"

where "path" must be encoded and making it optional create issues, so
I defined resources as query parameters instead of path parameters
2021-06-05 16:07:09 +02:00
Nicola Murino 575bcf1f03 add remote address to transfer and commands logs 2021-06-01 22:28:43 +02:00
Nicola Murino c1239fbf59 pre-upload action: add file open flags
Reading the flags the hook receiver can detect if the client wants to
truncate the target file
2021-05-31 22:33:23 +02:00
Nicola Murino c63b923ec3 cryptfs: add support for atomic uploads 2021-05-31 21:45:29 +02:00
Nicola Murino 3b46e6a6fb add support for a global temp path
Fixes #436
2021-05-27 15:38:27 +02:00
Nicola Murino 25a44030f9 actions: add pre-download and pre-upload
Downloads and uploads can be denied based on hook response
2021-05-26 07:48:37 +02:00
Nicola Murino 600268ebb8 httpclient: allow to set custom headers 2021-05-25 08:36:01 +02:00
Nicola Murino f2b93c0402 add a setup screen to create the first admin user
If you prefer to auto-create the first admin you can enable the
"create_default_admin" configuration key and SFTPGo will work as before.

You can also create the first admin by loading initial data: now you can
set both username and password, before you could only change the password
2021-05-14 19:21:15 +02:00
Nicola Murino 0540b8780e redact credentials within hooks
go-retryablehttp does not redact credentials, so we still log them
when we use it

https://github.com/hashicorp/go-retryablehttp/pull/133
2021-05-12 22:44:17 +02:00
Nicola Murino fa45c9c138 allow to execute actions for file operations and SSH commands synchronously
The actions to run synchronously can be configured via the `execute_sync`
configuration key.

Executing an action synchronously means that SFTPGo will not return a result
code to the client until your hook have completed its execution.

Fixes #409
2021-05-11 12:45:14 +02:00
Nicola Murino b67cd0d3df ensure no client is connected before running max connections test cases 2021-05-11 08:04:57 +02:00
Nicola Murino c8f7fc9bc9 httpd/webdav: add a list of hosts allowed to send proxy headers
X-Forwarded-For, X-Real-IP and X-Forwarded-Proto headers will be ignored
for hosts not included in this list.

This is a backward incompatible change, before the proxy headers were
always used
2021-05-11 06:54:06 +02:00
Nicola Murino 8f6cdacd00 allow to limit the number of per-host connections 2021-05-08 19:45:21 +02:00
Nicola Murino 23d9ebfc91 add a basic front-end web interface for end-users
Fixes #339 #321 #398
2021-05-06 21:35:43 +02:00
Nicola Murino 46998252e5 use bcrypt as default password hashing algo
argon2id has a high memory cost and, if not properly tuned, it can lead to
resource starvation.

Advanced users can still configure and use argon2id.
Passwords stored as argon2id will continue to work
2021-04-25 09:38:33 +02:00
Nicola Murino f4369cdbef fix max connections check
Also make sure to close the ssh client connection in test cases
2021-04-20 18:12:16 +02:00
Nicola Murino 92638ce93d add support for hashing password using bcrypt
argon2id remains the default
2021-04-20 13:55:09 +02:00
Nicola Murino 6ef85d6026 add, optional, in memory password caching
Verifying argon2 passwords has a high memory and computational cost,
by enabling, in memory, password caching you reduce this cost
2021-04-20 09:39:36 +02:00
Nicola Murino f45c89fc46 add rate limiting support for REST API/web admin too 2021-04-19 08:14:04 +02:00
Nicola Murino 112e3b2fc2 add rate limiting support 2021-04-18 12:31:06 +02:00
Nicola Murino c844fc7477 add support for delayed quota update
If there are a lot of close uploads, accumulating quota updates can
save you many queries to the data provider
2021-04-11 08:38:43 +02:00
Nicola Murino acb4310c11 add a startup hook 2021-04-05 10:07:59 +02:00
Nicola Murino ea26d7786c sftpfs: add buffering support
this way we improve performance over high latency networks
2021-04-03 16:00:55 +02:00
Nicola Murino 2f56375121 improve SFTP loop detection 2021-04-01 18:53:48 +02:00
Nicola Murino f249286cb1 docs: add some notes about the new virtual folders support
fixe a failing test case for the memory provider
2021-03-21 19:47:11 +01:00
Nicola Murino d6dc3a507e extend virtual folders support to all storage backends
Fixes #241
2021-03-21 19:15:47 +01:00
Nicola Murino ca3e15578e Use new methods in the io and os packages instead of ioutil ones
ioutil is deprecated in Go 1.16 and SFTPGo is an application, not
a library, we have no reason to keep compatibility with old Go
versions.

Go 1.16 fix some cifs related issues too.
2021-02-25 21:53:04 +01:00
Nicola Murino be9230e85b micro optimizations spotted using the go-critic linter 2021-02-16 19:11:36 +01:00
Nicola Murino 46176a54b4 minor doc fixes 2021-02-14 22:08:08 +01:00