chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
60158935f4
commit
6519682885
15831 files changed
+3063428
No files matched your search
@@ -0,0 +1,63 @@
|
||||
import type { CookieRewriteOptions, DevProxyConfig } from '@langgenius/dev-proxy'
|
||||
|
||||
const DIFY_CLOUD_TARGET = 'https://cloud.dify.ai'
|
||||
const DEV_PROXY_TARGET = process.env.DEV_PROXY_TARGET || DIFY_CLOUD_TARGET
|
||||
const DEV_PROXY_ENTERPRISE_TARGET = process.env.DEV_PROXY_ENTERPRISE_TARGET || DEV_PROXY_TARGET
|
||||
const DEV_PROXY_PUBLIC_TARGET = process.env.DEV_PROXY_PUBLIC_TARGET || DEV_PROXY_TARGET
|
||||
const DEV_PROXY_HOST = process.env.DEV_PROXY_HOST || '127.0.0.1'
|
||||
const DEV_PROXY_PORT = Number(process.env.DEV_PROXY_PORT || 5001)
|
||||
|
||||
const difyCookieRewrite: CookieRewriteOptions = {
|
||||
hostPrefixCookies: [
|
||||
'access_token',
|
||||
'csrf_token',
|
||||
'refresh_token',
|
||||
'webapp_access_token',
|
||||
/^passport-/,
|
||||
],
|
||||
localCookieScope: 'target-origin',
|
||||
csrfHeader: {
|
||||
cookieName: 'csrf_token',
|
||||
headerName: 'X-CSRF-Token',
|
||||
},
|
||||
}
|
||||
|
||||
export default {
|
||||
server: {
|
||||
host: DEV_PROXY_HOST,
|
||||
port: DEV_PROXY_PORT,
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
paths: [
|
||||
'/console/api/enterprise',
|
||||
'/api/enterprise',
|
||||
'/admin-api',
|
||||
'/inner/api',
|
||||
'/mfa',
|
||||
'/scim',
|
||||
'/v1/audit',
|
||||
'/v1/dashboard',
|
||||
'/v1/healthz',
|
||||
'/v1/plugin-manager',
|
||||
],
|
||||
target: DEV_PROXY_ENTERPRISE_TARGET,
|
||||
cookieRewrite: difyCookieRewrite,
|
||||
},
|
||||
{
|
||||
paths: ['/console/api', '/socket.io'],
|
||||
target: DEV_PROXY_TARGET,
|
||||
cookieRewrite: difyCookieRewrite,
|
||||
},
|
||||
{
|
||||
paths: ['/api'],
|
||||
target: DEV_PROXY_PUBLIC_TARGET,
|
||||
cookieRewrite: difyCookieRewrite,
|
||||
},
|
||||
],
|
||||
sessionImport: {
|
||||
refreshPath: '/console/api/refresh-token',
|
||||
cookieName: 'refresh_token',
|
||||
redirectTo: 'http://localhost:3000',
|
||||
},
|
||||
} satisfies DevProxyConfig
|
||||
Reference in new issue
Block a user