refactor(auth): replace dashboard sessions with stateless tokens and session control (#6329)

* refactor(auth): replace dashboard sessions with stateless tokens

* feat(auth): harden session issuance and distributed enforcement

* fix(proxy): preserve trusted proxy compatibility defaults

* refactor: address dashboard auth review feedback

* refactor: remove classic frontend and flatten web app
This commit is contained in:
Calcium-Ion
2026-07-20 16:48:43 +08:00
committed by GitHub
parent 5a6c53d496
commit 31d70fca39
1605 changed files with 17511 additions and 147913 deletions
+11 -23
View File
@@ -1,8 +1,6 @@
WEB_DIR = ./web/default
WEB_CLASSIC_DIR = ./web/classic
WEB_DIR = ./web
API_DIR = .
DEV_WEB_DEFAULT_PORT ?= 5173
DEV_WEB_CLASSIC_PORT ?= 5174
DEV_WEB_PORT ?= 5173
DEV_COMPOSE_FILE = docker-compose.dev.yml
DEV_POSTGRES_SERVICE = postgres
DEV_API_SERVICE = new-api
@@ -10,21 +8,16 @@ DEV_POSTGRES_DB = new-api
DEV_POSTGRES_USER = root
DEV_SQLITE_PATH ?= one-api.db
.PHONY: all build-web build-web-classic build-all-web start-api dev dev-api dev-api-rebuild dev-web dev-web-classic reset-setup
.PHONY: all build-web build-all-web start-api dev dev-api dev-api-rebuild dev-web reset-setup
all: build-all-web start-api
build-web:
@echo "Building default web..."
@cd ./web && bun install --frozen-lockfile
@cd $(WEB_DIR) && DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(cat ../../VERSION) bun run build
@echo "Building web frontend..."
@cd $(WEB_DIR) && bun install --frozen-lockfile
@cd $(WEB_DIR) && DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$$(cat ../VERSION) bun run build
build-web-classic:
@echo "Building classic web..."
@cd ./web && bun install --frozen-lockfile
@cd $(WEB_CLASSIC_DIR) && VITE_REACT_APP_VERSION=$(cat ../../VERSION) bun run build
build-all-web: build-web build-web-classic
build-all-web: build-web
start-api:
@echo "Starting api dev server..."
@@ -39,15 +32,10 @@ dev-api-rebuild:
@docker compose -f $(DEV_COMPOSE_FILE) up -d --build $(DEV_API_SERVICE)
dev-web:
@echo "Starting default web dev server..."
@echo "Default web: http://localhost:$(DEV_WEB_DEFAULT_PORT)"
@cd ./web && bun install --filter ./default
@cd $(WEB_DIR) && bun run dev -- --host 0.0.0.0 --port $(DEV_WEB_DEFAULT_PORT)
dev-web-classic:
@echo "Starting classic web dev server..."
@cd ./web && bun install --filter ./classic
@cd $(WEB_CLASSIC_DIR) && bun run dev -- --host 0.0.0.0 --port $(DEV_WEB_CLASSIC_PORT)
@echo "Starting web frontend dev server..."
@echo "Web frontend: http://localhost:$(DEV_WEB_PORT)"
@cd $(WEB_DIR) && bun install
@cd $(WEB_DIR) && bun run dev -- --host 0.0.0.0 --port $(DEV_WEB_PORT)
dev: dev-api dev-web