@budibase/worker 2.13.15 → 2.13.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Dockerfile CHANGED
@@ -5,22 +5,38 @@ LABEL com.centurylinklabs.watchtower.lifecycle.pre-update="scripts/watchtower-ho
5
5
  LABEL com.centurylinklabs.watchtower.lifecycle.post-update="scripts/watchtower-hooks/post-update.sh"
6
6
  LABEL com.centurylinklabs.watchtower.lifecycle.post-check="scripts/watchtower-hooks/post-check.sh"
7
7
 
8
- WORKDIR /app
9
8
 
10
9
  # handle node-gyp
11
- RUN apk add --no-cache --virtual .gyp python3 make g++
10
+ RUN apk add --no-cache --virtual .gyp python3 make g++ jq
12
11
  RUN yarn global add pm2
13
12
 
13
+ WORKDIR /
14
+
15
+ COPY scripts/removeWorkspaceDependencies.sh scripts/removeWorkspaceDependencies.sh
16
+ RUN chmod +x ./scripts/removeWorkspaceDependencies.sh
17
+
18
+
19
+ WORKDIR /string-templates
20
+ COPY packages/string-templates/package.json package.json
21
+ RUN ../scripts/removeWorkspaceDependencies.sh package.json
22
+ RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000
23
+ COPY packages/string-templates .
24
+
14
25
 
15
- COPY package.json .
16
- COPY dist/yarn.lock .
17
- RUN yarn install --production=true --network-timeout 1000000
26
+ WORKDIR /app
27
+ COPY packages/worker/package.json .
28
+ COPY packages/worker/dist/yarn.lock .
29
+ RUN cd ../string-templates && yarn link && cd - && yarn link @budibase/string-templates
30
+
31
+ RUN ../scripts/removeWorkspaceDependencies.sh package.json
32
+
33
+ RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000
18
34
  # Remove unneeded data from file system to reduce image size
19
35
  RUN apk del .gyp \
20
36
  && yarn cache clean
21
37
 
22
- COPY dist/ dist/
23
- COPY docker_run.sh .
38
+ COPY packages/worker/dist/ dist/
39
+ COPY packages/worker/docker_run.sh .
24
40
 
25
41
  EXPOSE 4001
26
42
 
@@ -34,4 +50,9 @@ ENV POSTHOG_TOKEN=phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU
34
50
  ENV TENANT_FEATURE_FLAGS=*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR
35
51
  ENV ACCOUNT_PORTAL_URL=https://account.budibase.app
36
52
 
53
+ ARG BUDIBASE_VERSION
54
+ # Ensuring the version argument is sent
55
+ RUN test -n "$BUDIBASE_VERSION"
56
+ ENV BUDIBASE_VERSION=$BUDIBASE_VERSION
57
+
37
58
  CMD ["./docker_run.sh"]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/worker",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.13.15",
4
+ "version": "2.13.16",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -37,10 +37,10 @@
37
37
  "author": "Budibase",
38
38
  "license": "GPL-3.0",
39
39
  "dependencies": {
40
- "@budibase/backend-core": "2.13.15",
41
- "@budibase/pro": "2.13.15",
42
- "@budibase/string-templates": "2.13.15",
43
- "@budibase/types": "2.13.15",
40
+ "@budibase/backend-core": "2.13.16",
41
+ "@budibase/pro": "2.13.16",
42
+ "@budibase/string-templates": "2.13.16",
43
+ "@budibase/types": "2.13.16",
44
44
  "@koa/router": "8.0.8",
45
45
  "@techpass/passport-openidconnect": "0.3.2",
46
46
  "@types/global-agent": "2.1.1",
@@ -107,5 +107,5 @@
107
107
  }
108
108
  }
109
109
  },
110
- "gitHead": "8ada75c2f51c6ddff52676944b0d6e9395ea1c0b"
110
+ "gitHead": "ea1029726d55fb3604a8b1463e9ea159cdbd2aae"
111
111
  }
