Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit de5ba93

Browse files
committed
fix: 418 error
1 parent b3e236b commit de5ba93

File tree

10 files changed

+873
-882
lines changed

10 files changed

+873
-882
lines changed

.dockerignore

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
logs
2-
dist
3-
doc
4-
tmp
5-
node_modules
6-
.vscode
7-
.git
8-
.gitignore
9-
README.md
1+
logs
2+
dist
3+
doc
4+
tmp
5+
node_modules
6+
.vscode
7+
.git
8+
.gitignore
9+
README.md
1010
*.tar.gz

.env.example

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# API 服务使用的端口
2-
PORT = 8787
3-
# API 调用的前缀地址
4-
API_PREFIX = '/'
5-
# 作为调用 API 验证的 API Key
6-
API_KEY = 'dummy_key'
7-
# 向 DDG 发送请求失败的重试次数
8-
MAX_RETRY_COUNT = 3
9-
# 向 DDG 发送请求失败的重试延迟,单位 ms
1+
# API 服务使用的端口
2+
PORT = 8787
3+
# API 调用的前缀地址
4+
API_PREFIX = '/'
5+
# 作为调用 API 验证的 API Key
6+
API_KEY = 'dummy_key'
7+
# 向 DDG 发送请求失败的重试次数
8+
MAX_RETRY_COUNT = 3
9+
# 向 DDG 发送请求失败的重试延迟,单位 ms
1010
RETRY_DELAY = 5000

.github/workflows/docker-image.yml

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
1-
name: Build and Push Docker Image
2-
3-
on:
4-
push:
5-
branches:
6-
- master
7-
paths-ignore:
8-
- 'readme.md'
9-
- 'dist/index.js'
10-
workflow_dispatch:
11-
12-
env:
13-
GHCR_REPO: ghcr.io/leafmoes/ddg-chat
14-
DOCKER_HUB_REPO: leafmoes/ddg-chat
15-
16-
jobs:
17-
docker:
18-
runs-on: ubuntu-latest
19-
steps:
20-
- name: Checkout
21-
uses: actions/checkout@v2
22-
23-
- name: Set up QEMU
24-
uses: docker/setup-qemu-action@v3
25-
26-
- name: Set up Docker Buildx
27-
uses: docker/setup-buildx-action@v3
28-
29-
- name: Login to GitHub Container Registry
30-
uses: docker/login-action@v1
31-
with:
32-
registry: ghcr.io
33-
username: ${{ github.repository_owner }}
34-
password: ${{ secrets.GHCR_PAT }}
35-
36-
- name: Login to Docker Hub
37-
uses: docker/login-action@v2
38-
with:
39-
username: ${{ secrets.DOCKERHUB_USERNAME }}
40-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
41-
42-
- name: Get short SHA
43-
id: slug
44-
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"
45-
46-
- name: Build and push to GitHub Container Registry
47-
uses: docker/build-push-action@v6
48-
with:
49-
context: .
50-
platforms: linux/amd64,linux/arm64
51-
file: Dockerfile
52-
push: true
53-
tags: |
54-
${{ env.GHCR_REPO }}:latest
55-
${{ env.GHCR_REPO }}:${{ steps.slug.outputs.sha7 }}
56-
cache-from: type=gha
57-
cache-to: type=gha,mode=max
58-
59-
- name: Build and push to Docker Hub
60-
uses: docker/build-push-action@v6
61-
with:
62-
context: .
63-
platforms: linux/amd64,linux/arm64
64-
file: Dockerfile
65-
push: true
66-
tags: |
67-
${{ env.DOCKER_HUB_REPO }}:latest
68-
${{ env.DOCKER_HUB_REPO }}:${{ steps.slug.outputs.sha7 }}
69-
cache-from: type=gha
70-
cache-to: type=gha,mode=max
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'readme.md'
9+
- 'dist/index.js'
10+
workflow_dispatch:
11+
12+
env:
13+
GHCR_REPO: ghcr.io/leafmoes/ddg-chat
14+
DOCKER_HUB_REPO: leafmoes/ddg-chat
15+
16+
jobs:
17+
docker:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v3
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Login to GitHub Container Registry
30+
uses: docker/login-action@v1
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.repository_owner }}
34+
password: ${{ secrets.GHCR_PAT }}
35+
36+
- name: Login to Docker Hub
37+
uses: docker/login-action@v2
38+
with:
39+
username: ${{ secrets.DOCKERHUB_USERNAME }}
40+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
41+
42+
- name: Get short SHA
43+
id: slug
44+
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"
45+
46+
- name: Build and push to GitHub Container Registry
47+
uses: docker/build-push-action@v6
48+
with:
49+
context: .
50+
platforms: linux/amd64,linux/arm64
51+
file: Dockerfile
52+
push: true
53+
tags: |
54+
${{ env.GHCR_REPO }}:latest
55+
${{ env.GHCR_REPO }}:${{ steps.slug.outputs.sha7 }}
56+
cache-from: type=gha
57+
cache-to: type=gha,mode=max
58+
59+
- name: Build and push to Docker Hub
60+
uses: docker/build-push-action@v6
61+
with:
62+
context: .
63+
platforms: linux/amd64,linux/arm64
64+
file: Dockerfile
65+
push: true
66+
tags: |
67+
${{ env.DOCKER_HUB_REPO }}:latest
68+
${{ env.DOCKER_HUB_REPO }}:${{ steps.slug.outputs.sha7 }}
69+
cache-from: type=gha
70+
cache-to: type=gha,mode=max

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,5 @@ dist/README.md
171171

172172
.dev.vars
173173
.wrangler/
174-
175-
.vercel
174+
175+
.vercel

Dockerfile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM node:lts-alpine
2-
3-
WORKDIR /app
4-
5-
COPY package*.json ./
6-
7-
RUN npm ci --only=production
8-
9-
COPY . .
10-
11-
EXPOSE 8787
12-
13-
CMD ["npm", "start"]
1+
FROM node:lts-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm ci --only=production
8+
9+
COPY . .
10+
11+
EXPOSE 8787
12+
13+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)