From 8388838703001332176e7d90b4a4f5ba866cbde3 Mon Sep 17 00:00:00 2001 From: Vijaykant Yadav Date: Thu, 3 Jul 2025 12:41:36 +0530 Subject: [PATCH 01/24] fix: disable pages on modules --- .../src/AppBuilder/AppCanvas/AppCanvas.jsx | 2 +- .../RightSideBar/RightSidebarToggle.jsx | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx b/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx index 12d33283c8..1566e87287 100644 --- a/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx +++ b/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx @@ -182,7 +182,7 @@ export const AppCanvas = ({ appId, isViewer = false, switchDarkMode, darkMode }) )} style={canvasContainerStyles} > - {showOnDesktop && ( + {showOnDesktop && appType !== 'module' && ( { @@ -13,6 +14,7 @@ const RightSidebarToggle = ({ darkMode = false }) => { (state) => [state.isRightSidebarOpen, state.setRightSidebarOpen], shallow ); + const { appType } = useModuleContext(); const setActiveRightSideBarTab = useStore((state) => state.setActiveRightSideBarTab); const activeRightSideBarTab = useStore((state) => state.activeRightSideBarTab); const isRightSidebarPinned = useStore((state) => state.isRightSidebarPinned); @@ -50,16 +52,18 @@ const RightSidebarToggle = ({ darkMode = false }) => { className={`left-sidebar-item left-sidebar-layout left-sidebar-inspector`} tip="Component properties" /> - { - handleToggle(RIGHT_SIDE_BAR_TAB.PAGES); - }} - darkMode={darkMode} - icon="file01" - className={`left-sidebar-item left-sidebar-layout left-sidebar-inspector`} - tip="Page settings" - /> + {appType !== 'module' && ( + { + handleToggle(RIGHT_SIDE_BAR_TAB.PAGES); + }} + darkMode={darkMode} + icon="file01" + className={`left-sidebar-item left-sidebar-layout left-sidebar-inspector`} + tip="Page settings" + /> + )} ); }; From 108aa42eea4f27385b72d9ea91a33983713973bf Mon Sep 17 00:00:00 2001 From: Kavin Venkatachalam Date: Thu, 3 Jul 2025 16:38:40 +0530 Subject: [PATCH 02/24] fix: show modules inside the editor --- frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx b/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx index 1566e87287..1c7d2d6d69 100644 --- a/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx +++ b/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx @@ -202,6 +202,7 @@ export const AppCanvas = ({ appId, isViewer = false, switchDarkMode, darkMode }) scrollbarWidth: 'none', overflow: 'auto', width: currentMode === 'view' ? `calc(100% - ${isViewerSidebarPinned ? '0px' : '0px'})` : '100%', + height: 'inherit', }} className={`app-${appId} _tooljet-page-${getPageId()}`} > @@ -213,7 +214,7 @@ export const AppCanvas = ({ appId, isViewer = false, switchDarkMode, darkMode }) {environmentLoadingState !== 'loading' && (
Date: Wed, 2 Jul 2025 14:18:59 +0530 Subject: [PATCH 03/24] fix: add fallback for useModuleId hook in query panel Handle case where ModuleContext is not available by wrapping useModuleId in try-catch with 'canvas' fallback --- frontend/package.json | 2 +- .../src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 57785151d3..3034d57e39 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -267,4 +267,4 @@ "jsx" ] } -} +} \ No newline at end of file diff --git a/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js b/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js index 1a41a7f19b..b5f549a354 100644 --- a/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js +++ b/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js @@ -7,7 +7,14 @@ export const useQueryPanelKeyHooks = (onChange, value, type) => { const queryPanelHeight = useStore((state) => state.queryPanel.queryPanelHeight); const runQueryOnShortcut = useStore((state) => state.queryPanel.runQueryOnShortcut); const previewQueryOnShortcut = useStore((state) => state.queryPanel.previewQueryOnShortcut); - const moduleId = useModuleId(); + + // Handle case where ModuleContext is not available + let moduleId; + try { + moduleId = useModuleId(); + } catch (error) { + moduleId = 'canvas'; // Default fallback + } const location = useLocation(); const { pathname } = location; From d9b6efefadb24010586d6f50d23f8190e2ee6e43 Mon Sep 17 00:00:00 2001 From: Kavin Venkatachalam Date: Thu, 3 Jul 2025 16:39:19 +0530 Subject: [PATCH 04/24] Updated submodules ref --- frontend/ee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/ee b/frontend/ee index 0ae5dac299..a2aaf14252 160000 --- a/frontend/ee +++ b/frontend/ee @@ -1 +1 @@ -Subproject commit 0ae5dac299e4a72e219243255722fbea2f530808 +Subproject commit a2aaf14252bfe033d52c37675bfc75aa03bf9389 From edf657b659f5a9b2433473493b2ae139e2ada188 Mon Sep 17 00:00:00 2001 From: Kavin Venkatachalam Date: Thu, 3 Jul 2025 17:47:41 +0530 Subject: [PATCH 05/24] Revert "fix: add fallback for useModuleId hook in query panel" This reverts commit 27ba7dec307a4c365971109cbe445a2cbba0ad69. --- frontend/package.json | 2 +- .../src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 3034d57e39..57785151d3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -267,4 +267,4 @@ "jsx" ] } -} \ No newline at end of file +} diff --git a/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js b/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js index b5f549a354..1a41a7f19b 100644 --- a/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js +++ b/frontend/src/AppBuilder/CodeEditor/useQueryPanelKeyHooks.js @@ -7,14 +7,7 @@ export const useQueryPanelKeyHooks = (onChange, value, type) => { const queryPanelHeight = useStore((state) => state.queryPanel.queryPanelHeight); const runQueryOnShortcut = useStore((state) => state.queryPanel.runQueryOnShortcut); const previewQueryOnShortcut = useStore((state) => state.queryPanel.previewQueryOnShortcut); - - // Handle case where ModuleContext is not available - let moduleId; - try { - moduleId = useModuleId(); - } catch (error) { - moduleId = 'canvas'; // Default fallback - } + const moduleId = useModuleId(); const location = useLocation(); const { pathname } = location; From ace4fe754cb7ca562bd48ee2a439adeb389d7f72 Mon Sep 17 00:00:00 2001 From: Kavin Venkatachalam Date: Thu, 3 Jul 2025 17:49:20 +0530 Subject: [PATCH 06/24] fix: Added a fallback for module context --- frontend/src/AppBuilder/_contexts/ModuleContext.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/AppBuilder/_contexts/ModuleContext.jsx b/frontend/src/AppBuilder/_contexts/ModuleContext.jsx index d0f2b96c31..b216743ed2 100644 --- a/frontend/src/AppBuilder/_contexts/ModuleContext.jsx +++ b/frontend/src/AppBuilder/_contexts/ModuleContext.jsx @@ -13,7 +13,7 @@ export const ModuleProvider = ({ moduleId, isModuleMode, appType, isModuleEditor export const useModuleContext = () => { const context = useContext(ModuleContext); if (!context) { - throw new Error('useModuleContext must be used within a ModuleProvider'); + return { moduleId: 'canvas', isModuleMode: false, isModuleEditor: false }; } return context; }; @@ -21,7 +21,7 @@ export const useModuleContext = () => { export const useModuleId = () => { const context = useContext(ModuleContext); if (!context) { - throw new Error('useModuleId must be used within a ModuleProvider'); + return 'canvas'; } return context.moduleId; From 841d66078342bb08bf7eda4a31928af1db3b1bac Mon Sep 17 00:00:00 2001 From: Kavin Venkatachalam Date: Thu, 3 Jul 2025 19:15:20 +0530 Subject: [PATCH 07/24] fix: modules are hidden if the query manager is expanded --- frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx b/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx index 1c7d2d6d69..b48143f383 100644 --- a/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx +++ b/frontend/src/AppBuilder/AppCanvas/AppCanvas.jsx @@ -202,7 +202,7 @@ export const AppCanvas = ({ appId, isViewer = false, switchDarkMode, darkMode }) scrollbarWidth: 'none', overflow: 'auto', width: currentMode === 'view' ? `calc(100% - ${isViewerSidebarPinned ? '0px' : '0px'})` : '100%', - height: 'inherit', + ...(appType === 'module' && isModuleMode && { height: 'inherit' }), }} className={`app-${appId} _tooljet-page-${getPageId()}`} > From f60784aecc00f2075fa8884a82004e075d1219a1 Mon Sep 17 00:00:00 2001 From: johnsoncherian Date: Thu, 3 Jul 2025 20:36:37 +0530 Subject: [PATCH 08/24] chore: update version for release --- frontend/ee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/ee b/frontend/ee index a2aaf14252..c5cd423567 160000 --- a/frontend/ee +++ b/frontend/ee @@ -1 +1 @@ -Subproject commit a2aaf14252bfe033d52c37675bfc75aa03bf9389 +Subproject commit c5cd423567d754d5a1edfa195faf9074c163da83 From b8aceb2e7a46131e14a973862a0a773e305d8f0a Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Thu, 3 Jul 2025 20:49:15 +0530 Subject: [PATCH 09/24] fix: Update server installation steps in Dockerfile for consistency (#13183) --- docker/cloud/cloud-server.Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/cloud/cloud-server.Dockerfile b/docker/cloud/cloud-server.Dockerfile index 7c04f8e567..08b56258da 100644 --- a/docker/cloud/cloud-server.Dockerfile +++ b/docker/cloud/cloud-server.Dockerfile @@ -44,8 +44,10 @@ ENV NODE_ENV=production # Building ToolJet server COPY ./server/package.json ./server/package-lock.json ./server/ -RUN npm --prefix server install --only=production +RUN npm --prefix server install COPY ./server/ ./server/ +RUN npm install -g @nestjs/cli +RUN npm install -g copyfiles RUN npm --prefix server run build FROM debian:12 From 317f1e913f4d5257b3c46cf3eb5fb6baaf3472bf Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Thu, 3 Jul 2025 20:58:10 +0530 Subject: [PATCH 10/24] fix: Update path for server keys in Dockerfile (#13184) --- docker/cloud/cloud-server.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/cloud/cloud-server.Dockerfile b/docker/cloud/cloud-server.Dockerfile index 08b56258da..2259c8cecb 100644 --- a/docker/cloud/cloud-server.Dockerfile +++ b/docker/cloud/cloud-server.Dockerfile @@ -99,7 +99,7 @@ COPY --from=builder /app/plugins/package.json ./app/plugins/package.json # copy server build COPY --from=builder /app/server/package.json ./app/server/package.json COPY --from=builder /app/server/.version ./app/server/.version -COPY --from=builder /app/server/keys ./app/server/keys +COPY --from=builder /app/server/ee/keys ./app/server/ee/keys COPY --from=builder /app/server/node_modules ./app/server/node_modules COPY --from=builder /app/server/templates ./app/server/templates COPY --from=builder /app/server/scripts ./app/server/scripts From 1c2b312b9e52d16b22511a72a474eab395c78ae9 Mon Sep 17 00:00:00 2001 From: johnsoncherian Date: Thu, 3 Jul 2025 21:02:31 +0530 Subject: [PATCH 11/24] chore: update version for release --- frontend/ee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/ee b/frontend/ee index c5cd423567..576b20238c 160000 --- a/frontend/ee +++ b/frontend/ee @@ -1 +1 @@ -Subproject commit c5cd423567d754d5a1edfa195faf9074c163da83 +Subproject commit 576b20238ceaa6920a8b7da6c49d4d6baee29ac6 From e051caca47b0ed5a52aad3ec346acdfb2262a31b Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Thu, 3 Jul 2025 21:47:25 +0530 Subject: [PATCH 12/24] fix: Update environment variable secrets for cloud deployment (#13171) * fix: Update environment variable secrets for cloud deployment * Add submodule checkout step to cloud frontend deployment workflow * fix: Update checkout step to use actions/checkout@v4 and streamline configuration * fix: Add missing environment variables for cloud deployment * Update Node.js and NPM versions in Netlify configuration --- .github/workflows/cloud-frontend.yml | 37 +++++++++++++++++++--------- netlify.toml | 7 +++--- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cloud-frontend.yml b/.github/workflows/cloud-frontend.yml index ee8c59ab4a..e8d4171248 100644 --- a/.github/workflows/cloud-frontend.yml +++ b/.github/workflows/cloud-frontend.yml @@ -36,10 +36,12 @@ jobs: # exit 1 # fi - - name: Checkout code - uses: actions/checkout@v2 + - name: Checkout code (with submodules) + uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.branch }} + token: ${{ secrets.TOKEN_PR }} + submodules: recursive - name: Setup Node.js uses: actions/setup-node@v2 @@ -52,16 +54,16 @@ jobs: - name: Build the project run: npm run build:plugins:prod && npm run build:frontend env: - GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }} - NODE_ENV: ${{ secrets.NODE_ENV }} - NODE_OPTIONS: ${{ secrets.NODE_OPTIONS }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - SERVE_CLIENT: ${{ secrets.SERVE_CLIENT }} - SERVER_IP: ${{ secrets.SERVER_IP }} - TJDB_SQL_MODE_DISABLE: ${{ secrets.TJDB_SQL_MODE_DISABLE }} - TOOLJET_SERVER_URL: ${{ secrets.TOOLJET_SERVER_URL }} + GOOGLE_MAPS_API_KEY: ${{ secrets.CLOUD_GOOGLE_MAPS_API_KEY }} + NODE_ENV: ${{ secrets.CLOUD_NODE_ENV }} + NODE_OPTIONS: ${{ secrets.CLOUD_NODE_OPTIONS }} + SENTRY_AUTH_TOKEN: ${{ secrets.CLOUD_SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.CLOUD_SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.CLOUD_SENTRY_PROJECT }} + SERVE_CLIENT: ${{ secrets.CLOUD_SERVE_CLIENT }} + SERVER_IP: ${{ secrets.CLOUD_SERVER_IP }} + TJDB_SQL_MODE_DISABLE: ${{ secrets.CLOUD_TJDB_SQL_MODE_DISABLE }} + TOOLJET_SERVER_URL: ${{ secrets.CLOUD_TOOLJET_SERVER_URL }} TOOLJET_EDITION: cloud - name: Deploy to Netlify @@ -70,6 +72,17 @@ jobs: netlify deploy --prod --dir=frontend/build --auth=$NETLIFY_AUTH_TOKEN --site=${{ secrets.CLOUD_NETLIFY_SITE_ID }} env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + GOOGLE_MAPS_API_KEY: ${{ secrets.CLOUD_GOOGLE_MAPS_API_KEY }} + NODE_ENV: ${{ secrets.CLOUD_NODE_ENV }} + NODE_OPTIONS: ${{ secrets.CLOUD_NODE_OPTIONS }} + SENTRY_AUTH_TOKEN: ${{ secrets.CLOUD_SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.CLOUD_SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.CLOUD_SENTRY_PROJECT }} + SERVE_CLIENT: ${{ secrets.CLOUD_SERVE_CLIENT }} + SERVER_IP: ${{ secrets.CLOUD_SERVER_IP }} + TJDB_SQL_MODE_DISABLE: ${{ secrets.CLOUD_TJDB_SQL_MODE_DISABLE }} + TOOLJET_SERVER_URL: ${{ secrets.CLOUD_TOOLJET_SERVER_URL }} + TOOLJET_EDITION: cloud - name: ✅ Deployment complete run: echo "🎉 Deployment to Netlify successful for branch ${{ github.event.inputs.branch }} by ${{ github.actor }}" diff --git a/netlify.toml b/netlify.toml index b6e4bc7077..cea3f8a356 100644 --- a/netlify.toml +++ b/netlify.toml @@ -4,9 +4,10 @@ command = "npm run build:plugins:prod && npm run build:frontend" [template.environment] - NODE_ENV = "production" - NODE_VERSION = "14.17.3" - NPM_VERSION = "7.20.0" + NODE_ENV = "production" + TOOOLJET_EDITION = "cloud" + NODE_VERSION = "22.15.1" + NPM_VERSION = "10.9.2" [[redirects]] from = "/*" From 0e8ed516b8e48716ba37ca6f20adade07fea95c3 Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Thu, 3 Jul 2025 22:31:21 +0530 Subject: [PATCH 13/24] fix: Correct typo in TOOLJET_EDITION and update redirects in netlify.toml (#13186) --- netlify.toml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/netlify.toml b/netlify.toml index cea3f8a356..2a4817c6d2 100644 --- a/netlify.toml +++ b/netlify.toml @@ -5,11 +5,12 @@ [template.environment] NODE_ENV = "production" - TOOOLJET_EDITION = "cloud" + TOOLJET_EDITION = "cloud" NODE_VERSION = "22.15.1" NPM_VERSION = "10.9.2" [[redirects]] - from = "/*" - to = "/" - status = 200 \ No newline at end of file + from = "/api/*" + to = "https://gcpstage-server.tooljet.ai/api/:splat" + status = 200 + force = true \ No newline at end of file From 86151ee64d1e8af61f03eeaab2b489372d1e9ae4 Mon Sep 17 00:00:00 2001 From: adishM98 Bot Date: Thu, 3 Jul 2025 17:02:08 +0000 Subject: [PATCH 14/24] =?UTF-8?q?=F0=9F=94=84=20chore:=20update=20submodul?= =?UTF-8?q?es=20to=20latest=20main=20after=20auto-merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/ee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/ee b/frontend/ee index 0ae5dac299..576b20238c 160000 --- a/frontend/ee +++ b/frontend/ee @@ -1 +1 @@ -Subproject commit 0ae5dac299e4a72e219243255722fbea2f530808 +Subproject commit 576b20238ceaa6920a8b7da6c49d4d6baee29ac6 From 441306a1de900caf6f6ef3934d5c715e3292c47b Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Thu, 3 Jul 2025 22:37:08 +0530 Subject: [PATCH 15/24] Update netlify.toml (#13187) --- netlify.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 2a4817c6d2..46d828d6b5 100644 --- a/netlify.toml +++ b/netlify.toml @@ -13,4 +13,9 @@ from = "/api/*" to = "https://gcpstage-server.tooljet.ai/api/:splat" status = 200 - force = true \ No newline at end of file + force = true + +[[redirects]] + from = "/*" + to = "/" + status = 200 From 6355d6d509e447151ecfe70e259d5bb0bf267c3d Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Thu, 3 Jul 2025 23:02:06 +0530 Subject: [PATCH 16/24] fix: Remove outdated API redirects from netlify.toml (#13188) --- netlify.toml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/netlify.toml b/netlify.toml index 46d828d6b5..07787f351c 100644 --- a/netlify.toml +++ b/netlify.toml @@ -9,12 +9,6 @@ NODE_VERSION = "22.15.1" NPM_VERSION = "10.9.2" -[[redirects]] - from = "/api/*" - to = "https://gcpstage-server.tooljet.ai/api/:splat" - status = 200 - force = true - [[redirects]] from = "/*" to = "/" From eae10cddebf1dbc9a01d7aaf9a5003e95cb074e8 Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Fri, 4 Jul 2025 12:00:20 +0530 Subject: [PATCH 17/24] Update Docker image build references and add cloud edition workflow (#13191) --- .github/workflows/docker-release.yml | 107 +++++++++++++-------------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index ca3a7420b7..7afca64ea7 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -21,7 +21,7 @@ jobs: if: "contains(github.event.release.tag_name, '-ce-lts')" uses: actions/checkout@v2 with: - ref: refs/heads/lts-4.0 + ref: refs/heads/lts-3.6 # Create Docker Buildx builder with platform configuration - name: Set up Docker Buildx @@ -99,7 +99,7 @@ jobs: steps: - name: Checkout code to main for pre-release EE edition - if: "!contains(github.event.release.tag_name, 'ee-lts')" + if: "!contains(github.event.release.tag_name, '-lts')" uses: actions/checkout@v2 with: ref: refs/heads/main @@ -108,7 +108,7 @@ jobs: if: "contains(github.event.release.tag_name, '-ee-lts')" uses: actions/checkout@v2 with: - ref: refs/heads/lts-4.0 + ref: refs/heads/lts-3.6 # Create Docker Buildx builder with platform configuration - name: Set up Docker Buildx @@ -148,7 +148,6 @@ jobs: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and Push Docker image for LTS tag if: "contains(github.event.release.tag_name, '-ee-lts')" uses: docker/build-push-action@v4 @@ -156,7 +155,7 @@ jobs: context: . build-args: | CUSTOM_GITHUB_TOKEN=${{ secrets.CUSTOM_GITHUB_TOKEN }} - BRANCH_NAME=lts + BRANCH_NAME=lts-3.6 file: docker/ee/ee-production.Dockerfile push: true tags: tooljet/tooljet-ee:${{ github.event.release.tag_name }},tooljet/tooljet-ee:ee-lts-latest,tooljet/tooljet:ee-lts-latest,tooljet/tooljet:${{ github.event.release.tag_name }} @@ -176,64 +175,64 @@ jobs: curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }} -# commented out for now, since cloud modularisation is not yet ready + build-tooljet-image-for-cloud-edtion: - # build-tooljet-image-for-cloud-edtion: + runs-on: ubuntu-latest + if: "${{ github.event.release }}" - # runs-on: ubuntu-latest - # if: "${{ github.event.release }}" + steps: + - name: Checkout code to LTS for Cloud LTS edition + if: "contains(github.event.release.tag_name, '-cloud-lts')" + uses: actions/checkout@v2 + with: + ref: refs/heads/lts-3.6 - # steps: - # - name: Checkout code to LTS for Cloud LTS edition - # if: "contains(github.event.release.tag_name, '-cloud-lts')" - # uses: actions/checkout@v2 - # with: - # ref: refs/heads/lts-4.0 + # Create Docker Buildx builder with platform configuration + - name: Set up Docker Buildx + run: | + mkdir -p ~/.docker/cli-plugins + curl -SL https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx + chmod a+x ~/.docker/cli-plugins/docker-buildx + docker buildx create --name mybuilder --platform linux/arm64,linux/amd64,linux/amd64/v2,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6 + docker buildx use mybuilder - # # Create Docker Buildx builder with platform configuration - # - name: Set up Docker Buildx - # run: | - # mkdir -p ~/.docker/cli-plugins - # curl -SL https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx - # chmod a+x ~/.docker/cli-plugins/docker-buildx - # docker buildx create --name mybuilder --platform linux/arm64,linux/amd64,linux/amd64/v2,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6 - # docker buildx use mybuilder + - name: Set DOCKER_CLI_EXPERIMENTAL + run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV - # - name: Set DOCKER_CLI_EXPERIMENTAL - # run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV + - name: use mybuilder buildx + run: docker buildx use mybuilder - # - name: use mybuilder buildx - # run: docker buildx use mybuilder + - name: Docker Login + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - # - name: Docker Login - # uses: docker/login-action@v2 - # with: - # username: ${{ secrets.DOCKER_USERNAME }} - # password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and Push Docker image for LTS tag + if: "contains(github.event.release.tag_name, '-cloud-lts')" + uses: docker/build-push-action@v4 + with: + context: . + build-args: | + CUSTOM_GITHUB_TOKEN=${{ secrets.CUSTOM_GITHUB_TOKEN }} + BRANCH_NAME=lts-3.6 + file: docker/cloud/cloud-server.Dockerfile + push: true + tags: tooljet/saas:${{ github.event.release.tag_name }} + platforms: linux/amd64 + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - # - name: Build and Push Docker image for LTS tag - # if: "contains(github.event.release.tag_name, '-cloud-lts')" - # uses: docker/build-push-action@v4 - # with: - # context: . - # args: ${{ secrets.CUSTOM_GITHUB_TOKEN }} - # file: docker/cloud/cloud-server.Dockerfile - # push: true - # tags: tooljet/saas:${{ github.event.release.tag_name }} - # platforms: linux/amd64 - # env: - # DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - # DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + - name: Send Slack Notification + run: | + if [[ "${{ job.status }}" == "success" ]]; then + message="ToolJet cloud image published:\n\`tooljet/saas:${{ github.event.release.tag_name }}\`" + else + message="Job '${{ env.JOB_NAME }}' failed! Image built:\n\`tooljet/saas:${{ github.event.release.tag_name }}\`" + fi - # - name: Send Slack Notification - # run: | - # if [[ "${{ job.status }}" == "success" ]]; then - # message="ToolJet cloud image published:\n\`tooljet/saas:${{ github.event.release.tag_name }}\`" - # else - # message="Job '${{ env.JOB_NAME }}' failed! Image built:\n\`tooljet/saas:${{ github.event.release.tag_name }}\`" - # fi - - # curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }} + curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }} try-tooljet-image-build: From c99e7dd856d466323cbf2935e20ce4df9d1374e9 Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Fri, 4 Jul 2025 17:46:30 +0530 Subject: [PATCH 18/24] fix: Restore authorization check in cloud frontend deployment workflow (#13195) * fix: Restore authorization check in cloud frontend deployment workflow * fix: Reinstate branch prefix validation in cloud frontend deployment workflow * fix: Enhance Netlify deployment step for cleaner output * fix: Update cloud frontend deployment workflow for improved clarity and authorization checks * Remove deployment completion message from cloud frontend workflow * Remove branch prefix validation from cloud frontend deployment workflow --- .github/workflows/cloud-frontend.yml | 54 ++++++++-------------------- 1 file changed, 14 insertions(+), 40 deletions(-) diff --git a/.github/workflows/cloud-frontend.yml b/.github/workflows/cloud-frontend.yml index e8d4171248..20025bf82c 100644 --- a/.github/workflows/cloud-frontend.yml +++ b/.github/workflows/cloud-frontend.yml @@ -4,9 +4,8 @@ on: workflow_dispatch: inputs: branch: - description: 'Branch to deploy (must start with lts/)' + description: 'Git branch to deploy (must start with "lts-", e.g., lts-3.6)' required: true - default: 'lts/latest' jobs: build: @@ -14,27 +13,20 @@ jobs: steps: - # - name: Check authorization - # run: | - # allowed_user1=${{ secrets.ALLOWED_USER1_USERNAME }} - # allowed_user2=${{ secrets.ALLOWED_USER2_USERNAME }} - # allowed_user3=${{ secrets.ALLOWED_USER3_USERNAME }} + - name: Check user authorization + run: | + allowed_user1=${{ secrets.ALLOWED_USER1_USERNAME }} + allowed_user2=${{ secrets.ALLOWED_USER2_USERNAME }} + allowed_user3=${{ secrets.ALLOWED_USER3_USERNAME }} - # if [[ "${{ github.actor }}" != "$allowed_user1" && \ - # "${{ github.actor }}" != "$allowed_user2" && \ - # "${{ github.actor }}" != "$allowed_user3" ]]; then - # echo "❌ User '${{ github.actor }}' is not authorized to trigger this workflow." - # exit 1 - # else - # echo "✅ User '${{ github.actor }}' is authorized." - # fi - - # - name: Validate branch prefix - # run: | - # if [[ "${{ github.event.inputs.branch }}" != lts/* ]]; then - # echo "❌ Branch name must start with 'lts/'" - # exit 1 - # fi + if [[ "${{ github.actor }}" != "$allowed_user1" && \ + "${{ github.actor }}" != "$allowed_user2" && \ + "${{ github.actor }}" != "$allowed_user3" ]]; then + echo "❌ User '${{ github.actor }}' is not authorized to trigger this workflow." + exit 1 + else + echo "✅ User '${{ github.actor }}' is authorized." + fi - name: Checkout code (with submodules) uses: actions/checkout@v4 @@ -51,21 +43,6 @@ jobs: - name: Install dependencies run: npm install - - name: Build the project - run: npm run build:plugins:prod && npm run build:frontend - env: - GOOGLE_MAPS_API_KEY: ${{ secrets.CLOUD_GOOGLE_MAPS_API_KEY }} - NODE_ENV: ${{ secrets.CLOUD_NODE_ENV }} - NODE_OPTIONS: ${{ secrets.CLOUD_NODE_OPTIONS }} - SENTRY_AUTH_TOKEN: ${{ secrets.CLOUD_SENTRY_AUTH_TOKEN }} - SENTRY_ORG: ${{ secrets.CLOUD_SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.CLOUD_SENTRY_PROJECT }} - SERVE_CLIENT: ${{ secrets.CLOUD_SERVE_CLIENT }} - SERVER_IP: ${{ secrets.CLOUD_SERVER_IP }} - TJDB_SQL_MODE_DISABLE: ${{ secrets.CLOUD_TJDB_SQL_MODE_DISABLE }} - TOOLJET_SERVER_URL: ${{ secrets.CLOUD_TOOLJET_SERVER_URL }} - TOOLJET_EDITION: cloud - - name: Deploy to Netlify run: | npm install -g netlify-cli @@ -83,6 +60,3 @@ jobs: TJDB_SQL_MODE_DISABLE: ${{ secrets.CLOUD_TJDB_SQL_MODE_DISABLE }} TOOLJET_SERVER_URL: ${{ secrets.CLOUD_TOOLJET_SERVER_URL }} TOOLJET_EDITION: cloud - - - name: ✅ Deployment complete - run: echo "🎉 Deployment to Netlify successful for branch ${{ github.event.inputs.branch }} by ${{ github.actor }}" From 584aa7a7eea0e0a8b2f6c95d46dd360ce05ac8c5 Mon Sep 17 00:00:00 2001 From: adishM98 Bot Date: Fri, 4 Jul 2025 12:17:17 +0000 Subject: [PATCH 19/24] =?UTF-8?q?=F0=9F=94=84=20chore:=20update=20submodul?= =?UTF-8?q?es=20to=20latest=20main=20after=20auto-merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/ee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/ee b/frontend/ee index 576b20238c..82d28db0cd 160000 --- a/frontend/ee +++ b/frontend/ee @@ -1 +1 @@ -Subproject commit 576b20238ceaa6920a8b7da6c49d4d6baee29ac6 +Subproject commit 82d28db0cd954aa017d97938f368586b0650ef09 From b1afdd4efca062ec52dd755e9817e29391070c8d Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Sun, 6 Jul 2025 15:29:17 +0530 Subject: [PATCH 20/24] refactor: Improve cloud frontend deployment workflow with manual Git checkout and enhanced user authorization (#13213) --- .github/workflows/cloud-frontend.yml | 68 +++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cloud-frontend.yml b/.github/workflows/cloud-frontend.yml index 20025bf82c..5ae1feea92 100644 --- a/.github/workflows/cloud-frontend.yml +++ b/.github/workflows/cloud-frontend.yml @@ -8,12 +8,11 @@ on: required: true jobs: - build: + deploy: runs-on: ubuntu-latest steps: - - - name: Check user authorization + - name: ✅ Check user authorization run: | allowed_user1=${{ secrets.ALLOWED_USER1_USERNAME }} allowed_user2=${{ secrets.ALLOWED_USER2_USERNAME }} @@ -28,25 +27,70 @@ jobs: echo "✅ User '${{ github.actor }}' is authorized." fi - - name: Checkout code (with submodules) - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.branch }} - token: ${{ secrets.TOKEN_PR }} - submodules: recursive + - name: 📥 Manual Git checkout with submodules + run: | + set -e - - name: Setup Node.js + BRANCH="${{ github.event.inputs.branch }}" + REPO="https://x-access-token:${{ secrets.CUSTOM_GITHUB_TOKEN }}@github.com/${{ github.repository }}" + + git config --global url."https://x-access-token:${{ secrets.CUSTOM_GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/" + git config --global http.version HTTP/1.1 + git config --global http.postBuffer 524288000 + + echo "👉 Cloning $REPO (branch: $BRANCH)" + git clone --recurse-submodules --depth=1 --branch "$BRANCH" "$REPO" repo + cd repo + + echo "🔁 Updating submodules" + git submodule update --init --recursive + + echo "🔀 Attempting to checkout '$BRANCH' in each submodule and validating" + + git submodule foreach --recursive bash -c " + echo '↪ '\$name': trying to checkout $BRANCH' + git fetch --all || true + git fetch origin $BRANCH:$BRANCH || echo '⚠️ '\$name': could not fetch $BRANCH' + git checkout $BRANCH || echo '⚠️ '\$name': checkout failed, staying on current branch' + CURRENT=\$(git rev-parse --abbrev-ref HEAD) + echo '✅ '\$name': now on branch '\$CURRENT + if [ \"\$CURRENT\" != \"$BRANCH\" ]; then + echo '❌ '\$name': expected $BRANCH but got '\$CURRENT + exit 1 + fi + " + + + - name: 🧰 Setup Node.js uses: actions/setup-node@v2 with: node-version: 22.15.1 - - name: Install dependencies + - name: 📦 Install dependencies run: npm install + working-directory: repo - - name: Deploy to Netlify + - name: 🛠️ Build the project + run: npm run build:plugins:prod && npm run build:frontend + working-directory: repo + env: + GOOGLE_MAPS_API_KEY: ${{ secrets.CLOUD_GOOGLE_MAPS_API_KEY }} + NODE_ENV: ${{ secrets.CLOUD_NODE_ENV }} + NODE_OPTIONS: ${{ secrets.CLOUD_NODE_OPTIONS }} + SENTRY_AUTH_TOKEN: ${{ secrets.CLOUD_SENTRY_AUTH_TOKEN }} + SENTRY_ORG: ${{ secrets.CLOUD_SENTRY_ORG }} + SENTRY_PROJECT: ${{ secrets.CLOUD_SENTRY_PROJECT }} + SERVE_CLIENT: ${{ secrets.CLOUD_SERVE_CLIENT }} + SERVER_IP: ${{ secrets.CLOUD_SERVER_IP }} + TJDB_SQL_MODE_DISABLE: ${{ secrets.CLOUD_TJDB_SQL_MODE_DISABLE }} + TOOLJET_SERVER_URL: ${{ secrets.CLOUD_TOOLJET_SERVER_URL }} + TOOLJET_EDITION: cloud + + - name: 🚀 Deploy to Netlify run: | npm install -g netlify-cli netlify deploy --prod --dir=frontend/build --auth=$NETLIFY_AUTH_TOKEN --site=${{ secrets.CLOUD_NETLIFY_SITE_ID }} + working-directory: repo env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} GOOGLE_MAPS_API_KEY: ${{ secrets.CLOUD_GOOGLE_MAPS_API_KEY }} From 348127afd70ced5283b50ca591f3007888ceffed Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Mon, 7 Jul 2025 12:28:45 +0530 Subject: [PATCH 21/24] Enhance submodule checkout process to handle branch existence and fallback to main (#13218) * Enhance submodule checkout process to handle branch existence and fallback to main * Improve submodule checkout process to handle branch validation and fallback to main * chore: Comment out Node.js setup, dependency installation, and build steps in cloud frontend workflow * refactor: Enhance submodule checkout process to include submodule name in logs * Update submodule checkout process to use the correct submodule name extraction method * fix: Update submodule checkout script to use correct submodule path variable * Improve submodule checkout process to correctly handle branch names and fallback to main * chore: Uncomment Node.js setup, dependency installation, and build steps in cloud frontend workflow * fix: Update branch checkout logic to use correct syntax and improve fallback handling * fix: Update git checkout command to use -B flag for branch creation * fix: Improve submodule checkout process to explicitly fetch branch ref before checkout * fix: Enhance submodule checkout process with improved branch validation and error handling * fix: Improve branch checkout logic by enhancing fetch command and validating branch existence * fix: Enhance manual Git checkout process with improved fetch and error handling * fix: Restore Node.js setup, dependency installation, and Netlify deployment steps in workflow --- .github/workflows/cloud-frontend.yml | 47 +++++++++++++++++++++------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cloud-frontend.yml b/.github/workflows/cloud-frontend.yml index 5ae1feea92..9d0fda1e30 100644 --- a/.github/workflows/cloud-frontend.yml +++ b/.github/workflows/cloud-frontend.yml @@ -47,19 +47,44 @@ jobs: echo "🔀 Attempting to checkout '$BRANCH' in each submodule and validating" - git submodule foreach --recursive bash -c " - echo '↪ '\$name': trying to checkout $BRANCH' - git fetch --all || true - git fetch origin $BRANCH:$BRANCH || echo '⚠️ '\$name': could not fetch $BRANCH' - git checkout $BRANCH || echo '⚠️ '\$name': checkout failed, staying on current branch' - CURRENT=\$(git rev-parse --abbrev-ref HEAD) - echo '✅ '\$name': now on branch '\$CURRENT - if [ \"\$CURRENT\" != \"$BRANCH\" ]; then - echo '❌ '\$name': expected $BRANCH but got '\$CURRENT + BRANCH="$BRANCH" git submodule foreach --recursive bash -c ' + name="$sm_path" + echo "" + echo "Entering '\''$name'\''" + echo "↪ $name: trying to checkout branch '\''$BRANCH'\''" + + if git ls-remote --exit-code --heads origin "$BRANCH" >/dev/null; then + git fetch origin "$BRANCH:$BRANCH" || { + echo "❌ $name: fetch failed for $BRANCH" + exit 1 + } + + PREV=$(git rev-parse --short HEAD || echo "unknown") + git checkout "$BRANCH" || { + echo "❌ $name: checkout failed for $BRANCH" + exit 1 + } + + echo "Previous HEAD position was $PREV: $(git log -1 --pretty=%s || echo 'unknown')" + echo "✅ $name: checked out branch $BRANCH" + else + echo "⚠️ $name: branch '$BRANCH' not found on origin. Falling back to 'main'" + PREV=$(git rev-parse --short HEAD || echo "unknown") + git checkout main && git pull origin main || { + echo "❌ $name: fallback to main failed" + exit 1 + } + echo "Previous HEAD position was $PREV: $(git log -1 --pretty=%s || echo 'unknown')" + echo "✅ $name: now on branch main" + fi + + CURRENT=$(git rev-parse --abbrev-ref HEAD) + echo "🔎 $name: current branch = $CURRENT" + if [ "$CURRENT" != "$BRANCH" ] && [ "$CURRENT" != "main" ]; then + echo "❌ $name: unexpected branch state — wanted '$BRANCH' or fallback 'main', got '$CURRENT'" exit 1 fi - " - + ' - name: 🧰 Setup Node.js uses: actions/setup-node@v2 From 9faf886d169e3ea2548e3e0e3399ee3453921285 Mon Sep 17 00:00:00 2001 From: adishM98 Bot Date: Mon, 7 Jul 2025 06:59:32 +0000 Subject: [PATCH 22/24] =?UTF-8?q?=F0=9F=94=84=20chore:=20update=20submodul?= =?UTF-8?q?es=20to=20latest=20main=20after=20auto-merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/ee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/ee b/frontend/ee index 82d28db0cd..1a14db61e1 160000 --- a/frontend/ee +++ b/frontend/ee @@ -1 +1 @@ -Subproject commit 82d28db0cd954aa017d97938f368586b0650ef09 +Subproject commit 1a14db61e117145def63bf66e9225e049a2f5818 From ed571cafe3ce89e3b3cfa189aa479c63e98d1705 Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Mon, 7 Jul 2025 18:14:18 +0530 Subject: [PATCH 23/24] feat: Update Packer workflow to checkout lts-3.6 branch and add Neo4j setup with APOC plugin (#13225) * feat: Update Packer workflow to checkout lts-3.6 branch and add Neo4j setup with APOC plugin * refactor: remove deprecated EC2 ce deployment files and scripts * fix: ensure newline at end of file in setup_app and setup_machine scripts --- .github/workflows/packer-build.yml | 4 +- deploy/ec2/ce/.env | 60 ---------------- deploy/ec2/ce/nest.service | 17 ----- deploy/ec2/ce/postgrest.service | 16 ----- deploy/ec2/ce/setup_app | 46 ------------ deploy/ec2/ce/setup_machine.sh | 83 ---------------------- deploy/ec2/ce/tooljet_ubuntu_focal.pkr.hcl | 63 ---------------- deploy/ec2/ce/variables.pkr.hcl | 23 ------ deploy/ec2/ee/setup_app | 17 ++++- deploy/ec2/ee/setup_machine.sh | 24 ++++++- 10 files changed, 41 insertions(+), 312 deletions(-) delete mode 100644 deploy/ec2/ce/.env delete mode 100644 deploy/ec2/ce/nest.service delete mode 100644 deploy/ec2/ce/postgrest.service delete mode 100755 deploy/ec2/ce/setup_app delete mode 100644 deploy/ec2/ce/setup_machine.sh delete mode 100644 deploy/ec2/ce/tooljet_ubuntu_focal.pkr.hcl delete mode 100644 deploy/ec2/ce/variables.pkr.hcl diff --git a/.github/workflows/packer-build.yml b/.github/workflows/packer-build.yml index aa60c6444f..81fb71f11f 100644 --- a/.github/workflows/packer-build.yml +++ b/.github/workflows/packer-build.yml @@ -16,11 +16,11 @@ jobs: name: packer-ee steps: - - name: Checkout code to lts-4.0 + - name: Checkout code to lts-3.6 branch if: contains(github.event.release.tag_name, '-ee-lts') uses: actions/checkout@v2 with: - ref: refs/heads/lts-4.0 + ref: refs/heads/lts-3.6 - name: Setting tag if: "${{ github.event.inputs.version != '' }}" diff --git a/deploy/ec2/ce/.env b/deploy/ec2/ce/.env deleted file mode 100644 index 8668d3d824..0000000000 --- a/deploy/ec2/ce/.env +++ /dev/null @@ -1,60 +0,0 @@ -# https://docs.tooljet.io/docs/setup/env-vars -TOOLJET_HOST=__required__ -LOCKBOX_MASTER_KEY=__required__ -SECRET_KEY_BASE=__required__ -PG_USER=__required__ -PG_HOST=__required__ -PG_PASS=__required__ -PG_DB=tooljet_prod -ORM_LOGGING=true -NODE_ENV=production -DEPLOYMENT_PLATFORM=ec2 - -# ToolJet Database -TOOLJET_DB=tooljet_db -TOOLJET_DB_USER= -TOOLJET_DB_HOST= -TOOLJET_DB_PASS= -PGRST_HOST=localhost:3001 -PGRST_SERVER_PORT=3001 -PGRST_JWT_SECRET= -PGRST_DB_URI= -PGRST_DB_PRE_CONFIG=postgrest.pre_config - -# Checks every 24 hours to see if a new version of ToolJet is available -# (Enabled by default. Set 0 to disable) -CHECK_FOR_UPDATES= - -# Checks every 24 hours to update app telemetry data to ToolJet hub. -# (Telemetry is enabled by default. Set value to true to disable.) -# DISABLE_APP_TELEMETRY=false - -GOOGLE_CLIENT_ID= -GOOGLE_CLIENT_SECRET= - -# EMAIL CONFIGURATION -DEFAULT_FROM_EMAIL=hello@tooljet.io -SMTP_USERNAME= -SMTP_PASSWORD= -SMTP_DOMAIN= -SMTP_PORT= - -# DISABLE USER SIGNUPS (true or false). Default: true -DISABLE_SIGNUPS= - -# OBSERVABILITY -APM_VENDOR= -SENTRY_DNS= -SENTRY_DEBUG= - -# FEATURE TOGGLE -COMMENT_FEATURE_ENABLE= -ENABLE_MULTIPLAYER_EDITING=true - -#SSO -SSO_DISABLE_SIGNUP= -SSO_RESTRICTED_DOMAIN= -SSO_GOOGLE_OAUTH2_CLIENT_ID= -SSO_GIT_OAUTH2_CLIENT_ID= -SSO_GIT_OAUTH2_CLIENT_SECRET= -SSO_GIT_OAUTH2_HOST= diff --git a/deploy/ec2/ce/nest.service b/deploy/ec2/ce/nest.service deleted file mode 100644 index 61a1127e2f..0000000000 --- a/deploy/ec2/ce/nest.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=Nest Server -After=network.target - -[Service] -Type=simple -User=ubuntu - -WorkingDirectory=/home/ubuntu/app -Environment="NODE_ENV=production" -EnvironmentFile=/home/ubuntu/app/.env -RestartSec=1 -ExecStart=/usr/bin/npm --prefix /home/ubuntu/app run start:prod -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/deploy/ec2/ce/postgrest.service b/deploy/ec2/ce/postgrest.service deleted file mode 100644 index 806c6c8ee1..0000000000 --- a/deploy/ec2/ce/postgrest.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=PostgREST Server -After=network.target - -[Service] -Type=simple -User=ubuntu - -WorkingDirectory=/bin -EnvironmentFile=/home/ubuntu/app/.env -RestartSec=1 -ExecStart=/bin/postgrest -Restart=always - -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/deploy/ec2/ce/setup_app b/deploy/ec2/ce/setup_app deleted file mode 100755 index b07a1299d5..0000000000 --- a/deploy/ec2/ce/setup_app +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -if grep __required__ .env -then - echo "Please set the required values within the .env file" - exit 1 -fi - -export $(grep -v '^#' .env | xargs) - -if psql -d postgresql://$PG_USER:$PG_PASS@$PG_HOST/postgres -c 'select now()' > /dev/null 2>&1 -then - echo "Successfully pinged the database!"; -else - echo "Can't connect to the database. Kindly check the credenials provided in the .env file!" - exit 1 -fi - -if sudo systemctl start openresty -then - echo "Successfully started reverse proxy!" -else - echo "Failed to start reverse proxy" - exit 1 -fi - -if $ENABLE_TOOLJET_DB == "true" -then - if sudo systemctl start postgrest - then - echo "Successfully started PostgREST server!" - else - echo "Failed to start PostgREST server" - exit 1 - fi -fi - -TOOLJET_EDTION=ce npm --prefix server run db:setup:prod - -if sudo systemctl start nest -then - echo "The app will be served at ${TOOLJET_HOST}" -else - echo "Failed to start the server!" - exit 1 -fi diff --git a/deploy/ec2/ce/setup_machine.sh b/deploy/ec2/ce/setup_machine.sh deleted file mode 100644 index 8e23853c7c..0000000000 --- a/deploy/ec2/ce/setup_machine.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -set -e -# Setup prerequisite dependencies -sudo apt-get update -sudo apt-get -y install --no-install-recommends wget gnupg ca-certificates apt-utils git curl postgresql-client -curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" -nvm install 22.15.1 -sudo ln -s "$(which node)" /usr/bin/node -sudo ln -s "$(which npm)" /usr/bin/npm - -sudo npm i -g npm@10.9.2 - -# Setup openresty -wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add - -echo "deb http://openresty.org/package/ubuntu bionic main" > openresty.list -sudo mv openresty.list /etc/apt/sources.list.d/ -sudo apt-get update -sudo apt-get -y install --no-install-recommends openresty -sudo apt-get install -y curl g++ gcc autoconf automake bison libc6-dev \ - libffi-dev libgdbm-dev libncurses5-dev libsqlite3-dev libtool \ - libyaml-dev make pkg-config sqlite3 zlib1g-dev libgmp-dev \ - libreadline-dev libssl-dev libmysqlclient-dev build-essential \ - freetds-dev libpq-dev -sudo apt-get install -y luarocks -sudo luarocks install lua-resty-auto-ssl -sudo mkdir /etc/resty-auto-ssl /var/log/openresty /etc/fallback-certs -sudo chown -R www-data:www-data /etc/resty-auto-ssl - -# Oracle db client library setup -sudo apt install -y libaio1 -curl -o instantclient-basiclite.zip https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip -SL && \ -curl -o instantclient-basiclite-11.zip https://tooljet-plugins-production.s3.us-east-2.amazonaws.com/marketplace-assets/oracledb/instantclients/instantclient-basiclite-linux.x64-11.2.0.4.0.zip -SL && \ - unzip instantclient-basiclite.zip && \ - unzip instantclient-basiclite-11.zip && \ - sudo mkdir -p /usr/lib/instantclient && sudo mv instantclient*/ /usr/lib/instantclient && \ - rm instantclient-basiclite.zip && \ - rm instantclient-basiclite-11.zip && \ - echo /usr/lib/instantclient/* | sudo tee /etc/ld.so.conf.d/oracle-instantclient.conf > /dev/null && sudo ldconfig -# Set the Instant Client library paths -export LD_LIBRARY_PATH="/usr/lib/instantclient/instantclient_11_2:/usr/lib/instantclient/instantclient_21_10${LD_LIBRARY_PATH}" - -# Gen fallback certs -sudo openssl rand -out /home/ubuntu/.rnd -hex 256 -sudo chown www-data:www-data /home/ubuntu/.rnd -sudo openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 \ - -subj '/CN=sni-support-required-for-valid-ssl' \ - -keyout /etc/fallback-certs/resty-auto-ssl-fallback.key \ - -out /etc/fallback-certs/resty-auto-ssl-fallback.crt - -# Setup nginx config -export SERVER_HOST="${SERVER_HOST:=localhost}" -export SERVER_USER="${SERVER_USER:=www-data}" -VARS_TO_SUBSTITUTE='$SERVER_HOST:$SERVER_USER' -envsubst "${VARS_TO_SUBSTITUTE}" < /tmp/nginx.conf > /tmp/nginx-substituted.conf -sudo cp /tmp/nginx-substituted.conf /usr/local/openresty/nginx/conf/nginx.conf - -# Download and setup postgrest binary -curl -OL https://github.com/PostgREST/postgrest/releases/download/v12.2.0/postgrest-v12.2.0-linux-static-x64.tar.xz -tar xJf postgrest-v12.2.0-linux-static-x64.tar.xz -sudo mv ./postgrest /bin/postgrest -sudo rm postgrest-v12.2.0-linux-static-x64.tar.xz - -# Setup app and postgrest as systemd service -sudo cp /tmp/nest.service /lib/systemd/system/nest.service -sudo cp /tmp/postgrest.service /lib/systemd/system/postgrest.service - -# Setup app directory -mkdir -p ~/app -git clone -b main https://github.com/ToolJet/ToolJet.git ~/app && cd ~/app - - -mv /tmp/.env ~/app/.env -mv /tmp/setup_app ~/app/setup_app -sudo chmod +x ~/app/setup_app - -npm install -g npm@10.9.2 - -# Building ToolJet app -npm install -g @nestjs/cli -TOOLJET_EDTION=ce npm run build diff --git a/deploy/ec2/ce/tooljet_ubuntu_focal.pkr.hcl b/deploy/ec2/ce/tooljet_ubuntu_focal.pkr.hcl deleted file mode 100644 index 9c61b0d554..0000000000 --- a/deploy/ec2/ce/tooljet_ubuntu_focal.pkr.hcl +++ /dev/null @@ -1,63 +0,0 @@ -packer { - required_plugins { - amazon = { - version = ">= 0.0.1" - source = "github.com/hashicorp/amazon" - } - } -} - -source "amazon-ebs" "ubuntu" { - ami_name = "${var.ami_name}" - instance_type = "${var.instance_type}" - region = "${var.ami_region}" - ami_regions = "${var.ami_regions}" - ami_groups = "${var.ami_groups}" - source_ami_filter { - filters = { - name = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*" - root-device-type = "ebs" - virtualization-type = "hvm" - } - most_recent = true - owners = ["099720109477"] - } - ssh_username = "ubuntu" - ssh_clear_authorized_keys = "true" -} - - -build { - sources = [ - "source.amazon-ebs.ubuntu" - ] - - provisioner "file" { - source = "nest.service" - destination = "/tmp/nest.service" - } - - provisioner "file" { - source = "../../frontend/config/nginx.conf.template" - destination = "/tmp/nginx.conf" - } - - provisioner "file" { - source = ".env" - destination = "/tmp/.env" - } - - provisioner "file" { - source = "setup_app" - destination = "/tmp/setup_app" - } - - provisioner "file" { - source = "postgrest.service" - destination = "/tmp/postgrest.service" - } - - provisioner "shell" { - script = "setup_machine.sh" - } -} diff --git a/deploy/ec2/ce/variables.pkr.hcl b/deploy/ec2/ce/variables.pkr.hcl deleted file mode 100644 index fcd6254505..0000000000 --- a/deploy/ec2/ce/variables.pkr.hcl +++ /dev/null @@ -1,23 +0,0 @@ -variable "ami_name" { - type = string -} - -variable "instance_type" { - type = string - default = "t2.medium" -} - -variable "ami_region" { - type = string - default = "us-west-1" -} - -variable "ami_groups" { - type = list(string) - default = ["all"] -} - -variable "ami_regions" { - type = list(string) - default = ["us-west-1", "us-east-1", "us-east-2", "eu-west-2", "eu-central-1", "ap-northeast-1", "ap-southeast-1","ap-northeast-3", "ap-south-1", "ap-northeast-2", "ap-southeast-2", "ca-central-1", "eu-west-1", "eu-north-1", "sa-east-1", "ap-east-1"] -} diff --git a/deploy/ec2/ee/setup_app b/deploy/ec2/ee/setup_app index 3dad6ebeef..deec307c1d 100755 --- a/deploy/ec2/ee/setup_app +++ b/deploy/ec2/ee/setup_app @@ -161,6 +161,21 @@ else exit 1 fi +if [[ "$WORKFLOW_WORKER" == "true" ]]; then + echo "WORKER is true. Running the worker..." + npm run worker:prod & +else + echo "WORKER is not true. Skipping the worker execution." +fi + +if sudo systemctl start neo4j && sudo systemctl enable neo4j +then + echo "Successfully started Neo4j!" +else + echo "Failed to start and enable Neo4j" + exit 1 +fi + TOOLJET_EDTION=ee npm --prefix server run db:setup:prod if sudo -E systemctl start nest @@ -172,4 +187,4 @@ else fi sudo systemctl restart nest -sudo -E systemctl restart postgrest \ No newline at end of file +sudo -E systemctl restart postgrest diff --git a/deploy/ec2/ee/setup_machine.sh b/deploy/ec2/ee/setup_machine.sh index 7c8427b9e2..0173bd45c6 100644 --- a/deploy/ec2/ee/setup_machine.sh +++ b/deploy/ec2/ee/setup_machine.sh @@ -78,6 +78,28 @@ sudo cp /tmp/redis-server.service /lib/systemd/system/redis-server.service # Start and enable Redis service sudo systemctl daemon-reload + +# Setup Neo4j with APOC plugin +wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add - +echo "deb https://debian.neo4j.com stable 5" | sudo tee /etc/apt/sources.list.d/neo4j.list +sudo apt-get update +sudo apt-get install -y neo4j=1:5.26.6 +sudo apt-mark hold neo4j + +# Setup APOC plugin +sudo mkdir -p /var/lib/neo4j/plugins +sudo wget -P /var/lib/neo4j/plugins https://github.com/neo4j/apoc/releases/download/5.26.6/apoc-5.26.6-core.jar + +# Update Neo4j config +echo "dbms.security.procedures.unrestricted=apoc.*" | sudo tee -a /etc/neo4j/neo4j.conf +echo "dbms.security.procedures.allowlist=apoc.*,algo.*,gds.*" | sudo tee -a /etc/neo4j/neo4j.conf +echo "dbms.directories.plugins=/var/lib/neo4j/plugins" | sudo tee -a /etc/neo4j/neo4j.conf +echo "dbms.security.auth_enabled=true" | sudo tee -a /etc/neo4j/neo4j.conf + +# Clean up APT cache +sudo apt-get clean +sudo rm -rf /var/lib/apt/lists/* + # Setup app directory mkdir -p ~/app @@ -96,4 +118,4 @@ npm install -g npm@10.9.2 # Building ToolJet app npm install -g @nestjs/cli -TOOLJET_EDTION=ee npm run build \ No newline at end of file +TOOLJET_EDTION=ee npm run build From 8695c63af7bdcddee9c5bc16c91e5ede96d1f32f Mon Sep 17 00:00:00 2001 From: Adish M <44204658+adishM98@users.noreply.github.com> Date: Tue, 8 Jul 2025 13:09:41 +0530 Subject: [PATCH 24/24] Enhance Neo4j configuration and installation in Try tooljet Dockerfiles with APOC plugin support (#13248) * Enhance Neo4j configuration and installation in Try tooljet Dockerfiles with APOC plugin support * fix: Update Dockerfile to use the latest ToolJet image version --- docker/ee/ee-try-entrypoint-lts.sh | 110 ++++++++++++++++++++++++ docker/ee/ee-try-entrypoint.sh | 109 +++++++++++++++++++++++ docker/ee/ee-try-tooljet-lts.Dockerfile | 14 ++- docker/ee/ee-try-tooljet.Dockerfile | 14 ++- 4 files changed, 245 insertions(+), 2 deletions(-) diff --git a/docker/ee/ee-try-entrypoint-lts.sh b/docker/ee/ee-try-entrypoint-lts.sh index f716ae8a20..c46d799a5b 100755 --- a/docker/ee/ee-try-entrypoint-lts.sh +++ b/docker/ee/ee-try-entrypoint-lts.sh @@ -3,6 +3,116 @@ set -e echo "🚀 Starting Try ToolJet container initialization..." +# Neo4j configuration +# ---------------------------------- +# Default Neo4j environment values +# ---------------------------------- +export NEO4J_USER=${NEO4J_USER:-"neo4j"} +export NEO4J_PASSWORD=${NEO4J_PASSWORD:-"appaqvyvRLbeukhFE"} +export NEO4J_AUTH=${NEO4J_AUTH:-"neo4j/appaqvyvRLbeukhFE"} +export NEO4J_URI=${NEO4J_URI:-"bolt://localhost:7687"} +export NEO4J_PLUGINS=${NEO4J_PLUGINS:-'["apoc"]'} +export NEO4J_AUTH + +# Extract username and password from NEO4J_AUTH if set +if [ -n "$NEO4J_AUTH" ]; then + # Extract username and password from NEO4J_AUTH (format: username/password) + NEO4J_USERNAME=$(echo "$NEO4J_AUTH" | cut -d'/' -f1) + NEO4J_PASSWORD=$(echo "$NEO4J_AUTH" | cut -d'/' -f2) + + # Export these for application use + export NEO4J_USERNAME + export NEO4J_PASSWORD + + echo "Neo4j authentication configured with username: $NEO4J_USERNAME" >/dev/null 2>&1 +else + echo "NEO4J_AUTH not set, using default authentication" >/dev/null 2>&1 +fi + +# Check if Neo4j is already initialized and set password if necessary +if [ "$NEO4J_AUTH" != "none" ] && [ -n "$NEO4J_PASSWORD" ]; then + echo "Setting Neo4j initial password..." >/dev/null 2>&1 + + # Ensure Neo4j is not running before setting the initial password + neo4j stop || true + + # Set the initial password using the correct command format for Neo4j 5.x + NEO4J_ADMIN_CMD=$(which neo4j-admin) + NEO4J_VERSION=$(neo4j --version | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+" | head -n 1) + echo "Detected Neo4j version: $NEO4J_VERSION" >/dev/null 2>&1 + + # Use version-specific command format + MAJOR_VERSION=$(echo $NEO4J_VERSION | cut -d. -f1) + if [ "$MAJOR_VERSION" -ge "5" ]; then + # For Neo4j 5.x and higher + echo "Using Neo4j 5.x+ password command format" >/dev/null 2>&1 + $NEO4J_ADMIN_CMD dbms set-initial-password "$NEO4J_PASSWORD" --require-password-change=false >/dev/null 2>&1 || { + echo "Warning: Could not set Neo4j password, it may already be set" >/dev/null 2>&1 + } + else + # For Neo4j 4.x and lower + echo "Using Neo4j 4.x password command format" >/dev/null 2>&1 + $NEO4J_ADMIN_CMD set-initial-password "$NEO4J_PASSWORD" >/dev/null 2>&1 || { + echo "Warning: Could not set Neo4j password, it may already be set" >/dev/null 2>&1 + } + fi +fi + +# Update Neo4j configuration +echo "Configuring Neo4j..." >/dev/null 2>&1 +cat > /etc/neo4j/neo4j.conf << EOF +# Neo4j configuration +dbms.security.auth_enabled=true +server.bolt.enabled=true +server.bolt.listen_address=0.0.0.0:7687 +server.directories.data=/var/lib/neo4j/data +server.directories.logs=/var/log/neo4j +initial.dbms.default_database=neo4j +server.directories.plugins=/var/lib/neo4j/plugins +server.directories.import=/var/lib/neo4j/import + +# APOC Settings +dbms.security.procedures.unrestricted=apoc.* +dbms.security.procedures.allowlist=apoc.*,algo.*,gds.* +EOF + +if [ -w "$NEO4J_LOG_DIR" ]; then + chmod -R 770 "$NEO4J_LOG_DIR" || echo "Warning: Could not set log directory permissions" >/dev/null 2>&1 +fi + +# Start Neo4j +echo "Starting Neo4j service..." +neo4j console >/dev/null 2>&1 & + +# Add a wait for Neo4j to be ready with more robust checking +echo "Waiting for Neo4j to be ready..." >/dev/null 2>&1 +NEO4J_READY=false +for i in {1..60}; do + # First try standard status check + if neo4j status >/dev/null 2>&1; then + echo "Neo4j is ready 🚀" + NEO4J_READY=true + break + fi + + # Also try connecting to the bolt port as a fallback + if command -v nc >/dev/null 2>&1; then + if nc -z localhost 7687 >/dev/null 2>&1; then + echo "Neo4j is ready (port 7687 is open)" + NEO4J_READY=true + break + fi + fi + + echo "Waiting for Neo4j to start... ($i/60)" >/dev/null 2>&1 + sleep 2 +done + +if [ "$NEO4J_READY" = false ]; then + echo "WARNING: Neo4j may not be fully started yet, but continuing..." +fi + + # Configure PostgreSQL authentication echo "🔧 Configuring PostgreSQL authentication..." sed -i 's/^local\s\+all\s\+postgres\s\+\(peer\|md5\)/local all postgres trust/' /etc/postgresql/13/main/pg_hba.conf >/dev/null 2>&1 diff --git a/docker/ee/ee-try-entrypoint.sh b/docker/ee/ee-try-entrypoint.sh index 8e2332ba19..df6128f9da 100755 --- a/docker/ee/ee-try-entrypoint.sh +++ b/docker/ee/ee-try-entrypoint.sh @@ -3,6 +3,115 @@ set -e echo "🚀 Starting Try ToolJet container initialization..." +# Neo4j configuration +# ---------------------------------- +# Default Neo4j environment values +# ---------------------------------- +export NEO4J_USER=${NEO4J_USER:-"neo4j"} +export NEO4J_PASSWORD=${NEO4J_PASSWORD:-"appaqvyvRLbeukhFE"} +export NEO4J_AUTH=${NEO4J_AUTH:-"neo4j/appaqvyvRLbeukhFE"} +export NEO4J_URI=${NEO4J_URI:-"bolt://localhost:7687"} +export NEO4J_PLUGINS=${NEO4J_PLUGINS:-'["apoc"]'} +export NEO4J_AUTH + +# Extract username and password from NEO4J_AUTH if set +if [ -n "$NEO4J_AUTH" ]; then + # Extract username and password from NEO4J_AUTH (format: username/password) + NEO4J_USERNAME=$(echo "$NEO4J_AUTH" | cut -d'/' -f1) + NEO4J_PASSWORD=$(echo "$NEO4J_AUTH" | cut -d'/' -f2) + + # Export these for application use + export NEO4J_USERNAME + export NEO4J_PASSWORD + + echo "Neo4j authentication configured with username: $NEO4J_USERNAME" >/dev/null 2>&1 +else + echo "NEO4J_AUTH not set, using default authentication" >/dev/null 2>&1 +fi + +# Check if Neo4j is already initialized and set password if necessary +if [ "$NEO4J_AUTH" != "none" ] && [ -n "$NEO4J_PASSWORD" ]; then + echo "Setting Neo4j initial password..." >/dev/null 2>&1 + + # Ensure Neo4j is not running before setting the initial password + neo4j stop || true + + # Set the initial password using the correct command format for Neo4j 5.x + NEO4J_ADMIN_CMD=$(which neo4j-admin) + NEO4J_VERSION=$(neo4j --version | grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+" | head -n 1) + echo "Detected Neo4j version: $NEO4J_VERSION" >/dev/null 2>&1 + + # Use version-specific command format + MAJOR_VERSION=$(echo $NEO4J_VERSION | cut -d. -f1) + if [ "$MAJOR_VERSION" -ge "5" ]; then + # For Neo4j 5.x and higher + echo "Using Neo4j 5.x+ password command format" >/dev/null 2>&1 + $NEO4J_ADMIN_CMD dbms set-initial-password "$NEO4J_PASSWORD" --require-password-change=false >/dev/null 2>&1 || { + echo "Warning: Could not set Neo4j password, it may already be set" >/dev/null 2>&1 + } + else + # For Neo4j 4.x and lower + echo "Using Neo4j 4.x password command format" >/dev/null 2>&1 + $NEO4J_ADMIN_CMD set-initial-password "$NEO4J_PASSWORD" >/dev/null 2>&1 || { + echo "Warning: Could not set Neo4j password, it may already be set" >/dev/null 2>&1 + } + fi +fi + +# Update Neo4j configuration +echo "Configuring Neo4j..." >/dev/null 2>&1 +cat > /etc/neo4j/neo4j.conf << EOF +# Neo4j configuration +dbms.security.auth_enabled=true +server.bolt.enabled=true +server.bolt.listen_address=0.0.0.0:7687 +server.directories.data=/var/lib/neo4j/data +server.directories.logs=/var/log/neo4j +initial.dbms.default_database=neo4j +server.directories.plugins=/var/lib/neo4j/plugins +server.directories.import=/var/lib/neo4j/import + +# APOC Settings +dbms.security.procedures.unrestricted=apoc.* +dbms.security.procedures.allowlist=apoc.*,algo.*,gds.* +EOF + +if [ -w "$NEO4J_LOG_DIR" ]; then + chmod -R 770 "$NEO4J_LOG_DIR" || echo "Warning: Could not set log directory permissions" >/dev/null 2>&1 +fi + +# Start Neo4j +echo "Starting Neo4j service..." +neo4j console >/dev/null 2>&1 & + +# Add a wait for Neo4j to be ready with more robust checking +echo "Waiting for Neo4j to be ready..." >/dev/null 2>&1 +NEO4J_READY=false +for i in {1..60}; do + # First try standard status check + if neo4j status >/dev/null 2>&1; then + echo "Neo4j is ready 🚀" + NEO4J_READY=true + break + fi + + # Also try connecting to the bolt port as a fallback + if command -v nc >/dev/null 2>&1; then + if nc -z localhost 7687 >/dev/null 2>&1; then + echo "Neo4j is ready (port 7687 is open)" + NEO4J_READY=true + break + fi + fi + + echo "Waiting for Neo4j to start... ($i/60)" >/dev/null 2>&1 + sleep 2 +done + +if [ "$NEO4J_READY" = false ]; then + echo "WARNING: Neo4j may not be fully started yet, but continuing..." +fi + # Configure PostgreSQL authentication echo "🔧 Configuring PostgreSQL authentication..." sed -i 's/^local\s\+all\s\+postgres\s\+\(peer\|md5\)/local all postgres trust/' /etc/postgresql/13/main/pg_hba.conf >/dev/null 2>&1 diff --git a/docker/ee/ee-try-tooljet-lts.Dockerfile b/docker/ee/ee-try-tooljet-lts.Dockerfile index 2dcf56edfe..c9fa440db2 100644 --- a/docker/ee/ee-try-tooljet-lts.Dockerfile +++ b/docker/ee/ee-try-tooljet-lts.Dockerfile @@ -6,7 +6,7 @@ COPY --from=postgrest/postgrest:v12.2.0 /bin/postgrest /bin # Install Postgres USER root RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list +RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list RUN echo "deb http://deb.debian.org/debian" RUN apt update && apt -y install postgresql-13 postgresql-client-13 supervisor USER postgres @@ -52,6 +52,18 @@ RUN apt update && apt install -y gettext-base curl \ COPY ./docker/ee/temporal-server.yaml /etc/temporal/temporal-server.template.yaml COPY ./docker/ee/temporal-ui-server.yaml /etc/temporal/temporal-ui-server.yaml +# Install Neo4j + APOC +RUN wget -O - https://debian.neo4j.com/neotechnology.gpg.key | apt-key add - && \ + echo "deb https://debian.neo4j.com stable 5" > /etc/apt/sources.list.d/neo4j.list && \ + apt-get update && apt-get install -y neo4j=1:5.26.6 && apt-mark hold neo4j && \ + mkdir -p /var/lib/neo4j/plugins && \ + wget -P /var/lib/neo4j/plugins https://github.com/neo4j/apoc/releases/download/5.26.6/apoc-5.26.6-core.jar && \ + echo "dbms.security.procedures.unrestricted=apoc.*" >> /etc/neo4j/neo4j.conf && \ + echo "dbms.security.procedures.allowlist=apoc.*,algo.*,gds.*" >> /etc/neo4j/neo4j.conf && \ + echo "dbms.directories.plugins=/var/lib/neo4j/plugins" >> /etc/neo4j/neo4j.conf && \ + echo "dbms.security.auth_enabled=true" >> /etc/neo4j/neo4j.conf && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + # Configure Supervisor to manage PostgREST, ToolJet, and Redis RUN echo "[supervisord] \n" \ "nodaemon=true \n" \ diff --git a/docker/ee/ee-try-tooljet.Dockerfile b/docker/ee/ee-try-tooljet.Dockerfile index 3aa416b87d..a108f30691 100644 --- a/docker/ee/ee-try-tooljet.Dockerfile +++ b/docker/ee/ee-try-tooljet.Dockerfile @@ -6,7 +6,7 @@ COPY --from=postgrest/postgrest:v12.2.0 /bin/postgrest /bin # Install Postgres USER root RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list +RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list RUN echo "deb http://deb.debian.org/debian" RUN apt update && apt -y install postgresql-13 postgresql-client-13 supervisor USER postgres @@ -52,6 +52,18 @@ RUN apt update && apt install -y gettext-base curl \ COPY ./docker/ee/temporal-server.yaml /etc/temporal/temporal-server.template.yaml COPY ./docker/ee/temporal-ui-server.yaml /etc/temporal/temporal-ui-server.yaml +# Install Neo4j + APOC +RUN wget -O - https://debian.neo4j.com/neotechnology.gpg.key | apt-key add - && \ + echo "deb https://debian.neo4j.com stable 5" > /etc/apt/sources.list.d/neo4j.list && \ + apt-get update && apt-get install -y neo4j=1:5.26.6 && apt-mark hold neo4j && \ + mkdir -p /var/lib/neo4j/plugins && \ + wget -P /var/lib/neo4j/plugins https://github.com/neo4j/apoc/releases/download/5.26.6/apoc-5.26.6-core.jar && \ + echo "dbms.security.procedures.unrestricted=apoc.*" >> /etc/neo4j/neo4j.conf && \ + echo "dbms.security.procedures.allowlist=apoc.*,algo.*,gds.*" >> /etc/neo4j/neo4j.conf && \ + echo "dbms.directories.plugins=/var/lib/neo4j/plugins" >> /etc/neo4j/neo4j.conf && \ + echo "dbms.security.auth_enabled=true" >> /etc/neo4j/neo4j.conf && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + # Configure Supervisor to manage PostgREST, ToolJet, and Redis RUN echo "[supervisord] \n" \ "nodaemon=true \n" \