Add ability for users to disable checking file permissions when starting a server; closes pterodactly/panel#2272

This commit is contained in:
Dane Everitt
2020-08-27 19:02:22 -07:00
parent c7e732d084
commit 5f1ceeff90
2 changed files with 13 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package server
import (
"context"
"github.com/pkg/errors"
"github.com/pterodactyl/wings/config"
"golang.org/x/sync/semaphore"
"os"
"time"
@@ -147,10 +148,12 @@ func (s *Server) onBeforeStart() error {
s.PublishConsoleOutputFromDaemon("Updating process configuration files...")
s.UpdateConfigurationFiles()
s.PublishConsoleOutputFromDaemon("Ensuring file permissions are set correctly, this could take a few seconds...")
// Ensure all of the server file permissions are set correctly before booting the process.
if err := s.Filesystem.Chown("/"); err != nil {
return errors.Wrap(err, "failed to chown root server directory during pre-boot process")
if config.Get().System.CheckPermissionsOnBoot {
s.PublishConsoleOutputFromDaemon("Ensuring file permissions are set correctly, this could take a few seconds...")
// Ensure all of the server file permissions are set correctly before booting the process.
if err := s.Filesystem.Chown("/"); err != nil {
return errors.Wrap(err, "failed to chown root server directory during pre-boot process")
}
}
return nil