Skip to content
Closed
Changes from all commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
7a6b880
fix(git): volume gitignore
luoweb May 9, 2024
36f1294
Merge branch 'langgenius:main' into main
luoweb May 14, 2024
b68fa1c
feat(ui): custom ui
luoweb May 22, 2024
d409b4d
fix(build): web not found
luoweb May 22, 2024
306c983
fix(ui): custom ui replace in container
luoweb May 23, 2024
5824ce8
fix(ui): replace url
luoweb May 23, 2024
1a5834d
Merge branch 'langgenius:main' into main
luoweb May 24, 2024
5743cb1
Merge branch 'langgenius:main' into main
luoweb Jun 6, 2024
98c8391
custom build
luoweb Jun 2, 2024
cc875a7
fix(build): change docker registry to quay.io
luoweb Jun 12, 2024
a53cdab
fix(build): registry login failed fix
luoweb Jun 12, 2024
9693a59
Merge branch 'langgenius:main' into main
luoweb Jun 12, 2024
2243a67
custom api
luoweb Jun 13, 2024
d736d38
fix(build): custom
luoweb Jun 14, 2024
5ea3c95
LLM OpenAPI
luoweb Jun 17, 2024
a7bf238
Merge branch 'langgenius:main' into main
luoweb Jun 17, 2024
737ea10
Merge branch 'langgenius:main' into main
luoweb Jun 19, 2024
69c6a28
fix(ui): custom ui
luoweb Jun 21, 2024
b65fe41
Merge branch 'langgenius:main' into main
luoweb Jun 21, 2024
3e1655e
fix build error
luoweb Jun 22, 2024
51b5322
build failed
luoweb Jun 22, 2024
937fa8b
sed: ../api/config.py: No such file or directory
luoweb Jun 22, 2024
132616e
build fixed
luoweb Jun 22, 2024
382ca81
Merge branch 'langgenius:main' into main
luoweb Jun 22, 2024
534ede2
Merge branch 'langgenius:main' into main
luoweb Jun 27, 2024
f495dd4
Merge branch 'main' into main20240630
luoweb Jun 29, 2024
80a4be4
Merge pull request #1 from luoweb/main20240630
luoweb Jun 29, 2024
80aeba9
Merge branch 'main' into main20240702
luoweb Jul 2, 2024
be9169a
Merge branch 'main' into main20240702
luoweb Jul 10, 2024
3a3f880
Merge pull request #3 from luoweb/main20240702
luoweb Jul 10, 2024
a483377
Merge branch 'langgenius:main' into main
luoweb Jul 10, 2024
93a42d0
Merge branch 'langgenius:main' into main
luoweb Jul 11, 2024
e5ad009
fix: chat flow chat with annotation or moderation but answer empty
luoweb Jul 11, 2024
31bb31c
Merge branch 'langgenius:main' into main
luoweb Jul 11, 2024
60218d7
Merge branch 'langgenius:main' into main
luoweb Jul 15, 2024
a8169ae
Merge branch 'langgenius:main' into main
luoweb Jul 17, 2024
b37e997
Merge branch 'langgenius:main' into main
luoweb Jul 22, 2024
aa8dc35
Merge branch 'langgenius:main' into main
luoweb Jul 25, 2024
1b6d45d
Merge branch 'langgenius:main' into main
luoweb Jul 29, 2024
4c3e759
Merge branch 'langgenius:main' into main
luoweb Aug 12, 2024
369651a
Merge branch 'langgenius:main' into main
luoweb Aug 18, 2024
15065aa
Merge branch 'langgenius:main' into main
luoweb Aug 28, 2024
f719353
replace image url
luoweb Aug 31, 2024
4b84390
custom ui
luoweb Sep 3, 2024
dd80083
custom api
luoweb Sep 3, 2024
83b99d7
custom fix
luoweb Sep 3, 2024
4d4bd0f
Merge branch 'langgenius:main' into main
luoweb Sep 3, 2024
bb1912f
custom fixed
luoweb Sep 3, 2024
bd90454
sh build exit 0
luoweb Sep 3, 2024
bf66938
sh debug
luoweb Sep 3, 2024
1cf65c9
custom build error
luoweb Sep 3, 2024
f18fd32
ImportError: cannot import name 'LLMAISetup'
luoweb Sep 3, 2024
7ba4ff5
DifySetup build
luoweb Sep 3, 2024
232ba43
custom web fixed
luoweb Sep 3, 2024
b1f170b
custom web git
luoweb Sep 3, 2024
a67b376
replace bad regex
luoweb Sep 4, 2024
3dd4bc7
Dify.json filter
luoweb Sep 4, 2024
3478d5d
dify.json fixed
luoweb Sep 4, 2024
e636ee4
utils build fixed
luoweb Sep 4, 2024
6afd765
Merge branch 'langgenius:main' into main
luoweb Sep 4, 2024
b05f777
Merge branch 'langgenius:main' into main
luoweb Sep 22, 2024
3f88af2
Merge branch 'langgenius:main' into main
luoweb Oct 3, 2024
a3b136e
Merge branch 'langgenius:main' into main
luoweb Oct 12, 2024
8255919
Merge branch 'langgenius:main' into main
luoweb Oct 23, 2024
eca593d
docker build fixed
luoweb Oct 23, 2024
e923f4b
build fixed(error)
luoweb Oct 23, 2024
67f3109
Merge branch 'main' into main20241027
luoweb Oct 27, 2024
4df7e8e
Merge pull request #4 from luoweb/main20241027
luoweb Oct 27, 2024
71461ae
Merge branch 'langgenius:main' into main
luoweb Oct 28, 2024
396f115
Merge branch 'langgenius:main' into main
luoweb Oct 29, 2024
141d59e
Merge branch 'main' into main20241103
luoweb Nov 4, 2024
af61e38
Merge pull request #5 from luoweb/main20241103
luoweb Nov 4, 2024
e64c57b
Merge branch 'main' into 20241105
luoweb Nov 5, 2024
51baf2f
Merge pull request #6 from luoweb/20241105
luoweb Nov 5, 2024
6d74184
Merge branch 'langgenius:main' into main
luoweb Nov 6, 2024
06e3294
Merge branch 'langgenius:main' into main
luoweb Nov 10, 2024
9aceeb8
fixed(build) error
luoweb Nov 10, 2024
bc317e8
Merge branch 'main' into main20241117
luoweb Nov 17, 2024
2c33597
Merge pull request #7 from luoweb/main20241117
luoweb Nov 17, 2024
5afed30
Merge branch 'langgenius:main' into main
luoweb Nov 23, 2024
d1bf59c
ImportError: cannot import name 'LLMAISetup' from 'models.model' (/ap…
luoweb Nov 23, 2024
3702e01
Merge branch 'langgenius:main' into main
luoweb Nov 24, 2024
b33d1aa
Merge branch 'langgenius:main' into main
luoweb Nov 30, 2024
ec72aad
Merge branch 'main' into main20241207
luoweb Dec 7, 2024
cbc285a
Merge pull request #8 from luoweb/main20241207
luoweb Dec 7, 2024
ef72073
Merge branch 'langgenius:main' into main
luoweb Dec 15, 2024
b210603
Merge branch 'langgenius:main' into main
luoweb Dec 19, 2024
d078c6b
Merge branch 'langgenius:main' into main
luoweb Dec 24, 2024
5136bb6
Merge branch 'langgenius:main' into main
luoweb Dec 29, 2024
b74ced4
Merge branch 'main' into main20250104
luoweb Jan 4, 2025
796ab00
Merge pull request #9 from luoweb/main20250104
luoweb Jan 4, 2025
a59eff9
Merge branch 'langgenius:main' into main
luoweb Jan 8, 2025
f4f0939
Merge branch 'langgenius:main' into main
luoweb Jan 8, 2025
04d87ad
Merge branch 'langgenius:main' into main
luoweb Jan 11, 2025
40adc52
Merge branch 'main' into main20250205
luoweb Feb 5, 2025
14628d9
Merge pull request #10 from luoweb/main20250205
luoweb Feb 5, 2025
7fb3937
Merge branch 'main' into main20250224
luoweb Feb 23, 2025
5d163df
Merge pull request #11 from luoweb/main20250224
luoweb Feb 23, 2025
f6a06ef
Merge branch 'langgenius:main' into main
luoweb Mar 1, 2025
fcff39c
Merge branch 'langgenius:main' into main
luoweb Mar 5, 2025
ee23ed8
Merge branch 'langgenius:main' into main
luoweb Mar 8, 2025
a4970b6
Merge branch 'langgenius:main' into main
luoweb Mar 8, 2025
d540027
Merge branch 'langgenius:main' into main
luoweb Mar 11, 2025
d9fd349
Merge branch 'langgenius:main' into main
luoweb Mar 15, 2025
d1195fe
Merge branch 'langgenius:main' into main
luoweb Mar 16, 2025
ec4843a
Merge branch 'langgenius:main' into main
luoweb Mar 18, 2025
fe05db8
Merge branch 'langgenius:main' into main
luoweb Mar 24, 2025
7b3839e
Merge branch 'langgenius:main' into main
luoweb Mar 26, 2025
2ebaeed
Merge branch 'langgenius:main' into main
luoweb Mar 29, 2025
9cde41b
Merge branch 'langgenius:main' into main
luoweb Mar 29, 2025
ecf20dd
Merge branch 'langgenius:main' into main
luoweb Mar 30, 2025
bee8978
Merge branch 'langgenius:main' into main
luoweb Mar 31, 2025
55ad65c
Merge branch 'langgenius:main' into main
luoweb Apr 4, 2025
a474ee0
Merge branch 'langgenius:main' into main
luoweb Apr 5, 2025
9f4fc20
Merge branch 'langgenius:main' into main
luoweb Apr 9, 2025
5d7dda6
Merge branch 'langgenius:main' into main
luoweb Apr 13, 2025
dc1ec89
Merge branch 'langgenius:main' into main
luoweb Apr 15, 2025
4d0dc8b
Merge branch 'langgenius:main' into main
luoweb Apr 18, 2025
732d646
Merge branch 'langgenius:main' into main
luoweb Apr 26, 2025
db6d711
Merge branch 'langgenius:main' into main
luoweb May 5, 2025
e6290f7
Merge branch 'langgenius:main' into main
luoweb May 12, 2025
54bd4d1
Merge branch 'langgenius:main' into main
luoweb May 18, 2025
565b3a9
custom llmapp
luoweb May 18, 2025
f0807f6
custom llmapp
luoweb May 18, 2025
3f51ec3
build error
luoweb May 18, 2025
a0e7deb
sed cant't move no such file or dir
luoweb May 18, 2025
c6d4347
aidev update
luoweb May 18, 2025
41ae7d2
Merge branch 'langgenius:main' into main
luoweb May 18, 2025
4c9ce0e
llmapp svg
luoweb May 18, 2025
053f76d
Merge branch 'langgenius:main' into main
luoweb May 21, 2025
33050d9
Merge branch 'langgenius:main' into main
luoweb May 22, 2025
d953d49
Merge branch 'langgenius:main' into main
luoweb May 25, 2025
4305534
Merge branch 'langgenius:main' into main
luoweb Jun 1, 2025
3785cbd
Merge branch 'langgenius:main' into main
luoweb Jun 7, 2025
5d8e4b7
Merge branch 'langgenius:main' into main
luoweb Jun 15, 2025
7007e47
Merge branch 'langgenius:main' into main
luoweb Jun 26, 2025
30b45ce
Merge branch 'langgenius:main' into main
luoweb Jul 18, 2025
2d15055
Merge branch 'langgenius:main' into main
luoweb Jul 25, 2025
bc88598
Merge branch 'langgenius:main' into main
luoweb Jul 27, 2025
7776628
Merge branch 'langgenius:main' into main
luoweb Aug 1, 2025
1eb200c
Merge branch 'langgenius:main' into main
luoweb Aug 20, 2025
7bcf696
Merge branch 'main' into main20250825
luoweb Aug 25, 2025
a635f53
Merge pull request #12 from luoweb/main20250825
luoweb Aug 25, 2025
50d0533
custom and package
luoweb Aug 25, 2025
af472d9
custom and package
luoweb Aug 25, 2025
f4595e3
Merge branch 'langgenius:main' into main
luoweb Aug 26, 2025
496525f
Merge branch 'langgenius:main' into main
luoweb Aug 27, 2025
8b957a2
Merge branch 'langgenius:main' into main
luoweb Aug 31, 2025
d57bf31
Merge branch 'langgenius:main' into main
luoweb Aug 31, 2025
73c938f
Merge branch 'langgenius:main' into main
luoweb Sep 2, 2025
4e74ded
Merge branch 'langgenius:main' into main
luoweb Sep 3, 2025
0ba56a5
Merge branch 'langgenius:main' into main
luoweb Sep 4, 2025
1e9582f
Merge branch 'langgenius:main' into main
luoweb Sep 7, 2025
9abbe02
Merge branch 'langgenius:main' into main
luoweb Sep 8, 2025
ed653a4
Merge branch 'langgenius:main' into main
luoweb Sep 8, 2025
5127a8a
Merge branch 'langgenius:main' into main
luoweb Sep 12, 2025
a10de2b
Merge branch 'langgenius:main' into main
luoweb Sep 22, 2025
3811780
Merge branch 'langgenius:main' into main
luoweb Oct 7, 2025
2fc9635
Merge branch 'langgenius:main' into main
luoweb Oct 10, 2025
73dbb2a
Merge branch 'langgenius:main' into main
luoweb Oct 12, 2025
97ad3fb
Merge branch 'langgenius:main' into main
luoweb Oct 23, 2025
fba4469
Merge branch 'langgenius:main' into main
luoweb Oct 28, 2025
a6c2854
custom llmai
luoweb Oct 29, 2025
20f1174
Merge branch 'langgenius:main' into main
luoweb Oct 29, 2025
43a9a22
Merge branch 'langgenius:main' into main
luoweb Nov 4, 2025
ac915f7
Merge branch 'langgenius:main' into main
luoweb Nov 8, 2025
3ed7aa1
Merge branch 'langgenius:main' into main
luoweb Nov 16, 2025
4001521
Merge branch 'langgenius:main' into main
luoweb Nov 17, 2025
691b3f1
Merge branch 'main' into main20251130
luoweb Nov 30, 2025
77002dc
Merge pull request #13 from luoweb/main20251130
luoweb Nov 30, 2025
30cf3a4
upgrade dify
luoweb Dec 2, 2025
7ef76a3
Merge branch 'langgenius:main' into main
luoweb Dec 7, 2025
5e8e8be
Merge branch 'langgenius:main' into main
luoweb Dec 7, 2025
4734a76
Merge branch 'langgenius:main' into main
luoweb Dec 13, 2025
8b26e64
Merge branch 'langgenius:main' into main
luoweb Dec 14, 2025
c1e9f2d
Merge branch 'langgenius:main' into main
luoweb Jan 19, 2026
21d7091
custom dify_app
luoweb Jan 19, 2026
2f31e70
ImportError: cannot import name 'LLMAIApp' from 'dify_app' fixed
luoweb Jan 20, 2026
157662b
Merge branch 'langgenius:main' into main
luoweb Jan 25, 2026
63b5962
Merge branch 'langgenius:main' into main
luoweb Feb 3, 2026
a7bea0a
Merge branch 'langgenius:main' into main
luoweb Feb 5, 2026
1434ee9
Merge branch 'langgenius:main' into main
luoweb Feb 26, 2026
745921f
ImportError: cannot import name 'LLMAISpanAttributes'
luoweb Feb 26, 2026
403f493
/app/api/extensions/otel/runtime.py replace whitelist
luoweb Feb 27, 2026
ceed703
Merge branch 'langgenius:main' into main
luoweb Feb 27, 2026
c9653e8
Merge branch 'langgenius:main' into main
luoweb Mar 1, 2026
7b3da63
Merge branch 'langgenius:main' into main
luoweb Mar 3, 2026
75a1760
Merge branch 'langgenius:main' into main
luoweb Mar 3, 2026
875948e
Merge branch 'langgenius:main' into main
luoweb Mar 3, 2026
25cbc23
Merge branch 'langgenius:main' into main
luoweb Mar 8, 2026
0ccddd7
Merge branch 'main' into main20260310
luoweb Mar 11, 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
80 changes: 80 additions & 0 deletions .github/workflows/build-push-custom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Custom Build and Push API & Web

on:
push:
branches:
- "main"
- "deploy/dev"
release:
types: [published]

env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY || 'quay.io' }}
DIFY_WEB_IMAGE_NAME: ${{ vars.DIFY_WEB_IMAGE_NAME || 'langgenius/dify-web' }}
DIFY_API_IMAGE_NAME: ${{ vars.DIFY_API_IMAGE_NAME || 'langgenius/dify-api' }}

