diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..fb97fdd43 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,232 @@ +# .gitlab-ci.yml +# 构建并推送API、Web、Admin-Server、Admin-Web镜像到腾讯云容器镜像服务 + +stages: + - build + - manifest + +variables: + DOCKER_REGISTRY: ccr.ccs.tencentyun.com + DIFY_WEB_IMAGE_NAME: ${DOCKER_REGISTRY}/yfgaia/dify-plus-web + DIFY_API_IMAGE_NAME: ${DOCKER_REGISTRY}/yfgaia/dify-plus-api + ADMIN_WEB_IMAGE_NAME: ${DOCKER_REGISTRY}/yfgaia/dify-plus-admin-web + ADMIN_SERVER_IMAGE_NAME: ${DOCKER_REGISTRY}/yfgaia/dify-plus-admin-server + +# 只有在打tag时触发 +workflow: + rules: + - if: $CI_COMMIT_TAG + when: always + - when: never + +default: + before_script: + - docker login ${DOCKER_REGISTRY} -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} + +# 构建API镜像 - AMD64 +build-api-amd64: + stage: build + script: + - | + platform="linux/amd64" + image_name=$DIFY_API_IMAGE_NAME + tag=$CI_COMMIT_TAG + platform_tag="$tag-amd64" + docker build \ + --platform $platform \ + --build-arg COMMIT_SHA=$CI_COMMIT_SHA \ + --tag $image_name:$platform_tag \ + --tag $image_name:$CI_COMMIT_SHA-amd64 \ + -f api/Dockerfile api + docker push $image_name:$platform_tag + docker push $image_name:$CI_COMMIT_SHA-amd64 + echo $image_name:$platform_tag >> manifest_api.txt + +# 构建API镜像 - ARM64 +build-api-arm64: + stage: build + script: + - | + platform="linux/arm64" + image_name=$DIFY_API_IMAGE_NAME + tag=$CI_COMMIT_TAG + platform_tag="$tag-arm64" + docker build \ + --platform $platform \ + --build-arg COMMIT_SHA=$CI_COMMIT_SHA \ + --tag $image_name:$platform_tag \ + --tag $image_name:$CI_COMMIT_SHA-arm64 \ + -f api/Dockerfile api + docker push $image_name:$platform_tag + docker push $image_name:$CI_COMMIT_SHA-arm64 + echo $image_name:$platform_tag >> manifest_api.txt + +# 构建Web镜像 - AMD64 +build-web-amd64: + stage: build + script: + - | + platform="linux/amd64" + image_name=$DIFY_WEB_IMAGE_NAME + tag=$CI_COMMIT_TAG + platform_tag="$tag-amd64" + docker build \ + --platform $platform \ + --build-arg COMMIT_SHA=$CI_COMMIT_SHA \ + --tag $image_name:$platform_tag \ + --tag $image_name:$CI_COMMIT_SHA-amd64 \ + -f web/Dockerfile web + docker push $image_name:$platform_tag + docker push $image_name:$CI_COMMIT_SHA-amd64 + echo $image_name:$platform_tag >> manifest_web.txt + +# 构建Web镜像 - ARM64 +build-web-arm64: + stage: build + script: + - | + platform="linux/arm64" + image_name=$DIFY_WEB_IMAGE_NAME + tag=$CI_COMMIT_TAG + platform_tag="$tag-arm64" + docker build \ + --platform $platform \ + --build-arg COMMIT_SHA=$CI_COMMIT_SHA \ + --tag $image_name:$platform_tag \ + --tag $image_name:$CI_COMMIT_SHA-arm64 \ + -f web/Dockerfile web + docker push $image_name:$platform_tag + docker push $image_name:$CI_COMMIT_SHA-arm64 + echo $image_name:$platform_tag >> manifest_web.txt + +# 构建Admin Server镜像 - AMD64 +build-admin-server-amd64: + stage: build + script: + - | + platform="linux/amd64" + image_name=$ADMIN_SERVER_IMAGE_NAME + tag=$CI_COMMIT_TAG + platform_tag="$tag-amd64" + docker build \ + --platform $platform \ + --tag $image_name:$platform_tag \ + --tag $image_name:$CI_COMMIT_SHA-amd64 \ + -f admin/server/Dockerfile admin/server + docker push $image_name:$platform_tag + docker push $image_name:$CI_COMMIT_SHA-amd64 + echo $image_name:$platform_tag >> manifest_admin_server.txt + +# 构建Admin Server镜像 - ARM64 +build-admin-server-arm64: + stage: build + script: + - | + platform="linux/arm64" + image_name=$ADMIN_SERVER_IMAGE_NAME + tag=$CI_COMMIT_TAG + platform_tag="$tag-arm64" + docker build \ + --platform $platform \ + --tag $image_name:$platform_tag \ + --tag $image_name:$CI_COMMIT_SHA-arm64 \ + -f admin/server/Dockerfile admin/server + docker push $image_name:$platform_tag + docker push $image_name:$CI_COMMIT_SHA-arm64 + echo $image_name:$platform_tag >> manifest_admin_server.txt + +# 构建Admin Web镜像 - AMD64 +build-admin-web-amd64: + stage: build + script: + - | + platform="linux/amd64" + image_name=$ADMIN_WEB_IMAGE_NAME + tag=$CI_COMMIT_TAG + platform_tag="$tag-amd64" + docker build \ + --platform $platform \ + --tag $image_name:$platform_tag \ + --tag $image_name:$CI_COMMIT_SHA-amd64 \ + -f admin/web/Dockerfile admin/web + docker push $image_name:$platform_tag + docker push $image_name:$CI_COMMIT_SHA-amd64 + echo $image_name:$platform_tag >> manifest_admin_web.txt + +# 构建Admin Web镜像 - ARM64 +build-admin-web-arm64: + stage: build + script: + - | + platform="linux/arm64" + image_name=$ADMIN_WEB_IMAGE_NAME + tag=$CI_COMMIT_TAG + platform_tag="$tag-arm64" + docker build \ + --platform $platform \ + --tag $image_name:$platform_tag \ + --tag $image_name:$CI_COMMIT_SHA-arm64 \ + -f admin/web/Dockerfile admin/web + docker push $image_name:$platform_tag + docker push $image_name:$CI_COMMIT_SHA-arm64 + echo $image_name:$platform_tag >> manifest_admin_web.txt + +# 创建API多架构清单 +create-manifest-api: + stage: manifest + needs: + - build-api-amd64 + - build-api-arm64 + script: + - | + image_name=$DIFY_API_IMAGE_NAME + tag=$CI_COMMIT_TAG + docker manifest create $image_name:$tag $(cat manifest_api.txt) + docker manifest create $image_name:latest $(cat manifest_api.txt) + docker manifest push $image_name:$tag + docker manifest push $image_name:latest + +# 创建Web多架构清单 +create-manifest-web: + stage: manifest + needs: + - build-web-amd64 + - build-web-arm64 + script: + - | + image_name=$DIFY_WEB_IMAGE_NAME + tag=$CI_COMMIT_TAG + docker manifest create $image_name:$tag $(cat manifest_web.txt) + docker manifest create $image_name:latest $(cat manifest_web.txt) + docker manifest push $image_name:$tag + docker manifest push $image_name:latest + +# 创建Admin Server多架构清单 +create-manifest-admin-server: + stage: manifest + needs: + - build-admin-server-amd64 + - build-admin-server-arm64 + script: + - | + image_name=$ADMIN_SERVER_IMAGE_NAME + tag=$CI_COMMIT_TAG + docker manifest create $image_name:$tag $(cat manifest_admin_server.txt) + docker manifest create $image_name:latest $(cat manifest_admin_server.txt) + docker manifest push $image_name:$tag + docker manifest push $image_name:latest + +# 创建Admin Web多架构清单 +create-manifest-admin-web: + stage: manifest + needs: + - build-admin-web-amd64 + - build-admin-web-arm64 + script: + - | + image_name=$ADMIN_WEB_IMAGE_NAME + tag=$CI_COMMIT_TAG + docker manifest create $image_name:$tag $(cat manifest_admin_web.txt) + docker manifest create $image_name:latest $(cat manifest_admin_web.txt) + docker manifest push $image_name:$tag + docker manifest push $image_name:latest \ No newline at end of file diff --git a/admin/server/config.docker.yaml b/admin/server/config.docker.yaml index abd27d1d4..ea7a99496 100644 --- a/admin/server/config.docker.yaml +++ b/admin/server/config.docker.yaml @@ -131,6 +131,12 @@ qiniu: secret-key: "" use-https: false use-cdn-domains: false +dify-redis: + name: "" + addr: redis:6379 + password: difyai123456 + db: 0 + useCluster: false redis: name: "" addr: redis:6379 diff --git a/admin/server/initialize/ensure_tables.go b/admin/server/initialize/ensure_tables.go index f4f19990f..f70df220e 100644 --- a/admin/server/initialize/ensure_tables.go +++ b/admin/server/initialize/ensure_tables.go @@ -65,6 +65,8 @@ func (e *ensureTables) MigrateTable(ctx context.Context) (context.Context, error gaia.AccountDingTalkExtend{}, gaia.AppRequestTestBatch{}, gaia.AppRequestTest{}, + gaia.SystemIntegration{}, // Extend System Integration + sysModel.SysUserGlobalCode{}, // Extend Global Code // Extend gaia model } for _, t := range tables { @@ -109,6 +111,8 @@ func (e *ensureTables) TableCreated(ctx context.Context) bool { gaia.AccountDingTalkExtend{}, gaia.AppRequestTestBatch{}, gaia.AppRequestTest{}, + gaia.SystemIntegration{}, // Extend System Integration + sysModel.SysUserGlobalCode{}, // Extend Global Code // Extend gaia model } yes := true diff --git a/admin/server/initialize/gorm.go b/admin/server/initialize/gorm.go index c29c33fec..43bce835f 100644 --- a/admin/server/initialize/gorm.go +++ b/admin/server/initialize/gorm.go @@ -66,9 +66,9 @@ func RegisterTables() { gaia.AccountDingTalkExtend{}, gaia.AppRequestTestBatch{}, gaia.AppRequestTest{}, - // Extend gaia model gaia.SystemIntegration{}, // Extend System Integration system.SysUserGlobalCode{}, // Extend Global Code + // Extend gaia model ) if err != nil { global.GVA_LOG.Error("register table failed", zap.Error(err)) diff --git a/admin/server/source/system/authorities_menus.go b/admin/server/source/system/authorities_menus.go index 14f2ffd01..5f3d68d17 100644 --- a/admin/server/source/system/authorities_menus.go +++ b/admin/server/source/system/authorities_menus.go @@ -45,7 +45,7 @@ func (i *initMenuAuthority) InitializeData(ctx context.Context) (next context.Co } next = ctx // 888 - if err = db.Model(&authorities[0]).Association("SysBaseMenus").Replace(menus[31:38]); err != nil { + if err = db.Model(&authorities[0]).Association("SysBaseMenus").Replace(menus[31:39]); err != nil { return next, err } if err = db.Model(&authorities[0]).Association("SysBaseMenus").Append(menus[2:5]); err != nil { diff --git a/admin/server/source/system/menu.go b/admin/server/source/system/menu.go index 9876f108c..5bd29bfea 100644 --- a/admin/server/source/system/menu.go +++ b/admin/server/source/system/menu.go @@ -87,11 +87,11 @@ func (i *initMenu) InitializeData(ctx context.Context) (next context.Context, er {MenuLevel: 0, Hidden: false, ParentId: 0, Path: "UserList", Name: "UserList", Component: "view/user/index.vue", Sort: 1, Meta: Meta{Title: "用户列表", Icon: "user"}}, {MenuLevel: 0, Hidden: false, ParentId: 0, Path: "QuotaList", Name: "QuotaList", Component: "view/quota/index.vue", Sort: 2, Meta: Meta{Title: "额度管理", Icon: "wallet"}}, {MenuLevel: 0, Hidden: false, ParentId: 0, Path: "SuperTest", Name: "SuperTest", Component: "view/test/index.vue", Sort: 2, Meta: Meta{Title: "测试管理", Icon: "management"}}, - {MenuLevel: 0, Hidden: false, ParentId: 36, Path: "AppRequestTestBatch", Name: "AppRequestTestBatch", Component: "view/test/appRequest/index.vue", Sort: 1, Meta: Meta{Title: "测试批次", Icon: "list"}}, - {MenuLevel: 0, Hidden: true, ParentId: 36, Path: "AppRequestTestList", Name: "AppRequestTestList", Component: "view/test/appRequest/list.vue", Sort: 1, Meta: Meta{Title: "测试列表", Icon: "list"}}, + {MenuLevel: 0, Hidden: false, ParentId: 35, Path: "AppRequestTestBatch", Name: "AppRequestTestBatch", Component: "view/test/appRequest/index.vue", Sort: 1, Meta: Meta{Title: "测试批次", Icon: "list"}}, + {MenuLevel: 0, Hidden: true, ParentId: 35, Path: "AppRequestTestList", Name: "AppRequestTestList", Component: "view/test/appRequest/list.vue", Sort: 1, Meta: Meta{Title: "测试列表", Icon: "list"}}, // Extend Start: system integration {MenuLevel: 0, Hidden: false, ParentId: 0, Path: "SystemIntegrated", Name: "SystemIntegrated", Component: "view/systemIntegrated/index.vue", Sort: 1, Meta: Meta{Title: "系统集成", Icon: "box"}}, - {MenuLevel: 0, Hidden: false, ParentId: 39, Path: "IntegratedDingTalk", Name: "IntegratedDingTalk", Component: "view/systemIntegrated/dingTalk/index.vue", Sort: 1, Meta: Meta{Title: "钉钉", Icon: "turn-off"}}, + {MenuLevel: 0, Hidden: false, ParentId: 38, Path: "IntegratedDingTalk", Name: "IntegratedDingTalk", Component: "view/systemIntegrated/dingTalk/index.vue", Sort: 1, Meta: Meta{Title: "钉钉", Icon: "turn-off"}}, // Extend Stop: system integration // 二开部分 diff --git a/api/controllers/service_api/app/app.py b/api/controllers/service_api/app/app.py index 8388e2045..716bb148b 100644 --- a/api/controllers/service_api/app/app.py +++ b/api/controllers/service_api/app/app.py @@ -5,7 +5,7 @@ from controllers.common import helpers as controller_helpers from controllers.service_api import api from controllers.service_api.app.error import AppUnavailableError from controllers.service_api.wraps import validate_app_token -from models.model import App, AppMode +from models.model import ApiToken, App, AppMode # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 from services.app_service import AppService @@ -14,7 +14,7 @@ class AppParameterApi(Resource): @validate_app_token @marshal_with(fields.parameters_fields) - def get(self, app_model: App): + def get(self, app_model: App, api_token: ApiToken): # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 """Retrieve app parameters.""" if app_model.mode in {AppMode.ADVANCED_CHAT.value, AppMode.WORKFLOW.value}: workflow = app_model.workflow diff --git a/api/controllers/service_api/app/audio.py b/api/controllers/service_api/app/audio.py index e6bcc0bfd..26e7b106f 100644 --- a/api/controllers/service_api/app/audio.py +++ b/api/controllers/service_api/app/audio.py @@ -20,7 +20,7 @@ from controllers.service_api.app.error import ( from controllers.service_api.wraps import FetchUserArg, WhereisUserArg, validate_app_token from core.errors.error import ModelCurrentlyNotSupportError, ProviderTokenNotInitError, QuotaExceededError from core.model_runtime.errors.invoke import InvokeError -from models.model import App, AppMode, EndUser +from models.model import ApiToken, App, AppMode, EndUser # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 from services.audio_service import AudioService from services.errors.audio import ( AudioTooLargeServiceError, @@ -32,7 +32,7 @@ from services.errors.audio import ( class AudioApi(Resource): @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.FORM)) - def post(self, app_model: App, end_user: EndUser): + def post(self, app_model: App, end_user: EndUser, api_token: ApiToken): # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 file = request.files["file"] try: diff --git a/api/controllers/service_api/app/conversation.py b/api/controllers/service_api/app/conversation.py index 334f2c562..8ae9096e0 100644 --- a/api/controllers/service_api/app/conversation.py +++ b/api/controllers/service_api/app/conversation.py @@ -15,14 +15,14 @@ from fields.conversation_fields import ( simple_conversation_fields, ) from libs.helper import uuid_value -from models.model import App, AppMode, EndUser +from models.model import ApiToken, App, AppMode, EndUser # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 from services.conversation_service import ConversationService class ConversationApi(Resource): @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.QUERY)) @marshal_with(conversation_infinite_scroll_pagination_fields) - def get(self, app_model: App, end_user: EndUser): + def get(self, app_model: App, end_user: EndUser, api_token: ApiToken): # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 app_mode = AppMode.value_of(app_model.mode) if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT}: raise NotChatAppError() @@ -58,7 +58,7 @@ class ConversationApi(Resource): class ConversationDetailApi(Resource): @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON)) @marshal_with(conversation_delete_fields) - def delete(self, app_model: App, end_user: EndUser, c_id): + def delete(self, app_model: App, end_user: EndUser, c_id, api_token: ApiToken): # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 app_mode = AppMode.value_of(app_model.mode) if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT}: raise NotChatAppError() @@ -75,7 +75,7 @@ class ConversationDetailApi(Resource): class ConversationRenameApi(Resource): @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON)) @marshal_with(simple_conversation_fields) - def post(self, app_model: App, end_user: EndUser, c_id): + def post(self, app_model: App, end_user: EndUser, c_id, api_token: ApiToken): # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 app_mode = AppMode.value_of(app_model.mode) if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT}: raise NotChatAppError() diff --git a/api/controllers/service_api/app/file.py b/api/controllers/service_api/app/file.py index 27b21b9f5..ce6a1993a 100644 --- a/api/controllers/service_api/app/file.py +++ b/api/controllers/service_api/app/file.py @@ -12,14 +12,14 @@ from controllers.service_api.app.error import ( ) from controllers.service_api.wraps import FetchUserArg, WhereisUserArg, validate_app_token from fields.file_fields import file_fields -from models.model import App, EndUser +from models.model import ApiToken, App, EndUser # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 from services.file_service import FileService class FileApi(Resource): @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.FORM)) @marshal_with(file_fields) - def post(self, app_model: App, end_user: EndUser): + def post(self, app_model: App, end_user: EndUser, api_token: ApiToken): # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 file = request.files["file"] # check file diff --git a/api/controllers/service_api/app/message.py b/api/controllers/service_api/app/message.py index e539e4bc0..c87fa7867 100644 --- a/api/controllers/service_api/app/message.py +++ b/api/controllers/service_api/app/message.py @@ -66,7 +66,7 @@ class MessageListApi(Resource): class MessageFeedbackApi(Resource): @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON, required=True)) - def post(self, app_model: App, end_user: EndUser, message_id): + def post(self, app_model: App, end_user: EndUser, message_id, api_token: ApiToken): # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 message_id = str(message_id) parser = reqparse.RequestParser() @@ -90,7 +90,7 @@ class MessageFeedbackApi(Resource): class MessageSuggestedApi(Resource): @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.QUERY, required=True)) - def get(self, app_model: App, end_user: EndUser, message_id): + def get(self, app_model: App, end_user: EndUser, message_id, api_token: ApiToken): # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 message_id = str(message_id) app_mode = AppMode.value_of(app_model.mode) if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT}: diff --git a/api/controllers/service_api/app/workflow.py b/api/controllers/service_api/app/workflow.py index c17330ac5..394c048c3 100644 --- a/api/controllers/service_api/app/workflow.py +++ b/api/controllers/service_api/app/workflow.py @@ -53,7 +53,7 @@ workflow_run_fields = { class WorkflowRunDetailApi(Resource): @validate_app_token @marshal_with(workflow_run_fields) - def get(self, app_model: App, workflow_id: str): + def get(self, app_model: App, workflow_id: str, api_token: ApiToken): # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 """ Get a workflow task running detail """ @@ -112,7 +112,7 @@ class WorkflowRunApi(Resource): class WorkflowTaskStopApi(Resource): @validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.JSON, required=True)) - def post(self, app_model: App, end_user: EndUser, task_id: str): + def post(self, app_model: App, end_user: EndUser, task_id: str, api_token: ApiToken): # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 """ Stop workflow task """ @@ -128,7 +128,7 @@ class WorkflowTaskStopApi(Resource): class WorkflowAppLogApi(Resource): @validate_app_token @marshal_with(workflow_app_log_pagination_fields) - def get(self, app_model: App): + def get(self, app_model: App, api_token: ApiToken): # 二开部分End - 密钥额度限制,新增api_token,否则上传文件会报错 """ Get workflow app logs """ diff --git a/api/migrations/versions/2025_03_31_2136-588f1696997b_add_system_integration_extend.py b/api/migrations/versions/2025_03_31_2136-588f1696997b_add_system_integration_extend.py new file mode 100644 index 000000000..567493578 --- /dev/null +++ b/api/migrations/versions/2025_03_31_2136-588f1696997b_add_system_integration_extend.py @@ -0,0 +1,43 @@ +"""add_system_integration_extend + +Revision ID: 588f1696997b +Revises: 37e5bf7a1e53 +Create Date: 2025-03-31 21:36:03.818117 + +""" +from alembic import op +import models as models +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = '588f1696997b' +down_revision = '37e5bf7a1e53' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('system_integration_extend', + sa.Column('id', sa.BigInteger(), autoincrement=True, nullable=False), + sa.Column('classify', sa.Integer(), server_default=sa.text('1'), nullable=False), + sa.Column('status', sa.Boolean(), server_default=sa.text('false'), nullable=False), + sa.Column('corp_id', sa.String(length=120), nullable=True), + sa.Column('agent_id', sa.String(length=120), nullable=True), + sa.Column('app_key', sa.String(length=120), nullable=True), + sa.Column('app_secret', sa.Text(), nullable=True), + sa.PrimaryKeyConstraint('id', name='system_integration_joins_pkey') + ) + with op.batch_alter_table('system_integration_extend', schema=None) as batch_op: + batch_op.create_index('system_integration_joins_classify_idx', ['classify'], unique=False) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('system_integration_extend', schema=None) as batch_op: + batch_op.drop_index('system_integration_joins_classify_idx') + + op.drop_table('system_integration_extend') + # ### end Alembic commands ### diff --git a/docker/docker-compose.dify-plus.yaml b/docker/docker-compose.dify-plus.yaml index c57aaa0a3..ac3afa30d 100644 --- a/docker/docker-compose.dify-plus.yaml +++ b/docker/docker-compose.dify-plus.yaml @@ -433,7 +433,7 @@ x-shared-env: &shared-api-worker-env services: # API service api: - image: famousmai/dify-plus-api:0.0.6 + image: ccr.ccs.tencentyun.com/yfgaia/dify-plus-api:1.0.0 # build: # context: ../api # dockerfile: ./Dockerfile @@ -450,6 +450,7 @@ services: PLUGIN_REMOTE_INSTALL_PORT: ${EXPOSE_PLUGIN_DEBUGGING_PORT:-5003} PLUGIN_MAX_PACKAGE_SIZE: ${PLUGIN_MAX_PACKAGE_SIZE:-52428800} INNER_API_KEY_FOR_PLUGIN: ${PLUGIN_DIFY_INNER_API_KEY:-QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1} + FULL_CODE_EXECUTION_ENDPOINT: ${FULL_CODE_EXECUTION_ENDPOINT:-http://sandbox-full:8194} depends_on: - db - redis @@ -463,7 +464,7 @@ services: # worker service # The Celery worker for processing the queue. worker: - image: famousmai/dify-plus-api:0.0.6 + image: ccr.ccs.tencentyun.com/yfgaia/dify-plus-api:1.0.0 # build: # context: ../api # dockerfile: ./Dockerfile @@ -490,7 +491,7 @@ services: # Frontend web application. web: - image: famousmai/dify-plus-web:0.0.6 + image: ccr.ccs.tencentyun.com/yfgaia/dify-plus-web:1.0.0 # build: # context: ../web # dockerfile: ./Dockerfile @@ -575,6 +576,28 @@ services: networks: - ssrf_proxy_network + # The Dify-plus SandboxFull + sandbox-full: + image: ccr.ccs.tencentyun.com/yfgaia/dify-plus-sandbox-full:1.0.0-arm64 + restart: always + environment: + # The DifySandbox configurations + # Make sure you are changing this key for your deployment with a strong key. + # You can generate a strong key using `openssl rand -base64 42`. + API_KEY: ${SANDBOX_API_KEY:-dify-sandbox} + GIN_MODE: ${SANDBOX_GIN_MODE:-release} + WORKER_TIMEOUT: ${SANDBOX_WORKER_TIMEOUT:-15} + ENABLE_NETWORK: ${SANDBOX_ENABLE_NETWORK:-true} + HTTP_PROXY: ${SANDBOX_HTTP_PROXY:-http://ssrf_proxy:3128} + HTTPS_PROXY: ${SANDBOX_HTTPS_PROXY:-http://ssrf_proxy:3128} + SANDBOX_PORT: ${SANDBOX_PORT:-8194} + volumes: + - ./volumes/sandbox/dependencies:/dependencies + healthcheck: + test: ['CMD', 'curl', '-f', 'http://localhost:8194/health'] + networks: + - ssrf_proxy_network + # plugin daemon plugin_daemon: image: langgenius/dify-plugin-daemon:0.0.6-local @@ -689,7 +712,7 @@ services: AUTHORIZATION_ADMINLIST_USERS: ${WEAVIATE_AUTHORIZATION_ADMINLIST_USERS:-hello@dify.ai} admin-web: - image: famousmai/dify-plus-admin-web:0.0.6 + image: ccr.ccs.tencentyun.com/yfgaia/dify-plus-admin-web:1.0.0 # build: # context: ../admin/web # dockerfile: ./Dockerfile @@ -703,7 +726,7 @@ services: - default admin-server: - image: famousmai/dify-plus-admin-server:0.0.6 + image: ccr.ccs.tencentyun.com/yfgaia/dify-plus-admin-server:1.0.0 # build: # context: ../admin/server # dockerfile: ./Dockerfile