Compare commits
12 Commits
v4.9.5
...
v4.8.19-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d82db01a9 | ||
|
|
80e670600b | ||
|
|
68f5afeba0 | ||
|
|
0d9f54cbf3 | ||
|
|
11cfe8a809 | ||
|
|
6f8c6b6ad1 | ||
|
|
f468ba2f30 | ||
|
|
19abfd1a3e | ||
|
|
ace304c619 | ||
|
|
923d0f85e9 | ||
|
|
62bcff2ff0 | ||
|
|
ec0cef09a2 |
30
.github/gh-bot.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
version: v1
|
||||||
|
debug: true
|
||||||
|
action:
|
||||||
|
printConfig: false
|
||||||
|
release:
|
||||||
|
retry: 15s
|
||||||
|
actionName: Release
|
||||||
|
allowOps:
|
||||||
|
- cuisongliu
|
||||||
|
bot:
|
||||||
|
prefix: /
|
||||||
|
spe: _
|
||||||
|
allowOps:
|
||||||
|
- sealos-ci-robot
|
||||||
|
- sealos-release-robot
|
||||||
|
email: sealos-ci-robot@sealos.io
|
||||||
|
username: sealos-ci-robot
|
||||||
|
repo:
|
||||||
|
org: false
|
||||||
|
|
||||||
|
message:
|
||||||
|
success: |
|
||||||
|
🤖 says: Hooray! The action {{.Body}} has been completed successfully. 🎉
|
||||||
|
format_error: |
|
||||||
|
🤖 says: ‼️ There is a formatting issue with the action, kindly verify the action's format.
|
||||||
|
permission_error: |
|
||||||
|
🤖 says: ‼️ The action doesn't have permission to trigger.
|
||||||
|
release_error: |
|
||||||
|
🤖 says: ‼️ Release action failed.
|
||||||
|
Error details: {{.Error}}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
yangchuansheng/fastgpt-imgs:
|
yangchuansheng/fastgpt-imgs:
|
||||||
- source: docSite/assets/imgs/
|
- source: docSite/assets/imgs/
|
||||||
dest: imgs/
|
dest: imgs/
|
||||||
deleteOrphaned: true
|
deleteOrphaned: true
|
||||||
96
.github/workflows/build-sandbox-image.yml
vendored
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
name: Build fastgpt-sandbox images
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'projects/sandbox/**'
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
jobs:
|
||||||
|
build-fastgpt-sandbox-images:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
# install env
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt update && sudo apt install -y nodejs npm
|
||||||
|
- name: Set up QEMU (optional)
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
driver-opts: network=host
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
|
# login docker
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GH_PAT }}
|
||||||
|
- name: Login to Ali Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: registry.cn-hangzhou.aliyuncs.com
|
||||||
|
username: ${{ secrets.ALI_HUB_USERNAME }}
|
||||||
|
password: ${{ secrets.ALI_HUB_PASSWORD }}
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_HUB_NAME }}
|
||||||
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
|
# Set tag
|
||||||
|
- name: Set image name and tag
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
||||||
|
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
||||||
|
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sandbox:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build and publish image for main branch or tag push event
|
||||||
|
env:
|
||||||
|
Git_Tag: ${{ env.Git_Tag }}
|
||||||
|
Git_Latest: ${{ env.Git_Latest }}
|
||||||
|
Ali_Tag: ${{ env.Ali_Tag }}
|
||||||
|
Ali_Latest: ${{ env.Ali_Latest }}
|
||||||
|
Docker_Hub_Tag: ${{ env.Docker_Hub_Tag }}
|
||||||
|
Docker_Hub_Latest: ${{ env.Docker_Hub_Latest }}
|
||||||
|
run: |
|
||||||
|
docker buildx build \
|
||||||
|
-f projects/sandbox/Dockerfile \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
|
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/fastgpt-sandbox" \
|
||||||
|
--label "org.opencontainers.image.description=fastgpt-sandbox image" \
|
||||||
|
--push \
|
||||||
|
--cache-from=type=local,src=/tmp/.buildx-cache \
|
||||||
|
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
||||||
|
-t ${Git_Tag} \
|
||||||
|
-t ${Git_Latest} \
|
||||||
|
-t ${Ali_Tag} \
|
||||||
|
-t ${Ali_Latest} \
|
||||||
|
-t ${Docker_Hub_Tag} \
|
||||||
|
-t ${Docker_Hub_Latest} \
|
||||||
|
.
|
||||||
21
.github/workflows/docs-deploy-kubeconfig.yml
vendored
@@ -6,17 +6,12 @@ on:
|
|||||||
- 'docSite/**'
|
- 'docSite/**'
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
|
tags:
|
||||||
|
- 'v*.*.*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-fastgpt-docs-images:
|
build-fastgpt-docs-images:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
attestations: write
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -34,6 +29,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
# list of Docker images to use as base name for tags
|
# list of Docker images to use as base name for tags
|
||||||
images: |
|
images: |
|
||||||
|
${{ secrets.DOCKER_HUB_NAME }}/fastgpt-docs
|
||||||
ghcr.io/${{ github.repository_owner }}/fastgpt-docs
|
ghcr.io/${{ github.repository_owner }}/fastgpt-docs
|
||||||
registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALI_HUB_USERNAME }}/fastgpt-docs
|
registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALI_HUB_USERNAME }}/fastgpt-docs
|
||||||
tags: |
|
tags: |
|
||||||
@@ -46,12 +42,18 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_HUB_NAME }}
|
||||||
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
- name: Login to ghcr.io
|
- name: Login to ghcr.io
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GH_PAT }}
|
||||||
|
|
||||||
- name: Login to Aliyun
|
- name: Login to Aliyun
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@@ -70,7 +72,6 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
outputs:
|
outputs:
|
||||||
tags: ${{ steps.datetime.outputs.datetime }}
|
tags: ${{ steps.datetime.outputs.datetime }}
|
||||||
|
|
||||||
update-docs-image:
|
update-docs-image:
|
||||||
needs: build-fastgpt-docs-images
|
needs: build-fastgpt-docs-images
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: Deploy doc image to cf
|
name: Deploy doc image to vercel
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -7,6 +7,8 @@ on:
|
|||||||
- 'docSite/**'
|
- 'docSite/**'
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
|
tags:
|
||||||
|
- 'v*.*.*'
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
jobs:
|
jobs:
|
||||||
@@ -20,11 +22,6 @@ jobs:
|
|||||||
# The type of runner that the job will run on
|
# The type of runner that the job will run on
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
|
|
||||||
# Job outputs
|
# Job outputs
|
||||||
outputs:
|
outputs:
|
||||||
docs: ${{ steps.filter.outputs.docs }}
|
docs: ${{ steps.filter.outputs.docs }}
|
||||||
@@ -61,11 +58,22 @@ jobs:
|
|||||||
|
|
||||||
# Step 4 - Builds the site using Hugo
|
# Step 4 - Builds the site using Hugo
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
|
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs && hugo -v --minify
|
||||||
|
|
||||||
|
# Step 5 - Push our generated site to Vercel
|
||||||
|
- name: Deploy to Vercel
|
||||||
|
uses: amondnet/vercel-action@v25
|
||||||
|
id: vercel-action
|
||||||
|
with:
|
||||||
|
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
|
||||||
|
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} #Required
|
||||||
|
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} #Required
|
||||||
|
github-comment: false
|
||||||
|
vercel-args: '--prod --local-config ../vercel.json' # Optional
|
||||||
|
working-directory: docSite/public
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GH_PAT }}
|
||||||
publish_dir: docSite/public
|
publish_dir: docSite/public
|
||||||
79
.github/workflows/docs-preview.yml
vendored
@@ -4,18 +4,14 @@ on:
|
|||||||
pull_request_target:
|
pull_request_target:
|
||||||
paths:
|
paths:
|
||||||
- 'docSite/**'
|
- 'docSite/**'
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
jobs:
|
jobs:
|
||||||
# This workflow contains jobs "deploy-production"
|
# This workflow contains jobs "deploy-production"
|
||||||
deploy-preview:
|
deploy-preview:
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
attestations: write
|
|
||||||
id-token: write
|
|
||||||
pull-requests: write
|
|
||||||
# The environment this job references
|
# The environment this job references
|
||||||
environment:
|
environment:
|
||||||
name: Preview
|
name: Preview
|
||||||
@@ -38,7 +34,6 @@ jobs:
|
|||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
submodules: recursive # Fetch submodules
|
submodules: recursive # Fetch submodules
|
||||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
# Step 2 Detect changes to Docs Content
|
# Step 2 Detect changes to Docs Content
|
||||||
- name: Detect changes in doc content
|
- name: Detect changes in doc content
|
||||||
@@ -50,6 +45,10 @@ jobs:
|
|||||||
- 'docSite/content/docs/**'
|
- 'docSite/content/docs/**'
|
||||||
base: main
|
base: main
|
||||||
|
|
||||||
|
- name: Add cdn for images
|
||||||
|
run: |
|
||||||
|
sed -i "s#\](/imgs/#\](https://cdn.jsdelivr.net/gh/yangchuansheng/fastgpt-imgs@main/imgs/#g" $(grep -rl "\](/imgs/" docSite/content/zh-cn/docs)
|
||||||
|
|
||||||
# Step 3 - Install Hugo (specific version)
|
# Step 3 - Install Hugo (specific version)
|
||||||
- name: Install Hugo
|
- name: Install Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v2
|
||||||
@@ -59,37 +58,41 @@ jobs:
|
|||||||
|
|
||||||
# Step 4 - Builds the site using Hugo
|
# Step 4 - Builds the site using Hugo
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
|
run: cd docSite && hugo mod get -u github.com/colinwilson/lotusdocs && hugo -v --minify
|
||||||
|
|
||||||
# Step 5 - Push our generated site to Cloudflare
|
# Step 5 - Push our generated site to Vercel
|
||||||
- name: Deploy to Cloudflare Pages
|
- name: Deploy to Vercel
|
||||||
id: deploy
|
uses: amondnet/vercel-action@v25
|
||||||
uses: cloudflare/wrangler-action@v3
|
id: vercel-action
|
||||||
with:
|
with:
|
||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} #Required
|
||||||
command: pages deploy ./docSite/public --project-name=fastgpt-doc
|
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} #Required
|
||||||
packageManager: npm
|
github-comment: false
|
||||||
|
vercel-args: '--local-config ../vercel.json' # Optional
|
||||||
- name: Create deployment status comment
|
working-directory: docSite/public
|
||||||
if: always()
|
alias-domains: | #Optional
|
||||||
|
fastgpt-staging.vercel.app
|
||||||
|
docsOutput:
|
||||||
|
needs: [deploy-preview]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
- name: Write md
|
||||||
|
run: |
|
||||||
|
echo "# 🤖 Generated by deploy action" > report.md
|
||||||
|
echo "[👀 Visit Preview](${{ needs.deploy-preview.outputs.url }})" >> report.md
|
||||||
|
cat report.md
|
||||||
|
- name: Gh Rebot for Sealos
|
||||||
|
uses: labring/gh-rebot@v0.0.6
|
||||||
|
if: ${{ (github.event_name == 'pull_request_target') }}
|
||||||
|
with:
|
||||||
|
version: v0.0.6
|
||||||
env:
|
env:
|
||||||
JOB_STATUS: ${{ job.status }}
|
GH_TOKEN: '${{ secrets.GH_PAT }}'
|
||||||
PREVIEW_URL: ${{ steps.deploy.outputs.deployment-url }}
|
SEALOS_TYPE: 'pr_comment'
|
||||||
uses: actions/github-script@v6
|
SEALOS_FILENAME: 'report.md'
|
||||||
with:
|
SEALOS_REPLACE_TAG: 'DEFAULT_REPLACE_DEPLOY'
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
script: |
|
|
||||||
const success = process.env.JOB_STATUS === 'success';
|
|
||||||
const deploymentUrl = `${process.env.PREVIEW_URL}`;
|
|
||||||
const status = success ? '✅ Success' : '❌ Failed';
|
|
||||||
console.log(process.env.JOB_STATUS);
|
|
||||||
|
|
||||||
const commentBody = `**Deployment Status: ${status}**
|
|
||||||
${success ? `🔗 Preview URL: ${deploymentUrl}` : ''}`;
|
|
||||||
|
|
||||||
await github.rest.issues.createComment({
|
|
||||||
...context.repo,
|
|
||||||
issue_number: context.payload.pull_request.number,
|
|
||||||
body: commentBody
|
|
||||||
});
|
|
||||||
|
|||||||
171
.github/workflows/fastgpt-build-image.yml
vendored
@@ -1,171 +0,0 @@
|
|||||||
name: Build FastGPT images
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- "projects/app/**"
|
|
||||||
- "packages/**"
|
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-fastgpt-images:
|
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
contents: read
|
|
||||||
attestations: write
|
|
||||||
id-token: write
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
sub_routes:
|
|
||||||
- repo: fastgpt
|
|
||||||
base_url: ""
|
|
||||||
- repo: fastgpt-sub-route
|
|
||||||
base_url: "/fastai"
|
|
||||||
- repo: fastgpt-sub-route-gchat
|
|
||||||
base_url: "/gchat"
|
|
||||||
archs:
|
|
||||||
- arch: amd64
|
|
||||||
- arch: arm64
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
runs-on: ${{ matrix.archs.runs-on || 'ubuntu-24.04' }}
|
|
||||||
steps:
|
|
||||||
# install env
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
driver-opts: network=host
|
|
||||||
|
|
||||||
- name: Cache Docker layers
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: /tmp/.buildx-cache
|
|
||||||
key: ${{ runner.os }}-${{ matrix.sub_routes.repo }}-buildx-${{ github.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-${{ matrix.sub_routes.repo }}-buildx-
|
|
||||||
|
|
||||||
# login docker
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Login to Ali Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: registry.cn-hangzhou.aliyuncs.com
|
|
||||||
username: ${{ secrets.ALI_HUB_USERNAME }}
|
|
||||||
password: ${{ secrets.ALI_HUB_PASSWORD }}
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_HUB_NAME }}
|
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build for ${{ matrix.archs.arch }}
|
|
||||||
id: build
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: projects/app/Dockerfile
|
|
||||||
platforms: linux/${{ matrix.archs.arch }}
|
|
||||||
build-args: |
|
|
||||||
${{ matrix.sub_routes.base_url && format('base_url={0}', matrix.sub_routes.base_url) || '' }}
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }}
|
|
||||||
org.opencontainers.image.description=${{ matrix.sub_routes.repo }} image
|
|
||||||
outputs: type=image,"name=ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }},${{ secrets.ALI_IMAGE_NAME }}/${{ matrix.sub_routes.repo }},${{ secrets.DOCKER_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}",push-by-digest=true,push=true
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
||||||
|
|
||||||
- name: Export digest
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ runner.temp }}/digests/${{ matrix.sub_routes.repo }}
|
|
||||||
digest="${{ steps.build.outputs.digest }}"
|
|
||||||
touch "${{ runner.temp }}/digests/${{ matrix.sub_routes.repo }}/${digest#sha256:}"
|
|
||||||
|
|
||||||
- name: Upload digest
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: digests-${{ matrix.sub_routes.repo }}-${{ github.sha }}-${{ matrix.archs.arch }}
|
|
||||||
path: ${{ runner.temp }}/digests/${{ matrix.sub_routes.repo }}/*
|
|
||||||
if-no-files-found: error
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
release-fastgpt-images:
|
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
contents: read
|
|
||||||
attestations: write
|
|
||||||
id-token: write
|
|
||||||
needs: build-fastgpt-images
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
sub_routes:
|
|
||||||
- repo: fastgpt
|
|
||||||
- repo: fastgpt-sub-route
|
|
||||||
- repo: fastgpt-sub-route-gchat
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Login to Ali Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: registry.cn-hangzhou.aliyuncs.com
|
|
||||||
username: ${{ secrets.ALI_HUB_USERNAME }}
|
|
||||||
password: ${{ secrets.ALI_HUB_PASSWORD }}
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_HUB_NAME }}
|
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Download digests
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: ${{ runner.temp }}/digests
|
|
||||||
pattern: digests-${{ matrix.sub_routes.repo }}-${{ github.sha }}-*
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Set image name and tag
|
|
||||||
run: |
|
|
||||||
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
|
||||||
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV
|
|
||||||
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV
|
|
||||||
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV
|
|
||||||
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV
|
|
||||||
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV
|
|
||||||
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }}:${{ github.ref_name }}" >> $GITHUB_ENV
|
|
||||||
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV
|
|
||||||
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:${{ github.ref_name }}" >> $GITHUB_ENV
|
|
||||||
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV
|
|
||||||
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:${{ github.ref_name }}" >> $GITHUB_ENV
|
|
||||||
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/${{ matrix.sub_routes.repo }}:latest" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Create manifest list and push
|
|
||||||
working-directory: ${{ runner.temp }}/digests
|
|
||||||
run: |
|
|
||||||
TAGS="$(echo -e "${Git_Tag}\n${Git_Latest}\n${Ali_Tag}\n${Ali_Latest}\n${Docker_Hub_Tag}\n${Docker_Hub_Latest}")"
|
|
||||||
for TAG in $TAGS; do
|
|
||||||
docker buildx imagetools create -t $TAG \
|
|
||||||
$(printf 'ghcr.io/${{ github.repository_owner }}/${{ matrix.sub_routes.repo }}@sha256:%s ' *)
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
@@ -9,11 +9,6 @@ on:
|
|||||||
- 'main'
|
- 'main'
|
||||||
jobs:
|
jobs:
|
||||||
build-fastgpt-images:
|
build-fastgpt-images:
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
contents: read
|
|
||||||
attestations: write
|
|
||||||
id-token: write
|
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
if: github.repository != 'labring/FastGPT'
|
if: github.repository != 'labring/FastGPT'
|
||||||
steps:
|
steps:
|
||||||
@@ -37,7 +32,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GH_PAT }}
|
||||||
- name: Set DOCKER_REPO_TAGGED based on branch or tag
|
- name: Set DOCKER_REPO_TAGGED based on branch or tag
|
||||||
run: |
|
run: |
|
||||||
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV
|
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV
|
||||||
258
.github/workflows/fastgpt-image.yml
vendored
Normal file
@@ -0,0 +1,258 @@
|
|||||||
|
name: Build FastGPT images
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'projects/app/**'
|
||||||
|
- 'packages/**'
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
jobs:
|
||||||
|
build-fastgpt-images:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
# install env
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt update && sudo apt install -y nodejs npm
|
||||||
|
- name: Set up QEMU (optional)
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
driver-opts: network=host
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
|
# login docker
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GH_PAT }}
|
||||||
|
- name: Login to Ali Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: registry.cn-hangzhou.aliyuncs.com
|
||||||
|
username: ${{ secrets.ALI_HUB_USERNAME }}
|
||||||
|
password: ${{ secrets.ALI_HUB_PASSWORD }}
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_HUB_NAME }}
|
||||||
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
|
# Set tag
|
||||||
|
- name: Set image name and tag
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
||||||
|
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV
|
||||||
|
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build and publish image for main branch or tag push event
|
||||||
|
env:
|
||||||
|
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
|
||||||
|
run: |
|
||||||
|
docker buildx build \
|
||||||
|
-f projects/app/Dockerfile \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
|
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \
|
||||||
|
--label "org.opencontainers.image.description=fastgpt image" \
|
||||||
|
--push \
|
||||||
|
--cache-from=type=local,src=/tmp/.buildx-cache \
|
||||||
|
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
||||||
|
-t ${Git_Tag} \
|
||||||
|
-t ${Git_Latest} \
|
||||||
|
-t ${Ali_Tag} \
|
||||||
|
-t ${Ali_Latest} \
|
||||||
|
-t ${Docker_Hub_Tag} \
|
||||||
|
-t ${Docker_Hub_Latest} \
|
||||||
|
.
|
||||||
|
build-fastgpt-images-sub-route:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
# install env
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt update && sudo apt install -y nodejs npm
|
||||||
|
- name: Set up QEMU (optional)
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
driver-opts: network=host
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
|
# login docker
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GH_PAT }}
|
||||||
|
- name: Login to Ali Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: registry.cn-hangzhou.aliyuncs.com
|
||||||
|
username: ${{ secrets.ALI_HUB_USERNAME }}
|
||||||
|
password: ${{ secrets.ALI_HUB_PASSWORD }}
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_HUB_NAME }}
|
||||||
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
|
# Set tag
|
||||||
|
- name: Set image name and tag
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
||||||
|
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route:latest" >> $GITHUB_ENV
|
||||||
|
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route:latest" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build and publish image for main branch or tag push event
|
||||||
|
env:
|
||||||
|
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
|
||||||
|
run: |
|
||||||
|
docker buildx build \
|
||||||
|
-f projects/app/Dockerfile \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
|
--build-arg base_url=/fastai \
|
||||||
|
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \
|
||||||
|
--label "org.opencontainers.image.description=fastgpt image" \
|
||||||
|
--push \
|
||||||
|
--cache-from=type=local,src=/tmp/.buildx-cache \
|
||||||
|
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
||||||
|
-t ${Git_Tag} \
|
||||||
|
-t ${Git_Latest} \
|
||||||
|
-t ${Ali_Tag} \
|
||||||
|
-t ${Ali_Latest} \
|
||||||
|
-t ${Docker_Hub_Tag} \
|
||||||
|
-t ${Docker_Hub_Latest} \
|
||||||
|
.
|
||||||
|
build-fastgpt-images-sub-route-gchat:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
# install env
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt update && sudo apt install -y nodejs npm
|
||||||
|
- name: Set up QEMU (optional)
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
driver-opts: network=host
|
||||||
|
- name: Cache Docker layers
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: /tmp/.buildx-cache
|
||||||
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
|
# login docker
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GH_PAT }}
|
||||||
|
- name: Login to Ali Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: registry.cn-hangzhou.aliyuncs.com
|
||||||
|
username: ${{ secrets.ALI_HUB_USERNAME }}
|
||||||
|
password: ${{ secrets.ALI_HUB_PASSWORD }}
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_HUB_NAME }}
|
||||||
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
|
# Set tag
|
||||||
|
- name: Set image name and tag
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
||||||
|
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||||
|
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sub-route-gchat:latest" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build and publish image for main branch or tag push event
|
||||||
|
env:
|
||||||
|
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
|
||||||
|
run: |
|
||||||
|
docker buildx build \
|
||||||
|
-f projects/app/Dockerfile \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
|
--build-arg base_url=/gchat \
|
||||||
|
--label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \
|
||||||
|
--label "org.opencontainers.image.description=fastgpt-sub-route-gchat image" \
|
||||||
|
--push \
|
||||||
|
--cache-from=type=local,src=/tmp/.buildx-cache \
|
||||||
|
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
||||||
|
-t ${Git_Tag} \
|
||||||
|
-t ${Git_Latest} \
|
||||||
|
-t ${Ali_Tag} \
|
||||||
|
-t ${Ali_Latest} \
|
||||||
|
-t ${Docker_Hub_Tag} \
|
||||||
|
-t ${Docker_Hub_Latest} \
|
||||||
|
.
|
||||||
32
.github/workflows/fastgpt-test.yaml
vendored
@@ -1,32 +0,0 @@
|
|||||||
name: 'FastGPT-Test'
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
# Required to checkout the code
|
|
||||||
contents: read
|
|
||||||
# Required to put a comment into the pull-request
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.pull_request.head.ref }}
|
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
||||||
- uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
- name: 'Install Deps'
|
|
||||||
run: pnpm install
|
|
||||||
- name: 'Test'
|
|
||||||
run: pnpm run test
|
|
||||||
- name: 'Report Coverage'
|
|
||||||
# Set if: always() to also generate the report if tests are failing
|
|
||||||
# Only works if you set `reportOnFailure: true` in your vite config as specified above
|
|
||||||
if: always()
|
|
||||||
uses: davelosert/vitest-coverage-report-action@v2
|
|
||||||
11
.github/workflows/helm-release.yaml
vendored
@@ -8,11 +8,6 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
helm:
|
helm:
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
contents: read
|
|
||||||
attestations: write
|
|
||||||
id-token: write
|
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -25,10 +20,10 @@ jobs:
|
|||||||
run: echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT
|
run: echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT
|
||||||
- name: Release Helm
|
- name: Release Helm
|
||||||
run: |
|
run: |
|
||||||
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io -u ${{ github.repository_owner }} --password-stdin
|
echo ${{ secrets.GH_PAT }} | helm registry login ghcr.io -u ${{ github.repository_owner }} --password-stdin
|
||||||
export APP_VERSION=${{ steps.vars.outputs.tag }}
|
export APP_VERSION=${{ steps.vars.outputs.tag }}
|
||||||
export HELM_VERSION=${{ steps.vars.outputs.tag }}
|
export HELM_VERSION=${{ steps.vars.outputs.tag }}
|
||||||
export HELM_REPO=ghcr.io/${{ github.repository_owner }}
|
export HELM_REPO=ghcr.io/${{ github.repository_owner }}
|
||||||
helm dependency update deploy/helm/fastgpt
|
helm dependency update files/helm/fastgpt
|
||||||
helm package deploy/helm/fastgpt --version ${HELM_VERSION}-helm --app-version ${APP_VERSION} -d bin
|
helm package files/helm/fastgpt --version ${HELM_VERSION}-helm --app-version ${APP_VERSION} -d bin
|
||||||
helm push bin/fastgpt-${HELM_VERSION}-helm.tgz oci://${HELM_REPO}
|
helm push bin/fastgpt-${HELM_VERSION}-helm.tgz oci://${HELM_REPO}
|
||||||
|
|||||||
@@ -1,17 +1,13 @@
|
|||||||
name: Preview FastGPT images
|
name: Preview FastGPT images
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
|
paths:
|
||||||
|
- 'projects/app/**'
|
||||||
|
- 'packages/**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
preview-fastgpt-images:
|
preview-fastgpt-images:
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
attestations: write
|
|
||||||
id-token: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -19,9 +15,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.ref }}
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
submodules: recursive # Fetch submodules
|
||||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -33,18 +28,15 @@ jobs:
|
|||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GH_PAT }}
|
||||||
|
|
||||||
- name: Set DOCKER_REPO_TAGGED based on branch or tag
|
- name: Set DOCKER_REPO_TAGGED based on branch or tag
|
||||||
run: |
|
run: |
|
||||||
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-pr:${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
|
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt-pr:${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build image for PR
|
- name: Build image for PR
|
||||||
env:
|
env:
|
||||||
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
|
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
|
||||||
@@ -59,13 +51,31 @@ jobs:
|
|||||||
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
--cache-to=type=local,dest=/tmp/.buildx-cache \
|
||||||
-t ${DOCKER_REPO_TAGGED} \
|
-t ${DOCKER_REPO_TAGGED} \
|
||||||
.
|
.
|
||||||
- uses: actions/github-script@v7
|
# Add write md step after build
|
||||||
|
- name: Write md
|
||||||
|
run: |
|
||||||
|
echo "# 🤖 Generated by deploy action" > report.md
|
||||||
|
echo "📦 Preview Image: \`${DOCKER_REPO_TAGGED}\`" >> report.md
|
||||||
|
cat report.md
|
||||||
|
|
||||||
|
- name: Gh Rebot for Sealos
|
||||||
|
uses: labring/gh-rebot@v0.0.6
|
||||||
|
if: ${{ (github.event_name == 'pull_request_target') }}
|
||||||
with:
|
with:
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
version: v0.0.6
|
||||||
script: |
|
env:
|
||||||
github.rest.issues.createComment({
|
GH_TOKEN: '${{ secrets.GH_PAT }}'
|
||||||
issue_number: context.issue.number,
|
SEALOS_TYPE: 'pr_comment'
|
||||||
owner: context.repo.owner,
|
SEALOS_FILENAME: 'report.md'
|
||||||
repo: context.repo.repo,
|
SEALOS_REPLACE_TAG: 'DEFAULT_REPLACE_DEPLOY'
|
||||||
body: 'Preview Image: `${{ env.DOCKER_REPO_TAGGED }}`'
|
|
||||||
})
|
helm-check:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Helm Check
|
||||||
|
run: |
|
||||||
|
helm dependency update files/helm/fastgpt
|
||||||
|
helm lint files/helm/fastgpt
|
||||||
|
helm package files/helm/fastgpt
|
||||||
151
.github/workflows/sandbox-build-image.yml
vendored
@@ -1,151 +0,0 @@
|
|||||||
name: Build fastgpt-sandbox images
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'projects/sandbox/**'
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
jobs:
|
|
||||||
build-fastgpt-sandbox-images:
|
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
contents: read
|
|
||||||
attestations: write
|
|
||||||
id-token: write
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- arch: amd64
|
|
||||||
- arch: arm64
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
runs-on: ${{ matrix.runs-on || 'ubuntu-24.04' }}
|
|
||||||
steps:
|
|
||||||
# install env
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
driver-opts: network=host
|
|
||||||
- name: Cache Docker layers
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: /tmp/.buildx-cache
|
|
||||||
key: ${{ runner.os }}-sandbox-buildx-${{ github.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-sandbox-buildx-
|
|
||||||
|
|
||||||
# login docker
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Login to Ali Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: registry.cn-hangzhou.aliyuncs.com
|
|
||||||
username: ${{ secrets.ALI_HUB_USERNAME }}
|
|
||||||
password: ${{ secrets.ALI_HUB_PASSWORD }}
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_HUB_NAME }}
|
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build for ${{ matrix.arch }}
|
|
||||||
id: build
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: projects/sandbox/Dockerfile
|
|
||||||
platforms: linux/${{ matrix.arch }}
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/fastgpt-sandbox
|
|
||||||
org.opencontainers.image.description=fastgpt-sandbox image
|
|
||||||
outputs: type=image,"name=ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox,${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sandbox,${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox",push-by-digest=true,push=true
|
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
||||||
|
|
||||||
- name: Export digest
|
|
||||||
run: |
|
|
||||||
mkdir -p ${{ runner.temp }}/digests
|
|
||||||
digest="${{ steps.build.outputs.digest }}"
|
|
||||||
touch "${{ runner.temp }}/digests/${digest#sha256:}"
|
|
||||||
|
|
||||||
- name: Upload digest
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: digests-fastgpt-sandbox-${{ github.sha }}-${{ matrix.arch }}
|
|
||||||
path: ${{ runner.temp }}/digests/*
|
|
||||||
if-no-files-found: error
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
release-fastgpt-sandbox-images:
|
|
||||||
permissions:
|
|
||||||
packages: write
|
|
||||||
contents: read
|
|
||||||
attestations: write
|
|
||||||
id-token: write
|
|
||||||
needs: build-fastgpt-sandbox-images
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Login to Ali Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: registry.cn-hangzhou.aliyuncs.com
|
|
||||||
username: ${{ secrets.ALI_HUB_USERNAME }}
|
|
||||||
password: ${{ secrets.ALI_HUB_PASSWORD }}
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_HUB_NAME }}
|
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Download digests
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: ${{ runner.temp }}/digests
|
|
||||||
pattern: digests-fastgpt-sandbox-${{ github.sha }}-*
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Set image name and tag
|
|
||||||
run: |
|
|
||||||
if [[ "${{ github.ref_name }}" == "main" ]]; then
|
|
||||||
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
|
||||||
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
|
||||||
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
|
||||||
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
|
||||||
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
|
||||||
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox:${{ github.ref_name }}" >> $GITHUB_ENV
|
|
||||||
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
|
||||||
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sandbox:${{ github.ref_name }}" >> $GITHUB_ENV
|
|
||||||
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
|
||||||
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox:${{ github.ref_name }}" >> $GITHUB_ENV
|
|
||||||
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Create manifest list and push
|
|
||||||
working-directory: ${{ runner.temp }}/digests
|
|
||||||
run: |
|
|
||||||
TAGS="$(echo -e "${Git_Tag}\n${Git_Latest}\n${Ali_Tag}\n${Ali_Latest}\n${Docker_Hub_Tag}\n${Docker_Hub_Latest}")"
|
|
||||||
for TAG in $TAGS; do
|
|
||||||
docker buildx imagetools create -t $TAG \
|
|
||||||
$(printf 'ghcr.io/${{ github.repository_owner }}/fastgpt-sandbox@sha256:%s ' *)
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
name: Sync images
|
name: Sync images
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request_target:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
@@ -15,6 +15,13 @@ jobs:
|
|||||||
sync:
|
sync:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
if: ${{ (github.event_name == 'pull_request_target') }}
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
@@ -25,4 +32,4 @@ jobs:
|
|||||||
CONFIG_PATH: .github/sync_imgs.yml
|
CONFIG_PATH: .github/sync_imgs.yml
|
||||||
ORIGINAL_MESSAGE: true
|
ORIGINAL_MESSAGE: true
|
||||||
SKIP_PR: true
|
SKIP_PR: true
|
||||||
COMMIT_EACH_FILE: false
|
COMMIT_EACH_FILE: false
|
||||||
1
.gitignore
vendored
@@ -44,4 +44,3 @@ files/helm/fastgpt/fastgpt-0.1.0.tgz
|
|||||||
files/helm/fastgpt/charts/*.tgz
|
files/helm/fastgpt/charts/*.tgz
|
||||||
|
|
||||||
tmp/
|
tmp/
|
||||||
coverage
|
|
||||||
|
|||||||
@@ -5,6 +5,4 @@ node_modules
|
|||||||
docSite/
|
docSite/
|
||||||
*.md
|
*.md
|
||||||
|
|
||||||
pnpm-lock.yaml
|
cl100l_base.ts
|
||||||
cl100l_base.ts
|
|
||||||
dict.json
|
|
||||||
7
.vscode/i18n-ally-custom-framework.yml
vendored
@@ -17,8 +17,15 @@ usageMatchRegex:
|
|||||||
# you can ignore it and use your own matching rules as well
|
# you can ignore it and use your own matching rules as well
|
||||||
- "[^\\w\\d]t\\(['\"`]({key})['\"`]"
|
- "[^\\w\\d]t\\(['\"`]({key})['\"`]"
|
||||||
- "[^\\w\\d]commonT\\(['\"`]({key})['\"`]"
|
- "[^\\w\\d]commonT\\(['\"`]({key})['\"`]"
|
||||||
|
# 支持 appT("your.i18n.keys")
|
||||||
|
- "[^\\w\\d]appT\\(['\"`]({key})['\"`]"
|
||||||
|
# 支持 datasetT("your.i18n.keys")
|
||||||
|
- "[^\\w\\d]datasetT\\(['\"`]({key})['\"`]"
|
||||||
- "[^\\w\\d]fileT\\(['\"`]({key})['\"`]"
|
- "[^\\w\\d]fileT\\(['\"`]({key})['\"`]"
|
||||||
|
- "[^\\w\\d]publishT\\(['\"`]({key})['\"`]"
|
||||||
- "[^\\w\\d]workflowT\\(['\"`]({key})['\"`]"
|
- "[^\\w\\d]workflowT\\(['\"`]({key})['\"`]"
|
||||||
|
- "[^\\w\\d]userT\\(['\"`]({key})['\"`]"
|
||||||
|
- "[^\\w\\d]chatT\\(['\"`]({key})['\"`]"
|
||||||
- "[^\\w\\d]i18nT\\(['\"`]({key})['\"`]"
|
- "[^\\w\\d]i18nT\\(['\"`]({key})['\"`]"
|
||||||
|
|
||||||
# A RegEx to set a custom scope range. This scope will be used as a prefix when detecting keys
|
# A RegEx to set a custom scope range. This scope will be used as a prefix when detecting keys
|
||||||
|
|||||||
39
.vscode/launch.json
vendored
@@ -1,39 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "Next.js: debug server-side",
|
|
||||||
"type": "node-terminal",
|
|
||||||
"request": "launch",
|
|
||||||
"command": "pnpm run dev",
|
|
||||||
"cwd": "${workspaceFolder}/projects/app"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Next.js: debug client-side",
|
|
||||||
"type": "chrome",
|
|
||||||
"request": "launch",
|
|
||||||
"url": "http://localhost:3000"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Next.js: debug client-side (Edge)",
|
|
||||||
"type": "msedge",
|
|
||||||
"request": "launch",
|
|
||||||
"url": "http://localhost:3000"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Next.js: debug full stack",
|
|
||||||
"type": "node-terminal",
|
|
||||||
"request": "launch",
|
|
||||||
"command": "pnpm run dev",
|
|
||||||
"cwd": "${workspaceFolder}/projects/app",
|
|
||||||
"skipFiles": ["<node_internals>/**"],
|
|
||||||
"serverReadyAction": {
|
|
||||||
"action": "debugWithEdge",
|
|
||||||
"killOnServerStop": true,
|
|
||||||
"pattern": "- Local:.+(https?://.+)",
|
|
||||||
"uriFormat": "%s",
|
|
||||||
"webRoot": "${workspaceFolder}/projects/app"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
2
.vscode/nextapi.code-snippets
vendored
@@ -58,7 +58,7 @@
|
|||||||
"body": [
|
"body": [
|
||||||
"import '@/pages/api/__mocks__/base';",
|
"import '@/pages/api/__mocks__/base';",
|
||||||
"import { root } from '@/pages/api/__mocks__/db/init';",
|
"import { root } from '@/pages/api/__mocks__/db/init';",
|
||||||
"import { getTestRequest } from '@fastgpt/service/test/utils'; ;",
|
"import { getTestRequest } from '@/test/utils';",
|
||||||
"import { AppErrEnum } from '@fastgpt/global/common/error/code/app';",
|
"import { AppErrEnum } from '@fastgpt/global/common/error/code/app';",
|
||||||
"import handler from './demo';",
|
"import handler from './demo';",
|
||||||
"",
|
"",
|
||||||
|
|||||||
4
.vscode/settings.json
vendored
@@ -27,5 +27,7 @@
|
|||||||
},
|
},
|
||||||
"markdown.copyFiles.destination": {
|
"markdown.copyFiles.destination": {
|
||||||
"/docSite/content/**/*": "${documentWorkspaceFolder}/docSite/assets/imgs/"
|
"/docSite/content/**/*": "${documentWorkspaceFolder}/docSite/assets/imgs/"
|
||||||
}
|
},
|
||||||
|
"markdown.copyFiles.overwriteBehavior": "nameIncrementally",
|
||||||
|
"markdown.copyFiles.transformPath": "const filename = uri.path.split('/').pop(); return `/imgs/${filename}`;"
|
||||||
}
|
}
|
||||||
30
README.md
@@ -10,7 +10,7 @@
|
|||||||
<a href="./README_ja.md">日语</a>
|
<a href="./README_ja.md">日语</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
FastGPT 是一个 AI Agent 构建平台,提供开箱即用的数据处理、模型调用等能力,同时可以通过 Flow 可视化进行工作流编排,从而实现复杂的应用场景!
|
FastGPT 是一个基于 LLM 大语言模型的知识库问答系统,提供开箱即用的数据处理、模型调用等能力。同时可以通过 Flow 可视化进行工作流编排,从而实现复杂的问答场景!
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -83,7 +83,6 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
|||||||
- [x] 统一查阅对话记录,并对数据进行标注
|
- [x] 统一查阅对话记录,并对数据进行标注
|
||||||
|
|
||||||
`6` 其他
|
`6` 其他
|
||||||
- [x] 可视化模型配置。
|
|
||||||
- [x] 支持语音输入和输出 (可配置语音输入语音回答)
|
- [x] 支持语音输入和输出 (可配置语音输入语音回答)
|
||||||
- [x] 模糊输入提示
|
- [x] 模糊输入提示
|
||||||
- [x] 模板市场
|
- [x] 模板市场
|
||||||
@@ -114,6 +113,16 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
|||||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
## 🏘️ 社区交流群
|
||||||
|
|
||||||
|
扫码加入飞书话题群:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
<a href="#readme">
|
||||||
|
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||||
|
</a>
|
||||||
|
|
||||||
## 🏘️ 加入我们
|
## 🏘️ 加入我们
|
||||||
|
|
||||||
我们正在寻找志同道合的小伙伴,加速 FastGPT 的发展。你可以通过 [FastGPT 2025 招聘](https://fael3z0zfze.feishu.cn/wiki/P7FOwEmPziVcaYkvVaacnVX1nvg)了解 FastGPT 的招聘信息。
|
我们正在寻找志同道合的小伙伴,加速 FastGPT 的发展。你可以通过 [FastGPT 2025 招聘](https://fael3z0zfze.feishu.cn/wiki/P7FOwEmPziVcaYkvVaacnVX1nvg)了解 FastGPT 的招聘信息。
|
||||||
@@ -123,26 +132,17 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
|||||||
- [Laf:3 分钟快速接入三方应用](https://github.com/labring/laf)
|
- [Laf:3 分钟快速接入三方应用](https://github.com/labring/laf)
|
||||||
- [Sealos:快速部署集群应用](https://github.com/labring/sealos)
|
- [Sealos:快速部署集群应用](https://github.com/labring/sealos)
|
||||||
- [One API:多模型管理,支持 Azure、文心一言等](https://github.com/songquanpeng/one-api)
|
- [One API:多模型管理,支持 Azure、文心一言等](https://github.com/songquanpeng/one-api)
|
||||||
|
- [TuShan:5 分钟搭建后台管理系统](https://github.com/msgbyte/tushan)
|
||||||
|
|
||||||
<a href="#readme">
|
<a href="#readme">
|
||||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
## 🌿 第三方生态
|
## 🌿 第三方生态
|
||||||
- [PPIO 派欧云:一键调用高性价比的开源模型 API 和 GPU 容器](https://ppinfra.com/user/register?invited_by=VITYVU&utm_source=github_fastgpt)
|
|
||||||
- [AI Proxy:国内模型聚合服务](https://sealos.run/aiproxy/?k=fastgpt-github/)
|
|
||||||
- [SiliconCloud (硅基流动) —— 开源模型在线体验平台](https://cloud.siliconflow.cn/i/TR9Ym0c4)
|
|
||||||
- [COW 个人微信/企微机器人](https://doc.tryfastgpt.ai/docs/use-cases/external-integration/onwechat/)
|
- [COW 个人微信/企微机器人](https://doc.tryfastgpt.ai/docs/use-cases/external-integration/onwechat/)
|
||||||
|
- [SiliconCloud (硅基流动) —— 开源模型在线体验平台](https://cloud.siliconflow.cn/i/TR9Ym0c4)
|
||||||
<a href="#readme">
|
|
||||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
|
||||||
</a>
|
|
||||||
|
|
||||||
## 🏘️ 社区交流群
|
|
||||||
|
|
||||||
扫码加入飞书话题群:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
<a href="#readme">
|
<a href="#readme">
|
||||||
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ Project tech stack: NextJs + TS + ChakraUI + MongoDB + PostgreSQL (PG Vector plu
|
|||||||
|
|
||||||
> When using [Sealos](https://sealos.io) services, there is no need to purchase servers or domain names. It supports high concurrency and dynamic scaling, and the database application uses the kubeblocks database, which far exceeds the simple Docker container deployment in terms of IO performance.
|
> When using [Sealos](https://sealos.io) services, there is no need to purchase servers or domain names. It supports high concurrency and dynamic scaling, and the database application uses the kubeblocks database, which far exceeds the simple Docker container deployment in terms of IO performance.
|
||||||
<div align="center">
|
<div align="center">
|
||||||
[](https://cloud.sealos.io/?openapp=system-fastdeploy%3FtemplateName%3Dfastgpt&uid=fnWRt09fZP)
|
[](https://cloud.sealos.io/?openapp=system-fastdeploy%3FtemplateName%3Dfastgpt)
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Give it a 2-4 minute wait after deployment as it sets up the database. Initially, it might be a too slow since we're using the basic settings.
|
Give it a 2-4 minute wait after deployment as it sets up the database. Initially, it might be a too slow since we're using the basic settings.
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
|||||||
|
|
||||||
- **⚡ デプロイ**
|
- **⚡ デプロイ**
|
||||||
|
|
||||||
[](https://cloud.sealos.io/?openapp=system-fastdeploy%3FtemplateName%3Dfastgpt&uid=fnWRt09fZP)
|
[](https://cloud.sealos.io/?openapp=system-fastdeploy%3FtemplateName%3Dfastgpt)
|
||||||
|
|
||||||
デプロイ 後、データベースをセットアップするので、2~4分待 ってください。基本設定 を 使 っているので、最初 は 少 し 遅 いかもしれません。
|
デプロイ 後、データベースをセットアップするので、2~4分待 ってください。基本設定 を 使 っているので、最初 は 少 し 遅 いかもしれません。
|
||||||
|
|
||||||
|
|||||||
26
SECURITY.md
@@ -1,26 +0,0 @@
|
|||||||
# 安全策略
|
|
||||||
|
|
||||||
## 漏洞报告
|
|
||||||
|
|
||||||
如果您发现了 FastGPT 的安全漏洞,请按照以下步骤进行报告:
|
|
||||||
|
|
||||||
1. **报告方式**
|
|
||||||
发送邮件至:yujinlong@sealos.io
|
|
||||||
请备注版本以及您的 GitHub 账号
|
|
||||||
|
|
||||||
3. **响应时间**
|
|
||||||
- 我们会在 48 小时内确认收到您的报告
|
|
||||||
- 一般在 3 个工作日内给出初步评估结果
|
|
||||||
|
|
||||||
4. **漏洞处理流程**
|
|
||||||
- 确认漏洞:我们会验证漏洞的存在性和影响范围
|
|
||||||
- 修复开发:针对已确认的漏洞进行修复
|
|
||||||
- 版本发布:在下一个版本更新中发布安全补丁
|
|
||||||
- 公开披露:在修复完成后,我们会在更新日志中公布相关信息
|
|
||||||
|
|
||||||
5. **注意事项**
|
|
||||||
- 在漏洞未修复前,请勿公开披露漏洞详情
|
|
||||||
- 我们欢迎负责任的漏洞披露
|
|
||||||
- 对于重大贡献者,我们会在项目致谢名单中提及
|
|
||||||
|
|
||||||
感谢您为 FastGPT 的安全性做出贡献!
|
|
||||||
@@ -1,202 +0,0 @@
|
|||||||
# 数据库的默认账号和密码仅首次运行时设置有效
|
|
||||||
# 如果修改了账号密码,记得改数据库和项目连接参数,别只改一处~
|
|
||||||
# 该配置文件只是给快速启动,测试使用。正式使用,记得务必修改账号密码,以及调整合适的知识库参数,共享内存等。
|
|
||||||
# 如何无法访问 dockerhub 和 git,可以用阿里云(阿里云没有arm包)
|
|
||||||
|
|
||||||
version: '3.3'
|
|
||||||
services:
|
|
||||||
# vector db
|
|
||||||
ob:
|
|
||||||
image: oceanbase/oceanbase-ce # docker hub
|
|
||||||
# image: quay.io/oceanbase/oceanbase-ce:4.3.5.1-101000042025031818 # 镜像
|
|
||||||
container_name: ob
|
|
||||||
restart: always
|
|
||||||
# ports: # 生产环境建议不要暴露
|
|
||||||
# - 2881:2881
|
|
||||||
networks:
|
|
||||||
- fastgpt
|
|
||||||
environment:
|
|
||||||
# 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
|
|
||||||
- OB_SYS_PASSWORD=obsyspassword
|
|
||||||
# 不同于传统数据库,OceanBase 数据库的账号包含更多字段,包括用户名、租户名和集群名。经典格式为“用户名@租户名#集群名”
|
|
||||||
# 比如用mysql客户端连接时,根据本文件的默认配置,应该指定 “-uroot@tenantname”
|
|
||||||
- OB_TENANT_NAME=tenantname
|
|
||||||
- OB_TENANT_PASSWORD=tenantpassword
|
|
||||||
# MODE分为MINI和NORMAL, 后者会最大程度使用主机资源
|
|
||||||
- MODE=NORMAL
|
|
||||||
- OB_SERVER_IP=127.0.0.1
|
|
||||||
# 更多环境变量配置见oceanbase官方文档: https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000002013494
|
|
||||||
volumes:
|
|
||||||
- ./ob/data:/root/ob
|
|
||||||
- ./ob/config:/root/.obd/cluster
|
|
||||||
- ./init.sql:/root/boot/init.d/init.sql
|
|
||||||
healthcheck:
|
|
||||||
# obclient -h127.0.0.1 -P2881 -uroot@tenantname -ptenantpassword -e "SELECT 1;"
|
|
||||||
test: ["CMD-SHELL", "obclient -h$OB_SERVER_IP -P2881 -uroot@$OB_TENANT_NAME -p$OB_TENANT_PASSWORD -e \"SELECT 1;\""]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 1000
|
|
||||||
start_period: 10s
|
|
||||||
mongo:
|
|
||||||
image: mongo:5.0.18 # dockerhub
|
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 # 阿里云
|
|
||||||
# image: mongo:4.4.29 # cpu不支持AVX时候使用
|
|
||||||
container_name: mongo
|
|
||||||
restart: always
|
|
||||||
# ports:
|
|
||||||
# - 27017:27017
|
|
||||||
networks:
|
|
||||||
- fastgpt
|
|
||||||
command: mongod --keyFile /data/mongodb.key --replSet rs0
|
|
||||||
environment:
|
|
||||||
- MONGO_INITDB_ROOT_USERNAME=myusername
|
|
||||||
- MONGO_INITDB_ROOT_PASSWORD=mypassword
|
|
||||||
volumes:
|
|
||||||
- ./mongo/data:/data/db
|
|
||||||
entrypoint:
|
|
||||||
- bash
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
openssl rand -base64 128 > /data/mongodb.key
|
|
||||||
chmod 400 /data/mongodb.key
|
|
||||||
chown 999:999 /data/mongodb.key
|
|
||||||
echo 'const isInited = rs.status().ok === 1
|
|
||||||
if(!isInited){
|
|
||||||
rs.initiate({
|
|
||||||
_id: "rs0",
|
|
||||||
members: [
|
|
||||||
{ _id: 0, host: "mongo:27017" }
|
|
||||||
]
|
|
||||||
})
|
|
||||||
}' > /data/initReplicaSet.js
|
|
||||||
# 启动MongoDB服务
|
|
||||||
exec docker-entrypoint.sh "$$@" &
|
|
||||||
|
|
||||||
# 等待MongoDB服务启动
|
|
||||||
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
|
|
||||||
echo "Waiting for MongoDB to start..."
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
|
|
||||||
# 执行初始化副本集的脚本
|
|
||||||
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
|
|
||||||
|
|
||||||
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
|
|
||||||
wait $$!
|
|
||||||
|
|
||||||
# fastgpt
|
|
||||||
sandbox:
|
|
||||||
container_name: sandbox
|
|
||||||
image: ghcr.io/labring/fastgpt-sandbox:v4.9.3 # git
|
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.3 # 阿里云
|
|
||||||
networks:
|
|
||||||
- fastgpt
|
|
||||||
restart: always
|
|
||||||
fastgpt:
|
|
||||||
container_name: fastgpt
|
|
||||||
image: ghcr.io/labring/fastgpt:v4.9.3 # git
|
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.3 # 阿里云
|
|
||||||
ports:
|
|
||||||
- 3000:3000
|
|
||||||
networks:
|
|
||||||
- fastgpt
|
|
||||||
depends_on:
|
|
||||||
mongo:
|
|
||||||
condition: service_started
|
|
||||||
ob:
|
|
||||||
condition: service_healthy
|
|
||||||
sandbox:
|
|
||||||
condition: service_started
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
|
|
||||||
- FE_DOMAIN=
|
|
||||||
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
|
|
||||||
- DEFAULT_ROOT_PSW=1234
|
|
||||||
# # AI Proxy 的地址,如果配了该地址,优先使用
|
|
||||||
# - AIPROXY_API_ENDPOINT=http://aiproxy:3000
|
|
||||||
# # AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
|
|
||||||
# - AIPROXY_API_TOKEN=aiproxy
|
|
||||||
# 模型中转地址(如果用了 AI Proxy,下面 2 个就不需要了,旧版 OneAPI 用户,使用下面的变量)
|
|
||||||
- # openai 基本地址,可用作中转。
|
|
||||||
- OPENAI_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
|
|
||||||
- # OpenAI API Key
|
|
||||||
- CHAT_API_KEY=sk-8990fa15a34b464a805237cfe9561f11
|
|
||||||
# 数据库最大连接数
|
|
||||||
- DB_MAX_LINK=30
|
|
||||||
# 登录凭证密钥
|
|
||||||
- TOKEN_KEY=any
|
|
||||||
# root的密钥,常用于升级时候的初始化请求
|
|
||||||
- ROOT_KEY=root_key
|
|
||||||
# 文件阅读加密
|
|
||||||
- FILE_TOKEN_KEY=filetoken
|
|
||||||
# MongoDB 连接参数. 用户名myusername,密码mypassword。
|
|
||||||
- MONGODB_URI=mongodb://myusername:mypassword@mongo:27017/fastgpt?authSource=admin
|
|
||||||
# OceanBase 向量库连接参数
|
|
||||||
- OCEANBASE_URL=mysql://root%40tenantname:tenantpassword@ob:2881/test
|
|
||||||
# sandbox 地址
|
|
||||||
- SANDBOX_URL=http://sandbox:3000
|
|
||||||
# 日志等级: debug, info, warn, error
|
|
||||||
- LOG_LEVEL=info
|
|
||||||
- STORE_LOG_LEVEL=warn
|
|
||||||
# 工作流最大运行次数
|
|
||||||
- WORKFLOW_MAX_RUN_TIMES=1000
|
|
||||||
# 批量执行节点,最大输入长度
|
|
||||||
- WORKFLOW_MAX_LOOP_TIMES=100
|
|
||||||
# 自定义跨域,不配置时,默认都允许跨域(多个域名通过逗号分割)
|
|
||||||
- ALLOWED_ORIGINS=
|
|
||||||
# 是否开启IP限制,默认不开启
|
|
||||||
- USE_IP_LIMIT=false
|
|
||||||
volumes:
|
|
||||||
- ./config.json:/app/data/config.json
|
|
||||||
|
|
||||||
# AI Proxy
|
|
||||||
aiproxy:
|
|
||||||
image: ghcr.io/labring/aiproxy:v0.1.5
|
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.1.3 # 阿里云
|
|
||||||
container_name: aiproxy
|
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
|
||||||
aiproxy_pg:
|
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
|
||||||
- fastgpt
|
|
||||||
environment:
|
|
||||||
# 对应 fastgpt 里的AIPROXY_API_TOKEN
|
|
||||||
- ADMIN_KEY=aiproxy
|
|
||||||
# 错误日志详情保存时间(小时)
|
|
||||||
- LOG_DETAIL_STORAGE_HOURS=1
|
|
||||||
# 数据库连接地址
|
|
||||||
- SQL_DSN=postgres://postgres:aiproxy@aiproxy_pg:5432/aiproxy
|
|
||||||
# 最大重试次数
|
|
||||||
- RETRY_TIMES=3
|
|
||||||
# 不需要计费
|
|
||||||
- BILLING_ENABLED=false
|
|
||||||
# 不需要严格检测模型
|
|
||||||
- DISABLE_MODEL_CONFIG=true
|
|
||||||
healthcheck:
|
|
||||||
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/status']
|
|
||||||
interval: 5s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 10
|
|
||||||
aiproxy_pg:
|
|
||||||
image: pgvector/pgvector:0.8.0-pg15 # docker hub
|
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
|
|
||||||
restart: unless-stopped
|
|
||||||
container_name: aiproxy_pg
|
|
||||||
volumes:
|
|
||||||
- ./aiproxy_pg:/var/lib/postgresql/data
|
|
||||||
networks:
|
|
||||||
- fastgpt
|
|
||||||
environment:
|
|
||||||
TZ: Asia/Shanghai
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_DB: aiproxy
|
|
||||||
POSTGRES_PASSWORD: aiproxy
|
|
||||||
healthcheck:
|
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres', '-d', 'aiproxy']
|
|
||||||
interval: 5s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 10
|
|
||||||
networks:
|
|
||||||
fastgpt:
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30;
|
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@ FROM hugomods/hugo:0.117.0 AS builder
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ADD ./docSite hugo
|
ADD ./docSite hugo
|
||||||
RUN cd /app/hugo && hugo mod get -u github.com/colinwilson/lotusdocs@6d0568e && hugo -v --minify
|
RUN cd /app/hugo && hugo mod get -u github.com/colinwilson/lotusdocs && hugo -v --minify
|
||||||
|
|
||||||
FROM fholzer/nginx-brotli:latest
|
FROM fholzer/nginx-brotli:latest
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 179 KiB |
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 229 KiB |
|
Before Width: | Height: | Size: 422 KiB |
|
Before Width: | Height: | Size: 235 KiB |
|
Before Width: | Height: | Size: 341 KiB |
|
Before Width: | Height: | Size: 212 KiB |
|
Before Width: | Height: | Size: 240 KiB |
|
Before Width: | Height: | Size: 342 KiB |
|
Before Width: | Height: | Size: 363 KiB |
|
Before Width: | Height: | Size: 348 KiB |
|
Before Width: | Height: | Size: 222 KiB |
|
Before Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 332 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 174 KiB |
|
Before Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 329 KiB |
|
Before Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 236 KiB |
|
Before Width: | Height: | Size: 146 KiB |
|
Before Width: | Height: | Size: 326 KiB |
|
Before Width: | Height: | Size: 321 KiB |
|
Before Width: | Height: | Size: 353 KiB |
|
Before Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 380 KiB |
|
Before Width: | Height: | Size: 393 KiB |
|
Before Width: | Height: | Size: 377 KiB |
|
Before Width: | Height: | Size: 257 KiB |
|
Before Width: | Height: | Size: 205 KiB |
|
Before Width: | Height: | Size: 221 KiB |
|
Before Width: | Height: | Size: 245 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 368 KiB |
|
Before Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 322 KiB |
|
Before Width: | Height: | Size: 323 KiB |
|
Before Width: | Height: | Size: 216 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 284 KiB |
|
Before Width: | Height: | Size: 294 KiB |
|
Before Width: | Height: | Size: 86 KiB |