kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: deploy gateway to CF workers
rodzic
48c480eb00
commit
65a16d8453
|
@ -5,6 +5,7 @@ import * as Sentry from '@sentry/node'
|
|||
Sentry.init({
|
||||
dsn: process.env.SENTRY_DSN, // eslint-disable-line no-process-env
|
||||
environment: process.env.ENVIRONMENT || 'development', // eslint-disable-line no-process-env
|
||||
integrations: [Sentry.extraErrorDataIntegration()],
|
||||
tracesSampleRate: 1.0,
|
||||
integrations: [Sentry.extraErrorDataIntegration()]
|
||||
sendDefaultPii: true
|
||||
})
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
"source": "./src/worker.ts",
|
||||
"scripts": {
|
||||
"dev": "wrangler dev",
|
||||
"deploy": "wrangler deploy --var SENTRY_RELEASE:$(sentry-cli releases propose-version)",
|
||||
"deploy": "wrangler deploy --env production --outdir dist --upload-source-maps --var SENTRY_RELEASE:$(sentry-cli releases propose-version)",
|
||||
"cf-clear-cache": "del .wrangler",
|
||||
"clean": "del dist",
|
||||
"test": "run-s test:*",
|
||||
"test:typecheck": "tsc --noEmit",
|
||||
"test:unit": "vitest run",
|
||||
"sentry:sourcemaps": "_SENTRY_RELEASE=$(sentry-cli releases propose-version) && sentry-cli releases new $_SENTRY_RELEASE --org=agentic-platform --project=node && sentry-cli sourcemaps upload --org=agentic-platform --project=node --release=$_SENTRY_RELEASE --strip-prefix 'dist/..' dist",
|
||||
"sentry:sourcemaps": "_SENTRY_RELEASE=$(sentry-cli releases propose-version) && sentry-cli releases new $_SENTRY_RELEASE --org=agentic-platform --project=gateway && sentry-cli sourcemaps upload --org=agentic-platform --project=gateway --release=$_SENTRY_RELEASE --strip-prefix 'dist/..' dist",
|
||||
"postdeploy": "pnpm sentry:sourcemaps"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -13,7 +13,9 @@ export default Sentry.withSentry(
|
|||
(env: RawEnv) => ({
|
||||
dsn: env.SENTRY_DSN,
|
||||
environment: env.ENVIRONMENT,
|
||||
integrations: [Sentry.extraErrorDataIntegration()]
|
||||
integrations: [Sentry.extraErrorDataIntegration()],
|
||||
tracesSampleRate: 1.0,
|
||||
sendDefaultPii: true
|
||||
}),
|
||||
{
|
||||
async fetch(
|
||||
|
|
|
@ -13,12 +13,6 @@
|
|||
"enabled": true,
|
||||
"head_sampling_rate": 1
|
||||
},
|
||||
"routes": [
|
||||
{
|
||||
"pattern": "gateway.agentic.so",
|
||||
"custom_domain": true
|
||||
}
|
||||
],
|
||||
"migrations": [
|
||||
{
|
||||
"tag": "v1",
|
||||
|
@ -29,26 +23,73 @@
|
|||
]
|
||||
}
|
||||
],
|
||||
"durable_objects": {
|
||||
"bindings": [
|
||||
{
|
||||
"class_name": "DurableRateLimiter",
|
||||
"name": "DO_RATE_LIMITER"
|
||||
},
|
||||
{
|
||||
"class_name": "DurableMcpServer",
|
||||
"name": "DO_MCP_SERVER"
|
||||
},
|
||||
{
|
||||
"class_name": "DurableMcpClient",
|
||||
"name": "DO_MCP_CLIENT"
|
||||
}
|
||||
]
|
||||
"vars": {
|
||||
"ENVIRONMENT": "production",
|
||||
"AGENTIC_API_BASE_URL": "https://api.agentic.so"
|
||||
},
|
||||
"analytics_engine_datasets": [
|
||||
{
|
||||
"binding": "AE_USAGE_DATASET",
|
||||
"dataset": "agentic_gateway_usage"
|
||||
"env": {
|
||||
"development": {
|
||||
"vars": {
|
||||
"ENVIRONMENT": "development",
|
||||
"AGENTIC_API_BASE_URL": "http://localhost:3001"
|
||||
},
|
||||
// TODO: double-check whether all of this needs to be duplicated for each environment
|
||||
"durable_objects": {
|
||||
"bindings": [
|
||||
{
|
||||
"class_name": "DurableRateLimiter",
|
||||
"name": "DO_RATE_LIMITER"
|
||||
},
|
||||
{
|
||||
"class_name": "DurableMcpServer",
|
||||
"name": "DO_MCP_SERVER"
|
||||
},
|
||||
{
|
||||
"class_name": "DurableMcpClient",
|
||||
"name": "DO_MCP_CLIENT"
|
||||
}
|
||||
]
|
||||
},
|
||||
"analytics_engine_datasets": [
|
||||
{
|
||||
"binding": "AE_USAGE_DATASET",
|
||||
"dataset": "agentic_gateway_usage"
|
||||
}
|
||||
]
|
||||
},
|
||||
"production": {
|
||||
"routes": [
|
||||
{
|
||||
"pattern": "gateway.agentic.so",
|
||||
"custom_domain": true
|
||||
}
|
||||
],
|
||||
"vars": {
|
||||
"ENVIRONMENT": "production",
|
||||
"AGENTIC_API_BASE_URL": "https://api.agentic.so"
|
||||
},
|
||||
"durable_objects": {
|
||||
"bindings": [
|
||||
{
|
||||
"class_name": "DurableRateLimiter",
|
||||
"name": "DO_RATE_LIMITER"
|
||||
},
|
||||
{
|
||||
"class_name": "DurableMcpServer",
|
||||
"name": "DO_MCP_SERVER"
|
||||
},
|
||||
{
|
||||
"class_name": "DurableMcpClient",
|
||||
"name": "DO_MCP_CLIENT"
|
||||
}
|
||||
]
|
||||
},
|
||||
"analytics_engine_datasets": [
|
||||
{
|
||||
"binding": "AE_USAGE_DATASET",
|
||||
"dataset": "agentic_gateway_usage"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue