File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package app
22
33import (
44 "fmt"
5+ "github.com/langgenius/dify-plugin-daemon/internal/oss"
56
67 "github.com/go-playground/validator/v10"
78)
@@ -203,7 +204,7 @@ func (c *Config) Validate() error {
203204 return fmt .Errorf ("plugin package cache path is empty" )
204205 }
205206
206- if c .PluginStorageType == "aws_s3" {
207+ if c .PluginStorageType == oss . OSS_TYPE_S3 {
207208 if c .PluginStorageOSSBucket == "" {
208209 return fmt .Errorf ("plugin storage bucket is empty" )
209210 }
@@ -213,7 +214,7 @@ func (c *Config) Validate() error {
213214 }
214215 }
215216
216- if c .PluginStorageType == "azure_blob" {
217+ if c .PluginStorageType == oss . OSS_TYPE_AZURE_BLOB {
217218 if c .AzureBlobStorageConnectionString == "" {
218219 return fmt .Errorf ("azure blob storage connection string is empty" )
219220 }
@@ -223,7 +224,7 @@ func (c *Config) Validate() error {
223224 }
224225 }
225226
226- if c .PluginStorageType == "aliyun_oss" {
227+ if c .PluginStorageType == oss . OSS_TYPE_ALIYUN_OSS {
227228 if c .PluginStorageOSSBucket == "" {
228229 return fmt .Errorf ("plugin storage bucket is empty" )
229230 }
Original file line number Diff line number Diff line change 11package app
22
3- import "golang.org/x/exp/constraints"
3+ import (
4+ "github.com/langgenius/dify-plugin-daemon/internal/oss"
5+ "golang.org/x/exp/constraints"
6+ )
47
58func (config * Config ) SetDefault () {
69 setDefaultInt (& config .ServerPort , 5002 )
@@ -15,7 +18,7 @@ func (config *Config) SetDefault() {
1518 setDefaultInt (& config .MaxBundlePackageSize , 52428800 * 12 )
1619 setDefaultInt (& config .MaxServerlessTransactionTimeout , 300 )
1720 setDefaultInt (& config .PluginMaxExecutionTimeout , 10 * 60 )
18- setDefaultString (& config .PluginStorageType , "local" )
21+ setDefaultString (& config .PluginStorageType , oss . OSS_TYPE_LOCAL )
1922 setDefaultInt (& config .PluginMediaCacheSize , 1024 )
2023 setDefaultInt (& config .DifyPluginServerlessConnectorLaunchTimeout , 240 )
2124 setDefaultInt (& config .PluginRemoteInstallingMaxSingleTenantConn , 5 )
You can’t perform that action at this time.
0 commit comments