mirror of
https://github.com/MengMengCode/CLICD.git
synced 2026-08-08 14:34:49 +08:00
Add custom image handling and access policy management
- Implement tests for custom KVM and LXC image creation, ensuring invalid sources and architecture mismatches are rejected. - Introduce access policy management in CLI, allowing configuration of allowed sources and trusted proxies. - Add NAT network configuration with validation for RFC1918 compliance and subnet parsing. - Create panel access policy management, including normalization and evaluation of access decisions based on client IPs and forwarded headers. - Develop middleware for enforcing access policies in the server, returning appropriate responses for allowed and denied requests. - Enhance custom image downloading and validation, ensuring integrity and security of downloaded root filesystem archives. - Include comprehensive tests for all new functionalities to ensure reliability and correctness.
This commit is contained in:
@@ -27,6 +27,7 @@ func main() {
|
||||
isServerMode := false
|
||||
isCliMode := false
|
||||
noWebAutostart := false
|
||||
isAccessPolicyCommand := len(os.Args) > 1 && os.Args[1] == "access-policy"
|
||||
for _, arg := range os.Args[1:] {
|
||||
if arg == "server" || arg == "-s" || arg == "--server" {
|
||||
isServerMode = true
|
||||
@@ -48,6 +49,14 @@ func main() {
|
||||
}
|
||||
_ = cfg
|
||||
|
||||
if isAccessPolicyCommand {
|
||||
if err := cli.RunAccessPolicyCommand(os.Args[2:]); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Access policy error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if isServerMode || (!isTerminal && !isCliMode) {
|
||||
installShutdownStateCapture()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user