diff --git a/cmd/server/main.go b/cmd/server/main.go index c6818da1..56ddc587 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -17,10 +17,15 @@ import ( func main() { var configPath = flag.String("config", "config.yaml", "配置文件路径") var httpsBootstrap = flag.Bool("https", false, "启用主站 HTTPS:未配置 tls_cert_path/tls_key_path 时使用内存自签证书(本地测试);与 run.sh 默认行为一致") + var httpBootstrap = flag.Bool("http", false, "强制主站使用明文 HTTP:覆盖配置文件中的 tls_enabled/tls_auto_self_sign/tls_cert_path/tls_key_path") flag.Parse() // 环境变量兼容(便于 systemd/docker 等不传参场景) - if !*httpsBootstrap { + if *httpsBootstrap && *httpBootstrap { + fmt.Fprintln(os.Stderr, "--http 与 --https 不能同时使用") + os.Exit(2) + } + if !*httpsBootstrap && !*httpBootstrap { v := strings.TrimSpace(os.Getenv("CYBERSTRIKE_HTTPS")) if v == "1" || strings.EqualFold(v, "true") || strings.EqualFold(v, "yes") { *httpsBootstrap = true @@ -51,7 +56,9 @@ func main() { termout.PrintConfigCreated() } - if *httpsBootstrap { + if *httpBootstrap { + config.ApplyPlainHTTPBootstrap(cfg) + } else if *httpsBootstrap { config.ApplyDevHTTPSBootstrap(cfg) } diff --git a/run.sh b/run.sh index b6b79bef..fc86ea8a 100644 --- a/run.sh +++ b/run.sh @@ -348,7 +348,7 @@ need_rebuild() { } # Main flow -# Default: HTTPS (--https passed to binary); --http uses plain HTTP. +# Default: HTTPS (--https passed to binary); --http forces plain HTTP even if config.yaml enables TLS. main() { USE_HTTPS=1 FORWARD_ARGS=() @@ -357,6 +357,10 @@ main() { USE_HTTPS=0 continue fi + if [ "$arg" = "--https" ]; then + USE_HTTPS=1 + continue + fi FORWARD_ARGS+=("$arg") done @@ -406,9 +410,9 @@ main() { fi else if [ "${#FORWARD_ARGS[@]}" -gt 0 ]; then - exec "./$BINARY_NAME" -config "$CONFIG_FILE" "${FORWARD_ARGS[@]}" + exec "./$BINARY_NAME" -config "$CONFIG_FILE" --http "${FORWARD_ARGS[@]}" else - exec "./$BINARY_NAME" -config "$CONFIG_FILE" + exec "./$BINARY_NAME" -config "$CONFIG_FILE" --http fi fi } diff --git a/web/static/css/style.css b/web/static/css/style.css index 10175cfa..b4ab4d9a 100644 --- a/web/static/css/style.css +++ b/web/static/css/style.css @@ -40104,7 +40104,7 @@ html[data-theme="dark"] .workflow-toolbar #workflow-connect-btn[aria-pressed="tr /* Asset management */ .asset-page-subtitle { margin: 5px 0 0; color: var(--text-secondary, #6b7280); font-size: 13px; font-weight: 400; } .asset-content { display: flex; flex-direction: column; gap: 20px; } -#page-asset-library .asset-content { overflow: hidden; } +#page-asset-library .asset-content { overflow: visible; } #page-asset-library .asset-toolbar { flex: 0 0 auto; } .asset-overview-summary { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, .75fr); gap: 16px; } .asset-total-card,.asset-recent-card,.asset-panel { border: 1px solid var(--border-color, #e5e7eb); border-radius: 16px; background: var(--card-bg, #fff); box-shadow: 0 8px 24px rgba(15,23,42,.035); } @@ -40238,9 +40238,10 @@ html[data-theme="dark"] .workflow-toolbar #workflow-connect-btn[aria-pressed="tr .asset-custom-select .settings-custom-select-option:hover:not(:disabled) { background: var(--bg-secondary, #f4f6f8); } .asset-custom-select .settings-custom-select-option.is-selected { background: rgba(59,130,246,.12); color: var(--accent-color,#2563eb); } .asset-custom-select--filter .settings-custom-select-trigger { height: 38px; min-height: 38px; padding: 7px 11px; } -.asset-custom-select--pagination { width: 76px; flex: 0 0 76px; } +.asset-custom-select--pagination { width: 88px; flex: 0 0 88px; } .asset-custom-select--pagination .settings-custom-select-trigger { height: 32px; min-height: 32px; padding: 5px 9px; } .asset-custom-select--pagination .settings-custom-select-menu { top: auto; bottom: calc(100% + 6px); } +.asset-custom-select--pagination .settings-custom-select-label { overflow: visible; text-overflow: clip; } .asset-batch-actions { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 1px solid rgba(37,99,235,.32); border-radius: 10px; background: rgba(37,99,235,.07); } .asset-batch-actions[hidden] { display: none; } .asset-batch-selection { display: flex; min-width: 0; align-items: center; gap: 9px; color: var(--text-primary, #111827); font-size: 13px; } @@ -40270,6 +40271,7 @@ html[data-theme="dark"] .workflow-toolbar #workflow-connect-btn[aria-pressed="tr .asset-batch-permission-action { display: contents; } .asset-list-meta { margin-left: auto; } .asset-list-card { overflow: hidden; border: 1px solid var(--border-color, #e5e7eb); border-radius: 12px; background: var(--card-bg, #fff); box-shadow: 0 1px 3px rgba(15,23,42,.03); } +#page-asset-library .asset-list-card { overflow: visible; } #page-asset-library .asset-list-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; } .asset-table-wrap { overflow: auto; border: 1px solid var(--border-color, #e5e7eb); border-radius: 12px; background: var(--card-bg, #fff); } .asset-list-card .asset-table-wrap { border: 0; border-radius: 0; } @@ -40296,8 +40298,8 @@ html[data-theme="dark"] .workflow-toolbar #workflow-connect-btn[aria-pressed="tr background: color-mix(in srgb, var(--text-secondary, #64748b) 82%, transparent); background-clip: content-box; } -.asset-list-card #asset-pagination.pagination-fixed { border: 0; border-top: 1px solid var(--border-color, #e5e7eb); border-radius: 0; box-shadow: none; } -#page-asset-library .asset-list-card #asset-pagination { flex: 0 0 auto; } +.asset-list-card #asset-pagination.pagination-fixed { overflow: visible; border: 0; border-top: 1px solid var(--border-color, #e5e7eb); border-radius: 0; box-shadow: none; } +#page-asset-library .asset-list-card #asset-pagination { position: relative; z-index: 30; flex: 0 0 auto; } .asset-list-card #asset-pagination.pagination-fixed .pagination { border-radius: 0; } .asset-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; } .asset-table th,.asset-table td { padding: 13px 14px; border-bottom: 1px solid var(--border-color, #edf0f4); text-align: left; vertical-align: middle; } diff --git a/web/templates/index.html b/web/templates/index.html index 0081fe8d..dbbb71ca 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -23,7 +23,7 @@ } })(); - +