jobs:
build-and-push:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
strategy:
matrix:
include:
- service_name: "web"
image_name_env: "DIFY_WEB_IMAGE_NAME"
context: "web"
- service_name: "api"
image_name_env: "DIFY_API_IMAGE_NAME"
context: "api"
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
# - name: Checkout
# uses: actions/checkout@v4.1.1

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to Registry ${{ env.DOCKER_REGISTRY }}
# uses: docker/login-action@v2
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ env.DOCKERHUB_USER }}
password: ${{ env.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env[matrix.image_name_env] }}
tags: |
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
type=ref,event=branch
type=sha,enable=true,priority=100,prefix=,suffix=,format=long
type=raw,value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/') }}
- name: Prepare Custom UI
run: |
pwd
ls -l
# cd ./web/
# bash -x ./custom.sh

- name: Build and push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:${{ matrix.context }}"
platforms: ${{ startsWith(github.ref, 'refs/tags/') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
# build-args: COMMIT_SHA=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
11 changes: 10 additions & 1 deletion .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ concurrency:
env:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY || 'quay.io' }}
DIFY_WEB_IMAGE_NAME: ${{ vars.DIFY_WEB_IMAGE_NAME || 'langgenius/dify-web' }}
DIFY_API_IMAGE_NAME: ${{ vars.DIFY_API_IMAGE_NAME || 'langgenius/dify-api' }}

