Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b910339e6e | ||
|
|
438445dab8 | ||
|
|
dc7e62c388 | ||
|
|
3ed8f9ca55 | ||
|
|
0282b5e75f | ||
|
|
f5f8218940 | ||
|
|
a634046757 |
@@ -1,11 +1,11 @@
|
|||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
LABEL maintainer="goedge.cdn@gmail.com"
|
LABEL maintainer="goedge.cdn@gmail.com"
|
||||||
ENV TZ "Asia/Shanghai"
|
ENV TZ "Asia/Shanghai"
|
||||||
ENV VERSION 1.2.4
|
ENV VERSION 1.2.6
|
||||||
ENV ROOT_DIR /usr/local/goedge
|
ENV ROOT_DIR /usr/local/goedge
|
||||||
ENV TAR_FILE edge-admin-linux-amd64-plus-v${VERSION}.zip
|
ENV TAR_FILE edge-admin-linux-amd64-plus-v${VERSION}.zip
|
||||||
ENV TAR_URL "https://dl.goedge.cn/edge/v${VERSION}/edge-admin-linux-amd64-plus-v${VERSION}.zip"
|
ENV TAR_URL "https://dl.goedge.cn/edge/v${VERSION}/edge-admin-linux-amd64-plus-v${VERSION}.zip"
|
||||||
#ENV TAR_URL "http://192.168.2.60:8080/edge-admin-linux-amd64-plus-v${VERSION}.zip" # your local repository
|
#ENV TAR_URL "http://192.168.2.61:8080/edge-admin-linux-amd64-plus-v${VERSION}.zip" # your local repository
|
||||||
|
|
||||||
RUN apk add --no-cache tzdata
|
RUN apk add --no-cache tzdata
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package teaconst
|
package teaconst
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version = "1.2.4"
|
Version = "1.2.6"
|
||||||
|
|
||||||
APINodeVersion = "1.2.4"
|
APINodeVersion = "1.2.6"
|
||||||
|
|
||||||
ProductName = "Edge Admin"
|
ProductName = "Edge Admin"
|
||||||
ProcessName = "edge-admin"
|
ProcessName = "edge-admin"
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import (
|
|||||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||||
"github.com/iwind/TeaGo/actions"
|
"github.com/iwind/TeaGo/actions"
|
||||||
"github.com/iwind/TeaGo/maps"
|
"github.com/iwind/TeaGo/maps"
|
||||||
|
"github.com/iwind/TeaGo/types"
|
||||||
|
"regexp"
|
||||||
)
|
)
|
||||||
|
|
||||||
type IndexAction struct {
|
type IndexAction struct {
|
||||||
@@ -42,8 +44,13 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
this.Data["config"] = config
|
this.Data["config"] = config
|
||||||
|
|
||||||
var httpAllDomainMismatchActionContentHTML = ""
|
var httpAllDomainMismatchActionContentHTML = ""
|
||||||
if config.HTTPAll.DomainMismatchAction != nil {
|
var httpAllDomainMismatchActionStatusCode = "404"
|
||||||
|
if config.HTTPAll.DomainMismatchAction != nil && config.HTTPAll.DomainMismatchAction.Options != nil {
|
||||||
httpAllDomainMismatchActionContentHTML = config.HTTPAll.DomainMismatchAction.Options.GetString("contentHTML")
|
httpAllDomainMismatchActionContentHTML = config.HTTPAll.DomainMismatchAction.Options.GetString("contentHTML")
|
||||||
|
var statusCode = config.HTTPAll.DomainMismatchAction.Options.GetInt("statusCode")
|
||||||
|
if statusCode > 0 {
|
||||||
|
httpAllDomainMismatchActionStatusCode = types.String(statusCode)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
httpAllDomainMismatchActionContentHTML = `<!DOCTYPE html>
|
httpAllDomainMismatchActionContentHTML = `<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
@@ -67,6 +74,7 @@ p { color: grey; }
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.Data["httpAllDomainMismatchActionContentHTML"] = httpAllDomainMismatchActionContentHTML
|
this.Data["httpAllDomainMismatchActionContentHTML"] = httpAllDomainMismatchActionContentHTML
|
||||||
|
this.Data["httpAllDomainMismatchActionStatusCode"] = httpAllDomainMismatchActionStatusCode
|
||||||
|
|
||||||
this.Show()
|
this.Show()
|
||||||
}
|
}
|
||||||
@@ -76,6 +84,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
|
|
||||||
HttpAllMatchDomainStrictly bool
|
HttpAllMatchDomainStrictly bool
|
||||||
HttpAllDomainMismatchActionContentHTML string
|
HttpAllDomainMismatchActionContentHTML string
|
||||||
|
HttpAllDomainMismatchActionStatusCode string
|
||||||
HttpAllAllowMismatchDomainsJSON []byte
|
HttpAllAllowMismatchDomainsJSON []byte
|
||||||
HttpAllAllowNodeIP bool
|
HttpAllAllowNodeIP bool
|
||||||
HttpAllDefaultDomain string
|
HttpAllDefaultDomain string
|
||||||
@@ -121,11 +130,18 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var domainMisMatchStatusCodeString = params.HttpAllDomainMismatchActionStatusCode
|
||||||
|
if !regexp.MustCompile(`^\d{3}$`).MatchString(domainMisMatchStatusCodeString) {
|
||||||
|
this.FailField("httpAllDomainMismatchActionContentStatusCode", "请输入正确的状态码")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var domainMisMatchStatusCode = types.Int(domainMisMatchStatusCodeString)
|
||||||
|
|
||||||
config.HTTPAll.MatchDomainStrictly = params.HttpAllMatchDomainStrictly
|
config.HTTPAll.MatchDomainStrictly = params.HttpAllMatchDomainStrictly
|
||||||
config.HTTPAll.DomainMismatchAction = &serverconfigs.DomainMismatchAction{
|
config.HTTPAll.DomainMismatchAction = &serverconfigs.DomainMismatchAction{
|
||||||
Code: serverconfigs.DomainMismatchActionPage,
|
Code: serverconfigs.DomainMismatchActionPage,
|
||||||
Options: maps.Map{
|
Options: maps.Map{
|
||||||
"statusCode": 404,
|
"statusCode": domainMisMatchStatusCode,
|
||||||
"contentHTML": params.HttpAllDomainMismatchActionContentHTML,
|
"contentHTML": params.HttpAllDomainMismatchActionContentHTML,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package reverseProxy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/locations/locationutils"
|
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/serverutils"
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/serverutils"
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||||
"github.com/iwind/TeaGo"
|
"github.com/iwind/TeaGo"
|
||||||
@@ -12,7 +11,6 @@ func init() {
|
|||||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||||
server.
|
server.
|
||||||
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeServer)).
|
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeServer)).
|
||||||
Helper(locationutils.NewLocationHelper()).
|
|
||||||
Helper(serverutils.NewServerHelper()).
|
Helper(serverutils.NewServerHelper()).
|
||||||
Data("mainTab", "setting").
|
Data("mainTab", "setting").
|
||||||
Prefix("/servers/groups/group/settings").
|
Prefix("/servers/groups/group/settings").
|
||||||
|
|||||||
@@ -17,6 +17,13 @@
|
|||||||
<p class="comment">选中后,表示禁止未绑定的域名和IP访问。</p>
|
<p class="comment">选中后,表示禁止未绑定的域名和IP访问。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr v-show="config.httpAll.matchDomainStrictly">
|
||||||
|
<td class="color-border">提示页面状态码</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="httpAllDomainMismatchActionStatusCode" v-model="httpAllDomainMismatchActionStatusCode" style="width: 4em" maxlength="3"/>
|
||||||
|
<p class="comment">默认404。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr v-show="config.httpAll.matchDomainStrictly">
|
<tr v-show="config.httpAll.matchDomainStrictly">
|
||||||
<td class="color-border">未绑定域名页面提示</td>
|
<td class="color-border">未绑定域名页面提示</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -35,7 +42,7 @@
|
|||||||
<td class="color-border">默认域名</td>
|
<td class="color-border">默认域名</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="httpAllDefaultDomain" v-model="config.httpAll.defaultDomain"/>
|
<input type="text" name="httpAllDefaultDomain" v-model="config.httpAll.defaultDomain"/>
|
||||||
<p class="comment">例外域名或使用节点IP访问时使用的默认域名。</p>
|
<p class="comment">例外域名或使用节点IP访问时使用的默认域名;如果指定的域名在集群里已经绑定到某个网站,则相当于直接访问该网站。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user