diff --git a/deploy/README.md b/deploy/README.md index 5a48c96..8ff850b 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -35,7 +35,16 @@ nginx -s stop \ ## Production 443 Proxy -For port 443, install `deploy/nginx.local-kanban.conf` into the system Nginx site directory and use a trusted certificate. The root domain serves the portal page, and individual apps keep their own ports: +For port 443, install `deploy/nginx.local-kanban.conf` into the system Nginx site directory and use a trusted certificate. The root domain serves the host-local service list from `/var/www/local-service-list`, and individual apps keep their own ports. The service-list HTML and CSS are maintained directly in that directory rather than copied from this repo. + +Before installing, make sure these files exist: + +```text +/var/www/local-service-list/index.html +/var/www/local-service-list/portal.css +``` + +Then install the Nginx configuration: ```bash sudo cp deploy/nginx.local-kanban.conf /etc/nginx/sites-available/local-kanban diff --git a/deploy/nginx.local-kanban.conf b/deploy/nginx.local-kanban.conf index fa3edf8..5c58c20 100644 --- a/deploy/nginx.local-kanban.conf +++ b/deploy/nginx.local-kanban.conf @@ -3,7 +3,7 @@ limit_req_zone $binary_remote_addr zone=kanban_login:10m rate=5r/m; server { listen 443 ssl http2; server_name gahow-pc.ipads-lab.se.sjtu.edu.cn; - root /var/www/local-kanban-portal; + root /var/www/local-service-list; index index.html; ssl_certificate /etc/nginx/certs/gahow-pc.fullchain.pem; diff --git a/portal/index.html b/portal/index.html deleted file mode 100644 index 8e147c9..0000000 --- a/portal/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - gahow-pc services - - - -
-
-
-

gahow-pc

-

Local services

-
-
- -
-
-

Services

-
- -
- -
- 后端 API - -
-
- - diff --git a/portal/portal.css b/portal/portal.css deleted file mode 100644 index 29f184a..0000000 --- a/portal/portal.css +++ /dev/null @@ -1,166 +0,0 @@ -:root { - color-scheme: light; - --bg: #f4f6f8; - --panel: #ffffff; - --ink: #17202c; - --muted: #697586; - --line: #d7dee8; - --accent: #2563eb; - --soft: #eef4ff; - --shadow: 0 16px 40px rgba(23, 32, 44, 0.08); -} - -* { - box-sizing: border-box; -} - -body { - margin: 0; - background: - radial-gradient(circle at 18% 10%, rgba(37, 99, 235, 0.12), transparent 28%), - radial-gradient(circle at 90% 18%, rgba(18, 128, 92, 0.11), transparent 26%), - var(--bg); - color: var(--ink); - font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -} - -.shell { - width: min(1180px, calc(100vw - 32px)); - margin: 0 auto; - padding: 42px 0 56px; -} - -.topbar { - margin-bottom: 30px; -} - -h1, -h2, -p { - margin: 0; -} - -h1 { - font-size: 34px; - line-height: 1.08; - letter-spacing: 0; -} - -h2 { - font-size: 14px; - margin-bottom: 0; - text-transform: uppercase; - color: var(--muted); -} - -.topbar p, -.service-desc { - color: var(--muted); -} - -.topbar p { - margin-top: 6px; -} - -.service-section { - margin-top: 18px; -} - -.section-heading { - display: flex; - align-items: baseline; - justify-content: space-between; - gap: 12px; - margin-bottom: 10px; -} - -.section-heading span { - color: var(--muted); -} - -.service-grid { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); - gap: 16px; -} - -.service-card, -.api-section { - background: var(--panel); - border: 1px solid var(--line); - border-radius: 8px; - box-shadow: var(--shadow); -} - -.service-card { - position: relative; - display: grid; - grid-template-columns: auto 1fr; - gap: 8px 14px; - min-height: 168px; - padding: 18px; - color: inherit; - text-decoration: none; - overflow: hidden; -} - -.service-card:hover { - border-color: var(--accent); - transform: translateY(-1px); -} - -.service-card.primary { - border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); -} - -.service-name { - grid-column: 1 / -1; - font-size: 22px; - font-weight: 700; -} - -.service-icon { - display: grid; - place-items: center; - width: 42px; - height: 42px; - border-radius: 8px; - background: var(--soft); - color: var(--accent); - font-weight: 800; -} - -.service-topline { - align-self: center; - color: var(--muted); - font-weight: 650; -} - -.service-desc { - grid-column: 1 / -1; -} - -.service-port { - grid-column: 1 / -1; - justify-self: start; - border-radius: 999px; - background: var(--soft); - color: #1849a9; - padding: 3px 9px; -} - -.api-section { - margin-top: 18px; - padding: 14px 16px; - box-shadow: none; -} - -.api-section summary { - cursor: pointer; - font-size: 15px; - font-weight: 700; -} - -.api-section .service-grid { - margin-top: 14px; -} diff --git a/scripts/install-nginx-system.sh b/scripts/install-nginx-system.sh index 7512e64..e89581f 100755 --- a/scripts/install-nginx-system.sh +++ b/scripts/install-nginx-system.sh @@ -8,18 +8,20 @@ ENABLE_HTTP_REDIRECT="${KANBAN_ENABLE_HTTP_REDIRECT:-0}" GITEA_PORT="${KANBAN_GITEA_PORT:-3443}" STOCK_FRONTEND_PORT="${KANBAN_STOCK_FRONTEND_PORT:-5443}" STOCK_API_PORT="${KANBAN_STOCK_API_PORT:-8788}" +SERVICE_LIST_ROOT="/var/www/local-service-list" if [[ "${EUID}" -ne 0 ]]; then exec sudo -E bash "$0" "$@" fi +if [[ ! -f "${SERVICE_LIST_ROOT}/index.html" || ! -f "${SERVICE_LIST_ROOT}/portal.css" ]]; then + echo "Missing local service list assets under ${SERVICE_LIST_ROOT}" >&2 + exit 1 +fi + mkdir -p /etc/nginx/certs -mkdir -p /var/www/local-kanban-portal cp "${ROOT_DIR}/deploy/certs/local-kanban.crt" /etc/nginx/certs/gahow-pc.fullchain.pem cp "${ROOT_DIR}/deploy/certs/local-kanban.key" /etc/nginx/certs/gahow-pc.key -cp "${ROOT_DIR}/portal/index.html" /var/www/local-kanban-portal/index.html -cp "${ROOT_DIR}/portal/portal.css" /var/www/local-kanban-portal/portal.css -rm -f /var/www/local-kanban-portal/portal.js chmod 600 /etc/nginx/certs/gahow-pc.key { @@ -43,7 +45,7 @@ cat <