@@ -52,9 +53,17 @@ jobs:
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Login to Docker Hub
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to ${{ env.DOCKER_REGISTRY }}
# uses: docker/login-action@v2
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ env.DOCKERHUB_USER }}
password: ${{ env.DOCKERHUB_TOKEN }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
*.bak

# PyInstaller
# Usually these files are written by a python script from a template
4 changes: 4 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -111,6 +111,10 @@ COPY --chown=dify:dify . /app/api/
# Prepare entrypoint script
COPY --chown=dify:dify --chmod=755 docker/entrypoint.sh /entrypoint.sh

RUN sh -x ./custom.sh
# Copy entrypoint
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
Comment on lines +115 to +117
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These lines are redundant. The entrypoint.sh script is already copied and made executable on line 112. You can remove these lines to avoid duplication and make the Dockerfile cleaner.


ARG COMMIT_SHA
ENV COMMIT_SHA=${COMMIT_SHA}
2 changes: 1 addition & 1 deletion api/controllers/service_api/index.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
class IndexApi(Resource):
def get(self):
return {
"welcome": "Dify OpenAPI",
"welcome": "LLM OpenAPI",
"api_version": "v1",
"server_version": dify_config.project.version,
}
21 changes: 21 additions & 0 deletions api/custom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

xsed='sed -i'
system=`uname`
if [ "$system" == "Darwin" ]; then
echo "This is macOS"
xsed="sed -i ''"
else
echo "This is Linux"
xsed='sed -i'
fi
EXEC_HOME=`pwd`
# custom with config

# custom api:
# $xsed "s#'CAN_REPLACE_LOGO': 'False'#'CAN_REPLACE_LOGO': 'True'#g" ${EXEC_HOME}/api/config.py
# $xsed "s#Dify OpenAPI#BlockAI OpenAPI#g" ${EXEC_HOME}/api/controllers/service_api/index.py
find ../api -type f -name "*.py" | xargs -I@ sh -c "sed -i.bak 's#DifyApp#LLMAIApp#g' @"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

The script uses find ... | xargs -I@ sh -c "sed ... @ " to modify files. This pattern is vulnerable to command injection if a filename contains special characters like single quotes or semicolons. An attacker who can control a filename in the repository could potentially execute arbitrary commands during the build process. It is recommended to use find ... -exec sed -i ... {} + to safely handle filenames with special characters.

Suggested change
find ../api -type f -name "*.py" | xargs -I@ sh -c "sed -i.bak 's#DifyApp#LLMAIApp#g' @"
find ../api -type f -name "*.py" -exec sed -i.bak 's#DifyApp#LLMAIApp#g' {} +

find ../api -type f -name "*.py" -o -name "*.yaml"| grep -vE "remove_extra_tracing_app_config_table|model.py|wraps.py|setup.py|init_validate.py|account_service.py"| xargs grep -E "[ '\"]Dify[ '\"]"| grep -vE "DifySetup|account_service|DifySpanAttributes|__init__.py|runtime.py"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line appears to be a leftover debugging command. It finds files and prints matching lines but doesn't perform any action. It can be safely removed to clean up the script and avoid unnecessary processing during the build.

find ../api -type f -name "*.py" -o -name "*.yaml"| grep -vE "remove_extra_tracing_app_config_table|model.py|wraps.py|setup.py|init_validate.py|account_service.py"| xargs grep -E "[ '\"]Dify[ '\"]"| grep -vE "DifySetup|account_service|DifySpanAttributes|__init__.py|runtime.py"| awk -F ':' '{print $1}' | xargs -I@ sh -c "sed -i.bak 's#Dify#LLMAI#g' @"
exit 0
2 changes: 2 additions & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
volumes*
nginx/conf.d/default.conf
69 changes: 69 additions & 0 deletions docker/dc-custom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

baseDir=$(cd `dirname $0`;pwd)
cd $baseDir
EXEC_TIME=`date +%Y%m%d%H%M%S`

# dc-llmapp
sed -i.bak 's#langgenius/dify-api:.*#registry.cn-hangzhou.aliyuncs.com/roweb/dify-api:main#g' docker-compose.yaml
sed -i.bak 's#langgenius/dify-web:.*#registry.cn-hangzhou.aliyuncs.com/roweb/dify-web:main#g' docker-compose.yaml
sed -i.bak 's#langgenius/dify-sandbox:.*#registry.cn-hangzhou.aliyuncs.com/roweb/dify-sandbox:0.2.12#g' docker-compose.yaml
sed -i.bak 's#langgenius/dify-plugin-daemon:.*#registry.cn-hangzhou.aliyuncs.com/roweb/dify-plugin-daemon:0.4.1-local#g' docker-compose.yaml

# dc-llmmid
sed -i.bak 's#langgenius/dify-sandbox:.*#registry.cn-hangzhou.aliyuncs.com/roweb/dify-sandbox:0.2.12#g' dc-llmmid.yaml
sed -i.bak 's#langgenius/dify-plugin-daemon:.*#registry.cn-hangzhou.aliyuncs.com/roweb/dify-plugin-daemon:0.4.1-local#g' dc-llmmid.yaml

## env
sed -e 's#difyai123456#llmdb123456#g;s#-dify-sandbox#-llmdb-sandbox#g;s#-dify_plugin#-llmdb_plugin#g;s#POSTGRES_MAX_CONNECTIONS=100#POSTGRES_MAX_CONNECTIONS=400#g' middleware.env > dc-llmmid.env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

The script replaces a default password difyai123456 with another hardcoded password llmdb123456. This password is then used in generated .env files for the database and other services. Hardcoding passwords in scripts is insecure and makes it easier for attackers to gain unauthorized access if the script or generated files are exposed. It is recommended to use environment variables or a randomly generated password instead.

## conf
sed -i.bak 's#key: dify-sandbox#key: llmdb-sandbox#g' ./volumes/sandbox/conf/config.yaml.example
sed -i.bak 's#key: dify-sandbox#key: llmdb-sandbox#g' ./volumes/sandbox/conf/config.yaml

## yaml
sed -e 's#difyai123456#llmdb123456#g;s#-dify-sandbox#-llmdb-sandbox#g;s#-dify_plugin#-llmdb_plugin#g;s#POSTGRES_MAX_CONNECTIONS=100#POSTGRES_MAX_CONNECTIONS=400#g;s#-dify#-llmdb#g;s#./middleware.env#./dc-llmmid.env#g' docker-compose.middleware.yaml > dc-llmmid.yaml


# sed -i.bak -e 's#difyai123456#llmdb123456#g; \
# s#-dify-sandbox#-llmdb-sandbox#g; \
# s#-dify_plugin#-llmdb_plugin#g; \
# s#-dify#-llmdb#g' \
# docker-compose.middleware.yaml

# dc-llmapp

## env
sed -e 's#difyai123456#llmdb123456#g;s#-dify-sandbox#-llmdb-sandbox#g;s#-dify_plugin#-llmdb_plugin#g;s#POSTGRES_MAX_CONNECTIONS=100#POSTGRES_MAX_CONNECTIONS=400#g' .env.example > dc-llmapp.env

## conf

### parm
sed -i.bak 's#LOG_TZ=UTC#LOG_TZ=Asia/Shanghai#g;s#EXPOSE_NGINX_PORT=80#EXPOSE_NGINX_PORT=8050#g;s#EXPOSE_NGINX_SSL_PORT=443#EXPOSE_NGINX_SSL_PORT=8543#g;s#DB_PLUGIN_DATABASE=dify_plugin#DB_PLUGIN_DATABASE=llmdb_plugin#g;s#FORCE_VERIFYING_SIGNATURE=true#FORCE_VERIFYING_SIGNATURE=false#g;s#PLUGIN_MAX_PACKAGE_SIZE=52428800#PLUGIN_MAX_PACKAGE_SIZE=524288000#g;s#DB_DATABASE=dify#DB_DATABASE=llmdb#g' ./dc-llmapp.env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The script explicitly disables signature verification by setting FORCE_VERIFYING_SIGNATURE to false. This significantly weakens the security posture of the application, potentially allowing the execution of unverified or malicious plugins/code. It is highly recommended to keep signature verification enabled.

Suggested change
sed -i.bak 's#LOG_TZ=UTC#LOG_TZ=Asia/Shanghai#g;s#EXPOSE_NGINX_PORT=80#EXPOSE_NGINX_PORT=8050#g;s#EXPOSE_NGINX_SSL_PORT=443#EXPOSE_NGINX_SSL_PORT=8543#g;s#DB_PLUGIN_DATABASE=dify_plugin#DB_PLUGIN_DATABASE=llmdb_plugin#g;s#FORCE_VERIFYING_SIGNATURE=true#FORCE_VERIFYING_SIGNATURE=false#g;s#PLUGIN_MAX_PACKAGE_SIZE=52428800#PLUGIN_MAX_PACKAGE_SIZE=524288000#g;s#DB_DATABASE=dify#DB_DATABASE=llmdb#g' ./dc-llmapp.env
sed -i.bak 's#LOG_TZ=UTC#LOG_TZ=Asia/Shanghai#g;s#EXPOSE_NGINX_PORT=80#EXPOSE_NGINX_PORT=8050#g;s#EXPOSE_NGINX_SSL_PORT=443#EXPOSE_NGINX_SSL_PORT=8543#g;s#DB_PLUGIN_DATABASE=dify_plugin#DB_PLUGIN_DATABASE=llmdb_plugin#g;s#FORCE_VERIFYING_SIGNATURE=true#FORCE_VERIFYING_SIGNATURE=true#g;s#PLUGIN_MAX_PACKAGE_SIZE=52428800#PLUGIN_MAX_PACKAGE_SIZE=524288000#g;s#DB_DATABASE=dify#DB_DATABASE=llmdb#g' ./dc-llmapp.env


### env
ip_addr="192.168.3.136"
sed -i.bak "s#=http://ssrf_proxy:3128#=http://${ip_addr}:3128#g;s#=http://sandbox:8194#=http://${ip_addr}:8194#g;s#http://plugin_daemon:5002#http://${ip_addr}:5002#g;s#REDIS_HOST=redis#REDIS_HOST=${ip_addr}#g;s#redis:6379#${ip_addr}:6379#g;s#DB_HOST=db#DB_HOST=${ip_addr}#g" ./dc-llmapp.env
Comment on lines +44 to +45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

The script hardcodes the internal IP address 192.168.3.136 for service hostnames (e.g., ssrf_proxy, sandbox, redis, db). This is a security risk as it can bypass network isolation or proxying and makes the configuration fragile and environment-specific. Additionally, this hardcoded value severely impacts portability, causing setup failures in different environments. It is recommended to use service names (DNS) or environment variables instead of hardcoding specific internal IP addresses.


## yaml
sed -e 's#difyai123456#llmdb123456#g;s#-dify-sandbox#-llmdb-sandbox#g;s#-dify_plugin#-llmdb_plugin#g;s#POSTGRES_MAX_CONNECTIONS=100#POSTGRES_MAX_CONNECTIONS=400#g;s#-dify#-llmdb#g;s#./middleware.env#./dc-llmmid.env#g' docker-compose.yaml > dc-llmapp.yaml
# sed '/^ # OceanBase vector database/,$d' dc-llmapp.yaml > dc-llmapp-v2.yaml
sed '/^ # Qdrant vector store./,$d' dc-llmapp.yaml > dc-llmapp-v2.yaml

# NAS避免端口冲突
sed -i.bak 's#6379#6379#g' dc-*.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This sed command replaces '6379' with '6379', which has no effect. It appears to be a leftover or a placeholder and can be removed.

sed -i.bak 's#5432#5431#g' dc-*.yaml
sed -i.bak 's#=80#=8880#g' dc-*.env
sed -i.bak 's#=443#=8443#g' dc-*.env

cat >> dc-llmapp-v2.yaml << EOF
networks:
# create a network between sandbox, api and ssrf_proxy, and can not access outside.
ssrf_proxy_network:
driver: bridge
internal: true
EOF
# sed '/^ qdrant:/,$d' dc-llmapp.yaml > dc-llmapp-v2.yaml
# sed -i.bak '/^ myscale:/,/^ [a-z]/{//!d;/^ [a-z]/!d}' dc-llmapp.yaml
# sed -i.bak '/^ myscale:/,/^ [a-z]/d' dc-llmapp.yaml
# # ...existing code...
# sed -i.bak '/^ myscale:/,/^ [a-z]/d' dc-llmapp.yaml
25 changes: 25 additions & 0 deletions docker/dc-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

baseDir=$(cd `dirname $0`;pwd)
cd $baseDir

EXEC_TIME=`date +%Y%m%d%H%M%S`

tar -cvzf dc-llmapp-deploy-${EXEC_TIME}.tar.gz \
dc-llmapp.* \
dc-llmapp-v2.* \
docker-compose.* \
.env.example \
nginx \
startupscripts \
pip \
volumes/sandbox

tar -cvzf dc-llmmid-deploy-${EXEC_TIME}.tar.gz \
dc-llmmid.* \
docker-compose.middleware.yaml \
middleware.env.example \
ssrf_proxy \
startupscripts \
pip \
volumes/sandbox
Binary file added docker/docker_config.tar.gz
Binary file not shown.
3 changes: 2 additions & 1 deletion web/Dockerfile
Original file line number Diff line number Diff line change
@@ -35,7 +35,8 @@ COPY --from=packages /app/web/ .
COPY . .

ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN pnpm build:docker

RUN sh -x ./custom.sh && pnpm build:docker


# production stage
50 changes: 50 additions & 0 deletions web/custom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

xsed='sed -i'
system=`uname`
if [ "$system" == "Darwin" ]; then
echo "This is macOS"
xsed="sed -i .bak"
else
echo "This is Linux"
xsed='sed -i'
fi

# custom with config
# $xsed "s#'CAN_REPLACE_LOGO': 'False'#'CAN_REPLACE_LOGO': 'True'#g" ../api/config.py

# custom webui
# find ../web/ -type f -name "*.ts" -o -name "*.tsx" | xargs grep -E "[ '\"]Dify[ '\"]"| awk -F ':' '{print $1}' | xargs -I@ bash -c "${xsed} -i.bak 's#Dify#LLMAI#g' @"
$xsed "s#Dify#LLMAI#g" ../web/public/_offline.html
$xsed "s#Dify#LLMAI#g" ../web/public/manifest.json
$xsed "s#Dify#LLM AI#g" ../web/i18n/zh-Hans/login.ts
$xsed "s#Dify#LLM AI#g" ../web/app/layout.tsx
$xsed "s#Dify#LLM AI#g" "../web/app/(commonLayout)/layout.tsx"
$xsed "s#Dify#LLM AI#g" "../web/app/(commonLayout)/datasets/page.tsx"
$xsed "s#'Dify'#'LLMAI'#g" ../web/app/components/base/icons/src/public/common/Dify.tsx
$xsed "s#Powered by Dify#Powered by LLMAI#g" ../web/app/components/base/chat/embedded-chatbot/index.tsx
$xsed "s#POWERED BY#技术支持:#g" ../web/app/components/custom/custom-web-app-brand/index.tsx

$xsed "s#logo-site.png#logo-site-jsb.png#g" ../web/app/components/base/logo/logo-site.tsx
$xsed "s#logo.svg#logo-llmapp.svg#g" ../web/app/components/base/logo/logo-site.tsx
$xsed "s#logo-monochrome-white.svg#logo-monochrome-white-llmapp.svg#g" ../web/app/components/base/logo/logo-site.tsx
find ../web -type f -name "*.ts" -o -name "*.tsx" -o -name "*.js" | grep -v node_modules | xargs $xsed "s#logo.svg#logo-llmapp.svg#g"
find ../web -type f -name "*.ts" -o -name "*.tsx" -o -name "*.js" | grep -v node_modules | xargs $xsed "s#logo-monochrome-white.svg#logo-monochrome-white-llmapp.svg#g"
$xsed "s#LangGenius, Inc.#BlockAI, Inc.#g" ../web/app/components/header/account-about/index.tsx
$xsed "s#LangGenius, Inc.#BlockAI, Inc.#g" ../web/app/signin/page.tsx
find ../web -type f -name "*.ts" -o -name "*.tsx" -o -name "*.js" | grep -v node_modules | xargs $xsed "s#LangGenius, Inc.#BlockAI, Inc.#g"
$xsed "s#https://dify.ai#https://llm.ai#g" ../web/app/components/header/account-about/index.tsx
$xsed "s#https://dify.ai#https://llm.ai#g" ../web/app/components/base/chat/chat-with-history/config-panel/index.tsx
# $xsed "s#https://dify.ai/#https://llm.ai/#g" ../web/app/components/share/chat/welcome/index.tsx
# $xsed "s#https://dify.ai/#https://llm.ai/#g" ../web/app/components/share/chatbot/welcome/index.tsx
$xsed "s#https://dify.ai#https://llm.ai#g" ../web/app/signin/normalForm.tsx
$xsed "s#https://github.com/langgenius/dify#https://github.com/blockmap/llmai#g" ../web/app/components/header/account-about/index.tsx
# find ../web -name "*.tsx" | xargs grep "\- Dify"
# find ../web -name "*.tsx" | xargs grep "\- Dify" | awk -F':' '{print $1}' | xargs $xsed "s#- Dify#- LLM#g"
find ../web -type f -name "*.ts" -o -name "*.tsx" | xargs grep -E "[ '>\"]Dify[ '<\"\$\`]" | grep -vE "default as Dify |Dify.json|embedded-chatbot/index.tsx"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line appears to be a leftover debugging command. It finds files and prints matching lines but doesn't perform any action. It can be safely removed to clean up the script.

find ../web -type f -name "*.ts" -o -name "*.tsx" | xargs grep -E "[ '>\"]Dify[ '<\"\$\`]" | grep -vE "default as Dify |Dify.json|embedded-chatbot/index.tsx" | awk -F ':' '{print $1}' | xargs -I@ sh -c "sed -i.bak 's#Dify#LLMAI#g' '@'"
find ../web -type f -name "*.ts" -o -name "*.tsx" | xargs grep -E "https://github.com/langgenius/dify" | grep -vE " default as Dify |Dify.json|embedded-chatbot/index.tsx" | awk -F ':' '{print $1}' | xargs -I@ sh -c "sed -i.bak 's#https://github.com/langgenius/dify#https://github.com/blockmap/llmai#g' '@'"
Comment on lines +45 to +46
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The sed commands here are hardcoded with sed -i.bak, which creates backup files. However, other sed commands in this script (e.g., on lines 18-41) use the $xsed variable, which on Linux resolves to sed -i and does not create backups. This inconsistency should be resolved. Please decide on a consistent strategy for backups and apply it throughout the script, for example by adjusting the xsed variable definition and using it in all sed commands.


# custom api:
# $xsed "s#Dify OpenAPI#BlockAI OpenAPI#g" ../api/controllers/service_api/index.py
exit 0
12 changes: 12 additions & 0 deletions web/public/logo/logo-dify.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions web/public/logo/logo-llmapp.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions web/public/logo/logo-llmapp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions web/public/logo/logo-monochrome-white-dify.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions web/public/logo/logo-monochrome-white-llmapp.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions web/public/logo/logo-monochrome-white-llmapp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 1 addition & 12 deletions web/public/logo/logo-monochrome-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions web/public/logo/logo-site-blockai.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/logo/logo-site-blockai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions web/public/logo/logo-site-jsb.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/logo/logo-site-jsb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 1 addition & 12 deletions web/public/logo/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Unchanged files with check annotations Beta

import type { NavIcon } from '@/app/components/app-sidebar/nav-link'
import type { App } from '@/types/app'
import {
RiDashboard2Fill,

Check warning on line 6 in web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx

GitHub Actions / Style Check / Web Style

Icon "RiDashboard2Fill" from "@remixicon/react" can be replaced with Tailwind CSS class "i-ri-dashboard-2-fill"
RiDashboard2Line,

Check warning on line 7 in web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx

GitHub Actions / Style Check / Web Style

Icon "RiDashboard2Line" from "@remixicon/react" can be replaced with Tailwind CSS class "i-ri-dashboard-2-line"
RiFileList3Fill,

Check warning on line 8 in web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx

GitHub Actions / Style Check / Web Style

Icon "RiFileList3Fill" from "@remixicon/react" can be replaced with Tailwind CSS class "i-ri-file-list-3-fill"
RiFileList3Line,

Check warning on line 9 in web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx

GitHub Actions / Style Check / Web Style

Icon "RiFileList3Line" from "@remixicon/react" can be replaced with Tailwind CSS class "i-ri-file-list-3-line"
RiTerminalBoxFill,

Check warning on line 10 in web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx

GitHub Actions / Style Check / Web Style

Icon "RiTerminalBoxFill" from "@remixicon/react" can be replaced with Tailwind CSS class "i-ri-terminal-box-fill"
RiTerminalBoxLine,

Check warning on line 11 in web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx

GitHub Actions / Style Check / Web Style

Icon "RiTerminalBoxLine" from "@remixicon/react" can be replaced with Tailwind CSS class "i-ri-terminal-box-line"
RiTerminalWindowFill,

Check warning on line 12 in web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx

GitHub Actions / Style Check / Web Style

Icon "RiTerminalWindowFill" from "@remixicon/react" can be replaced with Tailwind CSS class "i-ri-terminal-window-fill"
RiTerminalWindowLine,

Check warning on line 13 in web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx

GitHub Actions / Style Check / Web Style

Icon "RiTerminalWindowLine" from "@remixicon/react" can be replaced with Tailwind CSS class "i-ri-terminal-window-line"
} from '@remixicon/react'
import { useUnmount } from 'ahooks'
import dynamic from 'next/dynamic'
// if ((appDetail.mode === AppModeEnum.ADVANCED_CHAT || appDetail.mode === 'workflow') && (pathname).endsWith('workflow'))
// setAppSidebarExpand('collapse')
}
}, [appDetail, isMobile])

Check warning on line 118 in web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx

GitHub Actions / Style Check / Web Style

React Hook useEffect has a missing dependency: 'setAppSidebarExpand'. Either include it or remove the dependency array
useEffect(() => {
setAppDetail()
}).finally(() => {
setIsLoadingAppDetail(false)
})
}, [appId, pathname])

Check warning on line 131 in web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx

GitHub Actions / Style Check / Web Style

React Hook useEffect has missing dependencies: 'router' and 'setAppDetail'. Either include them or remove the dependency array
useEffect(() => {
if (!appDetailRes || !currentWorkspace.id || isLoadingCurrentWorkspace || isLoadingAppDetail)