mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 02:59:16 +08:00
feat: 创建运行环境网站,校验 PHP 镜像是否存在 (#6220)
This commit is contained in:
parent
70a8fda449
commit
f5f379465f
@ -9,6 +9,7 @@ import (
|
|||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/utils/docker"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"reflect"
|
"reflect"
|
||||||
@ -312,6 +313,14 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error)
|
|||||||
switch runtime.Type {
|
switch runtime.Type {
|
||||||
case constant.RuntimePHP:
|
case constant.RuntimePHP:
|
||||||
if runtime.Resource == constant.ResourceAppstore {
|
if runtime.Resource == constant.ResourceAppstore {
|
||||||
|
client, err := docker.NewDockerClient()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer client.Close()
|
||||||
|
if !checkImageExist(client, runtime.Image) {
|
||||||
|
return buserr.WithName("ErrImageNotExist", runtime.Name)
|
||||||
|
}
|
||||||
var (
|
var (
|
||||||
req request.AppInstallCreate
|
req request.AppInstallCreate
|
||||||
install *model.AppInstall
|
install *model.AppInstall
|
||||||
|
@ -94,6 +94,7 @@ ErrPathPermission: 'A folder with non-1000:1000 permissions was detected in the
|
|||||||
ErrDomainIsUsed: "Domain is already used by website {{ .name }}"
|
ErrDomainIsUsed: "Domain is already used by website {{ .name }}"
|
||||||
ErrDomainFormat: "{{ .name }} domain format error"
|
ErrDomainFormat: "{{ .name }} domain format error"
|
||||||
ErrDefaultAlias: "default is a reserved code name, please use another code name"
|
ErrDefaultAlias: "default is a reserved code name, please use another code name"
|
||||||
|
ErrImageNotExist: "Running environment {{.name}} image does not exist, please re-edit the running environment"
|
||||||
|
|
||||||
#ssl
|
#ssl
|
||||||
ErrSSLCannotDelete: "The certificate {{ .name }} is being used by the website and cannot be removed"
|
ErrSSLCannotDelete: "The certificate {{ .name }} is being used by the website and cannot be removed"
|
||||||
|
@ -94,6 +94,7 @@ ErrPathPermission: 'index 目錄下偵測到非 1000:1000 權限資料夾,可
|
|||||||
ErrDomainIsUsed: "域名已被網站【{{ .name }}】使用"
|
ErrDomainIsUsed: "域名已被網站【{{ .name }}】使用"
|
||||||
ErrDomainFormat: "{{ .name }} 域名格式不正確"
|
ErrDomainFormat: "{{ .name }} 域名格式不正確"
|
||||||
ErrDefaultAlias: "default 為保留代號,請使用其他代號"
|
ErrDefaultAlias: "default 為保留代號,請使用其他代號"
|
||||||
|
ErrImageNotExist: "執行環境 {{.name}} 鏡像不存在,請重新編輯執行環境"
|
||||||
|
|
||||||
#ssl
|
#ssl
|
||||||
ErrSSLCannotDelete: "{{ .name }} 證書正在被網站使用,無法刪除"
|
ErrSSLCannotDelete: "{{ .name }} 證書正在被網站使用,無法刪除"
|
||||||
|
@ -94,6 +94,7 @@ ErrPathPermission: 'index 目录下检测到非 1000:1000 权限文件夹,可
|
|||||||
ErrDomainIsUsed: "域名已被网站【{{ .name }}】使用"
|
ErrDomainIsUsed: "域名已被网站【{{ .name }}】使用"
|
||||||
ErrDomainFormat: "{{ .name }} 域名格式不正确"
|
ErrDomainFormat: "{{ .name }} 域名格式不正确"
|
||||||
ErrDefaultAlias: "default 为保留代号,请使用其他代号"
|
ErrDefaultAlias: "default 为保留代号,请使用其他代号"
|
||||||
|
ErrImageNotExist: "运行环境 {{.name}} 镜像不存在,请重新编辑运行环境"
|
||||||
|
|
||||||
#ssl
|
#ssl
|
||||||
ErrSSLCannotDelete: "{{ .name }} 证书正在被网站使用,无法删除"
|
ErrSSLCannotDelete: "{{ .name }} 证书正在被网站使用,无法删除"
|
||||||
|
Loading…
Reference in New Issue
Block a user