dify/api/services
Luyu Zhang acd6942d21 feat(storage): redirect signed file previews to S3 public base URL
Add an optional S3_PUBLIC_BASE_URL setting that, when configured, lets
file controllers 302-redirect signed previews to the object store / CDN
instead of streaming bytes through the Dify API. Works with any
S3-compatible backend exposing a public domain (Cloudflare R2 custom
domain, MinIO public endpoint, Aliyun OSS public domain, etc.) so that
egress and request handling for images, attachments, tool outputs, and
webapp logos no longer go through the API container.

Signature verification is preserved: the API still validates the HMAC
before issuing the redirect. When S3_PUBLIC_BASE_URL is unset the
behavior is unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 17:12:00 -07:00
..
auth refactor: replace bare dict with dict[str, Any] in core provider services and misc modules (#35124) 2026-04-14 03:03:08 +00:00
document_indexing_proxy feat: enable tenant isolation on duplicate document indexing tasks (#29080) 2025-12-08 17:54:57 +08:00
enterprise fix: sync 35528 (#35539) 2026-04-24 03:59:33 +00:00
entities chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
errors fix: enterprise API error handling and license enforcement (#33044) 2026-03-15 20:59:41 -07:00
plugin fix(plugin): persist tenant plugin auto-upgrade strategy changes (#35464) 2026-04-21 09:28:44 +00:00
rag_pipeline chore(api): adapt Graphon 0.2.2 upgrade (#35377) 2026-04-18 11:16:24 +00:00
recommend_app refactor: replace bare dict with dict[str, Any] in services grab-bag (#35112) 2026-04-14 03:02:34 +00:00
retention chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
tools feat: marketplace and oauth fixes (#35509) 2026-04-24 07:53:14 +00:00
trigger refactor: quota v3 integration (#35436) 2026-04-27 01:49:40 +00:00
workflow chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
__init__.py chore(api/services): apply ruff reformatting (#7599) 2024-08-26 13:43:57 +08:00
account_service.py fix(auth): enforce phase-bound change-email token flow (GHSA-4q3w-q5mc-45rq) (#35425) 2026-04-20 10:10:03 +00:00
advanced_prompt_template_service.py refactor: replace bare dict with AdvancedPromptTemplateArgs TypedDict (#35056) 2026-04-13 13:05:23 +00:00
agent_service.py refactor: select in 10 service files (#34373) 2026-04-01 08:03:49 +00:00
annotation_service.py refactor: port MessageAnnotation (#31005) 2026-04-26 11:47:42 +00:00
api_based_extension_service.py refactor: select in 10 service files (#34373) 2026-04-01 08:03:49 +00:00
api_token_service.py fix: redis for api token (#31861) 2026-02-06 16:25:27 +08:00
app_dsl_service.py feat: copy nodes cross apps (#33273) 2026-04-17 10:02:26 +00:00
app_generate_service.py refactor: quota v3 integration (#35436) 2026-04-27 01:49:40 +00:00
app_model_config_service.py refactor: replace bare dict with dict[str, Any] in core provider services and misc modules (#35124) 2026-04-14 03:03:08 +00:00
app_service.py fix: accept icon type in app icon updates (#35360) 2026-04-20 02:33:49 +00:00
app_task_service.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
async_workflow_service.py refactor: quota v3 integration (#35436) 2026-04-27 01:49:40 +00:00
attachment_service.py refactor: migrate session.query to select API in sync task and services (#34619) 2026-04-07 04:23:14 +00:00
audio_service.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
billing_service.py refactor: quota v3 integration (#35436) 2026-04-27 01:49:40 +00:00
clear_free_plan_tenant_expired_logs.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
code_based_extension_service.py remove bare list, dict, Sequence, None, Any (#25058) 2025-09-06 03:32:23 +08:00
conversation_service.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
conversation_variable_updater.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
credit_pool_service.py fix: optimize trigger long running read transactions (#35046) 2026-04-13 08:22:54 +00:00
dataset_service.py refactor: port ChildChunk (#30920) 2026-04-26 00:59:22 +00:00
datasource_provider_service.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
end_user_service.py refactor(api): use sessionmaker in end user, retention & cleanup services (#34765) 2026-04-08 23:21:28 +00:00
external_knowledge_service.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
feature_service.py refactor: quota v3 integration (#35436) 2026-04-27 01:49:40 +00:00
feedback_service.py refactor: select in 10 service files (#34373) 2026-04-01 08:03:49 +00:00
file_service.py feat(storage): redirect signed file previews to S3 public base URL 2026-04-28 17:12:00 -07:00
hit_testing_service.py refactor(api): tighten core rag typing batch 1 (#35210) 2026-04-21 04:32:43 +00:00
human_input_delivery_test_service.py chore(api): adapt Graphon 0.2.2 upgrade (#35377) 2026-04-18 11:16:24 +00:00
human_input_service.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
knowledge_service.py refactor: replace dict with BedrockRetrievalSetting BaseModel in knowledge_service (#34080) 2026-03-25 21:33:24 +09:00
message_service.py feat: improve follow-up settings (#35442) 2026-04-22 08:55:16 +00:00
metadata_service.py refactor: select in metadata_service (#34479) 2026-04-02 12:34:38 +00:00
model_load_balancing_service.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
model_provider_service.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
oauth_server.py refactor: use sessionmaker in small services 2 (#34696) 2026-04-08 05:06:50 +00:00
operation_service.py refactor: replace bare dict with UtmInfo TypedDict in operation_service (#35055) 2026-04-13 13:05:47 +00:00
ops_service.py refactor: replace bare dict with dict[str, Any] in ops_service tracin… (#35064) 2026-04-13 13:01:00 +00:00
quota_service.py refactor: quota v3 integration (#35436) 2026-04-27 01:49:40 +00:00
recommended_app_service.py refactor: replace bare dict with dict[str, Any] in services grab-bag (#35112) 2026-04-14 03:02:34 +00:00
saved_message_service.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
summary_index_service.py refactor: migrate DocumentSegmentSummary to TypeBase (#34862) 2026-04-17 06:58:32 +00:00
tag_service.py refactor: replace dict params with BaseModel payloads in TagService (#34422) 2026-04-07 04:20:02 +00:00
variable_truncator.py chore(api): adapt Graphon 0.2.2 upgrade (#35377) 2026-04-18 11:16:24 +00:00
vector_service.py refactor: port ChildChunk (#30920) 2026-04-26 00:59:22 +00:00
web_conversation_service.py chore(api): align Python support with 3.12 (#34419) 2026-04-02 05:07:32 +00:00
webapp_auth_service.py refactor: select in 13 small service files (#34371) 2026-04-01 04:00:05 +00:00
website_service.py refactor: replace bare dict with dict[str, Any] in website_service (#35074) 2026-04-13 17:07:59 +00:00
workflow_app_service.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
workflow_collaboration_service.py feat: collaboration (#30781) 2026-04-16 02:21:04 +00:00
workflow_comment_service.py feat: collaboration (#30781) 2026-04-16 02:21:04 +00:00
workflow_draft_variable_service.py chore(api): adapt Graphon 0.2.2 upgrade (#35377) 2026-04-18 11:16:24 +00:00
workflow_event_snapshot_service.py feat: add service api of HITL (#32826) 2026-04-24 06:37:10 +00:00
workflow_restore.py fix: adding a restore API for version control on workflow draft (#33582) 2026-03-20 14:54:23 +08:00
workflow_run_service.py refactor: replace bare dict with WorkflowRunListArgs TypedDict (#35057) 2026-04-13 13:05:39 +00:00
workflow_service.py refactor: quota v3 integration (#35436) 2026-04-27 01:49:40 +00:00
workspace_service.py refactor: select in 13 small service files (#34371) 2026-04-01 04:00:05 +00:00