Move server tracking in program into global memory state

This commit is contained in:
Dane Everitt
2019-12-07 16:43:00 -08:00
parent e2c04cc6f5
commit c9bff0fa31
6 changed files with 83 additions and 38 deletions

View File

@@ -24,6 +24,8 @@ func Initialize(config *config.Configuration) error {
DisableDiskCheck: config.System.Sftp.DisableDiskChecking,
},
CredentialValidator: validateCredentials,
PathValidator: validatePath,
DiskSpaceValidator: validateDiskSpace,
}
if err := sftp_server.New(c); err != nil {
@@ -45,6 +47,14 @@ func Initialize(config *config.Configuration) error {
return nil
}
func validatePath(fs sftp_server.FileSystem, p string) (string, error) {
return p, nil
}
func validateDiskSpace(fs sftp_server.FileSystem) bool {
return true
}
// Validates a set of credentials for a SFTP login aganist Pterodactyl Panel and returns
// the server's UUID if the credentials were valid.
func validateCredentials(c sftp_server.AuthenticationRequest) (*sftp_server.AuthenticationResponse, error) {