mirror of
https://github.com/YFGaia/dify-plus.git
synced 2026-06-26 16:02:18 +08:00
Merge branch 'main' into main_merge_dify_1.1.3
* main: fix:docker compose加上sandbox-full镜像 fix:更换镜像地址 fix: 管理中心admin,初始化数据漏了新加的菜单数据权限 fix:修复上传图片等api因加密钥计费导致报错问题 fix: 更新镜像,还有修复一些初始化的bug ci: 测试使用gitlab-ci,去构建推送镜像 ci: 测试使用gitlab-ci,去构建推送镜像 ci: 测试使用gitlab-ci,去构建推送镜像 feat:docker-compose镜像版本更新 # Conflicts: # docker/docker-compose.dify-plus.yaml
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}:
|
||||
|
||||
@@ -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
|
||||
"""
|
||||
|
||||
@@ -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 ###
|
||||
Reference in New Issue
Block a user