diff --git a/docker-compose/config/mimoto-default.properties b/docker-compose/config/mimoto-default.properties index 64793145..d720b2fc 100644 --- a/docker-compose/config/mimoto-default.properties +++ b/docker-compose/config/mimoto-default.properties @@ -30,7 +30,7 @@ mosip.inji.warningDomainName=${mosip.api.public.url} #timeout for vc download api via openid4vci flow in milliseconds mosip.inji.openId4VCIDownloadVCTimeout=30000 # inji documentation url -mosip.inji.aboutInjiUrl=https://docs.mosip.io/inji/inji-mobile-wallet/overview +mosip.inji.aboutInjiUrl=https://docs.inji.io/inji-wallet/inji-mobile # minimum storage space required for making audit entry in MB mosip.inji.minStorageRequiredForAuditEntry=2 # minimum storage space required for downloading / receiving vc in MB diff --git a/helm/inji-web/templates/configmap.yaml b/helm/inji-web/templates/configmap.yaml index b9c714b7..11ffd6be 100644 --- a/helm/inji-web/templates/configmap.yaml +++ b/helm/inji-web/templates/configmap.yaml @@ -22,11 +22,6 @@ data: access_log /var/log/nginx/access1.log; error_log /var/log/nginx/error1.log; - # Increase buffer sizes for reading response headers from the upstream server - proxy_buffer_size 16k; # Buffer for the first part of the response header - proxy_buffers 4 16k; # Number of buffers and their size for reading the response - proxy_busy_buffers_size 32k; # Buffer size for busy buffers - server { listen {{ .Values.inji_web.inji_web_port }}; server_name localhost; diff --git a/inji-web-proxy/.env b/inji-web-proxy/.env deleted file mode 100644 index 4602717b..00000000 --- a/inji-web-proxy/.env +++ /dev/null @@ -1,2 +0,0 @@ -MIMOTO_HOST=https://api.dev1.mosip.net/v1/mimoto -PORT=3010 diff --git a/inji-web-proxy/.gitignore b/inji-web-proxy/.gitignore deleted file mode 100644 index 60f1aa34..00000000 --- a/inji-web-proxy/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.project -.idea -package-*.json -node_modules diff --git a/inji-web-proxy/Dockerfile b/inji-web-proxy/Dockerfile deleted file mode 100644 index eb84af5d..00000000 --- a/inji-web-proxy/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# Dockerfile -# Use the official Node.js image -FROM node:16.9.1 - -# Create and set the working directory inside the container -WORKDIR /usr/src/app - -# Copy package.json and package-lock.json (if available) -COPY package*.json ./ - -# Install dependencies -RUN npm install - -# Copy the rest of the application code -COPY . . - -# Expose the port on which the app runs -EXPOSE 3010 - -# Run the application -CMD ["node", "proxy_server.js"] diff --git a/inji-web-proxy/README.md b/inji-web-proxy/README.md deleted file mode 100644 index 45e06778..00000000 --- a/inji-web-proxy/README.md +++ /dev/null @@ -1,20 +0,0 @@ -### Inji Web Proxy - -Inji Web Proxy is express js application which is build to connect Backend Service From Inji Web to Avoid CORS issue. - - -### Environment Variables : - -> MIMOTO_HOST : Update the host url of the Mimoto with **/v1/mimoto** suffix - -> PORT : port in which proxy will run - -### Installation Steps : - -> npm i && node proxy_server.js - -### Usage : - -- Goto InjiWeb [api.ts](../inji-web/src/utils/api.ts) -- In order to avoid CORS, update the **mimotoHost** of Inji Web from Mimoto service url to Inji Web Proxy server url, so that it proxies and bypasses the CORS - - ref : https://localhost:3010 diff --git a/inji-web-proxy/package.json b/inji-web-proxy/package.json deleted file mode 100644 index 833e8f96..00000000 --- a/inji-web-proxy/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "proxy-server", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "axios": "^1.6.8", - "body-parser": "^1.20.2", - "cors": "^2.8.5", - "dotenv": "^16.4.5", - "express": "^4.19.2", - "fs": "^0.0.1-security", - "path": "^0.12.7" - } -} diff --git a/inji-web-proxy/proxy_server.js b/inji-web-proxy/proxy_server.js deleted file mode 100644 index ab1db6ed..00000000 --- a/inji-web-proxy/proxy_server.js +++ /dev/null @@ -1,53 +0,0 @@ -const express = require('express'); -const cors = require('cors'); -const axios = require('axios'); -const bodyParser = require('body-parser'); -require('dotenv').config() - -const app = express(); -const PORT = process.env.PORT; - -app.use(express.json()); -app.use(cors()); -app.use(bodyParser.json()); -app.use(bodyParser.urlencoded({ extended: true })); - -app.all('*', async (req, res) => { - delete req.headers.host - delete req.headers.referer - - const API_URL = process.env.MIMOTO_HOST; - const PATH = req.url - try { - - let response = await axios({ - method: req.method, - responseType: PATH.indexOf("/download") === -1 ? "json" : "arraybuffer", - url: `${API_URL + PATH}`, - data: new URLSearchParams(req.body), - headers: req.headers - }); - - if(PATH.indexOf("/download") === -1){ - res.status(response.status).json(response.data); - } else { - res.setHeader('Access-Control-Allow-Origin', '*'); // Change '*' to specific origin if needed - res.setHeader('Access-Control-Allow-Methods', 'GET,OPTIONS,POST'); // Allow GET requests - res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization'); // Allow specific headers - res.set("Content-Type", "application/pdf"); - res.status(response.status).send(response.data); - } - - } catch (error) { - console.error("Error occurred: ", error); - if (error.response) { - res.status(error.response.status).json(error.response.data); - } else { - res.status(500).json({ error: error.message }); - } - } -}); - -app.listen(PORT, () => { - console.log(`Proxy server listening on port ${PORT}`); -}); diff --git a/inji-web/package-lock.json b/inji-web/package-lock.json index 65016886..e37308a2 100644 --- a/inji-web/package-lock.json +++ b/inji-web/package-lock.json @@ -18,6 +18,7 @@ "@types/react-outside-click-handler": "^1.3.3", "@types/react-redux": "^7.1.33", "autoprefixer": "^9.8.6", + "cross-env": "^7.0.3", "crypto-js": "^4.2.0", "i18next": "^23.11.2", "postcss-cli": "^11.0.0", @@ -5898,6 +5899,23 @@ "node": ">= 6" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -21389,6 +21407,14 @@ } } }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/inji-web/package.json b/inji-web/package.json index accddefb..3e5dfdca 100644 --- a/inji-web/package.json +++ b/inji-web/package.json @@ -13,6 +13,7 @@ "@types/react-outside-click-handler": "^1.3.3", "@types/react-redux": "^7.1.33", "autoprefixer": "^9.8.6", + "cross-env": "^7.0.3", "crypto-js": "^4.2.0", "i18next": "^23.11.2", "postcss-cli": "^11.0.0", @@ -33,7 +34,7 @@ "web-vitals": "^2.1.4" }, "scripts": { - "start": "set PORT=3001 && react-scripts start", + "start": "cross-env PORT=3004 react-scripts start", "build": "CI=false react-scripts build", "test": "react-scripts test --silent --testPathPattern=__tests__", "eject": "react-scripts eject", diff --git a/inji-web/public/env.config.js b/inji-web/public/env.config.js index 00ac242b..441fc9a9 100644 --- a/inji-web/public/env.config.js +++ b/inji-web/public/env.config.js @@ -4,5 +4,5 @@ window._env_ = { DEFAULT_FAVICON: "favicon.ico", DEFAULT_TITLE: "Inji Wallet", DEFAULT_FONT_URL: "https://fonts.googleapis.com/css?family=Inter", - MIMOTO_HOST: "http://localhost:3010" + MIMOTO_HOST: "http://localhost:8099/v1/mimoto" };