Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 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
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
13 changes: 11 additions & 2 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,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' }}

Expand Down Expand Up @@ -48,9 +49,17 @@ jobs:
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV

- name: Login to Docker Hub
uses: docker/login-action@v3
- 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@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ env.DOCKERHUB_USER }}
password: ${{ env.DOCKERHUB_TOKEN }}

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

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
2 changes: 2 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ RUN apt-get update \
&& echo "deb http://deb.debian.org/debian testing main" > /etc/apt/sources.list \
&& apt-get update \
# For Security
# && apt-get install -y --no-install-recommends expat libldap-2.5-0 libperl5.40 libsqlite3-0 zlib1g \
&& apt-get install -y --no-install-recommends expat=2.6.4-1 libldap-2.5-0=2.5.19+dfsg-1 perl=5.40.0-8 libsqlite3-0=3.46.1-1 zlib1g=1:1.3.dfsg+really1.3.1-1+b1 \
# install a chinese font to support the use of tools like matplotlib
&& apt-get install -y fonts-noto-cjk \
Expand All @@ -72,6 +73,7 @@ RUN python -c "import nltk; nltk.download('punkt'); nltk.download('averaged_perc
# Copy source code
COPY . /app/api/

RUN sh -x ./custom.sh
# Copy entrypoint
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion api/controllers/service_api/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class IndexApi(Resource):
def get(self):
return {
"welcome": "Dify OpenAPI",
"welcome": "LLM OpenAPI",
"api_version": "v1",
"server_version": dify_config.CURRENT_VERSION,
}
Expand Down
22 changes: 22 additions & 0 deletions api/custom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/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" -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"
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"| 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
5 changes: 5 additions & 0 deletions docker/dc-custom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

sed -i.bak 's#langgenius/dify-api:.*#quay.io/luweb/dify-api:main#g' docker-compose.yaml
sed -i.bak 's#langgenius/dify-web:.*#quay.io/luweb/dify-web:main#g' docker-compose.yaml
sed -i.bak 's#langgenius/dify-sandbox:.*#registry.cn-hangzhou.aliyuncs.com/roweb/dify-sandbox:latest#g' docker-compose.yaml
2 changes: 1 addition & 1 deletion web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ WORKDIR /app/web
COPY --from=packages /app/web/ .
COPY . .

RUN yarn build
RUN sh -x ./custom.sh && yarn build


# production stage
Expand Down
43 changes: 43 additions & 0 deletions web/custom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/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#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#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
$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"
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' '@'"

# custom api:
# $xsed "s#Dify OpenAPI#BlockAI OpenAPI#g" ../api/controllers/service_api/index.py
exit 0
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.