Browse Source

Set user's quota_files in SFTPGo

main
Miraty 2 months ago
parent
commit
18364c1ff6
  1. 2
      config.ini
  2. 13
      sftpgo-auth.php

2
config.ini

@ -52,3 +52,5 @@ public_sftp_port = 2022
; Will be used in configuration files
https_port = 42443
internal_onion_http_port = 9080
user_quota = 20971520

13
sftpgo-auth.php

@ -5,7 +5,18 @@ require "common/init.php";
$authData = json_decode(file_get_contents("php://input"), true);
if (checkPassword($authData['username'], $authData['password']) === true) {
echo '{"status":1,"username":"' . $authData['username'] . '","permissions":{"/":["*"]}}';
echo '
{
"status": 1,
"username": "' . $authData['username'] . '",
"quota_size": ' . CONF['ht']['user_quota'] . ',
"permissions": {
"/": [
"*"
]
}
}
';
http_response_code(200);
} else {
http_response_code(403);

Loading…
Cancel
Save