Nicola Murino
df96ea7e9f
add a new permission for overwriting existing files
...
The upload permission is required to allow file overwrite
2019-09-17 08:53:45 +02:00
Nicola Murino
3d13fe15c3
connections: close the ssh channel before the network connection
...
This way if pkg/sftp is stuck in Serve() method should be unlocked.
2019-09-11 16:29:56 +02:00
Nicola Murino
9794ca7ee0
connection: add a close method
...
and use it instead of netConn directly
2019-09-11 12:46:21 +02:00
Nicola Murino
784f75f45b
use net.Conn instead of ssh.Conn to close connections
2019-09-11 09:41:46 +02:00
Nicola Murino
bc5779e26f
actions: don't execute actions on errors
...
detect upload/download errors and don't execute actions if a transfer
error happen.
To detect SFTP errors this patch is needed:
https://github.com/pkg/sftp/pull/307
2019-09-07 23:10:20 +02:00
Nicola Murino
4f1c2c094f
improve logging
...
this partially revert #45
2019-09-06 15:19:01 +02:00
Jo Vandeginste
abbb7f272b
Refactor the logging system
...
* created a "Log" function for type "Connection"
* created a "log" function for type "Provider"
* replace logger calls to Log/log where possible
I also renamed PGSSQL to PGSQL, as this seemed to be a typo
Signed-off-by: Jo Vandeginste <Jo.Vandeginste@kuleuven.be >
2019-09-06 13:43:21 +02:00
Jo Vandeginste
bb589c6fc8
Show user info, remove some extraneous connection ids
...
Signed-off-by: Jo Vandeginste <Jo.Vandeginste@kuleuven.be >
2019-09-05 22:58:14 +02:00
Jo Vandeginste
0737c672f5
Add connectionID to as many entries as possible
...
Signed-off-by: Jo Vandeginste <Jo.Vandeginste@kuleuven.be >
2019-09-05 22:58:14 +02:00
Jo Vandeginste
795ffc4c5f
Add quotes to certain strings
...
Signed-off-by: Jo Vandeginste <Jo.Vandeginste@kuleuven.be >
2019-09-05 16:14:31 +02:00
Nicola Murino
e50c521c33
add SCP support
...
SCP is an experimental feature, we have our own SCP implementation
since we can't rely on scp system command to proper handle permissions,
quota and user's home dir restrictions. The SCP protocol is quite simple
but there is no official docs about it, so we need more testing and
feedbacks before enabling it by default.
We may not handle some borderline cases or have sneaky bugs.
This commit contains some breaking changes to the REST API.
SFTPGo API should be stable now and I hope no more breaking changes
before the first stable release.
2019-08-24 14:41:15 +02:00
Nicola Murino
61b5a1d9a3
simplify FileOpenFlags to os.Flags conversion
2019-08-04 11:02:38 +02:00
Nicola Murino
80b9c40489
add support for atomic upload
...
Atomic uploads are now configurable. The default upload mode remains
non atomic
2019-08-04 09:37:58 +02:00
Nicola Murino
b8dafecdd9
transfer: initialize lastActivity
...
This avoid a random value for transfer of empty file where no reads or writes happen
2019-08-02 15:49:51 +02:00
Nicola Murino
8058178ea0
Improve documentation
2019-07-30 20:51:29 +02:00
Nicola Murino
0bed768909
allow quota tracking only for users with quota restrictions
...
Setting "track_quota" to 2 in sftpgo.conf will avoid a database update
after each file upload/deletion if the user has no quota restrictions
2019-07-28 22:04:50 +02:00
Nicola Murino
88fedd577d
sftpd handler: remove eccessive logging and prepare the code to support upload resume
...
Upload resume is currently disabled for this upstream bug:
https://github.com/pkg/sftp/issues/295
2019-07-28 13:40:12 +02:00
Nicola Murino
c547c5c9ee
quota tracking: fix concurrent updates
...
added a test case to check quota size for upload that replace an existing file
2019-07-28 13:24:46 +02:00
Nicola Murino
48451a9924
add support for custom actions
...
Configurable custom commands and/or HTTP notifications on SFTP upload, download, delete or rename
2019-07-27 09:38:09 +02:00
Nicola Murino
ff8fb80e3c
fix check for used quota
...
remove unused data provider from sftpd configuration struct
2019-07-26 13:07:08 +02:00
Nicola Murino
5c861a7c46
sftpd config: MaxAuthTries is now configurable
2019-07-21 12:02:24 +02:00
Nicola Murino
14f919df47
simplify some code
2019-07-21 00:19:17 +02:00
Nicola Murino
22b8dc7f1d
fix misspells and ineffectual assignments
2019-07-20 21:17:53 +02:00
Nicola Murino
31cd4d7139
first version
2019-07-20 12:26:52 +02:00