Fix some typos and run gofmt on all .go files

This commit is contained in:
Matthew Penner
2020-09-05 13:08:40 -06:00
parent b9f6e17a7d
commit 7ba32aca84
42 changed files with 89 additions and 84 deletions

View File

@@ -16,4 +16,4 @@ func (e fxerr) Error() string {
default:
return "Failure"
}
}
}

View File

@@ -16,7 +16,7 @@ type FileSystem struct {
UUID string
Permissions []string
ReadOnly bool
User SftpUser
User User
Cache *cache.Cache
PathValidator func(fs FileSystem, p string) (string, error)
@@ -107,7 +107,7 @@ func (fs FileSystem) Filewrite(request *sftp.Request) (io.WriterAt, error) {
// Create all of the directories leading up to the location where this file is being created.
if err := os.MkdirAll(filepath.Dir(p), 0755); err != nil {
l.WithFields(log.Fields{
"path": filepath.Dir(p),
"path": filepath.Dir(p),
"error": errors.WithStack(err),
}).Error("error making path for file")
@@ -351,7 +351,7 @@ func (fs FileSystem) Filelist(request *sftp.Request) (sftp.ListerAt, error) {
default:
// Before adding readlink support we need to evaluate any potential security risks
// as a result of navigating around to a location that is outside the home directory
// for the logged in user. I don't forsee it being much of a problem, but I do want to
// for the logged in user. I don't foresee it being much of a problem, but I do want to
// check it out before slapping some code here. Until then, we'll just return an
// unsupported response code.
return nil, sftp.ErrSshFxOpUnsupported

View File

@@ -27,7 +27,7 @@ type Settings struct {
BindAddress string
}
type SftpUser struct {
type User struct {
Uid int
Gid int
}
@@ -36,7 +36,7 @@ type Server struct {
cache *cache.Cache
Settings Settings
User SftpUser
User User
PathValidator func(fs FileSystem, p string) (string, error)
DiskSpaceValidator func(fs FileSystem) bool

View File

@@ -12,7 +12,7 @@ var noMatchingServerError = errors.New("no matching server with that UUID was fo
func Initialize(config config.SystemConfiguration) error {
s := &Server{
User: SftpUser{
User: User{
Uid: config.User.Uid,
Gid: config.User.Gid,
},
@@ -66,7 +66,7 @@ func validateDiskSpace(fs FileSystem) bool {
return s.Filesystem.HasSpaceAvailable(true)
}
// Validates a set of credentials for a SFTP login aganist Pterodactyl Panel and returns
// Validates a set of credentials for a SFTP login against Pterodactyl Panel and returns
// the server's UUID if the credentials were valid.
func validateCredentials(c api.SftpAuthRequest) (*api.SftpAuthResponse, error) {
f := log.Fields{"subsystem": "sftp", "username": c.User, "ip": c.IP}