mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-09 23:17:21 +08:00
feat: apply acme account use proxy (#8516)
This commit is contained in:
parent
4dfa421c1a
commit
b0a7efe9c3
4 changed files with 14 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -236,5 +236,6 @@ export namespace Setting {
|
|||
version: string;
|
||||
isXpack: boolean;
|
||||
isBound: boolean;
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue