From 4cd5b3653b23c8fcb720376178ae7c28971b3d68 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 13 Oct 2025 00:08:14 +0530 Subject: [PATCH 001/116] update --- frontend/Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 frontend/Dockerfile diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..b1d8713 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,11 @@ +FROM node:24-alpine AS builder + +WORKDIR /app + +RUN npm install + +COPY . . + +EXPOSE 8080 + +CMD ["npm","start"] \ No newline at end of file From da1e3e466d80d7fb8ac6528b61d46840b11a5c00 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 13 Oct 2025 01:31:41 +0530 Subject: [PATCH 002/116] update dockerfile --- backend/Dockerfile | 11 +++++++++++ frontend/Dockerfile | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 backend/Dockerfile diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..fb291ac --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,11 @@ +FROM maven:3.9.9-eclipse-temurin-21 AS build +WORKDIR /app +COPY . . +RUN mvn clean package -DskipTests + +# Stage 2: Run the application using OpenJDK +FROM openjdk:21 +WORKDIR /app +COPY --from=build /app/target/*.jar app.jar +EXPOSE 8080 +ENTRYPOINT ["java", "-jar", "app.jar"] diff --git a/frontend/Dockerfile b/frontend/Dockerfile index b1d8713..7c579db 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -2,10 +2,12 @@ FROM node:24-alpine AS builder WORKDIR /app +COPY package*.json . + RUN npm install COPY . . -EXPOSE 8080 +EXPOSE 3000 CMD ["npm","start"] \ No newline at end of file From 17ec166f8fa5a88c01022de2a1070434df13790f Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 13 Oct 2025 15:23:03 +0530 Subject: [PATCH 003/116] update --- backend/.env.example | 7 +++---- docker-compose.yaml | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 docker-compose.yaml diff --git a/backend/.env.example b/backend/.env.example index a28bc1d..adca619 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -1,10 +1,9 @@ # JWT Configuration -JWT_SECRET=your-generated-jwt-secret-key-here - +JWT_SECRET=htxAPEWvHnRrMlL403iAktlmOFlseDUiPIqsECSQpAM= # Database Configuration SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/chattingo_db?createDatabaseIfNotExist=true SPRING_DATASOURCE_USERNAME=root -SPRING_DATASOURCE_PASSWORD=yourpassword +SPRING_DATASOURCE_PASSWORD=test@123 # CORS Configuration CORS_ALLOWED_ORIGINS=http://localhost:3000,https://your-domain.com @@ -16,5 +15,5 @@ SPRING_PROFILES_ACTIVE=development SERVER_PORT=8080 # Production Database (for Docker/VPS deployment) -MYSQL_ROOT_PASSWORD=your-secure-production-password +MYSQL_ROOT_PASSWORD=test@123 MYSQL_DATABASE=chattingo_db diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..0157f4f --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,43 @@ +version: '3.8' + +services: + db: + image: mysql:latest + environment: + MYSQL_ROOT_PASSWORD: test@123 + MYSQL_DATABASE: chattingo_db + volumes: + - db-data:/var/lib/mysql + healthcheck: + test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost'] + interval: 10s + timeout: 5s + retries: 5 + + backend: + build: ./backend + image: routparesh/chattingo-backend:latest + container_name: backend + depends_on: + db: + condition: service_healthy + environment: + DB_HOST: db + DB_USER: root + DB_PASS: test@123 + DB_NAME: usersdb + ports: + - '8080:8080' + + frontend: + build: + context: ./frontend + dockerfile: Dockerfile + image: routparesh/chattingo-frontend:latest + volumes: + - ./frontend:/usr/share/nginx/html:ro + ports: + - '3000:80' + +volumes: + db-data: From 6e23de239389d5da6817a63facd60d72644a54fc Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 26 Oct 2025 00:52:12 +0530 Subject: [PATCH 004/116] update --- docker-compose.yaml | 4 ++-- frontend/Dockerfile | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 0157f4f..6157389 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -26,6 +26,8 @@ services: DB_USER: root DB_PASS: test@123 DB_NAME: usersdb + env_file: + - ./backend/.env ports: - '8080:8080' @@ -34,8 +36,6 @@ services: context: ./frontend dockerfile: Dockerfile image: routparesh/chattingo-frontend:latest - volumes: - - ./frontend:/usr/share/nginx/html:ro ports: - '3000:80' diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 7c579db..89ddcb7 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,13 +1,18 @@ +# 1. Build stage FROM node:24-alpine AS builder WORKDIR /app - -COPY package*.json . - +COPY package*.json ./ RUN npm install - COPY . . +RUN npm run build + +# 2. Nginx stage +FROM nginx:alpine +COPY --from=builder /app/build /usr/share/nginx/html -EXPOSE 3000 +# Optional: remove default nginx config and copy your own +# COPY nginx.conf /etc/nginx/conf.d/default.conf -CMD ["npm","start"] \ No newline at end of file +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] From 0ebf0838a7a542c8e76fdb18065a414404a284cb Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 26 Oct 2025 18:10:43 +0530 Subject: [PATCH 005/116] update --- .github/workflows/ci-cd.yaml | 106 +++++++++++++++++++++++++++++++++++ frontend/Dockerfile | 2 +- gitops.yaml | 20 +++++++ k8s/deployment.yaml | 21 +++++++ k8s/ingress.yaml | 0 k8s/service.yaml | 0 6 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-cd.yaml create mode 100644 gitops.yaml create mode 100644 k8s/deployment.yaml create mode 100644 k8s/ingress.yaml create mode 100644 k8s/service.yaml diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml new file mode 100644 index 0000000..b211fd8 --- /dev/null +++ b/.github/workflows/ci-cd.yaml @@ -0,0 +1,106 @@ +name: CI Pipeline + +on: + push: + branches: [main, docker] + +env: + FRONTEND_IMAGE: routparesh/chattingo-frontend + BACKEND_IMAGE: routparesh/chattingo-backend + +jobs: + build-test-scan-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # ---------------- FRONTEND (Node.js) ---------------- + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Install frontend dependencies + working-directory: ./frontend + run: npm install + + - name: Run frontend tests + working-directory: ./frontend + run: | + if [ -f package.json ] && grep -q "\"test\":" package.json; then + npm test -- --watchAll=false + else + echo "⚠️ No test script found in frontend/package.json" + fi + + # ---------------- BACKEND (Java) ---------------- + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + + - name: Build backend + working-directory: ./backend + run: mvn clean package -DskipTests=false + + - name: Run backend tests + working-directory: ./backend + run: mvn test + + # ---------------- SECURITY: GitLeaks ---------------- + - name: Run GitLeaks scan + uses: gitleaks/gitleaks-action@v2 + with: + config-path: .gitleaks.toml + args: detect --source . --no-banner --verbose + + # ---------------- QUALITY: SonarQube ---------------- + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@v3 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + + # ---------------- SECURITY: Trivy Scan ---------------- + - name: Run Trivy filesystem scan + uses: aquasecurity/trivy-action@master + with: + scan-type: 'fs' + scan-ref: . + format: 'table' + exit-code: '0' + + # ---------------- DOCKER BUILD & PUSH ---------------- + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Frontend image + working-directory: ./frontend + run: | + docker build -t ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} . + docker push ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} + + - name: Build and Push Backend image + working-directory: ./backend + run: | + docker build -t ${{ env.BACKEND_IMAGE }}:${{ github.sha }} . + docker push ${{ env.BACKEND_IMAGE }}:${{ github.sha }} + + # ---------------- UPDATE K8S DEPLOYMENT ---------------- + - name: Update image tags in Kubernetes manifests + run: | + sed -i "s|routparesh/chattingo-frontend:.*|routparesh/chattingo-frontend:${{ github.sha }}|g" k8s/deployment.yaml + + - name: Commit updated image tags + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add k8s/deployment.yaml + git commit -m "update images to ${{ github.sha }}" + git push diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 89ddcb7..2c1cc57 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,5 +1,5 @@ # 1. Build stage -FROM node:24-alpine AS builder +FROM node:18-alpine AS builder WORKDIR /app COPY package*.json ./ diff --git a/gitops.yaml b/gitops.yaml new file mode 100644 index 0000000..d8f57af --- /dev/null +++ b/gitops.yaml @@ -0,0 +1,20 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: chattingo-application + namespace: argocd # Must match the namespace where Argo CD is installed +spec: + project: default # The Argo CD project this application belongs to + source: + repoURL: https://github.com/Routparesh/chattingo.git # URL of the Git repository + targetRevision: main # The branch, tag, or commit hash to deploy + path: k8s # Path within the repository to the Kubernetes manifests + destination: + server: https://kubernetes.default.svc # The target Kubernetes cluster API server URL + namespace: chattingo # The namespace in the target cluster where resources will be deployed + syncPolicy: + automated: + prune: true # Automatically delete resources that are no longer in Git + selfHeal: true # Automatically sync resources if they drift from Git + syncOptions: + - CreateNamespace=true # Create the destination namespace if it does not exist diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 0000000..78c6316 --- /dev/null +++ b/k8s/deployment.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: chattingo-deployment + labels: + app: chattingo +spec: + replicas: 1 + selector: + matchLabels: + app: chattingo + template: + metadata: + labels: + app: chattingo + spec: + containers: + - name: chattingo + image: routparesh/chattingo-frontend:latest + ports: + - containerPort: 80 diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml new file mode 100644 index 0000000..e69de29 diff --git a/k8s/service.yaml b/k8s/service.yaml new file mode 100644 index 0000000..e69de29 From 65c693b3395e6256584369ec5cc79acf8ba8d572 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 26 Oct 2025 18:28:57 +0530 Subject: [PATCH 006/116] update --- frontend/src/App.test.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.test.js b/frontend/src/App.test.js index 1f03afe..971f196 100644 --- a/frontend/src/App.test.js +++ b/frontend/src/App.test.js @@ -1,8 +1,13 @@ import { render, screen } from '@testing-library/react'; +import { MemoryRouter } from 'react-router-dom'; // ✅ Import router wrapper import App from './App'; test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); + render( + + + + ); + const linkElement = screen.getByText(/learn react/i); + expect(linkElement).toBeInTheDocument(); }); From 7ab0dbd99579a802e58e3d63c00134f9181fb89f Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 26 Oct 2025 18:43:10 +0530 Subject: [PATCH 007/116] update --- frontend/src/App.test.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/src/App.test.js b/frontend/src/App.test.js index 971f196..ee346dd 100644 --- a/frontend/src/App.test.js +++ b/frontend/src/App.test.js @@ -1,13 +1,15 @@ -import { render, screen } from '@testing-library/react'; -import { MemoryRouter } from 'react-router-dom'; // ✅ Import router wrapper +import { render } from '@testing-library/react'; +import { Provider } from 'react-redux'; +import { MemoryRouter } from 'react-router-dom'; import App from './App'; +import store from './Redux/store'; // ✅ Correct import -test('renders learn react link', () => { +test('renders App component', () => { render( - - - + + + + + ); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); }); From 80fac3f0ab7c61cd95cf953195661175b354b6e3 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 26 Oct 2025 18:54:38 +0530 Subject: [PATCH 008/116] update --- frontend/src/App.test.js | 2 +- frontend/src/Redux/store.jsx | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/frontend/src/App.test.js b/frontend/src/App.test.js index ee346dd..ac7ffb4 100644 --- a/frontend/src/App.test.js +++ b/frontend/src/App.test.js @@ -2,7 +2,7 @@ import { render } from '@testing-library/react'; import { Provider } from 'react-redux'; import { MemoryRouter } from 'react-router-dom'; import App from './App'; -import store from './Redux/store'; // ✅ Correct import +import { store } from './Redux/store'; test('renders App component', () => { render( diff --git a/frontend/src/Redux/store.jsx b/frontend/src/Redux/store.jsx index d500cd8..e6cc503 100644 --- a/frontend/src/Redux/store.jsx +++ b/frontend/src/Redux/store.jsx @@ -1,15 +1,19 @@ -import { combineReducers, legacy_createStore, applyMiddleware } from "redux"; -import thunk from "redux-thunk"; -import { authReducer } from "./Auth/Reducer"; -import { chatReducer } from "./Chat/Reducer"; -import { messageReducer } from "./Message/Reducer"; +import { applyMiddleware, combineReducers, legacy_createStore } from 'redux'; +import thunk from 'redux-thunk'; +import { authReducer } from './Auth/Reducer'; +import { chatReducer } from './Chat/Reducer'; +import { messageReducer } from './Message/Reducer'; // Combine multiple reducers into a single rootReducer const rootReducer = combineReducers({ - auth: authReducer, // Authentication related state - chat: chatReducer, // Chat related state - message: messageReducer, // Message related state + auth: authReducer, // Authentication related state + chat: chatReducer, // Chat related state + message: messageReducer, // Message related state }); // Create the Redux store with the rootReducer and apply middleware (thunk in this case) export const store = legacy_createStore(rootReducer, applyMiddleware(thunk)); + +export { store }; + +export default store; From 34a5c2f410e8241d644b304f19a45a108767d3bb Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 26 Oct 2025 19:00:18 +0530 Subject: [PATCH 009/116] update --- frontend/src/App.test.js | 2 +- frontend/src/Redux/store.jsx | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/App.test.js b/frontend/src/App.test.js index ac7ffb4..741c11e 100644 --- a/frontend/src/App.test.js +++ b/frontend/src/App.test.js @@ -2,7 +2,7 @@ import { render } from '@testing-library/react'; import { Provider } from 'react-redux'; import { MemoryRouter } from 'react-router-dom'; import App from './App'; -import { store } from './Redux/store'; +import store from './Redux/store'; test('renders App component', () => { render( diff --git a/frontend/src/Redux/store.jsx b/frontend/src/Redux/store.jsx index e6cc503..b18f24f 100644 --- a/frontend/src/Redux/store.jsx +++ b/frontend/src/Redux/store.jsx @@ -14,6 +14,4 @@ const rootReducer = combineReducers({ // Create the Redux store with the rootReducer and apply middleware (thunk in this case) export const store = legacy_createStore(rootReducer, applyMiddleware(thunk)); -export { store }; - export default store; From f5761d1be33d9ef605ea678f76f46af41ba4e176 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 26 Oct 2025 19:27:33 +0530 Subject: [PATCH 010/116] update --- .github/workflows/ci-cd.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index b211fd8..26b42c5 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -12,6 +12,22 @@ jobs: build-test-scan-deploy: runs-on: ubuntu-latest + services: + mysql: + image: mysql:8.0 + env: + MYSQL_ROOT_PASSWORD: test@123 + MYSQL_DATABASE: chattingo_db + MYSQL_USERNAME: root + MYSQL_PASSWORD: test@123 + ports: + - 3306:3306 + options: >- + --health-cmd="mysqladmin ping --silent" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + steps: - name: Checkout code uses: actions/checkout@v4 @@ -42,6 +58,10 @@ jobs: distribution: temurin java-version: 17 + - name: Load backend .env + working-directory: ./backend + run: | + export $(grep -v '^#' .env | xargs) - name: Build backend working-directory: ./backend run: mvn clean package -DskipTests=false From 1e3e12d9d2545a30568ade4cb0253167a7f3dc84 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 00:03:00 +0530 Subject: [PATCH 011/116] update --- backend/src/main/resources/application.properties | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 19eda2c..2c3dde0 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -1,15 +1,15 @@ -spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:mysql://localhost:3306/chattingo_db?createDatabaseIfNotExist=true} +spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:mysql://db:3306/chattingo_db?createDatabaseIfNotExist=true} spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.username=${SPRING_DATASOURCE_USERNAME:root} -spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:} +spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:test@123} spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true # JWT secret (fallback for local dev; override via env: JWT_SECRET) -jwt.secret=${JWT_SECRET:change-me-in-prod} +jwt.secret=${JWT_SECRET:htxAPEWvHnRrMlL403iAktlmOFlseDUiPIqsECSQpAM=} # CORS Configuration (can be overridden by environment variables) -cors.allowed.origins=${CORS_ALLOWED_ORIGINS:http://localhost:3000,http://localhost} +cors.allowed.origins=${CORS_ALLOWED_ORIGINS:http://54.173.113.194:3000,http://localhost} cors.allowed.methods=${CORS_ALLOWED_METHODS:GET,POST,PUT,DELETE,OPTIONS} From 48085c29bbd6464eeab2404b70898563f8b54d17 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 00:23:08 +0530 Subject: [PATCH 012/116] update --- .github/workflows/ci-cd.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 26b42c5..6d40b7a 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -58,10 +58,21 @@ jobs: distribution: temurin java-version: 17 - - name: Load backend .env + - name: Load backend environment variables working-directory: ./backend run: | - export $(grep -v '^#' .env | xargs) + echo "SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/chattingo_db" >> $GITHUB_ENV + echo "SPRING_DATASOURCE_USERNAME=root" >> $GITHUB_ENV + echo "SPRING_DATASOURCE_PASSWORD=test@123" >> $GITHUB_ENV + echo "JWT_SECRET=htxAPEWvHnRrMlL403iAktlmOFlseDUiPIqsECSQpAM=" >> $GITHUB_ENV + + - name: Wait for MySQL to be ready + run: | + for i in {1..15}; do + nc -zv 127.0.0.1 3306 && echo "MySQL is up!" && break + echo "Waiting for MySQL..." + sleep 5 + done - name: Build backend working-directory: ./backend run: mvn clean package -DskipTests=false From 6b90fed4af665916b915ae27c115d1c0625c1973 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 00:41:58 +0530 Subject: [PATCH 013/116] update --- .github/workflows/ci-cd.yaml | 2 +- backend/.env.example | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 6d40b7a..2760ae0 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -64,7 +64,7 @@ jobs: echo "SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/chattingo_db" >> $GITHUB_ENV echo "SPRING_DATASOURCE_USERNAME=root" >> $GITHUB_ENV echo "SPRING_DATASOURCE_PASSWORD=test@123" >> $GITHUB_ENV - echo "JWT_SECRET=htxAPEWvHnRrMlL403iAktlmOFlseDUiPIqsECSQpAM=" >> $GITHUB_ENV + echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> $GITHUB_ENV - name: Wait for MySQL to be ready run: | diff --git a/backend/.env.example b/backend/.env.example index adca619..38d697a 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -1,5 +1,5 @@ # JWT Configuration -JWT_SECRET=htxAPEWvHnRrMlL403iAktlmOFlseDUiPIqsECSQpAM= +JWT_SECRET=your-generated-jwt-secret-key-here # Database Configuration SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/chattingo_db?createDatabaseIfNotExist=true SPRING_DATASOURCE_USERNAME=root From cf4c4905c8ec3ddbc721c474b945259a268d52b8 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 01:02:35 +0530 Subject: [PATCH 014/116] update --- .github/workflows/ci-cd.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 2760ae0..929e289 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -91,6 +91,19 @@ jobs: # ---------------- QUALITY: SonarQube ---------------- - name: SonarQube Scan uses: sonarsource/sonarqube-scan-action@v3 + with: + projectBaseDir: ./backend + args: > + -Dsonar.projectName=chattingo-backend + -Dsonar.projectKey=chattingo-backend + + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@v3 + with: + projectBaseDir: ./frontend + args: > + -Dsonar.projectName=chattingo-frontend + -Dsonar.projectKey=chattingo-frontend env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} From a8a1a4798ff9821d6a4ac7114db5d6a4ab960930 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 01:03:32 +0530 Subject: [PATCH 015/116] update --- .github/workflows/ci-cd.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 929e289..8584d5d 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -96,7 +96,9 @@ jobs: args: > -Dsonar.projectName=chattingo-backend -Dsonar.projectKey=chattingo-backend - + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - name: SonarQube Scan uses: sonarsource/sonarqube-scan-action@v3 with: From d515179d0ba194506731b9e7352708721ef141d7 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 01:18:39 +0530 Subject: [PATCH 016/116] update --- .github/workflows/ci-cd.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 8584d5d..a3eace3 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -82,11 +82,18 @@ jobs: run: mvn test # ---------------- SECURITY: GitLeaks ---------------- - - name: Run GitLeaks scan + + - name: Checkout full history + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run Gitleaks Scan uses: gitleaks/gitleaks-action@v2 with: - config-path: .gitleaks.toml - args: detect --source . --no-banner --verbose + args: detect --source . --no-banner --verbose --config=.gitleaks.toml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # ---------------- QUALITY: SonarQube ---------------- - name: SonarQube Scan From 12b780c5bd6570c585f654f3c73e796ba5fd659b Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 01:32:38 +0530 Subject: [PATCH 017/116] update --- .github/workflows/ci-cd.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index a3eace3..07b73b6 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -46,7 +46,7 @@ jobs: working-directory: ./frontend run: | if [ -f package.json ] && grep -q "\"test\":" package.json; then - npm test -- --watchAll=false + npm test -- --coverage else echo "⚠️ No test script found in frontend/package.json" fi @@ -103,6 +103,7 @@ jobs: args: > -Dsonar.projectName=chattingo-backend -Dsonar.projectKey=chattingo-backend + -Dsonar.java.binaries=./backend/target/classes env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} @@ -113,6 +114,10 @@ jobs: args: > -Dsonar.projectName=chattingo-frontend -Dsonar.projectKey=chattingo-frontend + -Dsonar.sources=./frontend/src + -Dsonar.tests=./frontend/src + -Dsonar.test.inclusions=**/*.test.js,**/*.spec.js + -Dsonar.javascript.lcov.reportPaths=./frontend/coverage/lcov.info env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} From aa59048fe78556745e2aba21a515555bf1dfc844 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 02:00:22 +0530 Subject: [PATCH 018/116] update --- .github/workflows/ci-cd.yaml | 118 +++++++++++++++++++++-------------- 1 file changed, 70 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 07b73b6..7227791 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -9,30 +9,13 @@ env: BACKEND_IMAGE: routparesh/chattingo-backend jobs: - build-test-scan-deploy: + # ---------------- FRONTEND TEST ---------------- + frontend-test: runs-on: ubuntu-latest - - services: - mysql: - image: mysql:8.0 - env: - MYSQL_ROOT_PASSWORD: test@123 - MYSQL_DATABASE: chattingo_db - MYSQL_USERNAME: root - MYSQL_PASSWORD: test@123 - ports: - - 3306:3306 - options: >- - --health-cmd="mysqladmin ping --silent" - --health-interval=10s - --health-timeout=5s - --health-retries=5 - steps: - name: Checkout code uses: actions/checkout@v4 - # ---------------- FRONTEND (Node.js) ---------------- - name: Set up Node.js uses: actions/setup-node@v4 with: @@ -49,9 +32,29 @@ jobs: npm test -- --coverage else echo "⚠️ No test script found in frontend/package.json" - fi - # ---------------- BACKEND (Java) ---------------- + # ---------------- BACKEND TEST ---------------- + backend-test: + runs-on: ubuntu-latest + services: + mysql: + image: mysql:8.0 + env: + MYSQL_ROOT_PASSWORD: test@123 + MYSQL_DATABASE: chattingo_db + MYSQL_USERNAME: root + MYSQL_PASSWORD: test@123 + ports: + - 3306:3306 + options: >- + --health-cmd="mysqladmin ping --silent" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up JDK uses: actions/setup-java@v4 with: @@ -66,13 +69,14 @@ jobs: echo "SPRING_DATASOURCE_PASSWORD=test@123" >> $GITHUB_ENV echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> $GITHUB_ENV - - name: Wait for MySQL to be ready + - name: Wait for MySQL run: | for i in {1..15}; do nc -zv 127.0.0.1 3306 && echo "MySQL is up!" && break echo "Waiting for MySQL..." sleep 5 done + - name: Build backend working-directory: ./backend run: mvn clean package -DskipTests=false @@ -81,22 +85,32 @@ jobs: working-directory: ./backend run: mvn test - # ---------------- SECURITY: GitLeaks ---------------- - - - name: Checkout full history + # ---------------- SONAR SCAN ---------------- + sonar-scan: + runs-on: ubuntu-latest + needs: [frontend-test, backend-test] + steps: + - name: Checkout code uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Run Gitleaks Scan - uses: gitleaks/gitleaks-action@v2 + # Frontend Sonar scan + - name: SonarQube Scan (frontend) + uses: sonarsource/sonarqube-scan-action@v3 with: - args: detect --source . --no-banner --verbose --config=.gitleaks.toml + projectBaseDir: ./frontend + args: > + -Dsonar.projectName=chattingo-frontend + -Dsonar.projectKey=chattingo-frontend + -Dsonar.sources=./frontend/src + -Dsonar.tests=./frontend/src + -Dsonar.test.inclusions=**/*.test.js,**/*.spec.js + -Dsonar.javascript.lcov.reportPaths=./frontend/coverage/lcov.info env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - # ---------------- QUALITY: SonarQube ---------------- - - name: SonarQube Scan + # Backend Sonar scan + - name: SonarQube Scan (backend) uses: sonarsource/sonarqube-scan-action@v3 with: projectBaseDir: ./backend @@ -107,22 +121,24 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - - name: SonarQube Scan - uses: sonarsource/sonarqube-scan-action@v3 + + # ---------------- SECURITY ---------------- + security-scan: + runs-on: ubuntu-latest + needs: sonar-scan + steps: + - name: Checkout full history + uses: actions/checkout@v4 with: - projectBaseDir: ./frontend - args: > - -Dsonar.projectName=chattingo-frontend - -Dsonar.projectKey=chattingo-frontend - -Dsonar.sources=./frontend/src - -Dsonar.tests=./frontend/src - -Dsonar.test.inclusions=**/*.test.js,**/*.spec.js - -Dsonar.javascript.lcov.reportPaths=./frontend/coverage/lcov.info + fetch-depth: 0 + + - name: Run Gitleaks Scan + uses: gitleaks/gitleaks-action@v2 + with: + args: detect --source . --no-banner --verbose --config=.gitleaks.toml env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # ---------------- SECURITY: Trivy Scan ---------------- - name: Run Trivy filesystem scan uses: aquasecurity/trivy-action@master with: @@ -131,7 +147,14 @@ jobs: format: 'table' exit-code: '0' - # ---------------- DOCKER BUILD & PUSH ---------------- + # ---------------- DOCKER BUILD & DEPLOY ---------------- + docker-deploy: + runs-on: ubuntu-latest + needs: security-scan + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -150,7 +173,6 @@ jobs: docker build -t ${{ env.BACKEND_IMAGE }}:${{ github.sha }} . docker push ${{ env.BACKEND_IMAGE }}:${{ github.sha }} - # ---------------- UPDATE K8S DEPLOYMENT ---------------- - name: Update image tags in Kubernetes manifests run: | sed -i "s|routparesh/chattingo-frontend:.*|routparesh/chattingo-frontend:${{ github.sha }}|g" k8s/deployment.yaml From eefc42f1720eb0a0e620b3c2c4c1cdccb62d1f6b Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 02:06:11 +0530 Subject: [PATCH 019/116] update --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 7227791..e8d7343 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -32,7 +32,7 @@ jobs: npm test -- --coverage else echo "⚠️ No test script found in frontend/package.json" - + fi # ---------------- BACKEND TEST ---------------- backend-test: runs-on: ubuntu-latest From 7e5d3f8854599ffa020795dc70bd64536400661a Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 02:15:13 +0530 Subject: [PATCH 020/116] update --- .github/workflows/ci-cd.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index e8d7343..653d414 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -101,10 +101,10 @@ jobs: args: > -Dsonar.projectName=chattingo-frontend -Dsonar.projectKey=chattingo-frontend - -Dsonar.sources=./frontend/src - -Dsonar.tests=./frontend/src + -Dsonar.sources=src + -Dsonar.tests=src -Dsonar.test.inclusions=**/*.test.js,**/*.spec.js - -Dsonar.javascript.lcov.reportPaths=./frontend/coverage/lcov.info + -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} From 7cdf764c262b078329f08b5b249fc1bce3a12e7d Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 02:33:39 +0530 Subject: [PATCH 021/116] update --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 653d414..ca43ce6 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -117,7 +117,7 @@ jobs: args: > -Dsonar.projectName=chattingo-backend -Dsonar.projectKey=chattingo-backend - -Dsonar.java.binaries=./backend/target/classes + -Dsonar.java.binaries=target/classes env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} From d532983bc97b3252bcfbbe30e5435c5112d3f10e Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 02:45:33 +0530 Subject: [PATCH 022/116] update --- .github/workflows/ci-cd.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index ca43ce6..f02a67b 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -114,10 +114,11 @@ jobs: uses: sonarsource/sonarqube-scan-action@v3 with: projectBaseDir: ./backend - args: > - -Dsonar.projectName=chattingo-backend - -Dsonar.projectKey=chattingo-backend - -Dsonar.java.binaries=target/classes + run: mvn sonar:sonar \ + -Dsonar.projectKey=chattingo-backend \ + -Dsonar.projectName=chattingo-backend \ + -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ + -Dsonar.login=${{ secrets.SONAR_TOKEN }} env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} @@ -164,18 +165,18 @@ jobs: - name: Build and Push Frontend image working-directory: ./frontend run: | - docker build -t ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} . - docker push ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} + docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.FRONTEND_IMAGE }}:${{ github.sha }} . + docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.FRONTEND_IMAGE }}:${{ github.sha }} - name: Build and Push Backend image working-directory: ./backend run: | - docker build -t ${{ env.BACKEND_IMAGE }}:${{ github.sha }} . - docker push ${{ env.BACKEND_IMAGE }}:${{ github.sha }} + docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.BACKEND_IMAGE }}:${{ github.sha }} . + docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.BACKEND_IMAGE }}:${{ github.sha }} - name: Update image tags in Kubernetes manifests run: | - sed -i "s|routparesh/chattingo-frontend:.*|routparesh/chattingo-frontend:${{ github.sha }}|g" k8s/deployment.yaml + sed -i "s|routparesh/chattingo-frontend:.*|${{ secrets.DOCKERHUB_USERNAME }}/${{ env.BACKEND_IMAGE }}:${{ github.sha }}|g" k8s/deployment.yaml - name: Commit updated image tags run: | From 27002edf04061d337a2bcbeedac2c17c53ba902c Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 12:49:20 +0530 Subject: [PATCH 023/116] update --- .github/workflows/ci-cd.yaml | 79 ++++++++++++++++--- k8s/chattingo-backend-deployment.yaml | 21 +++++ k8s/chattingo-backend-service.yaml | 12 +++ k8s/chattingo-db-deployment.yaml | 30 +++++++ k8s/chattingo-db-service.yaml | 12 +++ ...aml => chattingo-frontend-deployment.yaml} | 6 +- k8s/chattingo-frontend-service.yaml | 12 +++ k8s/ingress.yaml | 16 ++++ k8s/service.yaml | 0 9 files changed, 172 insertions(+), 16 deletions(-) create mode 100644 k8s/chattingo-backend-deployment.yaml create mode 100644 k8s/chattingo-backend-service.yaml create mode 100644 k8s/chattingo-db-deployment.yaml create mode 100644 k8s/chattingo-db-service.yaml rename k8s/{deployment.yaml => chattingo-frontend-deployment.yaml} (75%) create mode 100644 k8s/chattingo-frontend-service.yaml delete mode 100644 k8s/service.yaml diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index f02a67b..79d81fc 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -33,6 +33,7 @@ jobs: else echo "⚠️ No test script found in frontend/package.json" fi + # ---------------- BACKEND TEST ---------------- backend-test: runs-on: ubuntu-latest @@ -42,8 +43,6 @@ jobs: env: MYSQL_ROOT_PASSWORD: test@123 MYSQL_DATABASE: chattingo_db - MYSQL_USERNAME: root - MYSQL_PASSWORD: test@123 ports: - 3306:3306 options: >- @@ -111,19 +110,15 @@ jobs: # Backend Sonar scan - name: SonarQube Scan (backend) - uses: sonarsource/sonarqube-scan-action@v3 - with: - projectBaseDir: ./backend - run: mvn sonar:sonar \ + run: | + cd backend + mvn sonar:sonar \ -Dsonar.projectKey=chattingo-backend \ -Dsonar.projectName=chattingo-backend \ -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ -Dsonar.login=${{ secrets.SONAR_TOKEN }} - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - # ---------------- SECURITY ---------------- + # ---------------- SECURITY SCAN ---------------- security-scan: runs-on: ubuntu-latest needs: sonar-scan @@ -133,14 +128,51 @@ jobs: with: fetch-depth: 0 + # --- Secret Scanning --- - name: Run Gitleaks Scan uses: gitleaks/gitleaks-action@v2 with: - args: detect --source . --no-banner --verbose --config=.gitleaks.toml + args: detect --source . --no-banner --verbose env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Run Trivy filesystem scan + # --- Frontend Dependency Scan --- + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Install Frontend Dependencies + working-directory: ./frontend + run: npm install + + - name: Run npm audit for vulnerabilities + working-directory: ./frontend + run: npm audit --audit-level=low || true + + # --- Backend Dependency Scan --- + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + + - name: OWASP Dependency Check (Backend) + uses: dependency-check/Dependency-Check_Action@main + with: + project: chattingo-backend + path: ./backend + format: 'HTML' + out: reports + + - name: Upload Dependency Check Report + uses: actions/upload-artifact@v4 + with: + name: dependency-check-report + path: reports + + # --- Filesystem Vulnerability Scan --- + - name: Run Trivy Filesystem Scan uses: aquasecurity/trivy-action@master with: scan-type: 'fs' @@ -148,6 +180,26 @@ jobs: format: 'table' exit-code: '0' + # --- Image Vulnerability Scan (before push) --- + - name: Build Images for Scanning + run: | + docker build -t frontend-scan ./frontend + docker build -t backend-scan ./backend + + - name: Run Trivy Image Scan (Frontend) + uses: aquasecurity/trivy-action@master + with: + image-ref: 'frontend-scan' + format: 'table' + exit-code: '0' + + - name: Run Trivy Image Scan (Backend) + uses: aquasecurity/trivy-action@master + with: + image-ref: 'backend-scan' + format: 'table' + exit-code: '0' + # ---------------- DOCKER BUILD & DEPLOY ---------------- docker-deploy: runs-on: ubuntu-latest @@ -176,7 +228,8 @@ jobs: - name: Update image tags in Kubernetes manifests run: | - sed -i "s|routparesh/chattingo-frontend:.*|${{ secrets.DOCKERHUB_USERNAME }}/${{ env.BACKEND_IMAGE }}:${{ github.sha }}|g" k8s/deployment.yaml + sed -i "s|routparesh/chattingo-frontend:.*|${{ secrets.DOCKERHUB_USERNAME }}/${{ env.FRONTEND_IMAGE }}:${{ github.sha }}|g" k8s/deployment.yaml + sed -i "s|routparesh/chattingo-backend:.*|${{ secrets.DOCKERHUB_USERNAME }}/${{ env.BACKEND_IMAGE }}:${{ github.sha }}|g" k8s/deployment.yaml - name: Commit updated image tags run: | diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml new file mode 100644 index 0000000..3fe8346 --- /dev/null +++ b/k8s/chattingo-backend-deployment.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: chattingo-backend-deployment + labels: + app: chattingo +spec: + replicas: 1 + selector: + matchLabels: + app: chattingo + template: + metadata: + labels: + app: chattingo-backend + spec: + containers: + - name: chattingo + image: routparesh/chattingo-backend:latest + ports: + - containerPort: 8080 diff --git a/k8s/chattingo-backend-service.yaml b/k8s/chattingo-backend-service.yaml new file mode 100644 index 0000000..3b9d9e4 --- /dev/null +++ b/k8s/chattingo-backend-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: chattingo-backend-service +spec: + selector: + app: chattingo-backend + ports: + - name: http + protocol: TCP + port: 8080 + targetPort: 8080 diff --git a/k8s/chattingo-db-deployment.yaml b/k8s/chattingo-db-deployment.yaml new file mode 100644 index 0000000..a9e2f17 --- /dev/null +++ b/k8s/chattingo-db-deployment.yaml @@ -0,0 +1,30 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: chattingo-db-deployment + labels: + app: chattingo +spec: + replicas: 1 + selector: + matchLabels: + app: chattingo + template: + metadata: + labels: + app: chattingo-db + spec: + containers: + - name: chattingo-db + image: mysql:8.0 + env: + - name: MYSQL_ROOT_PASSWORD + value: 'test@123' + - name: MYSQL_DATABASE + value: 'chattingo_db' + - name: MYSQL_USERNAME + value: 'root' + - name: MYSQL_PASSWORD + value: 'test@123' + ports: + - containerPort: 3306 diff --git a/k8s/chattingo-db-service.yaml b/k8s/chattingo-db-service.yaml new file mode 100644 index 0000000..510e117 --- /dev/null +++ b/k8s/chattingo-db-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: chattingo-db-service +spec: + selector: + app: chattingo-db + ports: + - name: http + protocol: TCP + port: 3306 + targetPort: 3306 diff --git a/k8s/deployment.yaml b/k8s/chattingo-frontend-deployment.yaml similarity index 75% rename from k8s/deployment.yaml rename to k8s/chattingo-frontend-deployment.yaml index 78c6316..b3a667c 100644 --- a/k8s/deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: chattingo-deployment + name: chattingo-frontend-deployment labels: app: chattingo spec: @@ -12,10 +12,10 @@ spec: template: metadata: labels: - app: chattingo + app: chattingo-frontend spec: containers: - - name: chattingo + - name: chattingo-frontend image: routparesh/chattingo-frontend:latest ports: - containerPort: 80 diff --git a/k8s/chattingo-frontend-service.yaml b/k8s/chattingo-frontend-service.yaml new file mode 100644 index 0000000..02a187c --- /dev/null +++ b/k8s/chattingo-frontend-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: chattingo-frontend-service +spec: + selector: + app: chattingo-frontend + ports: + - name: http + protocol: TCP + port: 80 + targetPort: 3000 diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index e69de29..e905ce5 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: chattingo-ingress +spec: + rules: + - host: 'chattingo.paresh.work' + http: + paths: + - pathType: Prefix + path: '/' + backend: + service: + name: chattingo-backend-service + port: + number: 80 diff --git a/k8s/service.yaml b/k8s/service.yaml deleted file mode 100644 index e69de29..0000000 From 5000678e5d5974f3c52c15fd799884943094d537 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 14:08:07 +0530 Subject: [PATCH 024/116] update --- Readme.md | 82 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 60 insertions(+), 22 deletions(-) diff --git a/Readme.md b/Readme.md index 8e16d5a..f70652d 100644 --- a/Readme.md +++ b/Readme.md @@ -4,20 +4,25 @@ A full-stack real-time chat application built with React, Spring Boot, and WebSo ## 🚨 **IMPORTANT: Registration Required** -### **📝 [REGISTER NOW](https://forms.gle/NgNJNg8yQvPaA1Vz9)** +### **📝 [REGISTER NOW](https://forms.gle/NgNJNg8yQvPaA1Vz9)** + **Deadline: September 5, 2025** **What you need to register:** + - Your Name - Email ID - LinkedIn Profile URL - GitHub Profile URL ### **📤 [SUBMISSION FORM](https://forms.gle/ww3vPN29JTNRqzM27)** + **Deadline: September 10, 2025 (11:59 PM)** ### **📂 Repository Access** + **Repository URL**: https://github.com/iemafzalhassan/chattingo + - **Currently**: Private repository (registration phase) - **Will be public**: After registration closes (Sept 6) - **Action Required**: Fork & star the repository once it becomes public @@ -25,6 +30,7 @@ A full-stack real-time chat application built with React, Spring Boot, and WebSo --- ## 🎯 **Hackathon Challenge** + Transform this vanilla application into a production-ready, containerized system with automated deployment! ## 📋 Table of Contents @@ -43,6 +49,7 @@ Transform this vanilla application into a production-ready, containerized system ## 🏆 Hackathon Overview ### 🎯 Project Goals + - **Build & Deploy**: Create Dockerfiles and containerize the application - **CI/CD Pipeline**: Implement Jenkins automated deployment - **VPS Deployment**: Deploy on Hostinger VPS using modern DevOps practices @@ -50,15 +57,18 @@ Transform this vanilla application into a production-ready, containerized system ### 📅 Timeline & Registration #### **Registration Phase (Sept 3-5)** + 📝 **[REGISTER HERE](https://forms.gle/NgNJNg8yQvPaA1Vz9)** - Complete by Sept 5 **Registration Form Requirements:** + - Name -- Email ID +- Email ID - LinkedIn Profile - GitHub Profile #### **Event Schedule** + - **Sept 6**: Kickoff session (VPS setup, Docker + Jenkins basics) - **Sept 7-10**: Build period (3 days) - **Sept 10**: Submissions close at 11:59 PM @@ -80,6 +90,7 @@ Transform this vanilla application into a production-ready, containerized system ## 🛠️ Technology Stack ### Frontend + - **React 18** - Modern UI framework - **Redux Toolkit** - State management - **Material-UI** - Component library @@ -88,6 +99,7 @@ Transform this vanilla application into a production-ready, containerized system - **React Router** - Client-side routing ### Backend + - **Spring Boot 3.3.1** - Java framework - **Spring Security** - Authentication & authorization - **Spring Data JPA** - Database operations @@ -96,6 +108,7 @@ Transform this vanilla application into a production-ready, containerized system - **MySQL** - Database ### DevOps (Your Tasks) + - **Docker** - Containerization (YOU BUILD) - **Docker Compose** - Multi-container orchestration (YOU BUILD) - **Jenkins** - CI/CD pipeline (YOU BUILD) @@ -106,6 +119,7 @@ Transform this vanilla application into a production-ready, containerized system ### **Just Registered? Start Here!** #### **Step 1: Fork & Clone** + ```bash # Fork this repository on GitHub: https://github.com/iemafzalhassan/chattingo # Then clone your fork @@ -114,17 +128,21 @@ cd chattingo ``` #### **Step 2: Join Discord** + - **[🗓┃Events-Announcement](https://discord.gg/jYeffuxs)**: Stay updated - **[📝┃Events-Chat](https://discord.gg/bHVKCYj4)**: Get technical support #### **Step 3: Local Development Setup** + Follow **[CONTRIBUTING.md](CONTRIBUTING.md)** for detailed setup instructions. #### **Step 4: Follow the Timeline** + - **Sept 7-10**: Build your implementation - **Sept 10**: Submit before 11:59 PM ### **Reference Guides** + - **Detailed Setup & Deployment**: **[CONTRIBUTING.md](CONTRIBUTING.md)** ## 🔧 **YOUR TASKS** @@ -134,16 +152,19 @@ Follow **[CONTRIBUTING.md](CONTRIBUTING.md)** for detailed setup instructions. You need to create these files from scratch: #### **Frontend Dockerfile** (3-stage build) + - Stage 1: Node.js build environment -- Stage 2: Build React application +- Stage 2: Build React application - Stage 3: Nginx runtime server #### **Backend Dockerfile** (3-stage build) + - Stage 1: Maven build environment - Stage 2: Build Spring Boot application -- Stage 3: JRE runtime +- Stage 3: JRE runtimee #### **Docker Compose** (Root level) + Create `docker-compose.yml` to orchestrate all services. **Scoring**: Single Stage (2), Two Stage (4), Multi Stage (5) @@ -155,27 +176,27 @@ Create a `Jenkinsfile` with these stages: ```groovy pipeline { agent any - + stages { - stage('Git Clone') { + stage('Git Clone') { // Clone repository from GitHub (2 Marks) } - stage('Image Build') { + stage('Image Build') { // Build Docker images for frontend & backend (2 Marks) } - stage('Filesystem Scan') { + stage('Filesystem Scan') { // Security scan of source code (2 Marks) } - stage('Image Scan') { + stage('Image Scan') { // Vulnerability scan of Docker images (2 Marks) } - stage('Push to Registry') { + stage('Push to Registry') { // Push images to Docker Hub/Registry (2 Marks) } - stage('Update Compose') { + stage('Update Compose') { // Update docker-compose with new image tags (2 Marks) } - stage('Deploy') { + stage('Deploy') { // Deploy to Hostinger VPS (5 Marks) } } @@ -183,6 +204,7 @@ pipeline { ``` ### Additional Requirements + - **Jenkins Shared Library**: 3 Marks - **Active Engagement**: 2 Marks - **Creativity**: 2 Marks @@ -192,6 +214,7 @@ pipeline { - Video (Compulsory): 5 Marks ### **Task 3: VPS Deployment** + - **Hostinger VPS Setup**: Ubuntu 22.04 LTS, 2GB RAM - **Domain Configuration**: Setup your domain with DNS - **SSL Certificate**: Configure HTTPS with Let's Encrypt @@ -202,6 +225,7 @@ pipeline { ## 📱 Application Features ### Core Functionality + - ✅ User authentication (JWT) - ✅ Real-time messaging (WebSocket) - ✅ Group chat creation @@ -210,6 +234,7 @@ pipeline { - ✅ Responsive design ### API Endpoints + ``` POST /api/auth/register - User registration POST /api/auth/login - User login @@ -250,9 +275,11 @@ chattingo/ ## 🎥 **Submission Requirements** ### **📤 Submission Form: [Submit Here](https://forms.gle/ww3vPN29JTNRqzM27)** + **Deadline: Sept 10, 11:59 PM** ### **Required Submission Fields** + 1. **Name** - Your full name 2. **Email ID** - Contact email 3. **GitHub Repository URL** - Your forked and implemented project @@ -262,7 +289,9 @@ chattingo/ 7. **README URL** - Link to your updated README file ### **Required Deliverables** + 1. **GitHub Repository** with your implementation + - ✅ Dockerfiles (Backend & Frontend - 3-stage builds) - ✅ docker-compose.yml (Root level orchestration) - ✅ Jenkinsfile (Complete CI/CD pipeline) @@ -271,6 +300,7 @@ chattingo/ - ✅ Updated README with deployment instructions 2. **Live Application** deployed on Hostinger VPS + - ✅ Working chat application with HTTPS - ✅ SSL certificate configured - ✅ Domain properly configured @@ -283,6 +313,7 @@ chattingo/ - ✅ Key features demonstration ### **Bonus Points** + 1. **Blog Post** - Technical writeup of your implementation (2 marks) 2. **Additional Features** - Enhancements to the chat app 3. **Monitoring** - Application monitoring and logging @@ -293,34 +324,41 @@ chattingo/ ### **Implementation Flow** (Following Hackathon Timeline) #### **Phase 1: Registration (Sept 3-5)** + 1. **[Register Here](https://forms.gle/NgNJNg8yQvPaA1Vz9)** with your details 2. **Fork this repository**: https://github.com/iemafzalhassan/chattingo 3. **Join Discord** channels for updates and support #### **Phase 2: Kickoff Session (Sept 6)** + - **Attend intro session** - VPS setup guide, Docker & Jenkins basics - **Get your VPS** access and domain setup - **Ask questions** and clarify requirements #### **Phase 3: Build Period (Sept 7-10)** + - **Day 1**: Local development setup → **[CONTRIBUTING.md](CONTRIBUTING.md)** -- **Day 2**: Docker & Jenkins implementation +- **Day 2**: Docker & Jenkins implementation - **Day 3**: VPS deployment → **[CONTRIBUTING.md](CONTRIBUTING.md)** #### **Phase 4: Submission (Sept 10)** + 📤 **[SUBMIT HERE](https://forms.gle/ww3vPN29JTNRqzM27)** before 11:59 PM #### **Phase 5: Results (Sept 11-13)** + - **Sept 11-12**: Judging & reviews - **Sept 13**: Winners announced ## 📞 Support & Resources ### Discord Channels -- **[🗓┃𝖤𝗏𝖾𝗇𝗍𝗌-𝖠𝗇𝗇𝗈𝗎𝗇𝖼𝖾𝗆𝖾𝗇𝗍](https://discord.gg/jYeffuxs)**: Stay Active in the Announcement channel for Hackathon Update. + +- **[🗓┃𝖤𝗏𝖾𝗇𝗍𝗌-𝖠𝗇𝗇𝗈𝗎𝗇𝖼𝖾𝗆𝖾𝗇𝗍](https://discord.gg/jYeffuxs)**: Stay Active in the Announcement channel for Hackathon Update. - **[📝┃𝖤𝗏𝖾𝗇𝗍𝗌-𝖢𝗁𝖺𝗍](https://discord.gg/bHVKCYj4)**: Technical support. ### Reference Links + - [Hackathon Repository](https://github.com/iemafzalhassan/chattingo) - [Docker Documentation](https://docs.docker.com/) - [Jenkins Documentation](https://www.jenkins.io/doc/) @@ -328,14 +366,14 @@ chattingo/ ## 🏅 Judging Criteria -| Component | Marks | Description | -|-----------|-------|-------------| -| Dockerfile | 5 | Multi-stage implementation | -| Jenkinsfile | 17 | Complete CI/CD pipeline | -| Shared Library | 3 | Reusable Jenkins components | -| Engagement | 2 | Active participation | -| Creativity | 2 | Unique features/implementation | -| Documentation | 10 | README, blog, video | +| Component | Marks | Description | +| -------------- | ----- | ------------------------------ | +| Dockerfile | 5 | Multi-stage implementation | +| Jenkinsfile | 17 | Complete CI/CD pipeline | +| Shared Library | 3 | Reusable Jenkins components | +| Engagement | 2 | Active participation | +| Creativity | 2 | Unique features/implementation | +| Documentation | 10 | README, blog, video | --- From 087ed9b18a55b1e0e51d8bd3c43754ef2958e06d Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 14:19:39 +0530 Subject: [PATCH 025/116] update --- .github/workflows/ci-cd.yaml | 60 +++++++++++++++++------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 79d81fc..e3c5e57 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -34,8 +34,8 @@ jobs: echo "⚠️ No test script found in frontend/package.json" fi - # ---------------- BACKEND TEST ---------------- - backend-test: + # ---------------- BACKEND CI (Build + Test + Sonar) ---------------- + backend-ci: runs-on: ubuntu-latest services: mysql: @@ -50,16 +50,24 @@ jobs: --health-interval=10s --health-timeout=5s --health-retries=5 + steps: - name: Checkout code uses: actions/checkout@v4 - - name: Set up JDK + - name: Set up JDK 17 uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Load backend environment variables working-directory: ./backend run: | @@ -68,31 +76,36 @@ jobs: echo "SPRING_DATASOURCE_PASSWORD=test@123" >> $GITHUB_ENV echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> $GITHUB_ENV - - name: Wait for MySQL + - name: Wait for MySQL to be ready run: | for i in {1..15}; do - nc -zv 127.0.0.1 3306 && echo "MySQL is up!" && break - echo "Waiting for MySQL..." - sleep 5 + nc -zv 127.0.0.1 3306 && echo "✅ MySQL is ready!" && break + echo "⏳ Waiting for MySQL..." + sleep 5 done - - name: Build backend + - name: Build and Run Tests working-directory: ./backend - run: mvn clean package -DskipTests=false + run: mvn clean verify - - name: Run backend tests + - name: SonarQube Analysis working-directory: ./backend - run: mvn test + run: | + mvn sonar:sonar \ + -Dsonar.projectKey=chattingo-backend \ + -Dsonar.projectName=chattingo-backend \ + -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ + -Dsonar.login=${{ secrets.SONAR_TOKEN }} \ + -Dsonar.java.binaries=target/classes - # ---------------- SONAR SCAN ---------------- - sonar-scan: + # ---------------- SONAR SCAN (Frontend Only) ---------------- + sonar-frontend: runs-on: ubuntu-latest - needs: [frontend-test, backend-test] + needs: [frontend-test, backend-ci] steps: - name: Checkout code uses: actions/checkout@v4 - # Frontend Sonar scan - name: SonarQube Scan (frontend) uses: sonarsource/sonarqube-scan-action@v3 with: @@ -108,27 +121,16 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - # Backend Sonar scan - - name: SonarQube Scan (backend) - run: | - cd backend - mvn sonar:sonar \ - -Dsonar.projectKey=chattingo-backend \ - -Dsonar.projectName=chattingo-backend \ - -Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \ - -Dsonar.login=${{ secrets.SONAR_TOKEN }} - # ---------------- SECURITY SCAN ---------------- security-scan: runs-on: ubuntu-latest - needs: sonar-scan + needs: sonar-frontend steps: - name: Checkout full history uses: actions/checkout@v4 with: fetch-depth: 0 - # --- Secret Scanning --- - name: Run Gitleaks Scan uses: gitleaks/gitleaks-action@v2 with: @@ -136,7 +138,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # --- Frontend Dependency Scan --- - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -150,7 +151,6 @@ jobs: working-directory: ./frontend run: npm audit --audit-level=low || true - # --- Backend Dependency Scan --- - name: Setup Java uses: actions/setup-java@v4 with: @@ -171,7 +171,6 @@ jobs: name: dependency-check-report path: reports - # --- Filesystem Vulnerability Scan --- - name: Run Trivy Filesystem Scan uses: aquasecurity/trivy-action@master with: @@ -180,7 +179,6 @@ jobs: format: 'table' exit-code: '0' - # --- Image Vulnerability Scan (before push) --- - name: Build Images for Scanning run: | docker build -t frontend-scan ./frontend From 2e268797d31e4ed54ae1e90cb08bdfa7f887146d Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 14:53:06 +0530 Subject: [PATCH 026/116] update --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index e3c5e57..e9913a8 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -164,7 +164,7 @@ jobs: path: ./backend format: 'HTML' out: reports - + java_home: /opt/java/openjdk - name: Upload Dependency Check Report uses: actions/upload-artifact@v4 with: From 3ad37ca970b9294745e7fc151a802d59d6d27087 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout <101355021+Routparesh@users.noreply.github.com> Date: Mon, 27 Oct 2025 15:05:20 +0530 Subject: [PATCH 027/116] Update --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index e9913a8..2202348 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -164,7 +164,7 @@ jobs: path: ./backend format: 'HTML' out: reports - java_home: /opt/java/openjdk + - name: Upload Dependency Check Report uses: actions/upload-artifact@v4 with: From 161b43886fc98b8ab8933e7559f6a6f41b67ce61 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout <101355021+Routparesh@users.noreply.github.com> Date: Mon, 27 Oct 2025 15:19:03 +0530 Subject: [PATCH 028/116] Update --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 2202348..e2d7bab 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -158,7 +158,7 @@ jobs: java-version: 17 - name: OWASP Dependency Check (Backend) - uses: dependency-check/Dependency-Check_Action@main + uses: jeremylong/DependencyCheck_Action@v5.4.2 with: project: chattingo-backend path: ./backend From 4bc0cb81435e6600f9cdcacb86a1df7279037a19 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout <101355021+Routparesh@users.noreply.github.com> Date: Mon, 27 Oct 2025 15:28:48 +0530 Subject: [PATCH 029/116] Update --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index e2d7bab..6aa81af 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -158,7 +158,7 @@ jobs: java-version: 17 - name: OWASP Dependency Check (Backend) - uses: jeremylong/DependencyCheck_Action@v5.4.2 + uses: jeremylong/DependencyCheck_Action@v12.1.0 with: project: chattingo-backend path: ./backend From dc8520b8f8abddfd6d70977fee2e3921848f5849 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout <101355021+Routparesh@users.noreply.github.com> Date: Mon, 27 Oct 2025 15:44:56 +0530 Subject: [PATCH 030/116] Update --- .github/workflows/ci-cd.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 6aa81af..8728291 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -158,7 +158,9 @@ jobs: java-version: 17 - name: OWASP Dependency Check (Backend) - uses: jeremylong/DependencyCheck_Action@v12.1.0 + uses: dependency-check/Dependency-Check_Action@main + env: + JAVA_HOME: /opt/jdk with: project: chattingo-backend path: ./backend From dc873d57e4bb82cd996c664961bc0a7b804273a3 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 16:46:58 +0530 Subject: [PATCH 031/116] update --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index f70652d..74f17d1 100644 --- a/Readme.md +++ b/Readme.md @@ -161,7 +161,7 @@ You need to create these files from scratch: - Stage 1: Maven build environment - Stage 2: Build Spring Boot application -- Stage 3: JRE runtimee +- Stage 3: JRE runtimeee #### **Docker Compose** (Root level) From b0a2f923fef1c8439fe2601aa5fd04c1a615a22b Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 17:11:12 +0530 Subject: [PATCH 032/116] update --- .github/workflows/ci-cd.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 8728291..1d3bc3e 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -166,7 +166,7 @@ jobs: path: ./backend format: 'HTML' out: reports - + - name: Upload Dependency Check Report uses: actions/upload-artifact@v4 with: @@ -217,19 +217,19 @@ jobs: - name: Build and Push Frontend image working-directory: ./frontend run: | - docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.FRONTEND_IMAGE }}:${{ github.sha }} . - docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.FRONTEND_IMAGE }}:${{ github.sha }} + docker build -t ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} + docker push ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} - name: Build and Push Backend image working-directory: ./backend run: | - docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.BACKEND_IMAGE }}:${{ github.sha }} . - docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.BACKEND_IMAGE }}:${{ github.sha }} + docker build -t ${{ env.BACKEND_IMAGE }}:${{ github.sha }} . + docker push ${{ env.BACKEND_IMAGE }}:${{ github.sha }} - name: Update image tags in Kubernetes manifests run: | - sed -i "s|routparesh/chattingo-frontend:.*|${{ secrets.DOCKERHUB_USERNAME }}/${{ env.FRONTEND_IMAGE }}:${{ github.sha }}|g" k8s/deployment.yaml - sed -i "s|routparesh/chattingo-backend:.*|${{ secrets.DOCKERHUB_USERNAME }}/${{ env.BACKEND_IMAGE }}:${{ github.sha }}|g" k8s/deployment.yaml + sed -i "s|routparesh/chattingo-frontend:.*| ${{ env.FRONTEND_IMAGE }}:${{ github.sha }}|g" k8s/deployment.yaml + sed -i "s|routparesh/chattingo-backend:.*| ${{ env.BACKEND_IMAGE }}:${{ github.sha }}|g" k8s/deployment.yaml - name: Commit updated image tags run: | From 7f754d5d13ef27579d9f5ca0a6aa43b8087cc6c7 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 17:33:31 +0530 Subject: [PATCH 033/116] update --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 74f17d1..cbc0ff1 100644 --- a/Readme.md +++ b/Readme.md @@ -161,7 +161,7 @@ You need to create these files from scratch: - Stage 1: Maven build environment - Stage 2: Build Spring Boot application -- Stage 3: JRE runtimeee +- Stage 3: JRE runtime #### **Docker Compose** (Root level) From 1c873920e1c14daa88e6e350f4b0cfe109f2eaa3 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 17:42:38 +0530 Subject: [PATCH 034/116] update --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 1d3bc3e..32102aa 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -217,7 +217,7 @@ jobs: - name: Build and Push Frontend image working-directory: ./frontend run: | - docker build -t ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} + docker build -t ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} . docker push ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} - name: Build and Push Backend image From 0d901754329d45cb9639cc9c8519d49baf61ef9e Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 17:57:27 +0530 Subject: [PATCH 035/116] update --- .github/workflows/ci-cd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 32102aa..18c034e 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -228,8 +228,8 @@ jobs: - name: Update image tags in Kubernetes manifests run: | - sed -i "s|routparesh/chattingo-frontend:.*| ${{ env.FRONTEND_IMAGE }}:${{ github.sha }}|g" k8s/deployment.yaml - sed -i "s|routparesh/chattingo-backend:.*| ${{ env.BACKEND_IMAGE }}:${{ github.sha }}|g" k8s/deployment.yaml + sed -i "s|routparesh/chattingo-frontend:.*| ${{ env.FRONTEND_IMAGE }}:${{ github.sha }}|g" k8s/chattingo-frontend-deployment.yaml + sed -i "s|routparesh/chattingo-backend:.*| ${{ env.BACKEND_IMAGE }}:${{ github.sha }}|g" k8s/chattingo-backend-deployment.yaml - name: Commit updated image tags run: | From 33bc576d4585f6673ac665ad81ba7c8d42ec3619 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 18:09:35 +0530 Subject: [PATCH 036/116] update --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 18c034e..6e91452 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -235,6 +235,6 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git add k8s/deployment.yaml + git add k8s/*.yaml git commit -m "update images to ${{ github.sha }}" git push From afad4bc94092b877c649c20790e746eef417ca35 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 27 Oct 2025 12:49:30 +0000 Subject: [PATCH 037/116] update images to 33bc576d4585f6673ac665ad81ba7c8d42ec3619 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 3fe8346..49e1eb9 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo - image: routparesh/chattingo-backend:latest + image: routparesh/chattingo-backend:33bc576d4585f6673ac665ad81ba7c8d42ec3619 ports: - containerPort: 8080 diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index b3a667c..60bc3fc 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:latest + image: routparesh/chattingo-frontend:33bc576d4585f6673ac665ad81ba7c8d42ec3619 ports: - containerPort: 80 From cdcc0dcad33aa757c3d49bdcdbc795548dee47e0 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 19:26:41 +0530 Subject: [PATCH 038/116] update k8s --- k8s/chattingo-backend-deployment.yaml | 19 ++++++++++--- k8s/chattingo-backend-service.yaml | 5 ++-- k8s/chattingo-db-deployment.yaml | 8 ++---- k8s/chattingo-db-service.yaml | 4 +-- k8s/chattingo-frontend-deployment.yaml | 6 ++-- k8s/chattingo-frontend-service.yaml | 4 +-- k8s/ingress.yaml | 38 +++++++++++++++++++++++--- 7 files changed, 60 insertions(+), 24 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 49e1eb9..4fbf9ed 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -3,19 +3,30 @@ kind: Deployment metadata: name: chattingo-backend-deployment labels: - app: chattingo + app: chattingo-backend spec: replicas: 1 selector: matchLabels: - app: chattingo + app: chattingo-backend template: metadata: labels: app: chattingo-backend spec: containers: - - name: chattingo - image: routparesh/chattingo-backend:33bc576d4585f6673ac665ad81ba7c8d42ec3619 + - name: chattingo-backend + image: routparesh/chattingo-backend:33bc576d4585f6673ac665ad81ba7c8d42ec3619 ports: - containerPort: 8080 + env: + - name: DB_HOST + value: chattingo-db-service + - name: DB_PORT + value: '3306' + - name: DB_NAME + value: chattingo_db + - name: DB_USER + value: root + - name: DB_PASSWORD + value: test@123 diff --git a/k8s/chattingo-backend-service.yaml b/k8s/chattingo-backend-service.yaml index 3b9d9e4..9761fde 100644 --- a/k8s/chattingo-backend-service.yaml +++ b/k8s/chattingo-backend-service.yaml @@ -6,7 +6,6 @@ spec: selector: app: chattingo-backend ports: - - name: http - protocol: TCP - port: 8080 + - protocol: TCP + port: 80 targetPort: 8080 diff --git a/k8s/chattingo-db-deployment.yaml b/k8s/chattingo-db-deployment.yaml index a9e2f17..c9a3d1c 100644 --- a/k8s/chattingo-db-deployment.yaml +++ b/k8s/chattingo-db-deployment.yaml @@ -3,12 +3,12 @@ kind: Deployment metadata: name: chattingo-db-deployment labels: - app: chattingo + app: chattingo-db spec: replicas: 1 selector: matchLabels: - app: chattingo + app: chattingo-db template: metadata: labels: @@ -22,9 +22,5 @@ spec: value: 'test@123' - name: MYSQL_DATABASE value: 'chattingo_db' - - name: MYSQL_USERNAME - value: 'root' - - name: MYSQL_PASSWORD - value: 'test@123' ports: - containerPort: 3306 diff --git a/k8s/chattingo-db-service.yaml b/k8s/chattingo-db-service.yaml index 510e117..95bf4ab 100644 --- a/k8s/chattingo-db-service.yaml +++ b/k8s/chattingo-db-service.yaml @@ -6,7 +6,7 @@ spec: selector: app: chattingo-db ports: - - name: http - protocol: TCP + - protocol: TCP port: 3306 targetPort: 3306 + type: ClusterIP diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 60bc3fc..e77f432 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -3,12 +3,12 @@ kind: Deployment metadata: name: chattingo-frontend-deployment labels: - app: chattingo + app: chattingo-frontend spec: replicas: 1 selector: matchLabels: - app: chattingo + app: chattingo-frontend template: metadata: labels: @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:33bc576d4585f6673ac665ad81ba7c8d42ec3619 + image: routparesh/chattingo-frontend:33bc576d4585f6673ac665ad81ba7c8d42ec3619 ports: - containerPort: 80 diff --git a/k8s/chattingo-frontend-service.yaml b/k8s/chattingo-frontend-service.yaml index 02a187c..f932423 100644 --- a/k8s/chattingo-frontend-service.yaml +++ b/k8s/chattingo-frontend-service.yaml @@ -6,7 +6,7 @@ spec: selector: app: chattingo-frontend ports: - - name: http - protocol: TCP + - protocol: TCP port: 80 targetPort: 3000 + type: ClusterIP diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index e905ce5..c7e635d 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -2,15 +2,45 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: chattingo-ingress + annotations: + # Required for AWS ALB Ingress Controller + kubernetes.io/ingress.class: alb + + # ALB scheme - internet-facing or internal + alb.ingress.kubernetes.io/scheme: internet-facing + + # Target type - IP mode for pods + alb.ingress.kubernetes.io/target-type: ip + + # Listen on HTTP (you can later switch to HTTPS) + alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80}]' + + # Optional health check settings + alb.ingress.kubernetes.io/healthcheck-path: /api/health + alb.ingress.kubernetes.io/healthcheck-port: '8080' + alb.ingress.kubernetes.io/healthcheck-protocol: HTTP + + # Optional: group rules under a single ALB if you plan multiple ingresses + alb.ingress.kubernetes.io/group.name: chattingo-group spec: rules: - - host: 'chattingo.paresh.work' + - host: chattingo.paresh.work http: paths: - - pathType: Prefix - path: '/' + # Frontend route + - path: / + pathType: Prefix backend: service: - name: chattingo-backend-service + name: chattingo-frontend-service port: number: 80 + + # Backend route + - path: /api + pathType: Prefix + backend: + service: + name: chattingo-backend-service + port: + number: 8080 From b7c38108cc06ec5d7894704d6e957ae2593f1f8a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 27 Oct 2025 14:05:31 +0000 Subject: [PATCH 039/116] update images to cdcc0dcad33aa757c3d49bdcdbc795548dee47e0 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 4fbf9ed..e762501 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:33bc576d4585f6673ac665ad81ba7c8d42ec3619 + image: routparesh/chattingo-backend:cdcc0dcad33aa757c3d49bdcdbc795548dee47e0 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index e77f432..b9f2978 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:33bc576d4585f6673ac665ad81ba7c8d42ec3619 + image: routparesh/chattingo-frontend:cdcc0dcad33aa757c3d49bdcdbc795548dee47e0 ports: - containerPort: 80 From 98f6a19ffa90e5a12c6049b413cd2f24c55bc3ce Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout <101355021+Routparesh@users.noreply.github.com> Date: Mon, 27 Oct 2025 23:30:33 +0530 Subject: [PATCH 040/116] Update chattingo-backend-deployment.yaml From a6d0952ae097eceb77214f3cdefada7b95bcea69 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Mon, 27 Oct 2025 23:44:41 +0530 Subject: [PATCH 041/116] update --- k8s/chattingo-backend-deployment.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 4fbf9ed..842543d 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -14,6 +14,17 @@ spec: labels: app: chattingo-backend spec: + initContainers: + - name: wait-for-db + image: busybox + command: + - sh + - -c + - | + until nc -z chattingo-db-service 3306; do + echo "Waiting for DB..." + sleep 2 + done containers: - name: chattingo-backend image: routparesh/chattingo-backend:33bc576d4585f6673ac665ad81ba7c8d42ec3619 From 7cabfacc0550f243faab9d1a59bd9e8b9f5354be Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Thu, 30 Oct 2025 17:12:42 +0530 Subject: [PATCH 042/116] update --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index cbc0ff1..f70652d 100644 --- a/Readme.md +++ b/Readme.md @@ -161,7 +161,7 @@ You need to create these files from scratch: - Stage 1: Maven build environment - Stage 2: Build Spring Boot application -- Stage 3: JRE runtime +- Stage 3: JRE runtimee #### **Docker Compose** (Root level) From 5ea382d6109214846b9c89fc0a935f4fa57be347 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Oct 2025 11:52:19 +0000 Subject: [PATCH 043/116] update images to 7cabfacc0550f243faab9d1a59bd9e8b9f5354be --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 05dae73..f780632 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -27,7 +27,7 @@ spec: done containers: - name: chattingo-backend - image: routparesh/chattingo-backend:cdcc0dcad33aa757c3d49bdcdbc795548dee47e0 + image: routparesh/chattingo-backend:7cabfacc0550f243faab9d1a59bd9e8b9f5354be ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index b9f2978..e0bfb7b 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:cdcc0dcad33aa757c3d49bdcdbc795548dee47e0 + image: routparesh/chattingo-frontend:7cabfacc0550f243faab9d1a59bd9e8b9f5354be ports: - containerPort: 80 From 78a2ce383fdd126feca2ded0a4421f567f258039 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Thu, 30 Oct 2025 18:34:28 +0530 Subject: [PATCH 044/116] update --- k8s/chattingo-db-service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/chattingo-db-service.yaml b/k8s/chattingo-db-service.yaml index 95bf4ab..220ec3c 100644 --- a/k8s/chattingo-db-service.yaml +++ b/k8s/chattingo-db-service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: chattingo-db-service + name: db spec: selector: app: chattingo-db From bd1509ce4b1cc2e7a24c52e77947289611b53f91 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Oct 2025 13:13:28 +0000 Subject: [PATCH 045/116] update images to 78a2ce383fdd126feca2ded0a4421f567f258039 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index f780632..f6b99b6 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -27,7 +27,7 @@ spec: done containers: - name: chattingo-backend - image: routparesh/chattingo-backend:7cabfacc0550f243faab9d1a59bd9e8b9f5354be + image: routparesh/chattingo-backend:78a2ce383fdd126feca2ded0a4421f567f258039 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index e0bfb7b..a40f8bc 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:7cabfacc0550f243faab9d1a59bd9e8b9f5354be + image: routparesh/chattingo-frontend:78a2ce383fdd126feca2ded0a4421f567f258039 ports: - containerPort: 80 From af3fb047841e59aa3e0851555b925dca6c2b6c49 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Thu, 30 Oct 2025 19:28:02 +0530 Subject: [PATCH 046/116] update --- k8s/chattingo-backend-deployment.yaml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index f780632..adfcf1d 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -21,13 +21,19 @@ spec: - sh - -c - | - until nc -z chattingo-db-service 3306; do - echo "Waiting for DB..." + echo "Waiting for DB..." + # Try 30 times (max ~60 seconds) + for i in $(seq 1 30); do + nc -z chattingo-db-service 3306 && exit 0 + echo "DB not ready, retrying ($i/30)..." sleep 2 done + echo "DB did not start in time, exiting initContainer." + exit 1 + imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:7cabfacc0550f243faab9d1a59bd9e8b9f5354be + image: routparesh/chattingo-backend:7cabfacc0550f243faab9d1a59bd9e8b9f5354be ports: - containerPort: 8080 env: @@ -41,3 +47,11 @@ spec: value: root - name: DB_PASSWORD value: test@123 + readinessProbe: + httpGet: + path: /actuator/health + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 5 + failureThreshold: 5 + restartPolicy: Always From ecffe30e4d35c94d3fcb4438415da4e6bdab6b7c Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Thu, 30 Oct 2025 19:29:30 +0530 Subject: [PATCH 047/116] update --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index f70652d..cbc0ff1 100644 --- a/Readme.md +++ b/Readme.md @@ -161,7 +161,7 @@ You need to create these files from scratch: - Stage 1: Maven build environment - Stage 2: Build Spring Boot application -- Stage 3: JRE runtimee +- Stage 3: JRE runtime #### **Docker Compose** (Root level) From f47ae78f113b6e2e1afce190ba01c3c92fd47954 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Oct 2025 14:07:54 +0000 Subject: [PATCH 048/116] update images to ecffe30e4d35c94d3fcb4438415da4e6bdab6b7c --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index adfcf1d..84b34c3 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,7 +33,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:7cabfacc0550f243faab9d1a59bd9e8b9f5354be + image: routparesh/chattingo-backend:ecffe30e4d35c94d3fcb4438415da4e6bdab6b7c ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index a40f8bc..7b7f397 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:78a2ce383fdd126feca2ded0a4421f567f258039 + image: routparesh/chattingo-frontend:ecffe30e4d35c94d3fcb4438415da4e6bdab6b7c ports: - containerPort: 80 From a623179c9f7c68968731b827ca09c64b69bce903 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Thu, 30 Oct 2025 19:39:12 +0530 Subject: [PATCH 049/116] update db --- k8s/chattingo-backend-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index adfcf1d..4d1f982 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -38,7 +38,7 @@ spec: - containerPort: 8080 env: - name: DB_HOST - value: chattingo-db-service + value: db - name: DB_PORT value: '3306' - name: DB_NAME From 9519bc1483c643c252cac0db4937f87197bfae3f Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Thu, 30 Oct 2025 19:39:45 +0530 Subject: [PATCH 050/116] update db in env --- k8s/chattingo-backend-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 4d1f982..e9cbe57 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -24,7 +24,7 @@ spec: echo "Waiting for DB..." # Try 30 times (max ~60 seconds) for i in $(seq 1 30); do - nc -z chattingo-db-service 3306 && exit 0 + nc -z db 3306 && exit 0 echo "DB not ready, retrying ($i/30)..." sleep 2 done From 969aa92946485f3b91eaf015f5480d05180261b1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Oct 2025 14:18:38 +0000 Subject: [PATCH 051/116] update images to c3785091fc1be8eaa3284730cb4541953c440de1 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 3e5fb35..cf5df88 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,7 +33,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:ecffe30e4d35c94d3fcb4438415da4e6bdab6b7c + image: routparesh/chattingo-backend:c3785091fc1be8eaa3284730cb4541953c440de1 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 7b7f397..e5821a0 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:ecffe30e4d35c94d3fcb4438415da4e6bdab6b7c + image: routparesh/chattingo-frontend:c3785091fc1be8eaa3284730cb4541953c440de1 ports: - containerPort: 80 From 5fabd61294c6a1a10db6fe281f3598dca6522a7c Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Thu, 30 Oct 2025 19:49:40 +0530 Subject: [PATCH 052/116] update probe --- backend/src/main/resources/application.properties | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 2c3dde0..6f4339a 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -7,6 +7,9 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true +management.endpoints.web.exposure.include=health,info +management.endpoint.health.show-details=always + # JWT secret (fallback for local dev; override via env: JWT_SECRET) jwt.secret=${JWT_SECRET:htxAPEWvHnRrMlL403iAktlmOFlseDUiPIqsECSQpAM=} From d03b5c22cd5f133891f4fd5e81a09f4a1eb3ab60 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Oct 2025 14:29:00 +0000 Subject: [PATCH 053/116] update images to 72452c8f2ba59698bee6cd0f793fddff5936c463 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index cf5df88..e341bf5 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,7 +33,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:c3785091fc1be8eaa3284730cb4541953c440de1 + image: routparesh/chattingo-backend:72452c8f2ba59698bee6cd0f793fddff5936c463 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index e5821a0..c2b9210 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:c3785091fc1be8eaa3284730cb4541953c440de1 + image: routparesh/chattingo-frontend:72452c8f2ba59698bee6cd0f793fddff5936c463 ports: - containerPort: 80 From a86f36bce280b34bbfea446a61a719c092113140 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Thu, 30 Oct 2025 23:51:23 +0530 Subject: [PATCH 054/116] update sonar --- backend/src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 6f4339a..9548828 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -14,5 +14,5 @@ management.endpoint.health.show-details=always jwt.secret=${JWT_SECRET:htxAPEWvHnRrMlL403iAktlmOFlseDUiPIqsECSQpAM=} # CORS Configuration (can be overridden by environment variables) -cors.allowed.origins=${CORS_ALLOWED_ORIGINS:http://54.173.113.194:3000,http://localhost} +cors.allowed.origins=${CORS_ALLOWED_ORIGINS:http://13.222.158.219:3000,http://localhost} cors.allowed.methods=${CORS_ALLOWED_METHODS:GET,POST,PUT,DELETE,OPTIONS} From 03ba45f3b728884ea1d5403bb65bfa983b4f55e8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Oct 2025 18:30:20 +0000 Subject: [PATCH 055/116] update images to afb75c0b9cc2ccf591699eac7dc6a981da125d11 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index e341bf5..17c97cc 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,7 +33,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:72452c8f2ba59698bee6cd0f793fddff5936c463 + image: routparesh/chattingo-backend:afb75c0b9cc2ccf591699eac7dc6a981da125d11 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index c2b9210..77fe934 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:72452c8f2ba59698bee6cd0f793fddff5936c463 + image: routparesh/chattingo-frontend:afb75c0b9cc2ccf591699eac7dc6a981da125d11 ports: - containerPort: 80 From e6d5246d46ee7fe917c1c042a433a0ce8f203c5f Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 00:30:29 +0530 Subject: [PATCH 056/116] ingress --- k8s/ingress.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index c7e635d..828ae5a 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -23,6 +23,7 @@ metadata: # Optional: group rules under a single ALB if you plan multiple ingresses alb.ingress.kubernetes.io/group.name: chattingo-group spec: + ingressClassName: alb rules: - host: chattingo.paresh.work http: From df48a2e2f91432c0b48beca4767d311d1228a6fb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Oct 2025 19:08:50 +0000 Subject: [PATCH 057/116] update images to 82fa8420fce86795a56e01a0b7cf97ecdc30e628 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 17c97cc..ffb99b9 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,7 +33,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:afb75c0b9cc2ccf591699eac7dc6a981da125d11 + image: routparesh/chattingo-backend:82fa8420fce86795a56e01a0b7cf97ecdc30e628 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 77fe934..f3c566d 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:afb75c0b9cc2ccf591699eac7dc6a981da125d11 + image: routparesh/chattingo-frontend:82fa8420fce86795a56e01a0b7cf97ecdc30e628 ports: - containerPort: 80 From 3375982f7e7718a4629864418f16c370641ff36c Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 00:41:19 +0530 Subject: [PATCH 058/116] update backend --- k8s/chattingo-backend-service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/chattingo-backend-service.yaml b/k8s/chattingo-backend-service.yaml index 9761fde..f1b1c24 100644 --- a/k8s/chattingo-backend-service.yaml +++ b/k8s/chattingo-backend-service.yaml @@ -7,5 +7,5 @@ spec: app: chattingo-backend ports: - protocol: TCP - port: 80 + port: 8080 targetPort: 8080 From 7fd472fc08c7ff492e9319907b8207bdf6c9c5b9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Oct 2025 19:20:39 +0000 Subject: [PATCH 059/116] update images to e9c0887ba3a614b29db043a3c682010bf2e84254 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index ffb99b9..436c7a4 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,7 +33,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:82fa8420fce86795a56e01a0b7cf97ecdc30e628 + image: routparesh/chattingo-backend:e9c0887ba3a614b29db043a3c682010bf2e84254 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index f3c566d..2dd7ff2 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:82fa8420fce86795a56e01a0b7cf97ecdc30e628 + image: routparesh/chattingo-frontend:e9c0887ba3a614b29db043a3c682010bf2e84254 ports: - containerPort: 80 From e52ba0014f143c0b04fe25de8e6657609ee84c9e Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 01:14:41 +0530 Subject: [PATCH 060/116] update db --- backend/src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 9548828..b570460 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:mysql://db:3306/chattingo_db?createDatabaseIfNotExist=true} spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.username=${SPRING_DATASOURCE_USERNAME:root} -spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:test@123} +spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:} spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect spring.jpa.hibernate.ddl-auto=update From ebb1658e568afec3a44c3b0c85b3567c8a1f3bbb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Oct 2025 19:53:24 +0000 Subject: [PATCH 061/116] update images to 419491474988e11ab740168b81a4564acff8d2c0 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 436c7a4..1fbd20d 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,7 +33,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:e9c0887ba3a614b29db043a3c682010bf2e84254 + image: routparesh/chattingo-backend:419491474988e11ab740168b81a4564acff8d2c0 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 2dd7ff2..192377d 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:e9c0887ba3a614b29db043a3c682010bf2e84254 + image: routparesh/chattingo-frontend:419491474988e11ab740168b81a4564acff8d2c0 ports: - containerPort: 80 From b7df82b36d82c1c1b13961160c9e3004a2b13f4a Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 01:32:33 +0530 Subject: [PATCH 062/116] update --- backend/src/main/resources/application.properties | 2 +- k8s/chattingo-backend-deployment.yaml | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index b570460..9548828 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:mysql://db:3306/chattingo_db?createDatabaseIfNotExist=true} spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.username=${SPRING_DATASOURCE_USERNAME:root} -spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:} +spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:test@123} spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect spring.jpa.hibernate.ddl-auto=update diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 436c7a4..eb060ce 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,19 +33,15 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:e9c0887ba3a614b29db043a3c682010bf2e84254 + image: routparesh/chattingo-backend:e9c0887ba3a614b29db043a3c682010bf2e84254 ports: - containerPort: 8080 env: - - name: DB_HOST - value: db - - name: DB_PORT - value: '3306' - - name: DB_NAME - value: chattingo_db - - name: DB_USER + - name: SPRING_DATASOURCE_URL + value: jdbc:mysql://db:3306/chattingo_db + - name: SPRING_DATASOURCE_USERNAME value: root - - name: DB_PASSWORD + - name: SPRING_DATASOURCE_PASSWORD value: test@123 readinessProbe: httpGet: From 6dfbdeeda11b5e3b2d55db2790961821e6504011 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Oct 2025 20:12:21 +0000 Subject: [PATCH 063/116] update images to 7cc2f1c79dfc2f4fdcc7a6bd0a1e688f41548f2d --- k8s/chattingo-backend-deployment.yaml | 4 ++-- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index b977f32..4cdf393 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,8 +33,8 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:e9c0887ba3a614b29db043a3c682010bf2e84254 - image: routparesh/chattingo-backend:419491474988e11ab740168b81a4564acff8d2c0 + image: routparesh/chattingo-backend:7cc2f1c79dfc2f4fdcc7a6bd0a1e688f41548f2d + image: routparesh/chattingo-backend:7cc2f1c79dfc2f4fdcc7a6bd0a1e688f41548f2d ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 192377d..5f69373 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:419491474988e11ab740168b81a4564acff8d2c0 + image: routparesh/chattingo-frontend:7cc2f1c79dfc2f4fdcc7a6bd0a1e688f41548f2d ports: - containerPort: 80 From 1d9bf4ea21c02cbf781990db01293eaa53489ef7 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 17:13:57 +0530 Subject: [PATCH 064/116] update --- k8s/chattingo-backend-deployment.yaml | 1 - k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index b977f32..eb060ce 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -34,7 +34,6 @@ spec: containers: - name: chattingo-backend image: routparesh/chattingo-backend:e9c0887ba3a614b29db043a3c682010bf2e84254 - image: routparesh/chattingo-backend:419491474988e11ab740168b81a4564acff8d2c0 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 192377d..e96caf0 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:419491474988e11ab740168b81a4564acff8d2c0 + image: routparesh/chattingo-frontend:419491474988e11ab740168b81a4564acff8d2c0 ports: - containerPort: 80 From a6dd095e6a935ecc89f4630b69aa54428b34b63f Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 17:23:31 +0530 Subject: [PATCH 065/116] update --- k8s/chattingo-backend-deployment.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 4cdf393..ded4b52 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,8 +33,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:7cc2f1c79dfc2f4fdcc7a6bd0a1e688f41548f2d - image: routparesh/chattingo-backend:7cc2f1c79dfc2f4fdcc7a6bd0a1e688f41548f2d + image: routparesh/chattingo-backend:7cc2f1c79dfc2f4fdcc7a6bd0a1e688f41548f2d ports: - containerPort: 8080 env: From 7ed9dc2b5e85636be48f2ea54a57c224994696cf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 31 Oct 2025 12:02:30 +0000 Subject: [PATCH 066/116] update images to a6dd095e6a935ecc89f4630b69aa54428b34b63f --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index ded4b52..11b89be 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,7 +33,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:7cc2f1c79dfc2f4fdcc7a6bd0a1e688f41548f2d + image: routparesh/chattingo-backend:a6dd095e6a935ecc89f4630b69aa54428b34b63f ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index bb3ff86..eb54e14 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -17,9 +17,9 @@ spec: containers: - name: chattingo-frontend <<<<<<< HEAD - image: routparesh/chattingo-frontend:419491474988e11ab740168b81a4564acff8d2c0 + image: routparesh/chattingo-frontend:a6dd095e6a935ecc89f4630b69aa54428b34b63f ======= - image: routparesh/chattingo-frontend:7cc2f1c79dfc2f4fdcc7a6bd0a1e688f41548f2d + image: routparesh/chattingo-frontend:a6dd095e6a935ecc89f4630b69aa54428b34b63f >>>>>>> 6dfbdeeda11b5e3b2d55db2790961821e6504011 ports: - containerPort: 80 From f099872806e87bbc06951b8420a2da56dac92d80 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 18:15:46 +0530 Subject: [PATCH 067/116] update frontend --- k8s/chattingo-frontend-deployment.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index bb3ff86..e96caf0 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,10 +16,6 @@ spec: spec: containers: - name: chattingo-frontend -<<<<<<< HEAD image: routparesh/chattingo-frontend:419491474988e11ab740168b81a4564acff8d2c0 -======= - image: routparesh/chattingo-frontend:7cc2f1c79dfc2f4fdcc7a6bd0a1e688f41548f2d ->>>>>>> 6dfbdeeda11b5e3b2d55db2790961821e6504011 ports: - containerPort: 80 From fbea059fdba410d808ddcf947506c7cc26d9f1af Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 18:17:59 +0530 Subject: [PATCH 068/116] update --- k8s/chattingo-frontend-deployment.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index eb54e14..e93b362 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,10 +16,6 @@ spec: spec: containers: - name: chattingo-frontend -<<<<<<< HEAD - image: routparesh/chattingo-frontend:a6dd095e6a935ecc89f4630b69aa54428b34b63f -======= - image: routparesh/chattingo-frontend:a6dd095e6a935ecc89f4630b69aa54428b34b63f ->>>>>>> 6dfbdeeda11b5e3b2d55db2790961821e6504011 + image: routparesh/chattingo-frontend:a6dd095e6a935ecc89f4630b69aa54428b34b63f ports: - containerPort: 80 From 072460198feb2c9cfbc297c1ec486002546e89de Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 31 Oct 2025 12:56:04 +0000 Subject: [PATCH 069/116] update images to fbea059fdba410d808ddcf947506c7cc26d9f1af --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 11b89be..fc94e3c 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,7 +33,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:a6dd095e6a935ecc89f4630b69aa54428b34b63f + image: routparesh/chattingo-backend:fbea059fdba410d808ddcf947506c7cc26d9f1af ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index e93b362..5e21339 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:a6dd095e6a935ecc89f4630b69aa54428b34b63f + image: routparesh/chattingo-frontend:fbea059fdba410d808ddcf947506c7cc26d9f1af ports: - containerPort: 80 From 549249c37ffb9269f95e5db52c53460d56fbf015 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 18:32:38 +0530 Subject: [PATCH 070/116] update --- k8s/chattingo-backend-deployment.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 11b89be..5283b23 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -22,7 +22,6 @@ spec: - -c - | echo "Waiting for DB..." - # Try 30 times (max ~60 seconds) for i in $(seq 1 30); do nc -z db 3306 && exit 0 echo "DB not ready, retrying ($i/30)..." @@ -33,12 +32,12 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:a6dd095e6a935ecc89f4630b69aa54428b34b63f + image: routparesh/chattingo-backend:a6dd095e6a935ecc89f4630b69aa54428b34b63f ports: - containerPort: 8080 env: - name: SPRING_DATASOURCE_URL - value: jdbc:mysql://db:3306/chattingo_db + value: jdbc:mysql://db:3306/chattingo_db?createDatabaseIfNotExist=true - name: SPRING_DATASOURCE_USERNAME value: root - name: SPRING_DATASOURCE_PASSWORD @@ -47,7 +46,16 @@ spec: httpGet: path: /actuator/health port: 8080 - initialDelaySeconds: 10 - periodSeconds: 5 + initialDelaySeconds: 25 # wait longer for Spring Boot startup + periodSeconds: 10 failureThreshold: 5 + timeoutSeconds: 5 + livenessProbe: + httpGet: + path: /actuator/health + port: 8080 + initialDelaySeconds: 35 # allow app to become stable first + periodSeconds: 20 + failureThreshold: 5 + timeoutSeconds: 5 restartPolicy: Always From 01c07af0b9bb95f706e19a151c1915b075fe2f44 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 18:34:14 +0530 Subject: [PATCH 071/116] update --- k8s/chattingo-backend-deployment.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 6ed6030..5283b23 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,7 +33,6 @@ spec: containers: - name: chattingo-backend image: routparesh/chattingo-backend:a6dd095e6a935ecc89f4630b69aa54428b34b63f - image: routparesh/chattingo-backend:fbea059fdba410d808ddcf947506c7cc26d9f1af ports: - containerPort: 8080 env: From 6eaa63a213b1296d6cd4a0cf9191cae0f1d5b8a2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 31 Oct 2025 13:12:34 +0000 Subject: [PATCH 072/116] update images to 01c07af0b9bb95f706e19a151c1915b075fe2f44 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 5283b23..73b6028 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:a6dd095e6a935ecc89f4630b69aa54428b34b63f + image: routparesh/chattingo-backend:01c07af0b9bb95f706e19a151c1915b075fe2f44 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 5e21339..840135f 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:fbea059fdba410d808ddcf947506c7cc26d9f1af + image: routparesh/chattingo-frontend:01c07af0b9bb95f706e19a151c1915b075fe2f44 ports: - containerPort: 80 From 89a78ba26e48e9bc22720e63a5ea6efa26395f42 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 18:47:41 +0530 Subject: [PATCH 073/116] update --- backend/src/main/resources/application.properties | 1 + k8s/chattingo-backend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 9548828..e2a8502 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -9,6 +9,7 @@ spring.jpa.show-sql=true management.endpoints.web.exposure.include=health,info management.endpoint.health.show-details=always +management.endpoint.health.probes.enabled=true # JWT secret (fallback for local dev; override via env: JWT_SECRET) jwt.secret=${JWT_SECRET:htxAPEWvHnRrMlL403iAktlmOFlseDUiPIqsECSQpAM=} diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 5283b23..cee19e9 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -44,7 +44,7 @@ spec: value: test@123 readinessProbe: httpGet: - path: /actuator/health + path: /actuator/health/readiness port: 8080 initialDelaySeconds: 25 # wait longer for Spring Boot startup periodSeconds: 10 From 3ab1df3d7454dc8da1bad5e7662f08403db8836e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 31 Oct 2025 13:27:08 +0000 Subject: [PATCH 074/116] update images to ec127a1f9ba4e3fcac6ba1c0f2d29752e642d005 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index d50969c..1b4223c 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:01c07af0b9bb95f706e19a151c1915b075fe2f44 + image: routparesh/chattingo-backend:ec127a1f9ba4e3fcac6ba1c0f2d29752e642d005 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 840135f..1f21ff3 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:01c07af0b9bb95f706e19a151c1915b075fe2f44 + image: routparesh/chattingo-frontend:ec127a1f9ba4e3fcac6ba1c0f2d29752e642d005 ports: - containerPort: 80 From b9f0da66970ce10deb3014b0d64f14582378ecae Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 22:07:25 +0530 Subject: [PATCH 075/116] new update --- k8s/chattingo-backend-deployment.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 1b4223c..8b1dd40 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -22,9 +22,9 @@ spec: - -c - | echo "Waiting for DB..." - for i in $(seq 1 30); do + for i in $(seq 1 60); do nc -z db 3306 && exit 0 - echo "DB not ready, retrying ($i/30)..." + echo "DB not ready, retrying ($i/60)..." sleep 2 done echo "DB did not start in time, exiting initContainer." @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:ec127a1f9ba4e3fcac6ba1c0f2d29752e642d005 + image: routparesh/chattingo-backend:ec127a1f9ba4e3fcac6ba1c0f2d29752e642d005 ports: - containerPort: 8080 env: @@ -46,15 +46,15 @@ spec: httpGet: path: /actuator/health/readiness port: 8080 - initialDelaySeconds: 25 # wait longer for Spring Boot startup + initialDelaySeconds: 40 # wait longer for DB + app startup periodSeconds: 10 - failureThreshold: 5 + failureThreshold: 6 timeoutSeconds: 5 livenessProbe: httpGet: - path: /actuator/health + path: /actuator/health/liveness port: 8080 - initialDelaySeconds: 35 # allow app to become stable first + initialDelaySeconds: 60 # app must stabilize first periodSeconds: 20 failureThreshold: 5 timeoutSeconds: 5 From c92f67f32888b4e6cc17ed93b2a06d8a2c138644 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 31 Oct 2025 16:48:55 +0000 Subject: [PATCH 076/116] update images to b9f0da66970ce10deb3014b0d64f14582378ecae --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 8b1dd40..e6b4d88 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:ec127a1f9ba4e3fcac6ba1c0f2d29752e642d005 + image: routparesh/chattingo-backend:b9f0da66970ce10deb3014b0d64f14582378ecae ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 1f21ff3..a08c072 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:ec127a1f9ba4e3fcac6ba1c0f2d29752e642d005 + image: routparesh/chattingo-frontend:b9f0da66970ce10deb3014b0d64f14582378ecae ports: - containerPort: 80 From 677c9acf18288392044dde78bbdae1698446d911 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 22:30:04 +0530 Subject: [PATCH 077/116] delete readness --- k8s/chattingo-backend-deployment.yaml | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 8b1dd40..c9a8575 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -33,8 +33,6 @@ spec: containers: - name: chattingo-backend image: routparesh/chattingo-backend:ec127a1f9ba4e3fcac6ba1c0f2d29752e642d005 - ports: - - containerPort: 8080 env: - name: SPRING_DATASOURCE_URL value: jdbc:mysql://db:3306/chattingo_db?createDatabaseIfNotExist=true @@ -42,20 +40,5 @@ spec: value: root - name: SPRING_DATASOURCE_PASSWORD value: test@123 - readinessProbe: - httpGet: - path: /actuator/health/readiness - port: 8080 - initialDelaySeconds: 40 # wait longer for DB + app startup - periodSeconds: 10 - failureThreshold: 6 - timeoutSeconds: 5 - livenessProbe: - httpGet: - path: /actuator/health/liveness - port: 8080 - initialDelaySeconds: 60 # app must stabilize first - periodSeconds: 20 - failureThreshold: 5 - timeoutSeconds: 5 - restartPolicy: Always + ports: + - containerPort: 8080 From 60d9fa9727a5eed0c1d1da19b1d74cd1fe2c63ec Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 22:31:29 +0530 Subject: [PATCH 078/116] delete readness --- k8s/chattingo-backend-deployment.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index ffcdbb5..da18e63 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -42,5 +42,4 @@ spec: value: root - name: SPRING_DATASOURCE_PASSWORD value: test@123 - ports: - - containerPort: 8080 + \ No newline at end of file From 21a8fb9533d3c814b4d5325c3451f0c43549b02d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 31 Oct 2025 17:10:51 +0000 Subject: [PATCH 079/116] update images to 60d9fa9727a5eed0c1d1da19b1d74cd1fe2c63ec --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index da18e63..ad72225 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:b9f0da66970ce10deb3014b0d64f14582378ecae + image: routparesh/chattingo-backend:60d9fa9727a5eed0c1d1da19b1d74cd1fe2c63ec ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index a08c072..9fb6b17 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:b9f0da66970ce10deb3014b0d64f14582378ecae + image: routparesh/chattingo-frontend:60d9fa9727a5eed0c1d1da19b1d74cd1fe2c63ec ports: - containerPort: 80 From f508f0c10da0385b9ec4f0a78886d4328fd4647d Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 22:49:17 +0530 Subject: [PATCH 080/116] update frontend deployment --- k8s/chattingo-frontend-service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/chattingo-frontend-service.yaml b/k8s/chattingo-frontend-service.yaml index f932423..59a77b1 100644 --- a/k8s/chattingo-frontend-service.yaml +++ b/k8s/chattingo-frontend-service.yaml @@ -8,5 +8,5 @@ spec: ports: - protocol: TCP port: 80 - targetPort: 3000 + targetPort: 80 type: ClusterIP From 16f0ffdeef09ac6afa80e9444927a1e126217265 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 31 Oct 2025 17:28:48 +0000 Subject: [PATCH 081/116] update images to 8e19a7637072f749b0a6b770e4c2d52d0e76895e --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index ad72225..e79de47 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:60d9fa9727a5eed0c1d1da19b1d74cd1fe2c63ec + image: routparesh/chattingo-backend:8e19a7637072f749b0a6b770e4c2d52d0e76895e ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 9fb6b17..2b1e36e 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:60d9fa9727a5eed0c1d1da19b1d74cd1fe2c63ec + image: routparesh/chattingo-frontend:8e19a7637072f749b0a6b770e4c2d52d0e76895e ports: - containerPort: 80 From 81f9af58364b6631d2d3fda0fb3c16261f5c9be8 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Fri, 31 Oct 2025 23:02:45 +0530 Subject: [PATCH 082/116] update ingress --- k8s/backend-ingress.yaml | 26 ++++++++++++++++++++++++++ k8s/ingress.yaml | 13 ++----------- 2 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 k8s/backend-ingress.yaml diff --git a/k8s/backend-ingress.yaml b/k8s/backend-ingress.yaml new file mode 100644 index 0000000..fcbcefd --- /dev/null +++ b/k8s/backend-ingress.yaml @@ -0,0 +1,26 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: chattingo-backend-ingress + namespace: chattingo + annotations: + kubernetes.io/ingress.class: alb + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/target-type: ip + alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80}]' + alb.ingress.kubernetes.io/healthcheck-path: /api/health + alb.ingress.kubernetes.io/healthcheck-port: '8080' + alb.ingress.kubernetes.io/group.name: chattingo-group +spec: + ingressClassName: alb + rules: + - host: chattingo.paresh.work + http: + paths: + - path: /api + pathType: Prefix + backend: + service: + name: chattingo-backend-service + port: + number: 8080 diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index 828ae5a..8b8826b 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -16,8 +16,8 @@ metadata: alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80}]' # Optional health check settings - alb.ingress.kubernetes.io/healthcheck-path: /api/health - alb.ingress.kubernetes.io/healthcheck-port: '8080' + alb.ingress.kubernetes.io/healthcheck-path: / + alb.ingress.kubernetes.io/healthcheck-port: '80' alb.ingress.kubernetes.io/healthcheck-protocol: HTTP # Optional: group rules under a single ALB if you plan multiple ingresses @@ -36,12 +36,3 @@ spec: name: chattingo-frontend-service port: number: 80 - - # Backend route - - path: /api - pathType: Prefix - backend: - service: - name: chattingo-backend-service - port: - number: 8080 From acb4475f6ea6025b6f3ba3c3bdf37fa7f56cd186 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 31 Oct 2025 17:40:56 +0000 Subject: [PATCH 083/116] update images to 0c2b2288b920a63c62a0fb8588e691f29dbe546d --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index e79de47..dfdbba3 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:8e19a7637072f749b0a6b770e4c2d52d0e76895e + image: routparesh/chattingo-backend:0c2b2288b920a63c62a0fb8588e691f29dbe546d ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 2b1e36e..c4279a8 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:8e19a7637072f749b0a6b770e4c2d52d0e76895e + image: routparesh/chattingo-frontend:0c2b2288b920a63c62a0fb8588e691f29dbe546d ports: - containerPort: 80 From d9c9cc366841e476b0debba0ab56fef46a29bbcc Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 17:07:40 +0530 Subject: [PATCH 084/116] update ingress --- k8s/backend-ingress.yaml | 26 -------------------------- k8s/ingress.yaml | 26 +++++++++++--------------- 2 files changed, 11 insertions(+), 41 deletions(-) delete mode 100644 k8s/backend-ingress.yaml diff --git a/k8s/backend-ingress.yaml b/k8s/backend-ingress.yaml deleted file mode 100644 index fcbcefd..0000000 --- a/k8s/backend-ingress.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: chattingo-backend-ingress - namespace: chattingo - annotations: - kubernetes.io/ingress.class: alb - alb.ingress.kubernetes.io/scheme: internet-facing - alb.ingress.kubernetes.io/target-type: ip - alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80}]' - alb.ingress.kubernetes.io/healthcheck-path: /api/health - alb.ingress.kubernetes.io/healthcheck-port: '8080' - alb.ingress.kubernetes.io/group.name: chattingo-group -spec: - ingressClassName: alb - rules: - - host: chattingo.paresh.work - http: - paths: - - path: /api - pathType: Prefix - backend: - service: - name: chattingo-backend-service - port: - number: 8080 diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index 8b8826b..18063ae 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -2,33 +2,22 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: chattingo-ingress + namespace: chattingo annotations: - # Required for AWS ALB Ingress Controller kubernetes.io/ingress.class: alb - - # ALB scheme - internet-facing or internal alb.ingress.kubernetes.io/scheme: internet-facing - - # Target type - IP mode for pods alb.ingress.kubernetes.io/target-type: ip - - # Listen on HTTP (you can later switch to HTTPS) alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80}]' - - # Optional health check settings - alb.ingress.kubernetes.io/healthcheck-path: / - alb.ingress.kubernetes.io/healthcheck-port: '80' - alb.ingress.kubernetes.io/healthcheck-protocol: HTTP - - # Optional: group rules under a single ALB if you plan multiple ingresses alb.ingress.kubernetes.io/group.name: chattingo-group + alb.ingress.kubernetes.io/healthcheck-path: / + alb.ingress.kubernetes.io/backend-protocol: HTTP + alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=120 spec: ingressClassName: alb rules: - host: chattingo.paresh.work http: paths: - # Frontend route - path: / pathType: Prefix backend: @@ -36,3 +25,10 @@ spec: name: chattingo-frontend-service port: number: 80 + - path: /api + pathType: Prefix + backend: + service: + name: chattingo-backend-service + port: + number: 8080 From 6d627ee484d86ca021bec41ead76e67e3e287d45 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 11:46:04 +0000 Subject: [PATCH 085/116] update images to 523082d8370812dfc632bee2279be1ab05b0336c --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index dfdbba3..b5a237e 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:0c2b2288b920a63c62a0fb8588e691f29dbe546d + image: routparesh/chattingo-backend:523082d8370812dfc632bee2279be1ab05b0336c ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index c4279a8..8c64cb6 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:0c2b2288b920a63c62a0fb8588e691f29dbe546d + image: routparesh/chattingo-frontend:523082d8370812dfc632bee2279be1ab05b0336c ports: - containerPort: 80 From b25c922a89013132bd23301491cd902ac6917ee6 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 18:10:02 +0530 Subject: [PATCH 086/116] update --- k8s/chattingo-backend-service.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/k8s/chattingo-backend-service.yaml b/k8s/chattingo-backend-service.yaml index f1b1c24..44e9b3b 100644 --- a/k8s/chattingo-backend-service.yaml +++ b/k8s/chattingo-backend-service.yaml @@ -3,6 +3,7 @@ kind: Service metadata: name: chattingo-backend-service spec: + type: LoadBalancer selector: app: chattingo-backend ports: From 6185933f8519684a9e248aecc5d5d343c12115dd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 12:48:05 +0000 Subject: [PATCH 087/116] update images to 7bef9daf98ef735ee57477a8f7160bf1edf42da6 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index b5a237e..de49e6c 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:523082d8370812dfc632bee2279be1ab05b0336c + image: routparesh/chattingo-backend:7bef9daf98ef735ee57477a8f7160bf1edf42da6 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 8c64cb6..f543b6a 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:523082d8370812dfc632bee2279be1ab05b0336c + image: routparesh/chattingo-frontend:7bef9daf98ef735ee57477a8f7160bf1edf42da6 ports: - containerPort: 80 From 7bf8b87f801e38b498fcc7eec3ac2476501d6d9f Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 18:23:20 +0530 Subject: [PATCH 088/116] update --- k8s/chattingo-backend-service.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/k8s/chattingo-backend-service.yaml b/k8s/chattingo-backend-service.yaml index 44e9b3b..f1b1c24 100644 --- a/k8s/chattingo-backend-service.yaml +++ b/k8s/chattingo-backend-service.yaml @@ -3,7 +3,6 @@ kind: Service metadata: name: chattingo-backend-service spec: - type: LoadBalancer selector: app: chattingo-backend ports: From 599e73a52860a4bb2aa6fa0d0c7389f80873eabb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 13:02:14 +0000 Subject: [PATCH 089/116] update images to 9bdbbe2e64847f3036d95ca5c25b94360a8448fd --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index de49e6c..fc10515 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:7bef9daf98ef735ee57477a8f7160bf1edf42da6 + image: routparesh/chattingo-backend:9bdbbe2e64847f3036d95ca5c25b94360a8448fd ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index f543b6a..b877f08 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:7bef9daf98ef735ee57477a8f7160bf1edf42da6 + image: routparesh/chattingo-frontend:9bdbbe2e64847f3036d95ca5c25b94360a8448fd ports: - containerPort: 80 From c619473185e269a0452fe83ec5f8f4abf037b0b4 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 18:59:31 +0530 Subject: [PATCH 090/116] update ingress file --- k8s/ingress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index 18063ae..2dc7f6f 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -19,7 +19,7 @@ spec: http: paths: - path: / - pathType: Prefix + pathType: ImplementationSpecific backend: service: name: chattingo-frontend-service From ae5f4308128d654fb9fa335d5f924f3e7bb76589 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 13:38:20 +0000 Subject: [PATCH 091/116] update images to 5d74fa78fc9cd4428190776e464a20515aabda2c --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index fc10515..44af3c0 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:9bdbbe2e64847f3036d95ca5c25b94360a8448fd + image: routparesh/chattingo-backend:5d74fa78fc9cd4428190776e464a20515aabda2c ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index b877f08..f00ace3 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:9bdbbe2e64847f3036d95ca5c25b94360a8448fd + image: routparesh/chattingo-frontend:5d74fa78fc9cd4428190776e464a20515aabda2c ports: - containerPort: 80 From e71b6e793915ddae1328766a04c4c88caa9844a9 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 19:24:45 +0530 Subject: [PATCH 092/116] update --- k8s/ingress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index 2dc7f6f..18063ae 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -19,7 +19,7 @@ spec: http: paths: - path: / - pathType: ImplementationSpecific + pathType: Prefix backend: service: name: chattingo-frontend-service From 858ff9b9ac78a5aa6816ac4ee70e3b8b08474b4d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 14:03:59 +0000 Subject: [PATCH 093/116] update images to 682b35874d299af33daf790d46d397c25e676a55 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 44af3c0..85c3409 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:5d74fa78fc9cd4428190776e464a20515aabda2c + image: routparesh/chattingo-backend:682b35874d299af33daf790d46d397c25e676a55 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index f00ace3..90500cd 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:5d74fa78fc9cd4428190776e464a20515aabda2c + image: routparesh/chattingo-frontend:682b35874d299af33daf790d46d397c25e676a55 ports: - containerPort: 80 From bd9c6d22305f4b5fff844e74a4cd87d21b10d24a Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 19:34:58 +0530 Subject: [PATCH 094/116] update --- k8s/chattingo-backend-deployment.yaml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 44af3c0..2c69c56 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -14,25 +14,9 @@ spec: labels: app: chattingo-backend spec: - initContainers: - - name: wait-for-db - image: busybox - command: - - sh - - -c - - | - echo "Waiting for DB..." - for i in $(seq 1 60); do - nc -z db 3306 && exit 0 - echo "DB not ready, retrying ($i/60)..." - sleep 2 - done - echo "DB did not start in time, exiting initContainer." - exit 1 - imagePullPolicy: Always containers: - name: chattingo-backend - image: routparesh/chattingo-backend:5d74fa78fc9cd4428190776e464a20515aabda2c + image: routparesh/chattingo-backend:5d74fa78fc9cd4428190776e464a20515aabda2c ports: - containerPort: 8080 env: @@ -42,4 +26,3 @@ spec: value: root - name: SPRING_DATASOURCE_PASSWORD value: test@123 - \ No newline at end of file From 7b34fca3ee4a822bbc868270b33201e84abcb6ca Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 19:36:57 +0530 Subject: [PATCH 095/116] update --- k8s/chattingo-backend-deployment.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 56b53ee..7fc3cb4 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,8 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:5d74fa78fc9cd4428190776e464a20515aabda2c - image: routparesh/chattingo-backend:682b35874d299af33daf790d46d397c25e676a55 + image: routparesh/chattingo-backend:682b35874d299af33daf790d46d397c25e676a55 ports: - containerPort: 8080 env: From c2dc2aa8a4cf6f9994a13cbc67f94e7977b71823 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 14:15:23 +0000 Subject: [PATCH 096/116] update images to 7b34fca3ee4a822bbc868270b33201e84abcb6ca --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 7fc3cb4..62ba0b2 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:682b35874d299af33daf790d46d397c25e676a55 + image: routparesh/chattingo-backend:7b34fca3ee4a822bbc868270b33201e84abcb6ca ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 90500cd..11c4be8 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:682b35874d299af33daf790d46d397c25e676a55 + image: routparesh/chattingo-frontend:7b34fca3ee4a822bbc868270b33201e84abcb6ca ports: - containerPort: 80 From 4c8619ceaab2acd591a09ebdf7abe07d8c6f79da Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 20:02:01 +0530 Subject: [PATCH 097/116] update --- k8s/chattingo-frontend-configmap.yaml | 32 ++++++++++++++++++++++++++ k8s/chattingo-frontend-deployment.yaml | 13 ++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 k8s/chattingo-frontend-configmap.yaml diff --git a/k8s/chattingo-frontend-configmap.yaml b/k8s/chattingo-frontend-configmap.yaml new file mode 100644 index 0000000..c6cf033 --- /dev/null +++ b/k8s/chattingo-frontend-configmap.yaml @@ -0,0 +1,32 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: chattingo-frontend-nginx-config + namespace: chattingo +data: + default.conf: | + server { + listen 80; + listen [::]:80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + # 💡 The FIX: Essential for Single Page Application (SPA) routing + try_files $uri $uri/ /index.html; + } + + # Handle API calls that might sneak through the Nginx Ingress if misconfigured + # This assumes your API calls are prefixed with /api + location /api { + # Deny access if a request path for the API is sent directly to the frontend + deny all; + return 404; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 90500cd..a1d6590 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,17 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:682b35874d299af33daf790d46d397c25e676a55 + image: routparesh/chattingo-frontend:682b35874d299af33daf790d46d397c25e676a55 + volumeMounts: + - name: nginx-config-volume + mountPath: /etc/nginx/conf.d/default.conf # Overwrite the default config + subPath: default.conf ports: - containerPort: 80 + volumes: + - name: nginx-config-volume + configMap: + name: chattingo-frontend-nginx-config # Reference the ConfigMap created in Step 1 + items: + - key: default.conf + path: default.conf From c7540b1492272ca3ce393f4653d3974174c09ff3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 14:42:28 +0000 Subject: [PATCH 098/116] update images to 9ed0d6537c613be77743b455f19dc88850228e16 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 62ba0b2..d384eea 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:7b34fca3ee4a822bbc868270b33201e84abcb6ca + image: routparesh/chattingo-backend:9ed0d6537c613be77743b455f19dc88850228e16 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 9a4d3db..850e102 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:7b34fca3ee4a822bbc868270b33201e84abcb6ca + image: routparesh/chattingo-frontend:9ed0d6537c613be77743b455f19dc88850228e16 ports: - containerPort: 80 volumes: From 15c157fa3254eee4af4e9eece7ec1d7fdb9ce9f3 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 20:45:23 +0530 Subject: [PATCH 099/116] update --- .github/workflows/ci-cd.yaml | 4 +++- frontend/Dockerfile | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 6e91452..680725d 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -217,7 +217,9 @@ jobs: - name: Build and Push Frontend image working-directory: ./frontend run: | - docker build -t ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} . + FRONTEND_BUILD_ARGS="--build-arg REACT_APP_API_URL=http://chattingo.paresh.work/api" + + docker build $FRONTEND_BUILD_ARGS -t ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} . docker push ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} - name: Build and Push Backend image diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 2c1cc57..63190b1 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -4,6 +4,10 @@ FROM node:18-alpine AS builder WORKDIR /app COPY package*.json ./ RUN npm install + +ARG REACT_APP_API_URL +ENV REACT_APP_API_URL=$REACT_APP_API_URL + COPY . . RUN npm run build From 48a5363b98115289416d46a138f37c3503a94d67 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 15:23:21 +0000 Subject: [PATCH 100/116] update images to 0f3229038bc72b99904dd35cd2ef9c2893cdaa8a --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index d384eea..7324c71 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:9ed0d6537c613be77743b455f19dc88850228e16 + image: routparesh/chattingo-backend:0f3229038bc72b99904dd35cd2ef9c2893cdaa8a ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 850e102..2da9ef4 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:9ed0d6537c613be77743b455f19dc88850228e16 + image: routparesh/chattingo-frontend:0f3229038bc72b99904dd35cd2ef9c2893cdaa8a ports: - containerPort: 80 volumes: From 9f55295f1c37a1cd34eaf5b25e2de28ac67aef6b Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 21:10:23 +0530 Subject: [PATCH 101/116] update ingress --- k8s/ingress.yaml | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index 18063ae..973ba11 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -18,13 +18,25 @@ spec: - host: chattingo.paresh.work http: paths: - - path: / - pathType: Prefix + # 💡 FIX 1: Explicitly match the sign-up path first + - path: /api/auth/signup + pathType: Exact backend: service: - name: chattingo-frontend-service + name: chattingo-backend-service port: - number: 80 + number: 8080 + + # 💡 FIX 2: Explicitly match the login path + - path: /api/auth/login + pathType: Exact + backend: + service: + name: chattingo-backend-service + port: + number: 8080 + + # EXISTING RULE: Generic /api rule (for all other protected API calls) - path: /api pathType: Prefix backend: @@ -32,3 +44,12 @@ spec: name: chattingo-backend-service port: number: 8080 + + # EXISTING RULE: Frontend traffic + - path: / + pathType: Prefix + backend: + service: + name: chattingo-frontend-service + port: + number: 80 From 6b77b25fe830256335c65b998c95f0918b2634ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 15:49:34 +0000 Subject: [PATCH 102/116] update images to 8f320729b4a13ba1fc67c0556d83637162c9a1e5 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 7324c71..4403891 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:0f3229038bc72b99904dd35cd2ef9c2893cdaa8a + image: routparesh/chattingo-backend:8f320729b4a13ba1fc67c0556d83637162c9a1e5 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 2da9ef4..736e1bc 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:0f3229038bc72b99904dd35cd2ef9c2893cdaa8a + image: routparesh/chattingo-frontend:8f320729b4a13ba1fc67c0556d83637162c9a1e5 ports: - containerPort: 80 volumes: From ba53d5aac413b04b9228dedde0e8cf052eb7e104 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 21:38:16 +0530 Subject: [PATCH 103/116] update --- k8s/ingress.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index 973ba11..4c1f794 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -19,7 +19,7 @@ spec: http: paths: # 💡 FIX 1: Explicitly match the sign-up path first - - path: /api/auth/signup + - path: /signup pathType: Exact backend: service: @@ -28,7 +28,7 @@ spec: number: 8080 # 💡 FIX 2: Explicitly match the login path - - path: /api/auth/login + - path: /login pathType: Exact backend: service: From 68d559ac0e1867625728d51796d7deb15f53fdac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 16:16:50 +0000 Subject: [PATCH 104/116] update images to 8e1702f69255627cdf6389a1e340488c663af363 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 4403891..7cc3dbf 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:8f320729b4a13ba1fc67c0556d83637162c9a1e5 + image: routparesh/chattingo-backend:8e1702f69255627cdf6389a1e340488c663af363 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 736e1bc..b228de6 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:8f320729b4a13ba1fc67c0556d83637162c9a1e5 + image: routparesh/chattingo-frontend:8e1702f69255627cdf6389a1e340488c663af363 ports: - containerPort: 80 volumes: From f4e2489b704deca2468bf50bdb115fec765ff753 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sat, 1 Nov 2025 22:04:51 +0530 Subject: [PATCH 105/116] update --- k8s/chattingo-frontend-deployment.yaml | 5 ++++- k8s/ingress.yaml | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 736e1bc..c4570e9 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,9 +16,12 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:8f320729b4a13ba1fc67c0556d83637162c9a1e5 + image: routparesh/chattingo-frontend:8f320729b4a13ba1fc67c0556d83637162c9a1e5 ports: - containerPort: 80 + volumeMounts: + - name: nginx-config-volume + mountPath: /etc/nginx/conf.d/ volumes: - name: nginx-config-volume configMap: diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index 4c1f794..66b6cda 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -19,7 +19,7 @@ spec: http: paths: # 💡 FIX 1: Explicitly match the sign-up path first - - path: /signup + - path: /api pathType: Exact backend: service: @@ -28,7 +28,7 @@ spec: number: 8080 # 💡 FIX 2: Explicitly match the login path - - path: /login + - path: /api/auth/login pathType: Exact backend: service: @@ -37,7 +37,7 @@ spec: number: 8080 # EXISTING RULE: Generic /api rule (for all other protected API calls) - - path: /api + - path: /api/auth/signup pathType: Prefix backend: service: From 45c90b529729103dbdd3cc855721307da8896b3a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 16:46:07 +0000 Subject: [PATCH 106/116] update images to 8b16d67e12f0ea39c82fe72e157a4dbea721773a --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 7cc3dbf..25967d9 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:8e1702f69255627cdf6389a1e340488c663af363 + image: routparesh/chattingo-backend:8b16d67e12f0ea39c82fe72e157a4dbea721773a ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index c8f4bec..0465aef 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:8f320729b4a13ba1fc67c0556d83637162c9a5 + image: routparesh/chattingo-frontend:8b16d67e12f0ea39c82fe72e157a4dbea721773a ports: - containerPort: 80 volumeMounts: From df702c2b08d1fd3cea394b0a4587e72461056aa9 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 2 Nov 2025 00:50:13 +0530 Subject: [PATCH 107/116] update --- frontend/Dockerfile | 2 +- frontend/nginx.conf | 18 +++++++++++++++ k8s/chattingo-backend-deployment.yaml | 8 ++++++- k8s/chattingo-frontend-configmap.yaml | 32 -------------------------- k8s/chattingo-frontend-deployment.yaml | 10 -------- k8s/ingress.yaml | 22 ++---------------- 6 files changed, 28 insertions(+), 64 deletions(-) create mode 100644 frontend/nginx.conf delete mode 100644 k8s/chattingo-frontend-configmap.yaml diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 63190b1..2659d18 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -16,7 +16,7 @@ FROM nginx:alpine COPY --from=builder /app/build /usr/share/nginx/html # Optional: remove default nginx config and copy your own -# COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..d9e49b1 --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,18 @@ +server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + # React SPA route handling + location / { + try_files $uri /index.html; + } + + # Optional: proxy API calls to backend service + # Uncomment if your frontend calls API like /api/* + # location /api/ { + # proxy_pass http://chattingo-backend-service:8080; + # } +} diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 7cc3dbf..b673a2e 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:8e1702f69255627cdf6389a1e340488c663af363 + image: routparesh/chattingo-backend:8e1702f69255627cdf6389a1e340488c663af363 ports: - containerPort: 8080 env: @@ -26,3 +26,9 @@ spec: value: root - name: SPRING_DATASOURCE_PASSWORD value: test@123 + - name: CORS_ALLOWED_ORIGINS + value: 'http://chattingo.paresh.work' + - name: CORS_ALLOWED_METHODS + value: 'GET,POST,PUT,DELETE,OPTIONS' + - name: CORS_ALLOWED_HEADERS + value: '*' diff --git a/k8s/chattingo-frontend-configmap.yaml b/k8s/chattingo-frontend-configmap.yaml deleted file mode 100644 index c6cf033..0000000 --- a/k8s/chattingo-frontend-configmap.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: chattingo-frontend-nginx-config - namespace: chattingo -data: - default.conf: | - server { - listen 80; - listen [::]:80; - server_name localhost; - - location / { - root /usr/share/nginx/html; - index index.html index.htm; - # 💡 The FIX: Essential for Single Page Application (SPA) routing - try_files $uri $uri/ /index.html; - } - - # Handle API calls that might sneak through the Nginx Ingress if misconfigured - # This assumes your API calls are prefixed with /api - location /api { - # Deny access if a request path for the API is sent directly to the frontend - deny all; - return 404; - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } - } diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index c8f4bec..c6e04fe 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -19,13 +19,3 @@ spec: image: routparesh/chattingo-frontend:8f320729b4a13ba1fc67c0556d83637162c9a5 ports: - containerPort: 80 - volumeMounts: - - name: nginx-config-volume - mountPath: /etc/nginx/conf.d/ - volumes: - - name: nginx-config-volume - configMap: - name: chattingo-frontend-nginx-config # Reference the ConfigMap created in Step 1 - items: - - key: default.conf - path: default.conf diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml index 66b6cda..ea388ba 100644 --- a/k8s/ingress.yaml +++ b/k8s/ingress.yaml @@ -18,26 +18,8 @@ spec: - host: chattingo.paresh.work http: paths: - # 💡 FIX 1: Explicitly match the sign-up path first + # Backend APIs - path: /api - pathType: Exact - backend: - service: - name: chattingo-backend-service - port: - number: 8080 - - # 💡 FIX 2: Explicitly match the login path - - path: /api/auth/login - pathType: Exact - backend: - service: - name: chattingo-backend-service - port: - number: 8080 - - # EXISTING RULE: Generic /api rule (for all other protected API calls) - - path: /api/auth/signup pathType: Prefix backend: service: @@ -45,7 +27,7 @@ spec: port: number: 8080 - # EXISTING RULE: Frontend traffic + # Frontend - path: / pathType: Prefix backend: From 234470df51366a4b777e3c4184d54f264a3141bb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 19:29:49 +0000 Subject: [PATCH 108/116] update images to b9f7a0105b5a36b2017b9b10f5411c8a94597d97 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index b673a2e..5633f10 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:8e1702f69255627cdf6389a1e340488c663af363 + image: routparesh/chattingo-backend:b9f7a0105b5a36b2017b9b10f5411c8a94597d97 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index ae5a94a..967bbfe 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:8b16d67e12f0ea39c82fe72e157a4dbea721773a + image: routparesh/chattingo-frontend:b9f7a0105b5a36b2017b9b10f5411c8a94597d97 ports: - containerPort: 80 From e3945ca03bdf1115e39dae806e5b99ca8332ab37 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 2 Nov 2025 01:40:48 +0530 Subject: [PATCH 109/116] update --- .../java/com/chattingo/config/AppConfig.java | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/backend/src/main/java/com/chattingo/config/AppConfig.java b/backend/src/main/java/com/chattingo/config/AppConfig.java index 85aa0f2..e2f6549 100644 --- a/backend/src/main/java/com/chattingo/config/AppConfig.java +++ b/backend/src/main/java/com/chattingo/config/AppConfig.java @@ -16,8 +16,6 @@ import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfigurationSource; -import jakarta.servlet.http.HttpServletRequest; - @Configuration public class AppConfig { @@ -36,40 +34,44 @@ public AppConfig(JwtValidator jwtValidator) { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { - http.sessionManagement(management -> management.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) - .authorizeHttpRequests(authorize -> authorize.requestMatchers("/api/**").authenticated() - .anyRequest().permitAll()) - .addFilterBefore(jwtValidator, BasicAuthenticationFilter.class) - .csrf(csrf -> csrf.disable()) - .cors(cors -> cors.configurationSource(new CorsConfigurationSource() { - @SuppressWarnings("null") - @Override - public CorsConfiguration getCorsConfiguration(HttpServletRequest request) { - CorsConfiguration cfg = new CorsConfiguration(); + http + .sessionManagement(management -> management.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .authorizeHttpRequests(authorize -> authorize + .requestMatchers("/login", "/signup").permitAll() // public endpoints + .requestMatchers("/api/**").authenticated() // protected endpoints + .anyRequest().permitAll() + ) + .addFilterBefore(jwtValidator, BasicAuthenticationFilter.class) + .csrf(csrf -> csrf.disable()) + .cors(cors -> cors.configurationSource(corsConfigurationSource())) + .formLogin(Customizer.withDefaults()) + .httpBasic(Customizer.withDefaults()); + + return http.build(); + } - // Parse allowed origins from environment variable - String[] origins = allowedOrigins.split(","); - cfg.setAllowedOrigins(Arrays.asList(origins)); - cfg.setAllowedOriginPatterns(Arrays.asList(origins)); + @Bean + public CorsConfigurationSource corsConfigurationSource() { + return request -> { + CorsConfiguration cfg = new CorsConfiguration(); + String[] origins = allowedOrigins.split(","); + cfg.setAllowedOrigins(Arrays.asList(origins)); + cfg.setAllowedOriginPatterns(Arrays.asList(origins)); - // Parse allowed methods from environment variable - String[] methods = allowedMethods.split(","); - cfg.setAllowedMethods(Arrays.asList(methods)); - - cfg.setAllowedHeaders(Collections.singletonList("*")); - cfg.setExposedHeaders(Arrays.asList("Authorization")); - cfg.setAllowCredentials(true); - cfg.setMaxAge(3600L); + String[] methods = allowedMethods.split(","); + cfg.setAllowedMethods(Arrays.asList(methods)); - return cfg; - } - })).formLogin(Customizer.withDefaults()).httpBasic(Customizer.withDefaults()); + cfg.setAllowedHeaders(Collections.singletonList("*")); + cfg.setExposedHeaders(Collections.singletonList("Authorization")); + cfg.setAllowCredentials(true); + cfg.setMaxAge(3600L); - return http.build(); + return cfg; + }; } @Bean - PasswordEncoder passwordEncoder() { + public PasswordEncoder passwordEncoder() { return new BCryptPasswordEncoder(); } -} \ No newline at end of file +} From 2db4dfbb7bcb7e5236d373f76157ba2a2afc5e08 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 20:19:47 +0000 Subject: [PATCH 110/116] update images to e92861bbd8fa2734e97899fe616c0250d7c49ded --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 5633f10..5879867 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:b9f7a0105b5a36b2017b9b10f5411c8a94597d97 + image: routparesh/chattingo-backend:e92861bbd8fa2734e97899fe616c0250d7c49ded ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 967bbfe..808ceac 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:b9f7a0105b5a36b2017b9b10f5411c8a94597d97 + image: routparesh/chattingo-frontend:e92861bbd8fa2734e97899fe616c0250d7c49ded ports: - containerPort: 80 From c08a3e094923f1e1478c1d542fefa19ce35aba4e Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 2 Nov 2025 02:01:12 +0530 Subject: [PATCH 111/116] update --- .../java/com/chattingo/config/AppConfig.java | 3 +- .../com/chattingo/config/JwtValidator.java | 32 ++++++++++++------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/backend/src/main/java/com/chattingo/config/AppConfig.java b/backend/src/main/java/com/chattingo/config/AppConfig.java index e2f6549..eb9fc01 100644 --- a/backend/src/main/java/com/chattingo/config/AppConfig.java +++ b/backend/src/main/java/com/chattingo/config/AppConfig.java @@ -33,7 +33,6 @@ public AppConfig(JwtValidator jwtValidator) { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { - http .sessionManagement(management -> management.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .authorizeHttpRequests(authorize -> authorize @@ -54,8 +53,8 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti public CorsConfigurationSource corsConfigurationSource() { return request -> { CorsConfiguration cfg = new CorsConfiguration(); + String[] origins = allowedOrigins.split(","); - cfg.setAllowedOrigins(Arrays.asList(origins)); cfg.setAllowedOriginPatterns(Arrays.asList(origins)); String[] methods = allowedMethods.split(","); diff --git a/backend/src/main/java/com/chattingo/config/JwtValidator.java b/backend/src/main/java/com/chattingo/config/JwtValidator.java index 900e6c4..f700ce8 100644 --- a/backend/src/main/java/com/chattingo/config/JwtValidator.java +++ b/backend/src/main/java/com/chattingo/config/JwtValidator.java @@ -5,13 +5,13 @@ import javax.crypto.SecretKey; +import org.springframework.beans.factory.annotation.Value; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.web.filter.OncePerRequestFilter; @@ -32,35 +32,43 @@ public JwtValidator(@Value("${jwt.secret}") String jwtSecret) { this.key = Keys.hmacShaKeyFor(jwtSecret.getBytes()); } - @SuppressWarnings("null") @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) - throws ServletException, IOException { + protected void doFilterInternal(HttpServletRequest request, + HttpServletResponse response, + FilterChain filterChain) throws ServletException, IOException { String jwt = request.getHeader("Authorization"); - if (jwt != null) { + if (jwt != null && jwt.startsWith("Bearer ")) { try { + jwt = jwt.substring(7); // Remove "Bearer " prefix - jwt = jwt.substring(7); - - Claims claim = Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(jwt).getBody(); + Claims claims = Jwts.parserBuilder() + .setSigningKey(key) + .build() + .parseClaimsJws(jwt) + .getBody(); - String username = String.valueOf(claim.get("email")); - String authorities = String.valueOf(claim.get("authorities")); + String username = String.valueOf(claims.get("email")); + String authorities = String.valueOf(claims.get("authorities")); List auths = AuthorityUtils.commaSeparatedStringToAuthorityList(authorities); Authentication authentication = new UsernamePasswordAuthenticationToken(username, null, auths); - SecurityContextHolder.getContext().setAuthentication(authentication); } catch (Exception e) { - throw new BadCredentialsException("Invalid token recieved..."); + throw new BadCredentialsException("Invalid token received"); } } filterChain.doFilter(request, response); } + @Override + protected boolean shouldNotFilter(HttpServletRequest request) { + // Skip JWT validation for public endpoints + String path = request.getServletPath(); + return path.equals("/login") || path.equals("/signup"); + } } From 5dff6c5d9e1250e7a705f676cbe7a447995a7e8c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 20:39:48 +0000 Subject: [PATCH 112/116] update images to a3505cf0d5d15ee4fcf48c6d31209178d2b2939f --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 5879867..384bbe7 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:e92861bbd8fa2734e97899fe616c0250d7c49ded + image: routparesh/chattingo-backend:a3505cf0d5d15ee4fcf48c6d31209178d2b2939f ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 808ceac..86136bf 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:e92861bbd8fa2734e97899fe616c0250d7c49ded + image: routparesh/chattingo-frontend:a3505cf0d5d15ee4fcf48c6d31209178d2b2939f ports: - containerPort: 80 From 38c1a80ad9aae4ddca98e03d3f3468ce973beee9 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 2 Nov 2025 02:41:25 +0530 Subject: [PATCH 113/116] update --- backend/src/main/java/com/chattingo/config/AppConfig.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/main/java/com/chattingo/config/AppConfig.java b/backend/src/main/java/com/chattingo/config/AppConfig.java index eb9fc01..d7bdb5e 100644 --- a/backend/src/main/java/com/chattingo/config/AppConfig.java +++ b/backend/src/main/java/com/chattingo/config/AppConfig.java @@ -43,8 +43,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti .addFilterBefore(jwtValidator, BasicAuthenticationFilter.class) .csrf(csrf -> csrf.disable()) .cors(cors -> cors.configurationSource(corsConfigurationSource())) - .formLogin(Customizer.withDefaults()) - .httpBasic(Customizer.withDefaults()); + .formLogin(Customizer.withDefaults()); return http.build(); } From b113291a57cc7e2fc9961b872454c01dc73b1e2c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 21:19:52 +0000 Subject: [PATCH 114/116] update images to 805098dfed53ef8349bc4bab41cf516a6c44007f --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index 384bbe7..bb3698b 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:a3505cf0d5d15ee4fcf48c6d31209178d2b2939f + image: routparesh/chattingo-backend:805098dfed53ef8349bc4bab41cf516a6c44007f ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 86136bf..61ee2da 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:a3505cf0d5d15ee4fcf48c6d31209178d2b2939f + image: routparesh/chattingo-frontend:805098dfed53ef8349bc4bab41cf516a6c44007f ports: - containerPort: 80 From 571a0ad3ec0becdb2b039c7cbd1494568b1d6409 Mon Sep 17 00:00:00 2001 From: Paresh Kumar Rout Date: Sun, 2 Nov 2025 03:02:26 +0530 Subject: [PATCH 115/116] update --- .../main/java/com/chattingo/config/AppConfig.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/com/chattingo/config/AppConfig.java b/backend/src/main/java/com/chattingo/config/AppConfig.java index d7bdb5e..2a1ec34 100644 --- a/backend/src/main/java/com/chattingo/config/AppConfig.java +++ b/backend/src/main/java/com/chattingo/config/AppConfig.java @@ -6,7 +6,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; @@ -16,6 +15,8 @@ import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfigurationSource; +import jakarta.servlet.http.HttpServletResponse; + @Configuration public class AppConfig { @@ -36,14 +37,18 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti http .sessionManagement(management -> management.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .authorizeHttpRequests(authorize -> authorize - .requestMatchers("/login", "/signup").permitAll() // public endpoints - .requestMatchers("/api/**").authenticated() // protected endpoints + .requestMatchers("/login", "/signup").permitAll() + .requestMatchers("/api/**").authenticated() .anyRequest().permitAll() ) .addFilterBefore(jwtValidator, BasicAuthenticationFilter.class) .csrf(csrf -> csrf.disable()) .cors(cors -> cors.configurationSource(corsConfigurationSource())) - .formLogin(Customizer.withDefaults()); + .exceptionHandling(exceptions -> exceptions + .authenticationEntryPoint( + (request, response, authException) -> response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized") + ) + ); return http.build(); } From 8e83fdf3edbda5852c985d4eea724c844a90c640 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 21:41:07 +0000 Subject: [PATCH 116/116] update images to d1f8b88c7c26ae078d2ce31e1062b52ae13ab753 --- k8s/chattingo-backend-deployment.yaml | 2 +- k8s/chattingo-frontend-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/chattingo-backend-deployment.yaml b/k8s/chattingo-backend-deployment.yaml index bb3698b..6fc9f9a 100644 --- a/k8s/chattingo-backend-deployment.yaml +++ b/k8s/chattingo-backend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: chattingo-backend - image: routparesh/chattingo-backend:805098dfed53ef8349bc4bab41cf516a6c44007f + image: routparesh/chattingo-backend:d1f8b88c7c26ae078d2ce31e1062b52ae13ab753 ports: - containerPort: 8080 env: diff --git a/k8s/chattingo-frontend-deployment.yaml b/k8s/chattingo-frontend-deployment.yaml index 61ee2da..957d24e 100644 --- a/k8s/chattingo-frontend-deployment.yaml +++ b/k8s/chattingo-frontend-deployment.yaml @@ -16,6 +16,6 @@ spec: spec: containers: - name: chattingo-frontend - image: routparesh/chattingo-frontend:805098dfed53ef8349bc4bab41cf516a6c44007f + image: routparesh/chattingo-frontend:d1f8b88c7c26ae078d2ce31e1062b52ae13ab753 ports: - containerPort: 80