From f712bc7a3c26970484cf327fd5a25d5ad27b87e2 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 23 Dec 2025 15:06:58 +0530 Subject: [PATCH 01/20] #SB-I403: fix: docker build and test --- .github/workflows/build-nodebb.yml | 91 ++++++++++++++++++++++++++++++ Dockerfile | 12 ++-- 2 files changed, 99 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build-nodebb.yml diff --git a/.github/workflows/build-nodebb.yml b/.github/workflows/build-nodebb.yml new file mode 100644 index 0000000..83bbc64 --- /dev/null +++ b/.github/workflows/build-nodebb.yml @@ -0,0 +1,91 @@ +name: Build and Push NodeBB Docker Image + +on: + push: + tags: + - '*' + branches: + - '**' + +env: + DOCKER_REGISTRY: docker.io + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + IMAGE_NAME: nodebb + # Hardcoded NodeBB version and release tag per request + NODEBB_VERSION: 'v4.7.1' + RELEASE_TAG: 'release-8.0.0_RC1' + BUILD_DOCKER_IMAGE: 'true' + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up build variables + id: vars + run: | + IMAGE_TAG="${{ env.RELEASE_TAG }}_${{ github.run_number }}_${{ env.NODEBB_VERSION }}" + echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT + echo "nodebb_version=${{ env.NODEBB_VERSION }}" >> $GITHUB_OUTPUT + echo "release_tag=${{ env.RELEASE_TAG }}" >> $GITHUB_OUTPUT + echo "Building NodeBB ${NODEBB_VERSION} as ${IMAGE_TAG}" + + - name: Clone NodeBB repository + run: | + git clone --depth=1 https://github.com/NodeBB/NodeBB.git -b ${{ env.NODEBB_VERSION }} NodeBB || true + + - name: Copy build files to NodeBB directory + run: | + cp Dockerfile NodeBB/ || true + cp build.sh NodeBB/ || true + chmod +x NodeBB/build.sh || true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ env.DOCKER_USERNAME }} + password: ${{ env.DOCKER_PASSWORD }} + + - name: Build Docker image + if: ${{ env.BUILD_DOCKER_IMAGE == 'true' }} + working-directory: ./NodeBB + run: | + docker build \ + --label "commitHash=$(git rev-parse --short HEAD)" \ + --label "nodebbVersion=${{ steps.vars.outputs.nodebb_version }}" \ + --label "buildNumber=${{ github.run_number }}" \ + -t ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.image_tag }} \ + -t ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest \ + . + + - name: Push Docker image + if: ${{ env.BUILD_DOCKER_IMAGE == 'true' }} + run: | + docker push ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.image_tag }} + docker push ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest + + - name: Create metadata file + run: | + echo "{\"image_name\": \"${{ env.IMAGE_NAME }}\", \"image_tag\": \"${{ steps.vars.outputs.image_tag }}\", \"nodebb_version\": \"${{ steps.vars.outputs.nodebb_version }}\", \"build_number\": \"${{ github.run_number }}\", \"commit_hash\": \"$(git rev-parse --short HEAD)\"}" > metadata.json + cat metadata.json + + - name: Upload metadata artifact + uses: actions/upload-artifact@v4 + with: + name: build-metadata + path: metadata.json + + - name: Update summary + run: | + echo "## Build Summary" >> $GITHUB_STEP_SUMMARY + echo "- **NodeBB Version**: ${{ steps.vars.outputs.nodebb_version }}" >> $GITHUB_STEP_SUMMARY + echo "- **Image Tag**: \`${{ steps.vars.outputs.image_tag }}\`" >> $GITHUB_STEP_SUMMARY + echo "- **Full Image**: \`${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.image_tag }}\`" >> $GITHUB_STEP_SUMMARY diff --git a/Dockerfile b/Dockerfile index 4b674ae..189c28e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,10 +11,14 @@ RUN npm install --only=prod && \ npm cache clean --force -RUN npm install https://github.com/Sunbird-Lern/nodebb-plugin-sunbird-oidc.git#master -RUN npm install https://github.com/Sunbird-Lern/nodebb-plugin-sunbird-api.git#release-4.6.0 -RUN npm install https://github.com/Sunbird-Lern/nodebb-plugin-sunbird-telemetry.git#master -RUN npm install https://github.com/Sunbird-Lern/nodebb-plugin-azure-storage.git#main +# Install Sunbird custom plugins from JeraldJF GitHub repositories +# Using same branch/tag names as original, just different owner +RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-oidc.git#master +RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-api.git#release-4.6.0 +RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-telemetry.git#master +RUN npm install https://github.com/JeraldJF/nodebb-plugin-azure-storage.git#main + +# Keep these plugins from upstream (already compatible or deprecated) RUN npm install https://github.com/NodeBB/nodebb-plugin-write-api.git#master # Nodebb was not taking the latest version of mentions plugin, That's why we added install command here. From 8f0e4746c6649ac438521acb37992d3d9d0ec906 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 23 Dec 2025 15:13:44 +0530 Subject: [PATCH 02/20] #SB-I403: fix: build file workflow fix --- .github/workflows/build-nodebb.yml | 51 ++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-nodebb.yml b/.github/workflows/build-nodebb.yml index 83bbc64..8152cfd 100644 --- a/.github/workflows/build-nodebb.yml +++ b/.github/workflows/build-nodebb.yml @@ -28,7 +28,7 @@ jobs: - name: Set up build variables id: vars run: | - IMAGE_TAG="${{ env.RELEASE_TAG }}_${{ github.run_number }}_${{ env.NODEBB_VERSION }}" + IMAGE_TAG=$(echo "${{ github.ref_name }}_$(echo $GITHUB_SHA | cut -c1-7)" | tr '[:upper:]' '[:lower:]') echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT echo "nodebb_version=${{ env.NODEBB_VERSION }}" >> $GITHUB_OUTPUT echo "release_tag=${{ env.RELEASE_TAG }}" >> $GITHUB_OUTPUT @@ -47,30 +47,47 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to Docker Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.DOCKER_REGISTRY }} - username: ${{ env.DOCKER_USERNAME }} - password: ${{ env.DOCKER_PASSWORD }} - - - name: Build Docker image + - name: Build Docker Image if: ${{ env.BUILD_DOCKER_IMAGE == 'true' }} - working-directory: ./NodeBB run: | - docker build \ - --label "commitHash=$(git rev-parse --short HEAD)" \ + IMAGE_NAME="nodebb" + IMAGE_TAG=${{ steps.vars.outputs.image_tag }} + echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV + echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV + docker build --label "commitHash=$(git rev-parse --short HEAD)" \ --label "nodebbVersion=${{ steps.vars.outputs.nodebb_version }}" \ --label "buildNumber=${{ github.run_number }}" \ - -t ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.image_tag }} \ - -t ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest \ - . + -t ${IMAGE_NAME}:${IMAGE_TAG} ./NodeBB + + - name: Login Docker Registry + if: ${{ env.BUILD_DOCKER_IMAGE == 'true' }} + run: | + echo "Pushing Docker image: ${IMAGE_NAME}:${IMAGE_TAG}" + case "${{ vars.REGISTRY_PROVIDER }}" in + "gcp") + echo "${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}" | base64 --decode > $HOME/gcloud-key.json + gcloud auth activate-service-account --key-file=$HOME/gcloud-key.json + gcloud auth configure-docker ${{ secrets.REGISTRY_NAME }} + REGISTRY_URL=$(echo "${{ secrets.REGISTRY_URL }}" | tr '[:upper:]' '[:lower:]') + ;; + "azure" | "dockerhub") + echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "${{ secrets.REGISTRY_NAME }}" \ + --username "${{ secrets.REGISTRY_USERNAME }}" --password-stdin + REGISTRY_URL=$(echo "${{ secrets.REGISTRY_URL }}" | tr '[:upper:]' '[:lower:]') + ;; + *) + REPO_NAME_LOWERCASE=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]') + echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + REGISTRY_URL="ghcr.io/$REPO_NAME_LOWERCASE" + ;; + esac + echo "REGISTRY_URL=${REGISTRY_URL}" >> $GITHUB_ENV - name: Push Docker image if: ${{ env.BUILD_DOCKER_IMAGE == 'true' }} run: | - docker push ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.image_tag }} - docker push ${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest + docker tag ${IMAGE_NAME}:${IMAGE_TAG} ${REGISTRY_URL}/${IMAGE_NAME}:${IMAGE_TAG} + docker push ${REGISTRY_URL}/${IMAGE_NAME}:${IMAGE_TAG} - name: Create metadata file run: | From 7d2fa808a26ba21970cd62fd00dfda3bbbe5876c Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 23 Dec 2025 15:17:21 +0530 Subject: [PATCH 03/20] #SB-I403: fix: nodebb clone fix --- .github/workflows/build-nodebb.yml | 2 +- Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-nodebb.yml b/.github/workflows/build-nodebb.yml index 8152cfd..4b86de1 100644 --- a/.github/workflows/build-nodebb.yml +++ b/.github/workflows/build-nodebb.yml @@ -57,7 +57,7 @@ jobs: docker build --label "commitHash=$(git rev-parse --short HEAD)" \ --label "nodebbVersion=${{ steps.vars.outputs.nodebb_version }}" \ --label "buildNumber=${{ github.run_number }}" \ - -t ${IMAGE_NAME}:${IMAGE_TAG} ./NodeBB + -f Dockerfile -t ${IMAGE_NAME}:${IMAGE_TAG} . - name: Login Docker Registry if: ${{ env.BUILD_DOCKER_IMAGE == 'true' }} diff --git a/Dockerfile b/Dockerfile index 189c28e..7269f4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ RUN mkdir -p /usr/src/app WORKDIR /usr/src/app ARG NODE_ENV -ENV NODE_ENV $NODE_ENV +ENV NODE_ENV=$NODE_ENV COPY NodeBB/install/package.json /usr/src/app/package.json COPY NodeBB/ /usr/src/app @@ -44,4 +44,4 @@ EXPOSE 4567 # ENV admin__password="nodebbAdminPassword00" ######################################################## -CMD node ./nodebb setup ; node ./nodebb start +CMD ["sh", "-c", "node ./nodebb setup ; node ./nodebb start"] From 6a5753b2a0c370bd847bb002e0dc2c867421994a Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 23 Dec 2025 15:35:29 +0530 Subject: [PATCH 04/20] #SB-I403: fix: dependency missing issue fix --- .github/workflows/build-nodebb.yml | 2 +- Dockerfile | 8 ++++++++ scripts/verify_plugin_deps.sh | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 scripts/verify_plugin_deps.sh diff --git a/.github/workflows/build-nodebb.yml b/.github/workflows/build-nodebb.yml index 4b86de1..5ec4e76 100644 --- a/.github/workflows/build-nodebb.yml +++ b/.github/workflows/build-nodebb.yml @@ -91,7 +91,7 @@ jobs: - name: Create metadata file run: | - echo "{\"image_name\": \"${{ env.IMAGE_NAME }}\", \"image_tag\": \"${{ steps.vars.outputs.image_tag }}\", \"nodebb_version\": \"${{ steps.vars.outputs.nodebb_version }}\", \"build_number\": \"${{ github.run_number }}\", \"commit_hash\": \"$(git rev-parse --short HEAD)\"}" > metadata.json + echo "{\"registry_url\": \"${REGISTRY_URL}\", \"image_name\": \"${IMAGE_NAME}\", \"image_tag\": \"${{ steps.vars.outputs.image_tag }}\", \"nodebb_version\": \"${{ steps.vars.outputs.nodebb_version }}\", \"build_number\": \"${{ github.run_number }}\", \"commit_hash\": \"$(git rev-parse --short HEAD)\"}" > metadata.json cat metadata.json - name: Upload metadata artifact diff --git a/Dockerfile b/Dockerfile index 7269f4c..5b850d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,14 @@ COPY NodeBB/ /usr/src/app RUN npm install --only=prod && \ npm cache clean --force +# Install pinned runtime dependencies required by plugins (pin for stability) +COPY scripts/verify_plugin_deps.sh /usr/src/app/scripts/verify_plugin_deps.sh +RUN chmod +x /usr/src/app/scripts/verify_plugin_deps.sh +RUN npm install --only=prod --no-audit --no-fund request-promise@4.2.6 connect-multiparty@2.2.1 + +# Verify that required plugin runtime dependencies are installed +RUN /usr/src/app/scripts/verify_plugin_deps.sh + # Install Sunbird custom plugins from JeraldJF GitHub repositories # Using same branch/tag names as original, just different owner diff --git a/scripts/verify_plugin_deps.sh b/scripts/verify_plugin_deps.sh new file mode 100644 index 0000000..51cacc6 --- /dev/null +++ b/scripts/verify_plugin_deps.sh @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +echo "Verifying plugin runtime dependencies..." + +if [ -d "node_modules/request-promise" ] || [ -f "node_modules/request-promise/index.js" ]; then + echo "request-promise: OK" +else + echo "request-promise: MISSING" >&2 + exit 1 +fi + +if [ -d "node_modules/connect-multiparty" ] || [ -f "node_modules/connect-multiparty/index.js" ]; then + echo "connect-multiparty: OK" +else + echo "connect-multiparty: MISSING" >&2 + exit 1 +fi + +echo "All plugin runtime dependencies are present." + +exit 0 From f0df6155765c45f229114a5083987db634a11345 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 23 Dec 2025 15:40:48 +0530 Subject: [PATCH 05/20] #SB-I403: fix: installation fix --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5b850d4..0e0157a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN npm install --only=prod && \ # Install pinned runtime dependencies required by plugins (pin for stability) COPY scripts/verify_plugin_deps.sh /usr/src/app/scripts/verify_plugin_deps.sh RUN chmod +x /usr/src/app/scripts/verify_plugin_deps.sh -RUN npm install --only=prod --no-audit --no-fund request-promise@4.2.6 connect-multiparty@2.2.1 +RUN npm install --omit=dev --no-audit --no-fund request-promise@4.2.6 connect-multiparty@2.2.0 # Verify that required plugin runtime dependencies are installed RUN /usr/src/app/scripts/verify_plugin_deps.sh From 17bdbc9960e90bb67ef07fe95780c45092b869a5 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 30 Dec 2025 12:32:25 +0530 Subject: [PATCH 06/20] #0000 changes --- .github/workflows/build-nodebb.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-nodebb.yml b/.github/workflows/build-nodebb.yml index 5ec4e76..8bb2e02 100644 --- a/.github/workflows/build-nodebb.yml +++ b/.github/workflows/build-nodebb.yml @@ -13,7 +13,7 @@ env: DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} IMAGE_NAME: nodebb # Hardcoded NodeBB version and release tag per request - NODEBB_VERSION: 'v4.7.1' + NODEBB_VERSION: 'v4.7.2' RELEASE_TAG: 'release-8.0.0_RC1' BUILD_DOCKER_IMAGE: 'true' From 3e1e6acae6917dbce13cffd7ea38bcc6d030ff48 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 30 Dec 2025 15:55:25 +0530 Subject: [PATCH 07/20] #SB-I403: fix: removal of deprecated write plugin --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0e0157a..2dd435f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,6 @@ RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-telemetry.git# RUN npm install https://github.com/JeraldJF/nodebb-plugin-azure-storage.git#main # Keep these plugins from upstream (already compatible or deprecated) -RUN npm install https://github.com/NodeBB/nodebb-plugin-write-api.git#master # Nodebb was not taking the latest version of mentions plugin, That's why we added install command here. RUN npm install https://github.com/julianlam/nodebb-plugin-mentions.git#master From 8a07dd990981df212b8e509c42889c582759a748 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Wed, 31 Dec 2025 15:07:38 +0530 Subject: [PATCH 08/20] #SB-I403: fix: point the create forum plugin branch --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2dd435f..69cdbf6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN /usr/src/app/scripts/verify_plugin_deps.sh # Install Sunbird custom plugins from JeraldJF GitHub repositories # Using same branch/tag names as original, just different owner RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-oidc.git#master -RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-api.git#release-4.6.0 +RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-api.git#nodebbupgrade RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-telemetry.git#master RUN npm install https://github.com/JeraldJF/nodebb-plugin-azure-storage.git#main From 0616d8ba185211917f98b693da126d9891d79588 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Wed, 31 Dec 2025 16:30:52 +0530 Subject: [PATCH 09/20] #0000: test the reverted old version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 69cdbf6..9bd99bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN /usr/src/app/scripts/verify_plugin_deps.sh # Install Sunbird custom plugins from JeraldJF GitHub repositories # Using same branch/tag names as original, just different owner RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-oidc.git#master -RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-api.git#nodebbupgrade +RUN npm install https://github.com/Sunbird-Ed/nodebb-plugin-sunbird-api.git#release-4.6.0 RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-telemetry.git#master RUN npm install https://github.com/JeraldJF/nodebb-plugin-azure-storage.git#main From 1276edc0493997ad1ee9ad8268507a2cc13f2f41 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Fri, 2 Jan 2026 14:54:22 +0530 Subject: [PATCH 10/20] #SB-I403: fix: Use local sunbird api plugin --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9bd99bf..2dd435f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN /usr/src/app/scripts/verify_plugin_deps.sh # Install Sunbird custom plugins from JeraldJF GitHub repositories # Using same branch/tag names as original, just different owner RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-oidc.git#master -RUN npm install https://github.com/Sunbird-Ed/nodebb-plugin-sunbird-api.git#release-4.6.0 +RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-api.git#release-4.6.0 RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-telemetry.git#master RUN npm install https://github.com/JeraldJF/nodebb-plugin-azure-storage.git#main From 66783c5fd21a78fbf098538a9d880b507e5e99ac Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Fri, 2 Jan 2026 16:19:38 +0530 Subject: [PATCH 11/20] #SB-I403: fix: added the write api plugin support --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 2dd435f..5708323 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,7 @@ RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-oidc.git#maste RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-api.git#release-4.6.0 RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-telemetry.git#master RUN npm install https://github.com/JeraldJF/nodebb-plugin-azure-storage.git#main +RUN npm install https://github.com/NodeBB/nodebb-plugin-write-api.git#master # Keep these plugins from upstream (already compatible or deprecated) From cc98ea9d4bbd44553886d73c4a40f6032d1ae0b5 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Mon, 5 Jan 2026 17:25:35 +0530 Subject: [PATCH 12/20] fix: Add NodeBB build step to generate service worker and build artifacts --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5708323..dc4b091 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,11 @@ RUN npm install https://github.com/NodeBB/nodebb-plugin-write-api.git#master # Nodebb was not taking the latest version of mentions plugin, That's why we added install command here. RUN npm install https://github.com/julianlam/nodebb-plugin-mentions.git#master +# Build NodeBB to generate required build artifacts (service worker, etc.) +RUN ./nodebb build + +# No entrypoint script needed - use direct NodeBB startup + ENV NODE_ENV=production \ daemon=false \ silent=false @@ -52,4 +57,4 @@ EXPOSE 4567 # ENV admin__password="nodebbAdminPassword00" ######################################################## -CMD ["sh", "-c", "node ./nodebb setup ; node ./nodebb start"] +CMD ["node", "./nodebb", "start"] From 7832b123d471d771d5fa18cb73f5e7055b248ab4 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Mon, 5 Jan 2026 17:33:17 +0530 Subject: [PATCH 13/20] fix: Improve NodeBB build process to generate UI templates and assets --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index dc4b091..2231452 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,9 @@ RUN npm install https://github.com/NodeBB/nodebb-plugin-write-api.git#master RUN npm install https://github.com/julianlam/nodebb-plugin-mentions.git#master # Build NodeBB to generate required build artifacts (service worker, etc.) -RUN ./nodebb build +# Create build directory and run build +RUN mkdir -p build/public/src +RUN NODE_ENV=production ./nodebb build || echo "Build completed with warnings" # No entrypoint script needed - use direct NodeBB startup From 5f5fdd5bb82f603daa89ea51f7fd89e0c0d34193 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 6 Jan 2026 12:50:09 +0530 Subject: [PATCH 14/20] #SB-I403: fix: workflow fix --- .github/workflows/build-nodebb.yml | 2 -- scripts/verify_plugin_deps.sh | 22 ---------------------- 2 files changed, 24 deletions(-) delete mode 100644 scripts/verify_plugin_deps.sh diff --git a/.github/workflows/build-nodebb.yml b/.github/workflows/build-nodebb.yml index 8bb2e02..c22395e 100644 --- a/.github/workflows/build-nodebb.yml +++ b/.github/workflows/build-nodebb.yml @@ -4,8 +4,6 @@ on: push: tags: - '*' - branches: - - '**' env: DOCKER_REGISTRY: docker.io diff --git a/scripts/verify_plugin_deps.sh b/scripts/verify_plugin_deps.sh deleted file mode 100644 index 51cacc6..0000000 --- a/scripts/verify_plugin_deps.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -set -e - -echo "Verifying plugin runtime dependencies..." - -if [ -d "node_modules/request-promise" ] || [ -f "node_modules/request-promise/index.js" ]; then - echo "request-promise: OK" -else - echo "request-promise: MISSING" >&2 - exit 1 -fi - -if [ -d "node_modules/connect-multiparty" ] || [ -f "node_modules/connect-multiparty/index.js" ]; then - echo "connect-multiparty: OK" -else - echo "connect-multiparty: MISSING" >&2 - exit 1 -fi - -echo "All plugin runtime dependencies are present." - -exit 0 From 7742d653105bed950538c63f0138432e3bd9c6a9 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 6 Jan 2026 12:52:56 +0530 Subject: [PATCH 15/20] #SB-I403: fix: Plugin version update --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2231452..c2966ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,9 +22,9 @@ RUN /usr/src/app/scripts/verify_plugin_deps.sh # Install Sunbird custom plugins from JeraldJF GitHub repositories # Using same branch/tag names as original, just different owner RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-oidc.git#master -RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-api.git#release-4.6.0 +RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-api.git#nodebv-v4 RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-telemetry.git#master -RUN npm install https://github.com/JeraldJF/nodebb-plugin-azure-storage.git#main +RUN npm install https://github.com/JeraldJF/nodebb-plugin-azure-storage.git#nodebbv4 RUN npm install https://github.com/NodeBB/nodebb-plugin-write-api.git#master # Keep these plugins from upstream (already compatible or deprecated) From 0de7146176fcd89ca71d7d3fcb384fffb26de515 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 6 Jan 2026 13:00:29 +0530 Subject: [PATCH 16/20] #SB-I403: fix: updated docker file --- Dockerfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index c2966ab..b97a5c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,14 +11,8 @@ RUN npm install --only=prod && \ npm cache clean --force # Install pinned runtime dependencies required by plugins (pin for stability) -COPY scripts/verify_plugin_deps.sh /usr/src/app/scripts/verify_plugin_deps.sh -RUN chmod +x /usr/src/app/scripts/verify_plugin_deps.sh RUN npm install --omit=dev --no-audit --no-fund request-promise@4.2.6 connect-multiparty@2.2.0 -# Verify that required plugin runtime dependencies are installed -RUN /usr/src/app/scripts/verify_plugin_deps.sh - - # Install Sunbird custom plugins from JeraldJF GitHub repositories # Using same branch/tag names as original, just different owner RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-oidc.git#master From d5c40744104eebc76efbcd020c336c741b78de59 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 6 Jan 2026 13:06:10 +0530 Subject: [PATCH 17/20] #SB-I403: fix: fix in docker file --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b97a5c5..9287017 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN npm install --omit=dev --no-audit --no-fund request-promise@4.2.6 connect-mu # Install Sunbird custom plugins from JeraldJF GitHub repositories # Using same branch/tag names as original, just different owner RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-oidc.git#master -RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-api.git#nodebv-v4 +RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-api.git#nodebb-v4 RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-telemetry.git#master RUN npm install https://github.com/JeraldJF/nodebb-plugin-azure-storage.git#nodebbv4 RUN npm install https://github.com/NodeBB/nodebb-plugin-write-api.git#master From 86c48d547fdd65cd09183717a1dbc898b88ff0a4 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Tue, 6 Jan 2026 13:10:34 +0530 Subject: [PATCH 18/20] #SB-I403: fix: eliminate build in workflow --- Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9287017..a8e5a45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,11 +26,6 @@ RUN npm install https://github.com/NodeBB/nodebb-plugin-write-api.git#master # Nodebb was not taking the latest version of mentions plugin, That's why we added install command here. RUN npm install https://github.com/julianlam/nodebb-plugin-mentions.git#master -# Build NodeBB to generate required build artifacts (service worker, etc.) -# Create build directory and run build -RUN mkdir -p build/public/src -RUN NODE_ENV=production ./nodebb build || echo "Build completed with warnings" - # No entrypoint script needed - use direct NodeBB startup ENV NODE_ENV=production \ From 62d5d5548e197cb2a332c9781093ec64f6a5629c Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Thu, 8 Jan 2026 23:11:40 +0530 Subject: [PATCH 19/20] #SB-I403: fix: changes in workflow --- .github/workflows/build-nodebb.yml | 108 +++++++++-------------------- Dockerfile | 16 ++--- 2 files changed, 38 insertions(+), 86 deletions(-) diff --git a/.github/workflows/build-nodebb.yml b/.github/workflows/build-nodebb.yml index c22395e..869b684 100644 --- a/.github/workflows/build-nodebb.yml +++ b/.github/workflows/build-nodebb.yml @@ -1,36 +1,27 @@ -name: Build and Push NodeBB Docker Image +name: Build and Publish Docker Image on: push: tags: - - '*' + - "*" env: - DOCKER_REGISTRY: docker.io - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - IMAGE_NAME: nodebb - # Hardcoded NodeBB version and release tag per request NODEBB_VERSION: 'v4.7.2' - RELEASE_TAG: 'release-8.0.0_RC1' - BUILD_DOCKER_IMAGE: 'true' jobs: build-and-push: runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up build variables - id: vars - run: | - IMAGE_TAG=$(echo "${{ github.ref_name }}_$(echo $GITHUB_SHA | cut -c1-7)" | tr '[:upper:]' '[:lower:]') - echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT - echo "nodebb_version=${{ env.NODEBB_VERSION }}" >> $GITHUB_OUTPUT - echo "release_tag=${{ env.RELEASE_TAG }}" >> $GITHUB_OUTPUT - echo "Building NodeBB ${NODEBB_VERSION} as ${IMAGE_TAG}" + uses: actions/checkout@v3 + with: + submodules: recursive + token: ${{ secrets.GITHUB_TOKEN }} - name: Clone NodeBB repository run: | @@ -42,65 +33,34 @@ jobs: cp build.sh NodeBB/ || true chmod +x NodeBB/build.sh || true - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Build Docker Image - if: ${{ env.BUILD_DOCKER_IMAGE == 'true' }} - run: | - IMAGE_NAME="nodebb" - IMAGE_TAG=${{ steps.vars.outputs.image_tag }} - echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV - echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV - docker build --label "commitHash=$(git rev-parse --short HEAD)" \ - --label "nodebbVersion=${{ steps.vars.outputs.nodebb_version }}" \ - --label "buildNumber=${{ github.run_number }}" \ - -f Dockerfile -t ${IMAGE_NAME}:${IMAGE_TAG} . + - name: Get short commit hash + id: vars + run: echo "commit_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - name: Login Docker Registry - if: ${{ env.BUILD_DOCKER_IMAGE == 'true' }} + - name: Prepare Docker image name and tag run: | - echo "Pushing Docker image: ${IMAGE_NAME}:${IMAGE_TAG}" - case "${{ vars.REGISTRY_PROVIDER }}" in - "gcp") - echo "${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}" | base64 --decode > $HOME/gcloud-key.json - gcloud auth activate-service-account --key-file=$HOME/gcloud-key.json - gcloud auth configure-docker ${{ secrets.REGISTRY_NAME }} - REGISTRY_URL=$(echo "${{ secrets.REGISTRY_URL }}" | tr '[:upper:]' '[:lower:]') - ;; - "azure" | "dockerhub") - echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "${{ secrets.REGISTRY_NAME }}" \ - --username "${{ secrets.REGISTRY_USERNAME }}" --password-stdin - REGISTRY_URL=$(echo "${{ secrets.REGISTRY_URL }}" | tr '[:upper:]' '[:lower:]') - ;; - *) - REPO_NAME_LOWERCASE=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]') - echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - REGISTRY_URL="ghcr.io/$REPO_NAME_LOWERCASE" - ;; - esac - echo "REGISTRY_URL=${REGISTRY_URL}" >> $GITHUB_ENV + REPO_NAME_LOWERCASE=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]') + TAG_NAME=$(echo "${GITHUB_REF_NAME}" | tr '[:upper:]' '[:lower:]') + BUILD_TAG="${TAG_NAME}-${{ steps.vars.outputs.commit_hash }}-${GITHUB_RUN_NUMBER}" - - name: Push Docker image - if: ${{ env.BUILD_DOCKER_IMAGE == 'true' }} - run: | - docker tag ${IMAGE_NAME}:${IMAGE_TAG} ${REGISTRY_URL}/${IMAGE_NAME}:${IMAGE_TAG} - docker push ${REGISTRY_URL}/${IMAGE_NAME}:${IMAGE_TAG} + echo "IMAGE_NAME=ghcr.io/${REPO_NAME_LOWERCASE}" >> $GITHUB_ENV + echo "IMAGE_TAG=${BUILD_TAG}" >> $GITHUB_ENV - - name: Create metadata file - run: | - echo "{\"registry_url\": \"${REGISTRY_URL}\", \"image_name\": \"${IMAGE_NAME}\", \"image_tag\": \"${{ steps.vars.outputs.image_tag }}\", \"nodebb_version\": \"${{ steps.vars.outputs.nodebb_version }}\", \"build_number\": \"${{ github.run_number }}\", \"commit_hash\": \"$(git rev-parse --short HEAD)\"}" > metadata.json - cat metadata.json + echo "Generated Image Name: ${IMAGE_NAME}" + echo "Generated Image Tag: ${IMAGE_TAG}" - - name: Upload metadata artifact - uses: actions/upload-artifact@v4 + - name: Build and push Docker image + uses: docker/build-push-action@v5 with: - name: build-metadata - path: metadata.json - - - name: Update summary - run: | - echo "## Build Summary" >> $GITHUB_STEP_SUMMARY - echo "- **NodeBB Version**: ${{ steps.vars.outputs.nodebb_version }}" >> $GITHUB_STEP_SUMMARY - echo "- **Image Tag**: \`${{ steps.vars.outputs.image_tag }}\`" >> $GITHUB_STEP_SUMMARY - echo "- **Full Image**: \`${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.image_tag }}\`" >> $GITHUB_STEP_SUMMARY + context: ./NodeBB + file: ./NodeBB/Dockerfile + push: true + labels: commitHash=${{ steps.vars.outputs.commit_hash }} + tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} diff --git a/Dockerfile b/Dockerfile index a8e5a45..d7bc13f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,24 +10,16 @@ COPY NodeBB/ /usr/src/app RUN npm install --only=prod && \ npm cache clean --force -# Install pinned runtime dependencies required by plugins (pin for stability) -RUN npm install --omit=dev --no-audit --no-fund request-promise@4.2.6 connect-multiparty@2.2.0 - # Install Sunbird custom plugins from JeraldJF GitHub repositories # Using same branch/tag names as original, just different owner -RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-oidc.git#master -RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-api.git#nodebb-v4 -RUN npm install https://github.com/JeraldJF/nodebb-plugin-sunbird-telemetry.git#master -RUN npm install https://github.com/JeraldJF/nodebb-plugin-azure-storage.git#nodebbv4 -RUN npm install https://github.com/NodeBB/nodebb-plugin-write-api.git#master - -# Keep these plugins from upstream (already compatible or deprecated) +RUN npm install https://github.com/Sunbird-Lern/nodebb-plugin-sunbird-oidc.git#develop +RUN npm install https://github.com/Sunbird-Lern/nodebb-plugin-sunbird-api.git#develop +RUN npm install https://github.com/Sunbird-Lern/nodebb-plugin-sunbird-telemetry.git#develop +RUN npm install https://github.com/Sunbird-Lern/nodebb-plugin-azure-storage.git#develop # Nodebb was not taking the latest version of mentions plugin, That's why we added install command here. RUN npm install https://github.com/julianlam/nodebb-plugin-mentions.git#master -# No entrypoint script needed - use direct NodeBB startup - ENV NODE_ENV=production \ daemon=false \ silent=false From 403fd48999cffeb527b83c82c8ebfaa3b0bc3da2 Mon Sep 17 00:00:00 2001 From: JeraldJF Date: Thu, 8 Jan 2026 23:13:17 +0530 Subject: [PATCH 20/20] #SB-I403: fix: changes in docker file --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d7bc13f..3f3ee77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,6 @@ COPY NodeBB/ /usr/src/app RUN npm install --only=prod && \ npm cache clean --force -# Install Sunbird custom plugins from JeraldJF GitHub repositories -# Using same branch/tag names as original, just different owner RUN npm install https://github.com/Sunbird-Lern/nodebb-plugin-sunbird-oidc.git#develop RUN npm install https://github.com/Sunbird-Lern/nodebb-plugin-sunbird-api.git#develop RUN npm install https://github.com/Sunbird-Lern/nodebb-plugin-sunbird-telemetry.git#develop