diff --git a/api/cmd/portainer/main.go b/api/cmd/portainer/main.go index 7c956a05c..3c8c9f2aa 100644 --- a/api/cmd/portainer/main.go +++ b/api/cmd/portainer/main.go @@ -7,7 +7,7 @@ import ( "github.com/portainer/portainer/cron" "github.com/portainer/portainer/crypto" "github.com/portainer/portainer/exec" - "github.com/portainer/portainer/file" + "github.com/portainer/portainer/filesystem" "github.com/portainer/portainer/git" "github.com/portainer/portainer/http" "github.com/portainer/portainer/jwt" @@ -31,7 +31,7 @@ func initCLI() *portainer.CLIFlags { } func initFileService(dataStorePath string) portainer.FileService { - fileService, err := file.NewService(dataStorePath, "") + fileService, err := filesystem.NewService(dataStorePath, "") if err != nil { log.Fatal(err) } diff --git a/api/file/file.go b/api/filesystem/filesystem.go similarity index 99% rename from api/file/file.go rename to api/filesystem/filesystem.go index 03de12d23..236845410 100644 --- a/api/file/file.go +++ b/api/filesystem/filesystem.go @@ -1,4 +1,4 @@ -package file +package filesystem import ( "bytes" diff --git a/api/http/handler/settings.go b/api/http/handler/settings.go index 40b14977b..bef01db91 100644 --- a/api/http/handler/settings.go +++ b/api/http/handler/settings.go @@ -5,7 +5,7 @@ import ( "github.com/asaskevich/govalidator" "github.com/portainer/portainer" - "github.com/portainer/portainer/file" + "github.com/portainer/portainer/filesystem" httperror "github.com/portainer/portainer/http/error" "github.com/portainer/portainer/http/security" @@ -138,11 +138,11 @@ func (handler *SettingsHandler) handlePutSettings(w http.ResponseWriter, r *http } if (settings.LDAPSettings.TLSConfig.TLS || settings.LDAPSettings.StartTLS) && !settings.LDAPSettings.TLSConfig.TLSSkipVerify { - caCertPath, _ := handler.FileService.GetPathForTLSFile(file.LDAPStorePath, portainer.TLSFileCA) + caCertPath, _ := handler.FileService.GetPathForTLSFile(filesystem.LDAPStorePath, portainer.TLSFileCA) settings.LDAPSettings.TLSConfig.TLSCACertPath = caCertPath } else { settings.LDAPSettings.TLSConfig.TLSCACertPath = "" - err := handler.FileService.DeleteTLSFiles(file.LDAPStorePath) + err := handler.FileService.DeleteTLSFiles(filesystem.LDAPStorePath) if err != nil { httperror.WriteErrorResponse(w, err, http.StatusInternalServerError, handler.Logger) } @@ -169,7 +169,7 @@ func (handler *SettingsHandler) handlePutSettingsLDAPCheck(w http.ResponseWriter } if (req.LDAPSettings.TLSConfig.TLS || req.LDAPSettings.StartTLS) && !req.LDAPSettings.TLSConfig.TLSSkipVerify { - caCertPath, _ := handler.FileService.GetPathForTLSFile(file.LDAPStorePath, portainer.TLSFileCA) + caCertPath, _ := handler.FileService.GetPathForTLSFile(filesystem.LDAPStorePath, portainer.TLSFileCA) req.LDAPSettings.TLSConfig.TLSCACertPath = caCertPath } diff --git a/api/http/handler/stack.go b/api/http/handler/stack.go index 1f6b23d6e..ed54c500f 100644 --- a/api/http/handler/stack.go +++ b/api/http/handler/stack.go @@ -9,7 +9,7 @@ import ( "github.com/asaskevich/govalidator" "github.com/portainer/portainer" - "github.com/portainer/portainer/file" + "github.com/portainer/portainer/filesystem" httperror "github.com/portainer/portainer/http/error" "github.com/portainer/portainer/http/proxy" "github.com/portainer/portainer/http/security" @@ -166,7 +166,7 @@ func (handler *StackHandler) handlePostStacksStringMethod(w http.ResponseWriter, ID: portainer.StackID(stackName + "_" + swarmID), Name: stackName, SwarmID: swarmID, - EntryPoint: file.ComposeFileDefaultName, + EntryPoint: filesystem.ComposeFileDefaultName, Env: req.Env, } @@ -264,7 +264,7 @@ func (handler *StackHandler) handlePostStacksRepositoryMethod(w http.ResponseWri } if req.PathInRepository == "" { - req.PathInRepository = file.ComposeFileDefaultName + req.PathInRepository = filesystem.ComposeFileDefaultName } stacks, err := handler.StackService.Stacks() @@ -404,7 +404,7 @@ func (handler *StackHandler) handlePostStacksFileMethod(w http.ResponseWriter, r ID: portainer.StackID(stackName + "_" + swarmID), Name: stackName, SwarmID: swarmID, - EntryPoint: file.ComposeFileDefaultName, + EntryPoint: filesystem.ComposeFileDefaultName, Env: env, }