diff --git a/backend/app/service/website_utils.go b/backend/app/service/website_utils.go index 1f219fe9b..b3ca2bb3b 100644 --- a/backend/app/service/website_utils.go +++ b/backend/app/service/website_utils.go @@ -19,7 +19,6 @@ import ( "github.com/1Panel-dev/1Panel/backend/utils/compose" "github.com/1Panel-dev/1Panel/backend/utils/files" "github.com/1Panel-dev/1Panel/backend/utils/nginx" - "github.com/1Panel-dev/1Panel/backend/utils/nginx/components" "github.com/1Panel-dev/1Panel/backend/utils/nginx/parser" "github.com/1Panel-dev/1Panel/cmd/server/nginx_conf" "github.com/pkg/errors" @@ -245,19 +244,6 @@ func deleteListenAndServerName(website model.Website, ports []int, domains []str return nginxCheckAndReload(nginxConfig.OldContent, nginxConfig.FilePath, nginxFull.Install.ContainerName) } -func getKeysFromStaticFile(scope dto.NginxKey) []string { - var res []string - newConfig := &components.Config{} - switch scope { - case dto.SSL: - newConfig = parser.NewStringParser(string(nginx_conf.SSL)).Parse() - } - for _, dir := range newConfig.GetDirectives() { - res = append(res, dir.GetName()) - } - return res -} - func createPemFile(website model.Website, websiteSSL model.WebsiteSSL) error { nginxApp, err := appRepo.GetFirst(appRepo.WithKey(constant.AppNginx)) if err != nil { diff --git a/backend/log/manager.go b/backend/log/manager.go index c24f3a991..1f4f94546 100644 --- a/backend/log/manager.go +++ b/backend/log/manager.go @@ -8,13 +8,12 @@ import ( ) type manager struct { - thresholdSize int64 - startAt time.Time - fire chan string - cr *cron.Cron - context chan int - wg sync.WaitGroup - lock sync.Mutex + startAt time.Time + fire chan string + cr *cron.Cron + context chan int + wg sync.WaitGroup + lock sync.Mutex } func (m *manager) Fire() chan string { diff --git a/backend/log/writer.go b/backend/log/writer.go index 0e1194d15..3c60ef1fc 100644 --- a/backend/log/writer.go +++ b/backend/log/writer.go @@ -2,6 +2,7 @@ package log import ( "fmt" + "github.com/1Panel-dev/1Panel/backend/global" "github.com/1Panel-dev/1Panel/backend/utils/files" "io/ioutil" "log" @@ -41,6 +42,7 @@ func (w *AsynchronousWriter) Close() error { func() { defer func() { if r := recover(); r != nil { + global.LOG.Error(r) } }() w.m.Close() @@ -59,11 +61,11 @@ func (w *AsynchronousWriter) onClose() { select { case w.errChan <- err: default: - _asyncBufferPool.Put(b) + _asyncBufferPool.Put(&b) return } } - _asyncBufferPool.Put(b) + _asyncBufferPool.Put(&b) default: return } @@ -183,7 +185,7 @@ func (w *AsynchronousWriter) writer() { if _, err = w.file.Write(b); err != nil && len(w.errChan) < cap(w.errChan) { w.errChan <- err } - _asyncBufferPool.Put(b) + _asyncBufferPool.Put(&b) case <-w.ctx: return } @@ -191,11 +193,9 @@ func (w *AsynchronousWriter) writer() { } func (w *Writer) DoRemove() { - select { - case file := <-w.rollingfilech: - if err := os.Remove(file); err != nil { - log.Println("error in remove log file", file, err) - } + file := <-w.rollingfilech + if err := os.Remove(file); err != nil { + log.Println("error in remove log file", file, err) } } diff --git a/backend/utils/ssl/acme_test.go b/backend/utils/ssl/acme_test.go index a84ee3f0c..09d0ac5f1 100644 --- a/backend/utils/ssl/acme_test.go +++ b/backend/utils/ssl/acme_test.go @@ -3,16 +3,13 @@ package ssl import ( "crypto/rand" "crypto/rsa" - "crypto/tls" "crypto/x509" "encoding/pem" "fmt" "io/ioutil" "os" - "strings" "testing" - "github.com/1Panel-dev/1Panel/backend/utils/cmd" "github.com/go-acme/lego/v4/acme/api" "github.com/go-acme/lego/v4/certcrypto" "github.com/go-acme/lego/v4/certificate" @@ -22,22 +19,6 @@ import ( "github.com/go-acme/lego/v4/registration" ) -type plainDnsProvider struct { - Resolve -} - -func (p *plainDnsProvider) Present(domain, token, keyAuth string) error { - fqdn, value := dns01.GetRecord(domain, keyAuth) - p.Key = fqdn - p.Value = value - return nil -} - -func (p *plainDnsProvider) CleanUp(domain, token, keyAuth string) error { - fmt.Printf("%s,%s,%s", domain, token, keyAuth) - return nil -} - func TestCreatePrivate(t *testing.T) { priKey, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { @@ -261,27 +242,3 @@ func TestSSL(t *testing.T) { fmt.Println(cert2) } - -func TestDaoqi(t *testing.T) { - conn, err := tls.Dial("tcp", "1panel.xyz:443", nil) - if err != nil { - panic(err) - } - - conn2 := conn.ConnectionState() - - fmt.Println(conn2.PeerCertificates[0].NotBefore) - - fmt.Println(conn.ConnectionState().PeerCertificates[0].AuthorityKeyId) - fmt.Println(string(conn.ConnectionState().PeerCertificates[0].SubjectKeyId)) -} - -func Test111(t *testing.T) { - out, err := cmd.Exec("docker exec -i 1Panel-nginx1.23.1-AiCt curl http://127.0.0.1/nginx_status") - if err != nil { - panic(err) - } - outArray := strings.Split(out, " ") - fmt.Println(outArray) - fmt.Println(outArray[8]) -} diff --git a/backend/utils/websocket/client.go b/backend/utils/websocket/client.go index 6623b0902..60ac167a4 100644 --- a/backend/utils/websocket/client.go +++ b/backend/utils/websocket/client.go @@ -48,13 +48,11 @@ func (c *Client) Write() { }() for { - select { - case message, ok := <-c.Msg: - if !ok { - return - } - _ = c.Socket.WriteMessage(websocket.TextMessage, message) + message, ok := <-c.Msg + if !ok { + return } + _ = c.Socket.WriteMessage(websocket.TextMessage, message) } } diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 2f740dc58..38d91d96e 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -874,6 +874,7 @@ export default { github: '开源社区', doc: '文档', document: '文档说明', + updatePrompt: '当前应用均为最新版本', }, website: { website: '网站', diff --git a/frontend/src/layout/layout-content.vue b/frontend/src/layout/layout-content.vue index a38330d60..676222a3a 100644 --- a/frontend/src/layout/layout-content.vue +++ b/frontend/src/layout/layout-content.vue @@ -54,7 +54,7 @@ -
+
@@ -120,6 +120,10 @@ const showBack = computed(() => { margin-top: 20px; } +.prompt { + margin-top: 10px; +} + .divider { margin-top: 20px; border: 0; diff --git a/frontend/src/views/app-store/index.scss b/frontend/src/views/app-store/index.scss index 81058aaac..22b7ae9d1 100644 --- a/frontend/src/views/app-store/index.scss +++ b/frontend/src/views/app-store/index.scss @@ -73,3 +73,12 @@ .el-avatar { --el-avatar-bg-color: #ffffff; } + +.update-prompt { + text-align: center; + span { + font-weight: 500; + font-size: 16px; + color: #bbbfc4; + } +} diff --git a/frontend/src/views/app-store/installed/index.vue b/frontend/src/views/app-store/installed/index.vue index c9bf3f774..addc21994 100644 --- a/frontend/src/views/app-store/installed/index.vue +++ b/frontend/src/views/app-store/installed/index.vue @@ -39,6 +39,9 @@ {{ $t('app.sync') }}