feat: apply acme account use proxy (#8516)

This commit is contained in:
ChengPlay 2025-04-29 19:13:00 +08:00 committed by GitHub
parent 4dfa421c1a
commit b0a7efe9c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 11 deletions

View file

@ -130,14 +130,6 @@ func (a AppService) PageApp(ctx *gin.Context, req request.AppSearch) (interface{
Description: ap.GetDescription(ctx),
}
appDTOs = append(appDTOs, appDTO)
appTags, err := appTagRepo.GetByAppId(ap.ID)
if err != nil {
continue
}
var tagIds []uint
for _, at := range appTags {
tagIds = append(tagIds, at.TagId)
}
tags, err := getAppTags(ap.ID, lang)
if err != nil {
continue

View file

@ -58,9 +58,10 @@ func initAcmeAccount() {
count, _, _ := acmeAccountService.Page(search)
if count == 0 {
createAcmeAccount := request.WebsiteAcmeAccountCreate{
Email: "acme@1paneldev.com",
Type: "letsencrypt",
KeyType: "2048",
Email: "acme@1paneldev.com",
Type: "letsencrypt",
KeyType: "2048",
UseProxy: true,
}
if _, err := acmeAccountService.Create(createAcmeAccount); err != nil {
global.LOG.Errorf("create acme account error: %s", err.Error())

View file

@ -2,6 +2,7 @@ package service
import (
"crypto/hmac"
"encoding/base64"
"strconv"
"github.com/1Panel-dev/1Panel/core/app/dto"
@ -62,6 +63,10 @@ func (u *AuthService) Login(c *gin.Context, info dto.Login, entrance string) (*d
if err != nil {
return nil, "", err
}
if entrance != "" {
entranceValue := base64.StdEncoding.EncodeToString([]byte(entrance))
c.SetCookie("SecurityEntrance", entranceValue, 0, "", "", false, true)
}
return res, "", nil
}
@ -99,6 +104,10 @@ func (u *AuthService) MFALogin(c *gin.Context, info dto.MFALogin, entrance strin
if err != nil {
return nil, "", err
}
if entrance != "" {
entranceValue := base64.StdEncoding.EncodeToString([]byte(entrance))
c.SetCookie("SecurityEntrance", entranceValue, 0, "", "", false, true)
}
return res, "", nil
}

View file

@ -236,5 +236,6 @@ export namespace Setting {
version: string;
isXpack: boolean;
isBound: boolean;
name: string;
}
}