Move server tracking in program into global memory state
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user