Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
35c1d5e
fix channel affinity cache validation
z23cc May 11, 2026
65ff625
Merge remote-tracking branch 'upstream/main'
z23cc May 28, 2026
4135155
chore: default local docker deployment to new frontend
z23cc May 28, 2026
8b8052e
feat(nav): dynamic database-backed navigation system with multi-lingu…
z23cc May 29, 2026
f11f535
Merge remote-tracking branch 'upstream/main'
z23cc May 31, 2026
f2213df
fix: reuse upstream model fetch for channel preview
z23cc May 31, 2026
fc75746
fix: add claude opus 4-8 defaults
z23cc May 31, 2026
f52a7b3
fix: align classic playground route
z23cc May 31, 2026
1359d60
feat: 批量导入Claude渠道 & 默认渠道类型改为Anthropic
z23cc Jun 1, 2026
e67f912
chore: remove models UI from batch import dialog & optimize classic p…
z23cc Jun 1, 2026
1bc776e
perf: use native esbuild config for classic theme jsx transform to fi…
z23cc Jun 1, 2026
70c2398
perf: configure Bun GC limits & disable rollup cache to resolve Docke…
z23cc Jun 1, 2026
17dc5e5
ci: add GitHub Container Registry (GHCR) support to Docker workflows
z23cc Jun 1, 2026
0dec4d5
ci: remove all Docker Hub logins, tags, and manifest push steps to bu…
z23cc Jun 1, 2026
12dbd79
feat: improve classic channel quota controls
z23cc Jun 2, 2026
94c669d
feat: add channel preparation pool
z23cc Jun 2, 2026
68ca944
build: make docker local build theme-aware
z23cc Jun 2, 2026
7cf34db
build: lower docker frontend build heap
z23cc Jun 2, 2026
01bd116
build: reduce default frontend build heap
z23cc Jun 2, 2026
8fd6e31
feat: delete channel preparations after promotion
z23cc Jun 2, 2026
f8afb93
feat: add channel preparation auto promotion
z23cc Jun 2, 2026
d405a7c
fix: include existing groups in import dropdowns
z23cc Jun 2, 2026
e3f559f
feat: improve channel preparation auto promotion
z23cc Jun 3, 2026
de537f0
feat: add flexible auto promotion rules
z23cc Jun 3, 2026
1214534
feat: usage log Excel export and cost report (jspreadsheet)
z23cc Jun 3, 2026
7ef015c
feat: add classic batch key channel search
z23cc Jun 4, 2026
ce7ee00
feat: add hidden query key report
z23cc Jun 4, 2026
69823a9
fix: widen query key report layout
z23cc Jun 4, 2026
b504a10
Merge remote-tracking branch 'upstream/main' into merge/upstream-2026…
z23cc Jun 8, 2026
9af1e32
feat: enhance channel balance management
z23cc Jun 8, 2026
0c6c084
feat: add channel quota statistics
z23cc Jun 9, 2026
da5f5e4
fix: simplify channel quota statistics
z23cc Jun 9, 2026
e665bcc
fix: include channel preparations in query key report
z23cc Jun 9, 2026
3c6c970
fix: match channel preparation groups exactly
z23cc Jun 9, 2026
960347c
feat: add testing support to channel preparation pool
z23cc Jun 12, 2026
a0affe9
feat: add query key copy options
z23cc Jun 15, 2026
b6d774d
feat: add batch testing status for channel preparations
z23cc Jun 18, 2026
6cd7af9
feat: add query key status testing
z23cc Jun 18, 2026
df7c612
fix: set default batch test model
z23cc Jun 18, 2026
5c300e2
fix: stabilize channel testing and pricing
z23cc Jun 18, 2026
fb3f77a
fix(2fa): require account password for 2FA setup/enable/disable
Jun 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 33 additions & 20 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,25 @@ jobs:
echo "${TAG}" > VERSION
echo "Building tag: ${TAG} for ${{ matrix.arch }}"

- name: Normalize GHCR repository
run: echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
- name: Log in to GHCR
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (labels)
id: meta
uses: docker/metadata-action@v5
with:
images: calciumion/new-api
images: |
ghcr.io/${{ env.GHCR_REPOSITORY }}

