diff --git a/.github/workflows/build_backend.yaml b/.github/workflows/build_backend.yaml new file mode 100644 index 0000000..f6ee603 --- /dev/null +++ b/.github/workflows/build_backend.yaml @@ -0,0 +1,61 @@ +--- + +name: Build docker image- backend application + +on: + push: + branches: + - main + # trigger events for SemVer like tags + tags: + # match e.g. 1.1.1 and 1.1.1-rc1 + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-*' + pull_request: + branches: + - main + + +jobs: + build-docker-images-backend: + runs-on: ubuntu-latest + permissions: + packages: write + + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + # Needed to create multi-platfrom image + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 + + # Needed to create multi-platfrom image + - name: Set up QEMU + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 + + # Create SemVer or ref tags dependent of trigger event + - name: Docker meta + id: meta + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + with: + images: | + ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }} + tags: | + # set latest tag for main branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }},event=pr + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push + uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0 + with: + context: . + file: ./edc-chat-app-backend/Dockerfile + platforms: linux/amd64, linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/build_frontend.yaml b/.github/workflows/build_frontend.yaml new file mode 100644 index 0000000..3a0317a --- /dev/null +++ b/.github/workflows/build_frontend.yaml @@ -0,0 +1,61 @@ +--- + +name: Build docker image- frontend application + +on: + push: + branches: + - main + # trigger events for SemVer like tags + tags: + # match e.g. 1.1.1 and 1.1.1-rc1 + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-*' + pull_request: + branches: + - main + + +jobs: + build-docker-images-backend: + runs-on: ubuntu-latest + permissions: + packages: write + + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + # Needed to create multi-platfrom image + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 + + # Needed to create multi-platfrom image + - name: Set up QEMU + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 + + # Create SemVer or ref tags dependent of trigger event + - name: Docker meta + id: meta + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + with: + images: | + ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }} + tags: | + # set latest tag for main branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }},event=pr + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push + uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0 + with: + context: . + file: ./edc-chat-app-ui/Dockerfile + platforms: linux/amd64, linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index c8d2785..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,93 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - schedule: - - cron: '29 17 * * 2' - -jobs: - analyze: - name: Analyze (${{ matrix.language }}) - # Runner size impacts CodeQL analysis time. To learn more, please see: - # - https://gh.io/recommended-hardware-resources-for-running-codeql - # - https://gh.io/supported-runners-and-hardware-resources - # - https://gh.io/using-larger-runners (GitHub.com only) - # Consider using larger runners or machines with greater resources for possible analysis time improvements. - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} - timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} - permissions: - # required for all workflows - security-events: write - - # required to fetch internal or private CodeQL packs - packages: read - - # only required for workflows in private repositories - actions: read - contents: read - - strategy: - fail-fast: false - matrix: - include: - - language: java-kotlin - build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too. - # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' - # Use `c-cpp` to analyze code written in C, C++ or both - # Use 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, - # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. - # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how - # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - # If the analyze step fails for one of the languages you are analyzing with - # "We were unable to automatically build your code", modify the matrix above - # to set the build mode to "manual" for that language. Then modify this step - # to build your code. - # âšī¸ Command-line programs to run using the OS shell. - # đ See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - if: matrix.build-mode == 'manual' - shell: bash - run: | - echo 'If you are using a "manual" build mode for one or more of the' \ - 'languages you are analyzing, replace this with the commands to build' \ - 'your code, for example:' - echo ' make bootstrap' - echo ' make release' - exit 1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/snyk-security.yml b/.github/workflows/snyk-security.yml deleted file mode 100644 index 8a63639..0000000 --- a/.github/workflows/snyk-security.yml +++ /dev/null @@ -1,79 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# A sample workflow which sets up Snyk to analyze the full Snyk platform (Snyk Open Source, Snyk Code, -# Snyk Container and Snyk Infrastructure as Code) -# The setup installs the Snyk CLI - for more details on the possible commands -# check https://docs.snyk.io/snyk-cli/cli-reference -# The results of Snyk Code are then uploaded to GitHub Security Code Scanning -# -# In order to use the Snyk Action you will need to have a Snyk API token. -# More details in https://github.com/snyk/actions#getting-your-snyk-token -# or you can signup for free at https://snyk.io/login -# -# For more examples, including how to limit scans to only high-severity issues -# and fail PR checks, see https://github.com/snyk/actions/ - -name: Snyk Security - -on: - push: - branches: ["main" ] - pull_request: - branches: ["main"] - -permissions: - contents: read - -jobs: - snyk: - permissions: - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Snyk CLI to check for security issues - # Snyk can be used to break the build when it detects security issues. - # In this case we want to upload the SAST issues to GitHub Code Scanning - uses: snyk/actions/setup@806182742461562b67788a64410098c9d9b96adb - - # For Snyk Open Source you must first set up the development environment for your application's dependencies - # For example for Node - #- uses: actions/setup-node@v3 - # with: - # node-version: 16 - - env: - # This is where you will need to introduce the Snyk API token created with your Snyk account - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - - # Runs Snyk Code (SAST) analysis and uploads result into GitHub. - # Use || true to not fail the pipeline - - name: Snyk Code test - run: snyk code test --sarif > snyk-code.sarif # || true - - # Runs Snyk Open Source (SCA) analysis and uploads result to Snyk. - - name: Snyk Open Source monitor - run: snyk monitor --all-projects - - # Runs Snyk Infrastructure as Code (IaC) analysis and uploads result to Snyk. - # Use || true to not fail the pipeline. - - name: Snyk IaC test and report - run: snyk iac test --report # || true - - # Build the docker image for testing - - name: Build a Docker image - run: docker build -t your/image-to-test . - # Runs Snyk Container (Container and SCA) analysis and uploads result to Snyk. - - name: Snyk Container monitor - run: snyk container monitor your/image-to-test --file=Dockerfile - - # Push the Snyk Code results into GitHub Code Scanning tab - - name: Upload result to GitHub Code Scanning - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: snyk-code.sarif diff --git a/.github/workflows/trufflehog.yaml b/.github/workflows/trufflehog.yaml new file mode 100644 index 0000000..8504698 --- /dev/null +++ b/.github/workflows/trufflehog.yaml @@ -0,0 +1,41 @@ +name: "TruffleHog" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: "0 0 * * *" # Once a day + workflow_dispatch: + +permissions: + actions: read + contents: read + security-events: write + id-token: write + issues: write + +jobs: + ScanSecrets: + name: Scan secrets + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Ensure full clone for pull request workflows + + - name: TruffleHog OSS + id: trufflehog + uses: trufflesecurity/trufflehog@8a8ef8526527dd5f5d731d8e74843c121777b82d #v3.80.2 + continue-on-error: true + with: + path: ./ # Scan the entire repository + base: "${{ github.event.repository.default_branch }}" # Set base branch for comparison (pull requests) + extra_args: --filter-entropy=4 --results=verified,unknown --debug + + - name: Scan Results Status + if: steps.trufflehog.outcome == 'failure' + run: exit 1 # Set workflow run to failure if TruffleHog finds secrets \ No newline at end of file diff --git a/AUTHORS.md b/AUTHORS.md index 088f95c..7c6f10d 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -2,10 +2,10 @@ The following people have contributed to this repository: -* [Bahutik Sakhiya](https://github.com/bhautik-sakhiya), smartSense Consulting Solutions Pvt Ltd. +* [Bhautik Sakhiya](https://github.com/bhautik-sakhiya), smartSense Consulting Solutions Pvt Ltd. * [Dilip Dhankecha](https://github.com/dilipdhankecha2530), smartSense Consulting Solutions Pvt Ltd. * [Jigar Gadhiya](https://github.com/smartjigar), smartSense Consulting Solutions Pvt Ltd. -* [Neha Purswani](https://github.com/neha-puraswani), smartSense Consulting Solutions Pvt Ltd. -* [Mittal Vaghela](https://github.com/mittalVaghela), smartSense Consulting Solutions Pvt Ltd. * [Khushboo Shah](https://github.com/khushbooshah7), smartSense Consulting Solutions Pvt Ltd. +* [Mittal Vaghela](https://github.com/mittalVaghela), smartSense Consulting Solutions Pvt Ltd. * [Nitin Vavdiya](https://github.com/nitin-vavdiya), smartSense Consulting Solutions Pvt Ltd. +* [Neha Puraswani](https://github.com/neha-puraswani), smartSense Consulting Solutions Pvt Ltd. diff --git a/deployment/README.md b/deployment/README.md index e797bb1..855c9c8 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -33,6 +33,13 @@ includes multiple components working together for real-time messaging and data t - The `create_database.sh` script creates required databases at startup. - **Note**: - To ensure functionality, manually run the provided `migration.sql` to create EDC-specific tables. +#### For deployment in Windows OS + + - The [create_database.sh](deployment/env/postgres/create_database.sh) needs to be modified. The `chmod +x /docker-entrypoint-initdb.d/create_databases.sh` needs to be removed. + - Additionally, Windows uses CRLF line separators instead of LF, causing issues while running the init script. + - To change the line separators in IntelliJ IDEA, go to `File -> File Properties -> Line Separators` and select `LF - Unix and macOS (\n)`. + - To change the line separators in Notepad++, go to `Edit -> EOL Conversion` and select `Unix (LF)` + ### **EDC (Eclipse Data Connector)** @@ -82,7 +89,7 @@ includes multiple components working together for real-time messaging and data t 3. Start the chat with the selected business partner. ![start-chat.png](../docs/images/ui/start-chat.png) 4. When message has been passed then the logs are looks like below: - ![logs.png](../docs/images/ui/logs.png) + ![logs.png](../docs/images/deployment/logs.png) --- diff --git a/docs/images/ui/logs.png b/docs/images/deployment/logs.png similarity index 100% rename from docs/images/ui/logs.png rename to docs/images/deployment/logs.png diff --git a/docs/images/ui/register-bp.png b/docs/images/ui/register-bp.png new file mode 100644 index 0000000..71e7593 Binary files /dev/null and b/docs/images/ui/register-bp.png differ diff --git a/docs/images/ui/select-bp.png b/docs/images/ui/select-bp.png deleted file mode 100644 index 48347ef..0000000 Binary files a/docs/images/ui/select-bp.png and /dev/null differ diff --git a/docs/images/ui/start-chat.png b/docs/images/ui/start-chat.png deleted file mode 100644 index 3cd2f4c..0000000 Binary files a/docs/images/ui/start-chat.png and /dev/null differ diff --git a/edc-chat-app-ui/public/edclogo.svg b/edc-chat-app-ui/public/edclogo.svg new file mode 100644 index 0000000..dd22632 --- /dev/null +++ b/edc-chat-app-ui/public/edclogo.svg @@ -0,0 +1,6 @@ + diff --git a/edc-chat-app-ui/public/index.html b/edc-chat-app-ui/public/index.html index 166d62a..a78515b 100644 --- a/edc-chat-app-ui/public/index.html +++ b/edc-chat-app-ui/public/index.html @@ -7,6 +7,12 @@
+ + + @@ -31,14 +37,13 @@ - + To begin the development, run `npm start` or `yarn start`. + To create a production bundle, use `npm run build` or `yarn build`. + -->