Skip to content

Commit 243b81c

Browse files
committed
Merge branch 'main' into post_release_v4.17
2 parents 7dea296 + 190682c commit 243b81c

44 files changed

Lines changed: 1178 additions & 725 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ENV NODE_ENV=production
2727
ENV NODE_PATH='dist'
2828

2929
# Install dependencies
30-
RUN apk --no-cache add python3 git jq openssh
30+
RUN apk --no-cache add python3 git jq openssh tini
3131

3232
# Install app
3333
RUN mkdir /app
@@ -42,4 +42,7 @@ RUN echo 'nouser:x:999:999::/home/nouser:/bin/sh' >> /etc/passwd
4242
USER node
4343
EXPOSE 8080
4444

45+
# tini is used as PID 1 to reap zombie child processes (e.g. git-remote-http)
46+
# that Node.js would otherwise leave unreaped, causing PID exhaustion over time
47+
ENTRYPOINT ["/sbin/tini", "--"]
4548
CMD ["node", "--max-http-header-size", "16384", "dist/src/app.js"]

package-lock.json

Lines changed: 116 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
"@linode/api-v4": "0.158.0",
1616
"@types/json-schema": "7.0.15",
1717
"@types/jsonwebtoken": "9.0.10",
18-
"axios": "1.13.6",
19-
"jose": "^6.2.1",
2018
"async-retry": "^1.3.3",
19+
"axios": "1.13.6",
2120
"clean-deep": "3.4.0",
2221
"cors": "2.8.6",
2322
"debug": "4.4.3",
@@ -29,43 +28,46 @@
2928
"fs-extra": "11.3.4",
3029
"generate-password": "1.7.1",
3130
"glob": "13.0.6",
31+
"jose": "^6.2.2",
3232
"jsonpath": "1.3.0",
3333
"jsonwebtoken": "9.0.3",
3434
"jwt-decode": "4.0.0",
3535
"lightship": "6.7.2",
3636
"lodash": "4.17.23",
3737
"morgan": "1.10.1",
38+
"semver": "^7.7.4",
3839
"simple-git": "3.33.0",
3940
"socket.io": "4.8.3",
4041
"swagger-ui-express": "5.0.1",
4142
"ts-custom-error": "3.3.1",
4243
"uuid": "13.0.0",
43-
"yaml": "2.8.2",
44+
"yaml": "2.8.3",
4445
"zod": "^4.3.6"
4546
},
4647
"description": "The brain of the Otomi Container Platform. Handling console input and talking to core, it knows what to do.",
4748
"devDependencies": {
4849
"@babel/core": "7.29.0",
49-
"@babel/preset-env": "7.29.0",
50+
"@babel/preset-env": "7.29.2",
5051
"@babel/preset-typescript": "7.28.5",
5152
"@commitlint/cli": "20.5.0",
5253
"@commitlint/config-conventional": "20.5.0",
5354
"@eslint/compat": "2.0.3",
5455
"@redocly/openapi-cli": "1.0.0-beta.95",
5556
"@semantic-release/changelog": "6.0.3",
56-
"@types/async-retry": "^1.4.8",
5757
"@semantic-release/git": "10.0.1",
58-
"@types/debug": "^4.1.12",
58+
"@types/async-retry": "^1.4.8",
59+
"@types/debug": "^4.1.13",
5960
"@types/expect": "24.3.2",
6061
"@types/express": "^5.0.6",
6162
"@types/fs-extra": "11.0.4",
6263
"@types/jest": "30.0.0",
6364
"@types/jsonpath": "0.2.4",
6465
"@types/lodash": "4.17.24",
6566
"@types/node": "24.12.0",
67+
"@types/semver": "^7.7.1",
6668
"@types/supertest": "7.2.0",
67-
"@typescript-eslint/eslint-plugin": "8.57.0",
68-
"@typescript-eslint/parser": "8.57.0",
69+
"@typescript-eslint/eslint-plugin": "8.57.1",
70+
"@typescript-eslint/parser": "8.57.1",
6971
"babel-jest": "30.3.0",
7072
"commitizen": "4.3.1",
7173
"copyfiles": "2.4.1",

src/api-v2.authz.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function createTeamResource(kind: AplKind, spec: Record<string, any>) {
2727
}
2828
}
2929

30-
jest.mock('./k8s_operations')
30+
jest.mock('./k8s-operations')
3131
jest.mock('./utils/sealedSecretUtils')
3232
beforeAll(async () => {
3333
jest.spyOn(console, 'log').mockImplementation(() => {})

src/api.authz.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const userToken = getToken([])
2020
const teamId = 'team1'
2121
const otherTeamId = 'team2'
2222

23-
jest.mock('./k8s_operations')
23+
jest.mock('./k8s-operations')
2424
jest.mock('./utils/sealedSecretUtils')
2525
beforeAll(async () => {
2626
jest.spyOn(console, 'log').mockImplementation(() => {})

src/api/v1/apps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const debug = Debug('otomi:api:v1:apps')
99
* Get all apps across all teams
1010
* Returns list of all apps with their ids and enabled status
1111
*/
12-
export const getApps = (req: OpenApiRequestExt, res: Response): void => {
12+
export const getApps = async (req: OpenApiRequestExt, res: Response): Promise<void> => {
1313
debug('getAllApps')
14-
res.json(req.otomi.getApps())
14+
res.json(await req.otomi.getApps())
1515
}

src/api/v1/apps/{teamId}.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ const debug = Debug('otomi:api:v1:apps')
99
* Get apps for a team
1010
* Returns list of team apps with their ids and enabled status
1111
*/
12-
export const getTeamApps = (req: OpenApiRequestExt, res: Response): void => {
12+
export const getTeamApps = async (req: OpenApiRequestExt, res: Response): Promise<void> => {
1313
const { teamId } = req.params
1414
debug('getTeamApps', teamId)
15-
res.json(req.otomi.getTeamApps(teamId))
15+
res.json(await req.otomi.getTeamApps(teamId))
1616
}
1717

1818
/**

src/api/v1/apps/{teamId}/{appId}.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { App, OpenApiRequestExt } from 'src/otomi-models'
55
* GET /v1/apps/{teamId}/{appId}
66
* Get a specific team app
77
*/
8-
export const getTeamApp = (req: OpenApiRequestExt, res: Response): void => {
8+
export const getTeamApp = async (req: OpenApiRequestExt, res: Response): Promise<void> => {
99
const { teamId, appId } = req.params
10-
res.json(req.otomi.getTeamApp(teamId, appId))
10+
res.json(await req.otomi.getTeamApp(teamId, appId))
1111
}
1212

1313
/**

src/api/v1/cloudtty.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const connectCloudtty = async (req: OpenApiRequestExt, res: Response): Pr
2323
export const deleteCloudtty = async (req: OpenApiRequestExt, res: Response): Promise<void> => {
2424
const sessionUser = req.user
2525
debug(`deleteCloudtty - ${sessionUser.email} - ${sessionUser.sub}`)
26-
await req.otomi.deleteCloudtty(sessionUser)
26+
const { teamId } = req.query as { teamId: string }
27+
await req.otomi.deleteCloudtty(teamId, sessionUser)
2728
res.json({})
2829
}

src/api/v1/sealedsecretskeys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Debug from 'debug'
22
import { Request, Response } from 'express'
3-
import { getSealedSecretsKeys } from 'src/k8s_operations'
3+
import { getSealedSecretsKeys } from 'src/k8s-operations'
44
import YAML from 'yaml'
55

66
const debug = Debug('otomi:api:v1:sealedsecrets')

0 commit comments

Comments
 (0)