Commit ff44e37
Stage (#9213)
* fix: remove and use only lax to avoid the oauth flow to be restrictive
* feat: migrate GitHub workflows to Ubicloud/Warp runners and normalize YAML quoting
* chore(deps): bump min-document from 2.19.0 to 2.19.2
Bumps [min-document](https://github.com/Raynos/min-document) from 2.19.0 to 2.19.2.
- [Commits](Raynos/min-document@v2.19.0...v2.19.2)
---
updated-dependencies:
- dependency-name: min-document
dependency-version: 2.19.2
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <[email protected]>
* feat(redis): migrate from cache-manager-redis-yet to @keyv/redis (#9172)
* feat(redis): improve Redis connection configuration
- Add pingInterval (30s) to prevent LB/firewall disconnections
- Add keepAlive (10s) for TCP keepalive
- Add reconnectStrategy with exponential backoff (1s-5s)
- Add connectTimeout (10s) for connection stability
- Apply improvements to session store, cache store, and health checks
- Optimize for DigitalOcean Valkey 8 compatibility
Resolves #9162 (step 4)
* fix typos
* fix(redis): implement true exponential backoff in reconnectStrategy
- Replace linear progression (1000 + retries * 200) with exponential backoff (1000 * 2^retries)
- Retry delays now: 1000ms, 2000ms, 4000ms, 5000ms (capped)
- Previous formula was arithmetic, not exponential as claimed in comment
- Apply fix to session store, cache store, and health checks
Resolves #9162 (reconnectStrategy fix)
* feat: migrate from cache-manager-redis-yet to @keyv/redis with production-ready options
- Replace outdated cache-manager-redis-yet with modern @keyv/redis adapter
- Create new CacheModule with Keyv Redis integration
- Add production-ready Redis connection options:
- keepAlive: 10_000ms for TCP keepalive
- reconnectStrategy with exponential backoff (1s-5s)
- connectTimeout: 10_000ms for connection stability
- pingInterval: 30_000ms to prevent LB/firewall disconnections
- isolationPoolOptions with connection pooling (min: 1, max: 100)
- TLS support for secure connections
- Configure Keyv options for optimal performance:
- namespace: 'gauzy-cache' for key organization
- useUnlink: true for better performance (UNLINK vs DEL)
- clearBatchSize: 1000 for batch operations
- throwOnConnectError: true for error handling
- Create CacheService with get/set/delete/clear methods
- Update app.module.ts to use new CacheModule
- Remove cache-manager-redis-yet dependency from package.json
* fix cspell
* fix redis config
* fix ttl config
* fix ttl config
* remove unused import
* chore: sanitize .env.sample - remove sensitive credentials
* Refactor cache service
* refactor(cache): migrate from cache-manager-redis-yet to cacheable with 2-layer non-blocking cache
- Replace cache-manager-redis-yet with cacheable package
- Implement 2-layer caching (in-memory L1 + Redis L2)
- Configure non-blocking mode for Redis operations
- Add Redis URL validation to prevent invalid URLs
- Remove custom cache module in favor of NestJS cache-manager integration
- Add fallback to in-memory cache if Redis connection fails
Follows NestJS caching documentation and cacheable best practices:
https://docs.nestjs.com/techniques/caching
https://cacheable.org/docs/cacheable/#non-blocking-with-keyvredis
* refactor(cache): simplify cache configuration using createKeyvNonBlocking helper
- Use createKeyvNonBlocking() helper function from @keyv/redis for non-blocking Redis setup
- Remove manual Redis client configuration (disableOfflineQueue, reconnectStrategy, event listeners)
- Remove explicit primary cache configuration (Cacheable manages in-memory LRU by default)
- Replace 'as any' type cast with factory function for type safety
- Simplify code from ~120 lines to ~40 lines while maintaining same functionality
Benefits:
- Automatic non-blocking configuration (disableOfflineQueue: true, reconnectStrategy: false, throwOnConnectError: false)
- Type-safe cache-manager integration without 'as any' cast
- Cleaner, more maintainable code following cacheable best practices
- Default in-memory LRU cache managed by Cacheable (Layer 1)
- Non-blocking Redis cache for distributed persistence (Layer 2)
Follows cacheable documentation:
https://cacheable.org/docs/cacheable/#non-blocking-with-keyvredis
* fix(cache): improve security and error handling
Security improvements:
- Remove credential logging: Replace plain-text Redis URL logging with sanitized connection info
- Log only host, port, and protocol (rediss/redis) without username/password
- Prevent credential exposure in application logs (compliance & security best practice)
Error handling improvements:
- Fix invalid fallback: Replace 'store: undefined' with proper in-memory config
- Add try-catch around Redis initialization to handle connection failures gracefully
- Return '{ isGlobal: true }' for in-memory fallback instead of broken 'store: undefined'
- Ensure cache operations continue to work even when Redis is unavailable
Before (security risk):
console.log('REDIS_URL: ', url); // Logs: redis://user:password@host:6379
After (secure):
console.log('Redis Cache: Connecting to redis://host:6379'); // No credentials
Before (broken fallback):
return { store: undefined }; // Cache operations will fail
After (working fallback):
return { isGlobal: true }; // In-memory cache works correctly
* fix 2layer cache
* add primary store
* fix config
* fix return
* fix deeepscan
* feat: add comprehensive Redis configuration properties for cache consistency
- Parse Redis URL to extract username, password, host, port
- Add conditional socket configuration based on TLS/TCP mode
- TLS mode: tls, passphrase, rejectUnauthorized, connectTimeout
- TCP mode: keepAlive, keepAliveInitialDelay, connectTimeout
- Add pingInterval for connection keep-alive
- Maintain consistency with RedisHealthIndicator configuration
- Respect non-blocking mode constraints (reconnectStrategy omitted)
* fix parse
* fix parse
* add default port
* improve parse int
* fix comment
---------
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: rolandm99 <[email protected]>
Co-authored-by: Paradoxe Ngwasi <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: samuel mbabhazi <[email protected]>File tree
61 files changed
+2254
-2170
lines changed- .github/workflows
- packages
- auth/src/lib/mcp/server
- core
- src/lib/app
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
61 files changed
+2254
-2170
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
| |||
348 | 349 | | |
349 | 350 | | |
350 | 351 | | |
| 352 | + | |
351 | 353 | | |
352 | 354 | | |
353 | 355 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
0 commit comments