Commit Graph

61 Commits

Author SHA1 Message Date
wangxiaolei 07815fd34c fix: fix lru miss init (#622)
* fix: fix lru miss init

* fix: gemini review

---------

Co-authored-by: Stream <Stream_2@qq.com>
2026-03-04 12:30:25 +08:00
wangxiaolei 35825a7925 feat: support opentelemetry (#583) 2026-01-27 13:36:13 +08:00
Oscaner Miao 2be1f651a9 feat(#450): add Redis SSL/TLS configuration support (#558)
* feat(#450): add Redis SSL/TLS configuration support

Add comprehensive SSL/TLS support for Redis connections with configurable certificate verification modes. Introduces new environment variables for SSL configuration including REDIS_USE_SSL, REDIS_SSL_CERT_REQS (supporting CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED), and REDIS_SSL_CA_CERTS for custom CA certificates.

Changes:
- Add Redis SSL configuration options to .env.example
- Implement RedisTLSConfig() method to build tls.Config based on environment settings
- Pass TLS config to both standard Redis and Sentinel mode initializers
- Support custom CA certificate loading and verification modes
- Set minimum TLS version to 1.2 for security
- Minor whitespace cleanup in existing config comments

This enables secure Redis connections in production environments with flexible certificate verification options.

* fix(#450): prevent reference cycle in TLS config and simplify SSL setup

- Capture only RootCAs in VerifyConnection closure to avoid retaining
  entire tlsConf and potential reference cycles
- Remove redundant nil checks for tlsConf in Redis client initialization
  since tlsConf is guaranteed to be non-nil when useSsl is true
- Update comments to reflect actual behavior and constraints

* fix(#450): improve Redis TLS certificate verification logic for optional certificates

* fix(#450): simplify Redis TLS certificate verification logic for optional and required certificates

* docs(#450): add note for CA certificate file path in Redis SSL configuration

* test(#450): add comprehensive tests for Redis TLS configuration

* fix(#450): enhance Redis SSL configuration documentation and enforce CA cert requirement

* fix(#450): add nil TLS parameter to InitRedisClient calls in tests

Update all InitRedisClient function calls across test files to include the new nil parameter for TLS configuration. This change maintains backward compatibility by explicitly passing nil for TLS settings in non-TLS test scenarios.

* fix(#450): add default TLS configuration for Redis client when no tlsConf is provided
2026-01-13 16:27:16 +08:00
wangxiaolei d58d6cb5e2 fix: add server_host force listen to ipv4 (#566) 2026-01-12 19:00:58 +08:00
Byron.wang ca3d00229e Feat/Implement structured logging and Trace ID propagation (#552)
* use slog instead of log package and format to new log schema

* update the environment name to LOG_OUTPUT_FORMAT

* add the env to .env.example

* fix log reference error

* change the order of milldlewares

* delete unused code

* fix the concurrently session potential race condition

* fix the log format in tests

* update the duplicate code

* refactor: convert log functions to slog structured format

- Change log.Error/Info/Warn/Debug/Panic to accept msg + key-value pairs
- Remove printf-style formatting from log functions
- Update log calls in internal/cluster, internal/db, internal/core/session_manager
- Remove unused 'initialized' variable from log package
- Remaining files will be updated in follow-up commits

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: update all log call sites to use slog structured format

Convert all log.Error, log.Info, log.Warn, log.Debug, and log.Panic
calls from printf-style formatting to slog key-value pairs.

Before: log.Error("failed to do something: %s", err.Error())
After:  log.Error("failed to do something", "error", err)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: update cmd/ log calls to use slog structured format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: implement GnetLogger for structured logging in gnet

* refactor: remove deprecated log visibility functions and related calls

* feat: enhance session management with trace and identity context propagation

* feat: implement serverless transaction handler and writer for plugin runtime

* refactor: rename context field to traceCtx in RealBackwardsInvocation

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Yeuoly <admin@srmxy.cn>
2025-12-30 11:00:48 +08:00
Michael.Y.Ma 8ff1c2c9f2 Feat: Add OSS-specific parameters for HW and ALI private deployment (#539)
* Update internal/types/app/config.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update internal/server/server.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-12-17 16:36:56 +08:00
longbingljw ad7d3a1ab7 update config after mysql adaptation (#514)
* update config after mysql adaptation

* fix

* fix
2025-12-08 16:38:26 +08:00
Tonlo b06732f210 fix(plugin): support customized stdio buffer size, align serverless runtime with local runtime (#470)
* fix(plugin): support customized stdio buffer size, align serverless runtime with local runtime

* fix(plugin): update config naming to pluginRuntimeBufferSize & pluginRuntimeMaxBufferSize, and keep the compatibility to stdoutBufferSize

* fix: provide a default value for PLUGIN_RUNTIME_BUFFER_SIZE & PLUGIN_RUNTIME_MAX_BUFFER_SIZE

* fix: remove redundant logic

* fix: add compatibility to PLUGIN_STDIO_BUFFER_SIZE & PLUGIN_STDIO_MAX_BUFFER_SIZE
2025-10-15 19:28:21 +08:00
Yeuoly b85253f773 feat(plugin): implement unauthorized Langgenius plugin blocking (#458)
* feat(plugin): implement unauthorized Langgenius plugin blocking

- Added configuration option to disable installation of plugins falsely claiming Langgenius authorship.
- Introduced new error handling for unauthorized Langgenius claims during plugin installation.
- Implemented tests to validate unauthorized Langgenius detection logic.
- Updated environment configuration and service files to support the new feature.

* fix: typo

* refactor(plugin): update Langgenius plugin signature enforcement

- Renamed configuration option from DISABLE_UNAUTHORIZED_LANGGENIUS_PACKAGE to ENFORCE_LANGGENIUS_PLUGIN_SIGNATURES for clarity.
- Updated error messages and logic in the plugin installation process to reflect the new configuration.
- Enhanced tests to validate the behavior of unauthorized Langgenius plugin detection with the new enforcement setting.
2025-09-24 11:28:41 +08:00
Yeuoly dfc9622e91 feat(db): enhance database configuration with charset and extras support (#347)
- Updated .env.example to include DB_EXTRAS and DB_CHARSET variables.
- Refactored InitPluginDB functions for PostgreSQL and MySQL to accept a configuration struct, allowing for more flexible database connection settings.
- Adjusted connection pool settings to utilize new configuration options for charset and extras.

This change improves the configurability of database connections and prepares the codebase for future enhancements.
2025-06-18 12:08:56 +08:00
Byron.wang 18e91bbb37 fix s3 client path style not used (#344)
* bump cloud-kit version to fix #343

* change env name USE_AWS_S3 to S3_USE_AWS

* update s3_use_aws default value to true

* update readme about the upgrade notice
2025-06-13 15:10:21 +08:00
Byron.wang debb3744c0 add USE_AWS_S3 args avoid ambiguity. (#340) 2025-06-11 14:32:53 +08:00
Byron.wang 1c9e28bc75 Feat: Replace the internal/oss module with dify-cloud-kit (#317)
* replace internal oss with dify-cloud-kit

* remove validate

* fix tests

* fix tests
2025-05-30 16:44:59 +08:00
Zhi 6b112bc8b5 feat(redis): Add support for Redis Sentinel mode (#276)
* feat(redis): Add support for Redis Sentinel mode

Added support for Redis Sentinel mode to the Redis client, enabling automatic discovery and connection to the primary node through Sentinel. Updated relevant configuration files and initialization logic to support Sentinel mode configuration and connection.

* add lost RedisUser.
2025-05-20 14:23:01 +08:00
bravomark 7492a3d8cd feat: Support Alibaba Cloud OSS (#261)
* feat: support aliyun OSS

* feat: support aliyun OSS
2025-05-07 16:46:18 +08:00
Good Wood 977665e73b feat: add read & write timeout config (#259)
* feat: add read & write timeout config

* refactor: update Dify invocation configuration to use structured payload

- Changed the Dify invocation daemon to accept a structured payload for initialization, improving clarity and maintainability.
- Updated related configuration variables in the .env.example file to reflect the new naming convention for backwards invocation timeouts.
- Adjusted tests and plugin manager to accommodate the new payload structure.

---------

Co-authored-by: Yeuoly <admin@srmxy.cn>
2025-05-06 13:08:02 +08:00
quicksand 2858ac210c optimize (db): add db pool config (#251) 2025-04-30 15:36:35 +08:00
Yeuoly 61bd7d9c8a feat: add configurable stdio buffer sizes for plugins (#256)
- Introduced new configuration options for plugin stdio buffer sizes in the .env.example file.
- Updated the PluginManager and LocalPluginRuntime to utilize these new buffer size settings.
- Enhanced the stdioHolder to accept buffer size configurations, improving plugin output handling.
- Modified related tests to accommodate the new stdioHolder configuration structure.
2025-04-30 15:28:34 +08:00
非法操作 618609af3a add uv path config (#187)
* add uv path config

* write uv_path to env during docker build process

* Revert "write uv_path to env during docker build process"

This reverts commit c9501411aa.

* add UVPATH
2025-04-10 15:16:22 +08:00
Yeuoly 0a556dfd54 Merge pull request #172 from te-chan/feat/azure-blob-storage
feat(storage): add azure blob storage support
2025-04-08 14:41:48 +09:00
Yeuoly 5160e0848d Merge pull request #122 from ke-feng/ssl
Specifies the SSL mode for the database connection
2025-04-08 14:32:56 +09:00
te-chan 05e03e5de3 fix: incorrect environment variable name 2025-04-07 18:14:11 +09:00
te-chan 2f84673539 feat: Add Azure blob storage connectivity 2025-04-03 21:17:47 +09:00
kurokobo 6f75bcca43 feat: verify plugin with public keys specified in environment variable in addition to official one 2025-04-02 13:48:04 +00:00
Yeuoly b5fefd1a99 Merge pull request #152 from quicksandznzn/add-redis-db-config
optimize: add redis db config
2025-03-30 21:10:27 +09:00
quicksandzn b50a0c4403 optimize: add redis db config 2025-03-27 14:48:59 +08:00
akisaya a6e73807f1 remove S3_BUCKET_NAME in env.example & fix some logs 2025-03-22 18:42:33 +08:00
akisaya 038f152769 make pathStyle param configurable when using s3 compatible storage 2025-03-22 16:59:15 +08:00
Yeuoly ef41d22df4 Merge pull request #97 from quicksandznzn/main
feat: oss support tencent cos
2025-03-20 15:56:48 +08:00
kefeng-ai 597f40a778 Specifies the SSL mode for the database connection 2025-03-19 20:37:26 +08:00
yuhang2.zhang 261886167b update: Add Support for Custom S3 Endpoints to Enhance Compatibility with S3-Compatible Services. 2025-03-18 17:20:47 +08:00
quicksandzn d3db63ea68 feat: oss support tencent cos 2025-03-12 11:25:38 +08:00
Yeuoly 1d3342e730 fix: enhance env.example (#65) 2025-03-06 16:36:55 +08:00
非法操作 07a53a4fd7 change variable name 2025-01-14 09:16:18 +08:00
非法操作 d44eb84e5a Merge remote-tracking branch 'myfork/p3' into p2 2025-01-14 09:11:34 +08:00
非法操作 468c0743db use environment variable config python init time 2025-01-13 17:29:56 +08:00
非法操作 7b47d8b79a add proxy for runtime 2025-01-13 16:10:13 +08:00
Yeuoly afa910ed78 add PPROF_ENABLED and FORCE_VERIFYING_SIGNATURE to .env.example 2025-01-08 17:12:07 +08:00
Yeuoly 06ab89550a feat: support detailed logs 2024-11-26 23:42:35 +08:00
Yeuoly 28f4e82eb2 chore: remove unnecessary variables in .env.example 2024-11-13 00:44:24 +08:00
Yeuoly 89714978e8 fix: switch persistence layer to aws s3 2024-11-12 23:42:24 +08:00
Yeuoly aec7ef024a fix: incorrect persistence storage path 2024-11-08 19:31:32 +08:00
Yeuoly 84703ef1b4 refactor: uni storage 2024-11-08 19:17:19 +08:00
Yeuoly 3a5e1c1d66 fix: rename redis env 2024-10-23 18:23:32 +08:00
Yeuoly a55f6f507f refactor: install plugin from local 2024-10-18 20:29:02 +08:00
Yeuoly 140602667c fix: missing file extension 2024-09-20 14:28:46 +08:00
Yeuoly 755f3f1bb5 feat: support inner key 2024-09-20 13:32:46 +08:00
Yeuoly 1c2d5e6bca feat: support plugin assets 2024-09-04 20:35:56 +08:00
Yeuoly b338eb77ea feat: support persistence 2024-08-28 13:45:58 +08:00
Yeuoly 9715b2fffe chore: remove aws config 2024-08-28 12:56:40 +08:00