[release] 0.9.9
This commit is contained in:
parent
52b600deee
commit
59803821ef
|
@ -1,3 +1,6 @@
|
||||||
|
## Version 0.9.9
|
||||||
|
- Add new filters for routes based on method, query strings and headers (missing UI)
|
||||||
|
|
||||||
## Version 0.9.1 > 0.9.8
|
## Version 0.9.1 > 0.9.8
|
||||||
- Fix subdomain logic for composed TLDs
|
- Fix subdomain logic for composed TLDs
|
||||||
- Add option for custom wildcard domains
|
- Add option for custom wildcard domains
|
||||||
|
|
|
@ -73,7 +73,7 @@ const AuthRegister = ({nickname, isRegister, isInviteLink, regkey}) => {
|
||||||
.max(255)
|
.max(255)
|
||||||
.required('Password is required')
|
.required('Password is required')
|
||||||
.matches(
|
.matches(
|
||||||
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[~!@#$%\^&\*\(\)_\+=\-\{\[\}\]:;"'<,>\.\/])(?=.{9,})/,
|
/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[~!@#$%\^&\*\(\)_\+=\-\{\[\}\]:;"'<,>\/])(?=.{9,})/,
|
||||||
'Must Contain 9 Characters, One Uppercase, One Lowercase, One Number and one special case Character (~!@#$%^&*()_+=-{[}]:;"\'<>.?/)'
|
'Must Contain 9 Characters, One Uppercase, One Lowercase, One Number and one special case Character (~!@#$%^&*()_+=-{[}]:;"\'<>.?/)'
|
||||||
),
|
),
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -485,7 +485,7 @@ const NewInstall = () => {
|
||||||
// nickname cant be admin or root
|
// nickname cant be admin or root
|
||||||
nickname: Yup.string().required('Nickname is required').min(3).max(32)
|
nickname: Yup.string().required('Nickname is required').min(3).max(32)
|
||||||
.matches(/^(?!admin|root).*$/, 'Nickname cannot be admin or root'),
|
.matches(/^(?!admin|root).*$/, 'Nickname cannot be admin or root'),
|
||||||
password: Yup.string().required('Password is required').min(8).max(128).matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[~!@#$%\^&\*\(\)_\+=\-\{\[\}\]:;"'<,>\.\/])(?=.{9,})/, 'Password must contain 9 characters: at least 1 lowercase, 1 uppercase, 1 number, and 1 special character'),
|
password: Yup.string().required('Password is required').min(8).max(128).matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[~!@#$%\^&\*\(\)_\+=\-\{\[\}\]:;"'<,>\/])(?=.{9,})/, 'Password must contain 9 characters: at least 1 lowercase, 1 uppercase, 1 number, and 1 special character'),
|
||||||
email: Yup.string().email('Must be a valid email').max(255),
|
email: Yup.string().email('Must be a valid email').max(255),
|
||||||
confirmPassword: Yup.string().oneOf([Yup.ref('password'), null], 'Passwords must match'),
|
confirmPassword: Yup.string().oneOf([Yup.ref('password'), null], 'Passwords must match'),
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -5,7 +5,7 @@ const hasNumber = (number) => new RegExp(/[0-9]/).test(number);
|
||||||
const hasMixed = (number) => new RegExp(/[a-z]/).test(number) && new RegExp(/[A-Z]/).test(number);
|
const hasMixed = (number) => new RegExp(/[a-z]/).test(number) && new RegExp(/[A-Z]/).test(number);
|
||||||
|
|
||||||
// has special chars
|
// has special chars
|
||||||
const hasSpecial = (number) => new RegExp(/[~!@#$%\^&\*\(\)_\+=\-\{\[\}\]:;"'<,>\.\?\/]/).test(number);
|
const hasSpecial = (number) => new RegExp(/[~!@#$%\^&\*\(\)_\+=\-\{\[\}\]:;"'<,>\?\/]/).test(number);
|
||||||
|
|
||||||
// set color based on password strength
|
// set color based on password strength
|
||||||
export const strengthColor = (count) => {
|
export const strengthColor = (count) => {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.9.8",
|
"version": "0.9.9",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -72,6 +72,18 @@ func RouterGen(route utils.ProxyRouteConfig, router *mux.Router, destination htt
|
||||||
}
|
}
|
||||||
destination = http.StripPrefix(route.PathPrefix, destination)
|
destination = http.StripPrefix(route.PathPrefix, destination)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for filter := range route.AddionalFilters {
|
||||||
|
if route.AddionalFilters[filter].Type == "header" {
|
||||||
|
origin = origin.Headers(route.AddionalFilters[filter].Name, route.AddionalFilters[filter].Value)
|
||||||
|
} else if route.AddionalFilters[filter].Type == "query" {
|
||||||
|
origin = origin.Queries(route.AddionalFilters[filter].Name, route.AddionalFilters[filter].Value)
|
||||||
|
} else if route.AddionalFilters[filter].Type == "method" {
|
||||||
|
origin = origin.Methods(route.AddionalFilters[filter].Value)
|
||||||
|
} else {
|
||||||
|
utils.Error("Unknown filter type: "+route.AddionalFilters[filter].Type, nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
destination = SmartShieldMiddleware(route.SmartShield)(destination)
|
destination = SmartShieldMiddleware(route.SmartShield)(destination)
|
||||||
|
|
||||||
|
|
|
@ -235,6 +235,11 @@ func calculateLowestExhaustedPercentage(policy utils.SmartShieldPolicy, userCons
|
||||||
|
|
||||||
func GetClientID(r *http.Request) string {
|
func GetClientID(r *http.Request) string {
|
||||||
// when using Docker we need to get the real IP
|
// when using Docker we need to get the real IP
|
||||||
|
utils.Debug("SmartShield TEMPLOG: Getting client ID")
|
||||||
|
utils.Debug("SmartShield TEMPLOG HOSTNAME: " + os.Getenv("HOSTNAME"))
|
||||||
|
utils.Debug("SmartShield TEMPLOG x-forwarded-for: " + r.Header.Get("x-forwarded-for"))
|
||||||
|
utils.Debug("SmartShield TEMPLOG RemoteAddr: " + r.RemoteAddr)
|
||||||
|
|
||||||
if os.Getenv("HOSTNAME") != "" && r.Header.Get("x-forwarded-for") != "" {
|
if os.Getenv("HOSTNAME") != "" && r.Header.Get("x-forwarded-for") != "" {
|
||||||
ip, _, _ := net.SplitHostPort(r.Header.Get("x-forwarded-for"))
|
ip, _, _ := net.SplitHostPort(r.Header.Get("x-forwarded-for"))
|
||||||
utils.Debug("SmartShield: Getting client ID " + ip)
|
utils.Debug("SmartShield: Getting client ID " + ip)
|
||||||
|
|
|
@ -149,6 +149,12 @@ type ProxyConfig struct {
|
||||||
Routes []ProxyRouteConfig
|
Routes []ProxyRouteConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type AddionalFiltersConfig struct {
|
||||||
|
Type string
|
||||||
|
Name string
|
||||||
|
Value string
|
||||||
|
}
|
||||||
|
|
||||||
type ProxyRouteConfig struct {
|
type ProxyRouteConfig struct {
|
||||||
Name string `validate:"required"`
|
Name string `validate:"required"`
|
||||||
Description string
|
Description string
|
||||||
|
@ -170,6 +176,7 @@ type ProxyRouteConfig struct {
|
||||||
BlockAPIAbuse bool
|
BlockAPIAbuse bool
|
||||||
AcceptInsecureHTTPSTarget bool
|
AcceptInsecureHTTPSTarget bool
|
||||||
HideFromDashboard bool
|
HideFromDashboard bool
|
||||||
|
AddionalFilters []AddionalFiltersConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
type EmailConfig struct {
|
type EmailConfig struct {
|
||||||
|
|
Loading…
Reference in a new issue