-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(system-security): Optimized unauthenticated settings to enhance … #7532
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package res | ||
|
||
import "embed" | ||
|
||
//go:embed html/* | ||
var ErrorMsg embed.FS |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Access Temporarily Unavailable</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
text-align: center; | ||
background-color: #f9f9f9; | ||
margin: 0; | ||
padding: 0; | ||
color: #333; | ||
} | ||
.container { | ||
max-width: 600px; | ||
margin: 50px auto; | ||
padding: 20px; | ||
background: #fff; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
border-radius: 8px; | ||
} | ||
.icon img { | ||
width: 100px; | ||
height: auto; | ||
} | ||
h1 { | ||
font-size: 24px; | ||
color: #555; | ||
} | ||
p { | ||
font-size: 16px; | ||
color: #666; | ||
line-height: 1.5; | ||
} | ||
.command { | ||
font-family: monospace; | ||
background: #f0f0f0; | ||
padding: 5px 10px; | ||
border-radius: 4px; | ||
display: inline-block; | ||
margin-top: 10px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Access Temporarily Unavailable</h1> | ||
<p>The current environment has enabled secure login access.</p> | ||
<p>Run the following SSH command to view the panel login URL:</p> | ||
<p class="command">1pctl user-info</p> | ||
</div> | ||
</body> | ||
</html> | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Access Temporarily Unavailable</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
text-align: center; | ||
background-color: #f9f9f9; | ||
margin: 0; | ||
padding: 0; | ||
color: #333; | ||
} | ||
.container { | ||
max-width: 600px; | ||
margin: 50px auto; | ||
padding: 20px; | ||
background: #fff; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
border-radius: 8px; | ||
} | ||
.icon img { | ||
width: 100px; | ||
height: auto; | ||
} | ||
h1 { | ||
font-size: 24px; | ||
color: #555; | ||
} | ||
p { | ||
font-size: 16px; | ||
color: #666; | ||
line-height: 1.5; | ||
} | ||
.command { | ||
font-family: monospace; | ||
background: #f0f0f0; | ||
padding: 5px 10px; | ||
border-radius: 4px; | ||
display: inline-block; | ||
margin-top: 10px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Access Temporarily Unavailable</h1> | ||
<p>The current environment has enabled domain name binding.</p> | ||
<p>Run the following SSH command to reset the binding information:</p> | ||
<p class="command">1pctl reset domain</p> | ||
</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Access Temporarily Unavailable</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
text-align: center; | ||
background-color: #f9f9f9; | ||
margin: 0; | ||
padding: 0; | ||
color: #333; | ||
} | ||
.container { | ||
max-width: 600px; | ||
margin: 50px auto; | ||
padding: 20px; | ||
background: #fff; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
border-radius: 8px; | ||
} | ||
.icon img { | ||
width: 100px; | ||
height: auto; | ||
} | ||
h1 { | ||
font-size: 24px; | ||
color: #555; | ||
} | ||
p { | ||
font-size: 16px; | ||
color: #666; | ||
line-height: 1.5; | ||
} | ||
.command { | ||
font-family: monospace; | ||
background: #f0f0f0; | ||
padding: 5px 10px; | ||
border-radius: 4px; | ||
display: inline-block; | ||
margin-top: 10px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Access Temporarily Unavailable</h1> | ||
<p>The current environment has enabled authorized IP access.</p> | ||
<p>Run the following SSH command to reset the binding information:</p> | ||
<p class="command">1pctl reset ips</p> | ||
</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head><title>400 Bad Request</title></head> | ||
<body> | ||
<center><h1>400 Bad Request</h1></center> | ||
<hr><center>nginx</center> | ||
</body> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head><title>401 Unauthorized</title></head> | ||
<body> | ||
<center><h1>401 Unauthorized</h1></center> | ||
<hr><center>nginx</center> | ||
</body> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head><title>403 Forbidden</title></head> | ||
<body> | ||
<center><h1>403 Forbidden</h1></center> | ||
<hr><center>nginx</center> | ||
</body> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head><title>404 Not Found</title></head> | ||
<body> | ||
<center><h1>404 Not Found</h1></center> | ||
<hr><center>nginx</center> | ||
</body> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head><title>408 Request Timeout</title></head> | ||
<body> | ||
<center><h1>408 Request Timeout</h1></center> | ||
<hr><center>nginx</center> | ||
</body> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head><title>416 Requested Not Satisfiable</title></head> | ||
<body> | ||
<center><h1>416 Requested Not Satisfiable</h1></center> | ||
<hr><center>nginx</center> | ||
</body> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head><title>Internal Server Error</title></head> | ||
<body> | ||
<center><h1>Internal Server Error</h1></center> | ||
<hr><center>nginx</center> | ||
</body> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,105 @@ const ( | |
FilePerm = 0644 | ||
) | ||
|
||
var WebUrlMap = map[string]struct{}{ | ||
"/apps": {}, | ||
"/apps/all": {}, | ||
"/apps/installed": {}, | ||
"/apps/upgrade": {}, | ||
|
||
"/containers": {}, | ||
"/containers/container": {}, | ||
"/containers/image": {}, | ||
"/containers/network": {}, | ||
"/containers/volume": {}, | ||
"/containers/repo": {}, | ||
"/containers/compose": {}, | ||
"/containers/template": {}, | ||
"/containers/setting": {}, | ||
|
||
"/cronjobs": {}, | ||
|
||
"/databases": {}, | ||
"/databases/mysql": {}, | ||
"/databases/mysql/remote": {}, | ||
"/databases/postgresql": {}, | ||
"/databases/postgresql/remote": {}, | ||
"/databases/redis": {}, | ||
"/databases/redis/remote": {}, | ||
|
||
"/hosts": {}, | ||
"/hosts/files": {}, | ||
"/hosts/monitor/monitor": {}, | ||
"/hosts/monitor/setting": {}, | ||
"/hosts/terminal": {}, | ||
"/hosts/firewall/port": {}, | ||
"/hosts/firewall/forward": {}, | ||
"/hosts/firewall/ip": {}, | ||
"/hosts/process/process": {}, | ||
"/hosts/process/network": {}, | ||
"/hosts/ssh/ssh": {}, | ||
"/hosts/ssh/log": {}, | ||
"/hosts/ssh/session": {}, | ||
|
||
"/logs": {}, | ||
"/logs/operation": {}, | ||
"/logs/login": {}, | ||
"/logs/website": {}, | ||
"/logs/system": {}, | ||
"/logs/ssh": {}, | ||
|
||
"/settings": {}, | ||
"/settings/panel": {}, | ||
"/settings/backupaccount": {}, | ||
"/settings/license": {}, | ||
"/settings/about": {}, | ||
"/settings/safe": {}, | ||
"/settings/snapshot": {}, | ||
"/settings/expired": {}, | ||
|
||
"/toolbox": {}, | ||
"/toolbox/device": {}, | ||
"/toolbox/supervisor": {}, | ||
"/toolbox/clam": {}, | ||
"/toolbox/clam/setting": {}, | ||
"/toolbox/ftp": {}, | ||
"/toolbox/fail2ban": {}, | ||
"/toolbox/clean": {}, | ||
|
||
"/websites": {}, | ||
"/websites/ssl": {}, | ||
"/websites/runtimes/php": {}, | ||
"/websites/runtimes/node": {}, | ||
"/websites/runtimes/java": {}, | ||
"/websites/runtimes/go": {}, | ||
"/websites/runtimes/python": {}, | ||
"/websites/runtimes/dotnet": {}, | ||
|
||
"/login": {}, | ||
|
||
"/xpack": {}, | ||
"/xpack/waf/dashboard": {}, | ||
"/xpack/waf/global": {}, | ||
"/xpack/waf/websites": {}, | ||
"/xpack/waf/log": {}, | ||
"/xpack/waf/block": {}, | ||
"/xpack/monitor/dashboard": {}, | ||
"/xpack/monitor/setting": {}, | ||
"/xpack/monitor/rank": {}, | ||
"/xpack/monitor/log": {}, | ||
"/xpack/tamper": {}, | ||
"/xpack/gpu": {}, | ||
"/xpack/alert/dashboard": {}, | ||
"/xpack/alert/log": {}, | ||
"/xpack/alert/setting": {}, | ||
"/xpack/setting": {}, | ||
} | ||
|
||
var DynamicRoutes = []string{ | ||
`^/containers/composeDetail/[^/]+$`, | ||
`^/databases/mysql/setting/[^/]+/[^/]+$`, | ||
`^/databases/postgresql/setting/[^/]+/[^/]+$`, | ||
`^/websites/[^/]+/config/[^/]+$`, | ||
} | ||
|
||
var CertStore atomic.Value | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The provided code snippet appears to be part of an application configuration that manages various endpoints URLs. It seems there are some minor inconsistencies between the original and suggested versions, particularly concerning variable names. For example:
However, without seeing any specific discrepancies or actual problems with these definitions, it would be challenging to provide detailed suggestions about how to optimize this section of the code. Nonetheless, here's what I've found out based on my understanding at present:
Please review the documentation comments for any other potential issues you need guidance on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The given HTML code is not related to any programming code. It seems to be a layout with CSS styling applied on it and it's currently used in a webpage design only.
For checking the code differences:
As for potential issues:
run
could imply running commands in a terminal/bash-like manner, but this isn't specified here; it might need some clarification to avoid confusion.For optimization suggestions:
No changes suggested beyond those provided:
The provided information doesn't pertain to any software coding language nor specific programming tasks—it merely describes how the existing HTML template structure looks like now.