-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(api): add version endpoint for instance identification #2520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Conversation
… fixes, subflow resize clamping
…ribe, auth checks, new db indexes
…dioai#2481) The realtime service network policy was missing the custom egress rules section that allows configuration of additional egress rules via values.yaml. This caused the realtime pods to be unable to connect to external databases (e.g., PostgreSQL on port 5432) when using external database configurations. The app network policy already had this section, but the realtime network policy was missing it, creating an inconsistency and preventing the realtime service from accessing external databases configured via networkPolicy.egress values. This fix adds the same custom egress rules template section to the realtime network policy, matching the app network policy behavior and allowing users to configure database connectivity via values.yaml.
…rovements, additional kb tag types
Adds GET /api/version endpoint that returns: - Application version - Application name - Build time (if available) - Git commit hash (if available) - Node environment This helps users identify the version of a running Sim Studio instance. Fixes simstudioai#2014
|
@majiayu000 is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryAdded a new Changes:
Issues Found:
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant API as GET /api/version
participant Env as Environment Variables
Client->>API: HTTP GET /api/version
API->>Env: Read APP_VERSION
Env-->>API: process.env.npm_package_version || process.env.APP_VERSION || '0.1.0'
API->>Env: Read BUILD_TIME
Env-->>API: process.env.BUILD_TIME || null
API->>Env: Read GIT_COMMIT
Env-->>API: process.env.VERCEL_GIT_COMMIT_SHA || process.env.GIT_COMMIT || null
API->>Env: Read NODE_ENV
Env-->>API: process.env.NODE_ENV
API->>API: Format git commit (first 7 chars)
API->>Client: JSON response {version, name, buildTime, gitCommit, nodeEnv}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
apps/sim/app/api/version/route.ts, line 22 (link)logic: exposing
NODE_ENVcould reveal whether the instance is in development/staging/production, which may aid attackers in reconnaissance
2 files reviewed, 1 comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (2)
-
apps/sim/app/api/version/route.ts, line 6 (link)logic:
process.env.npm_package_versionis undefined at runtime in Next.js.npm_package_*variables are only available during npm script execution, not in the deployed app. -
apps/sim/app/api/version/route.ts, line 14-15 (link)logic: Environment variables
BUILD_TIME,GIT_COMMIT, andAPP_VERSIONneed to be set during Docker build. Add build args todocker/app.Dockerfile:ARG BUILD_TIME ARG GIT_COMMIT ARG APP_VERSION ENV BUILD_TIME=${BUILD_TIME} ENV GIT_COMMIT=${GIT_COMMIT} ENV APP_VERSION=${APP_VERSION}And pass them in
.github/workflows/images.ymlbuild step.
2 files reviewed, 2 comments
Summary
Test plan
curl /api/versionFixes #2014