From 1e3cc52feaa05c5f2ec9fba08854e6de23c8f4b0 Mon Sep 17 00:00:00 2001 From: Andrei-Lucian Mociu Date: Sun, 16 Apr 2023 20:06:14 +0000 Subject: [PATCH] some fixes --- config/config.go | 11 ----------- main.go | 3 +++ sftp/server.go | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/config/config.go b/config/config.go index 70ed583..94922be 100644 --- a/config/config.go +++ b/config/config.go @@ -39,17 +39,6 @@ type RemoteQueryConfiguration struct { // should be resolved on the Panel, and not something that should be resolved by upping this // number. Timeout int `default:"30" yaml:"timeout"` - - // The number of servers to load in a single request to the Panel API when booting the - // Wings instance. A single request is initially made to the Panel to get this number - // of servers, and then the pagination status is checked and additional requests are - // fired off in parallel to request the remaining pages. - // - // It is not recommended to change this from the default as you will likely encounter - // memory limits on your Panel instance. In the grand scheme of things 4 requests for - // 50 servers is likely just as quick as two for 100 or one for 400, and will certainly - // be less likely to cause performance issues on the Panel. - BootServersPerPage int `default:"50" yaml:"boot_servers_per_page"` } type SystemConfiguration struct { diff --git a/main.go b/main.go index 231b1f0..d62863a 100644 --- a/main.go +++ b/main.go @@ -22,6 +22,9 @@ import ( func initLogging() { dir := config.Get().System.LogDirectory p := filepath.Join(dir, "/sftp-server.log") + if err := os.MkdirAll(filepath.Dir(p), 0o755); err != nil { + log2.Fatalf("sftp: could not create internal sftp server log directory: %s", err) + } w, err := logrotate.NewFile(p) if err != nil { log2.Fatalf("failed to create server log: %s", err) diff --git a/sftp/server.go b/sftp/server.go index 34c68dd..c6c1782 100644 --- a/sftp/server.go +++ b/sftp/server.go @@ -83,7 +83,7 @@ func (c *SFTPServer) Run() error { Extensions: map[string]string{ "ip": conn.RemoteAddr().String(), "uuid": os.Getenv("P_SERVER_UUID"), - "user": "test", + "user": "admin", "permissions": "*,admin.websocket.errors,admin.websocket.install,admin.websocket.transfer", }, }, nil