@@ -51,10 +51,22 @@ export async function removeAppRole(ctx: Ctx) {
51
51
  const users = await sdk.users.db.allUsers()
52
52
  const bulk = []
53
53
  const cacheInvalidations = []
54
+ const prodAppId = dbCore.getProdAppID(appId)
54
55
  for (let user of users) {
55
- if (user.roles[appId]) {
56
- cacheInvalidations.push(cache.user.invalidateUser(user._id))
57
- delete user.roles[appId]
56
+ let updated = false
57
+ if (user.roles[prodAppId]) {
58
+ cacheInvalidations.push(cache.user.invalidateUser(user._id!))
59
+ delete user.roles[prodAppId]
60
+ updated = true
61
+ }
62
+ if (user.builder && Array.isArray(user.builder?.apps)) {
63
+ const idx = user.builder.apps.indexOf(prodAppId)
64
+ if (idx !== -1) {
65
+ user.builder.apps.splice(idx, 1)
66
+ updated = true
67
+ }
68
+ }
69
+ if (updated) {
58
70
  bulk.push(user)
59
71
  }
60
72
  }
package/Dockerfile.v2 DELETED
@@ -1,58 +0,0 @@
1
- FROM node:18-alpine
2
-
3
- LABEL com.centurylinklabs.watchtower.lifecycle.pre-check="scripts/watchtower-hooks/pre-check.sh"
4
- LABEL com.centurylinklabs.watchtower.lifecycle.pre-update="scripts/watchtower-hooks/pre-update.sh"
5
- LABEL com.centurylinklabs.watchtower.lifecycle.post-update="scripts/watchtower-hooks/post-update.sh"
6
- LABEL com.centurylinklabs.watchtower.lifecycle.post-check="scripts/watchtower-hooks/post-check.sh"
7
-
8
-
9
- # handle node-gyp
10
- RUN apk add --no-cache --virtual .gyp python3 make g++ jq
11
- RUN yarn global add pm2
12
-
13
- WORKDIR /
14
-
15
- COPY scripts/removeWorkspaceDependencies.sh scripts/removeWorkspaceDependencies.sh
16
- RUN chmod +x ./scripts/removeWorkspaceDependencies.sh
17
-
18
-
19
- WORKDIR /string-templates
20
- COPY packages/string-templates/package.json package.json
21
- RUN ../scripts/removeWorkspaceDependencies.sh package.json
22
- RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000
23
- COPY packages/string-templates .
24
-
25
-
26
- WORKDIR /app
27
- COPY packages/worker/package.json .
28
- COPY packages/worker/dist/yarn.lock .
29
- RUN cd ../string-templates && yarn link && cd - && yarn link @budibase/string-templates
30
-
31
- RUN ../scripts/removeWorkspaceDependencies.sh package.json
32
-
33
- RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000
34
- # Remove unneeded data from file system to reduce image size
35
- RUN apk del .gyp \
36
- && yarn cache clean
37
-
38
- COPY packages/worker/dist/ dist/
39
- COPY packages/worker/docker_run.sh .
40
-
41
- EXPOSE 4001
42
-
43
- # have to add node environment production after install
44
- # due to this causing yarn to stop installing dev dependencies
45
- # which are actually needed to get this environment up and running
46
- ENV NODE_ENV=production
47
- ENV CLUSTER_MODE=${CLUSTER_MODE}
48
- ENV SERVICE=worker-service
49
- ENV POSTHOG_TOKEN=phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU
50
- ENV TENANT_FEATURE_FLAGS=*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR
51
- ENV ACCOUNT_PORTAL_URL=https://account.budibase.app
52
-
53
- ARG BUDIBASE_VERSION
54
- # Ensuring the version argument is sent
55
- RUN test -n "$BUDIBASE_VERSION"
56
- ENV BUDIBASE_VERSION=$BUDIBASE_VERSION
57
-
58
- CMD ["./docker_run.sh"]