- name: Build & push
id: build
Expand All @@ -81,8 +86,8 @@ jobs:
platforms: ${{ matrix.platform }}
push: true
tags: |
calciumion/new-api:${{ env.TAG }}-${{ matrix.arch }}
calciumion/new-api:latest-${{ matrix.arch }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }}-${{ matrix.arch }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:latest-${{ matrix.arch }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
Expand All @@ -93,13 +98,14 @@ jobs:
uses: sigstore/cosign-installer@v3

- name: Sign image with cosign
run: cosign sign --yes calciumion/new-api@${{ steps.build.outputs.digest }}
run: |
cosign sign --yes ghcr.io/${{ env.GHCR_REPOSITORY }}@${{ steps.build.outputs.digest }}

- name: Image summary
run: |
echo "### Docker Image Digest (${{ matrix.arch }})" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "calciumion/new-api:${TAG}-${{ matrix.arch }}" >> $GITHUB_STEP_SUMMARY
echo "ghcr.io/${{ env.GHCR_REPOSITORY }}:${TAG}-${{ matrix.arch }}" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.build.outputs.digest }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY

Expand All @@ -108,34 +114,41 @@ jobs:
needs: [build_single_arch]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
permissions:
packages: write
contents: read

steps:
- name: Set version
run: echo "TAG=${{ needs.build_single_arch.outputs.tag }}" >> $GITHUB_ENV

- name: Log in to Docker Hub
- name: Normalize GHCR repository
run: echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV

- name: Log in to GHCR
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create & push manifest (version)
- name: Create & push manifest (GHCR version)
run: |
docker buildx imagetools create \
-t calciumion/new-api:${TAG} \
calciumion/new-api:${TAG}-amd64 \
calciumion/new-api:${TAG}-arm64
-t ghcr.io/${GHCR_REPOSITORY}:${TAG} \
ghcr.io/${GHCR_REPOSITORY}:${TAG}-amd64 \
ghcr.io/${GHCR_REPOSITORY}:${TAG}-arm64

- name: Create & push manifest (latest)
- name: Create & push manifest (GHCR latest)
run: |
docker buildx imagetools create \
-t calciumion/new-api:latest \
calciumion/new-api:latest-amd64 \
calciumion/new-api:latest-arm64
-t ghcr.io/${GHCR_REPOSITORY}:latest \
ghcr.io/${GHCR_REPOSITORY}:latest-amd64 \
ghcr.io/${GHCR_REPOSITORY}:latest-arm64

- name: Manifest summary
run: |
echo "### Multi-arch Manifest" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
docker buildx imagetools inspect calciumion/new-api:${TAG} >> $GITHUB_STEP_SUMMARY
docker buildx imagetools inspect ghcr.io/${GHCR_REPOSITORY}:${TAG} >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
33 changes: 0 additions & 33 deletions .github/workflows/docker-image-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3

- name: Log in to Docker Hub
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to GHCR
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
Expand All @@ -67,7 +61,6 @@ jobs:
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
with:
images: |
calciumion/new-api
ghcr.io/${{ env.GHCR_REPOSITORY }}

- name: Build & push single-arch (to both registries)
Expand All @@ -78,8 +71,6 @@ jobs:
platforms: ${{ matrix.platform }}
push: true
tags: |
calciumion/new-api:alpha-${{ matrix.arch }}
calciumion/new-api:${{ steps.version.outputs.value }}-${{ matrix.arch }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:alpha-${{ matrix.arch }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ steps.version.outputs.value }}-${{ matrix.arch }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -93,14 +84,12 @@ jobs:

- name: Sign image with cosign
run: |
cosign sign --yes calciumion/new-api@${{ steps.build.outputs.digest }}
cosign sign --yes ghcr.io/${{ env.GHCR_REPOSITORY }}@${{ steps.build.outputs.digest }}

- name: Output digest
run: |
echo "### Docker Image Digest (${{ matrix.arch }})" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "calciumion/new-api:alpha-${{ matrix.arch }}" >> $GITHUB_STEP_SUMMARY
echo "ghcr.io/${{ env.GHCR_REPOSITORY }}:alpha-${{ matrix.arch }}" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.build.outputs.digest }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -128,26 +117,6 @@ jobs:
echo "value=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Log in to Docker Hub
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Create & push manifest (Docker Hub - alpha)
run: |
docker buildx imagetools create \
-t calciumion/new-api:alpha \
calciumion/new-api:alpha-amd64 \
calciumion/new-api:alpha-arm64

- name: Create & push manifest (Docker Hub - versioned alpha)
run: |
docker buildx imagetools create \
-t calciumion/new-api:${VERSION} \
calciumion/new-api:${VERSION}-amd64 \
calciumion/new-api:${VERSION}-arm64

- name: Log in to GHCR
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
Expand All @@ -173,7 +142,5 @@ jobs:
run: |
echo "### Multi-arch Manifest Digests" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
docker buildx imagetools inspect calciumion/new-api:alpha >> $GITHUB_STEP_SUMMARY
echo "---" >> $GITHUB_STEP_SUMMARY
docker buildx imagetools inspect ghcr.io/${GHCR_REPOSITORY}:alpha >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
48 changes: 30 additions & 18 deletions .github/workflows/docker-image-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
runs-on: ${{ matrix.runner }}

permissions:
packages: write
contents: read

steps:
Expand All @@ -43,21 +44,25 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Publishing version: $VERSION for ${{ matrix.arch }}"

- name: Normalize GHCR repository
run: echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
- name: Log in to GHCR
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (labels)
id: meta
uses: docker/metadata-action@v5
with:
images: |
calciumion/new-api
ghcr.io/${{ env.GHCR_REPOSITORY }}

- name: Build & push single-arch
uses: docker/build-push-action@v6
Expand All @@ -66,18 +71,21 @@ jobs:
platforms: ${{ matrix.platform }}
push: true
tags: |
calciumion/new-api:nightly-${{ matrix.arch }}
calciumion/new-api:${{ steps.version.outputs.value }}-${{ matrix.arch }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:nightly-${{ matrix.arch }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ steps.version.outputs.value }}-${{ matrix.arch }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
sbom: false

create_manifests:
name: Create multi-arch manifests (Docker Hub)
name: Create multi-arch manifests (Docker Hub + GHCR)
needs: [build_single_arch]
runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- name: Check out (shallow)
Expand All @@ -92,22 +100,26 @@ jobs:
echo "value=$VERSION" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Log in to Docker Hub
- name: Normalize GHCR repository
run: echo "GHCR_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV

- name: Log in to GHCR
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create & push manifest (Docker Hub - nightly)
- name: Create & push manifest (GHCR - nightly)
run: |
docker buildx imagetools create \
-t calciumion/new-api:nightly \
calciumion/new-api:nightly-amd64 \
calciumion/new-api:nightly-arm64
-t ghcr.io/${GHCR_REPOSITORY}:nightly \
ghcr.io/${GHCR_REPOSITORY}:nightly-amd64 \
ghcr.io/${GHCR_REPOSITORY}:nightly-arm64

- name: Create & push manifest (Docker Hub - versioned nightly)
- name: Create & push manifest (GHCR - versioned nightly)
run: |
docker buildx imagetools create \
-t calciumion/new-api:${VERSION} \
calciumion/new-api:${VERSION}-amd64 \
calciumion/new-api:${VERSION}-arm64
-t ghcr.io/${GHCR_REPOSITORY}:${VERSION} \
ghcr.io/${GHCR_REPOSITORY}:${VERSION}-amd64 \
ghcr.io/${GHCR_REPOSITORY}:${VERSION}-arm64
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ data/
.test
token_estimator_test.go
skills-lock.json
query-newapi/*
.playwright-mcp
32 changes: 18 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
FROM oven/bun:1@sha256:0733e50325078969732ebe3b15ce4c4be5082f18c4ac1a0f0ca4839c2e4e42a7 AS builder
FROM oven/bun:1@sha256:0733e50325078969732ebe3b15ce4c4be5082f18c4ac1a0f0ca4839c2e4e42a7 AS frontend-builder

WORKDIR /build/web
COPY web/package.json web/bun.lock ./
COPY web/default/package.json ./default/package.json
COPY web/classic/package.json ./classic/package.json
RUN bun install --frozen-lockfile
COPY ./web/default ./default
COPY ./VERSION /build/VERSION
RUN cd default && DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=$(cat /build/VERSION) bun run build

FROM oven/bun:1@sha256:0733e50325078969732ebe3b15ce4c4be5082f18c4ac1a0f0ca4839c2e4e42a7 AS builder-classic
ARG FRONTEND_THEME=all
ARG FRONTEND_BUILD_GC_HEAP_SIZE=536870912

WORKDIR /build/web
COPY web/package.json web/bun.lock ./
COPY web/default/package.json ./default/package.json
COPY web/classic/package.json ./classic/package.json
RUN bun install --frozen-lockfile

COPY ./web/default ./default
COPY ./web/classic ./classic
COPY ./VERSION /build/VERSION
RUN cd classic && VITE_REACT_APP_VERSION=$(cat /build/VERSION) bun run build
RUN set -eux; \
mkdir -p /build/web/default/dist /build/web/classic/dist; \
case "${FRONTEND_THEME}" in \
default) cd /build/web/default && DISABLE_ESLINT_PLUGIN='true' BUN_JSC_gcMaxHeapSize="${FRONTEND_BUILD_GC_HEAP_SIZE}" VITE_REACT_APP_VERSION="$(cat /build/VERSION)" bun --smol run build ;; \
classic) cd /build/web/classic && BUN_JSC_gcMaxHeapSize="${FRONTEND_BUILD_GC_HEAP_SIZE}" VITE_REACT_APP_VERSION="$(cat /build/VERSION)" bun --smol run build ;; \
all) cd /build/web/default && DISABLE_ESLINT_PLUGIN='true' BUN_JSC_gcMaxHeapSize="${FRONTEND_BUILD_GC_HEAP_SIZE}" VITE_REACT_APP_VERSION="$(cat /build/VERSION)" bun --smol run build && cd /build/web/classic && BUN_JSC_gcMaxHeapSize="${FRONTEND_BUILD_GC_HEAP_SIZE}" VITE_REACT_APP_VERSION="$(cat /build/VERSION)" bun --smol run build ;; \
"") ;; \
*) echo "Invalid FRONTEND_THEME: ${FRONTEND_THEME} (use default|classic|all, or empty to skip frontend build)" >&2; exit 1 ;; \
esac; \
if [ ! -f /build/web/default/dist/index.html ]; then printf '%s\n' '<!doctype html><html><head><title>frontend not built</title></head><body>frontend theme was not built in this image</body></html>' > /build/web/default/dist/index.html; fi; \
if [ ! -f /build/web/classic/dist/index.html ]; then printf '%s\n' '<!doctype html><html><head><title>frontend not built</title></head><body>frontend theme was not built in this image</body></html>' > /build/web/classic/dist/index.html; fi

FROM golang:1.26.1-alpine@sha256:2389ebfa5b7f43eeafbd6be0c3700cc46690ef842ad962f6c5bd6be49ed82039 AS builder2
ENV GO111MODULE=on CGO_ENABLED=0
Expand All @@ -34,8 +38,8 @@ ADD go.mod go.sum ./
RUN go mod download

COPY . .
COPY --from=builder /build/web/default/dist ./web/default/dist
COPY --from=builder-classic /build/web/classic/dist ./web/classic/dist
COPY --from=frontend-builder /build/web/default/dist ./web/default/dist
COPY --from=frontend-builder /build/web/classic/dist ./web/classic/dist
RUN go build -ldflags "-s -w -X 'github.com/QuantumNous/new-api/common.Version=$(cat VERSION)'" -o new-api

FROM debian:bookworm-slim@sha256:f06537653ac770703bc45b4b113475bd402f451e85223f0f2837acbf89ab020a
Expand Down
Loading
Loading