ip logging for error reporting
This commit is contained in:
+8
-8
@@ -13,11 +13,11 @@ RELAYPATH = "dev-pedw-hc"
|
||||
|
||||
|
||||
//Test Oauth ESNR
|
||||
//CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
|
||||
//CLIENT_SECRET = IXI8Q~D5oqsC-nrtayHHc~tUAfjQFzNiKVQ~fc2S
|
||||
//RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/
|
||||
//RELAYURI = "test-pedw-ns.servicebus.windows.net"
|
||||
//RELAYPATH = "test-pedw-hc"
|
||||
CLIENT_ID = d40b9373-96c2-4b04-8bd8-c2a2fe6444c1
|
||||
CLIENT_SECRET = IXI8Q~D5oqsC-nrtayHHc~tUAfjQFzNiKVQ~fc2S
|
||||
RELAY_ROOT = https://test-pedw-ns.servicebus.windows.net/test-pedw-hc/
|
||||
RELAYURI = "test-pedw-ns.servicebus.windows.net"
|
||||
RELAYPATH = "test-pedw-hc"
|
||||
|
||||
|
||||
//Preprod Oauth WGO
|
||||
@@ -69,9 +69,9 @@ AZURE_STORAGE_ACCOUNT_KEY = JS3ZIXianhYhB1lZrHB+bXbdzaLlON0alCyKrFAb+jVEwr9iqo2d
|
||||
AZURE_PEDW_STORAGE_ENDPOINT = https://pedwdev.blob.core.windows.net
|
||||
|
||||
// test key
|
||||
//AZURE_STORAGE_ACCOUNT_NAME= "pedwtest"
|
||||
//AZURE_STORAGE_ACCOUNT_KEY = Dl8qUVEnR2mglklQorttMurmjUpe2lI3oMWl9V245U6BOLutXDwmpU36afeTrGLK+zfzNVLErsWM+AStiYsimw==
|
||||
//AZURE_PEDW_STORAGE_ENDPOINT = https://pedwtest.blob.core.windows.net
|
||||
AZURE_STORAGE_ACCOUNT_NAME= "pedwtest"
|
||||
AZURE_STORAGE_ACCOUNT_KEY = Dl8qUVEnR2mglklQorttMurmjUpe2lI3oMWl9V245U6BOLutXDwmpU36afeTrGLK+zfzNVLErsWM+AStiYsimw==
|
||||
AZURE_PEDW_STORAGE_ENDPOINT = https://pedwtest.blob.core.windows.net
|
||||
|
||||
|
||||
AZURE_PEDW_CONTAINER = "pedwapplications"
|
||||
|
||||
+16
-9
@@ -505,7 +505,7 @@ export const uploadPDFAppealFiles = async (
|
||||
// console.log(`files[${prop}] = ${files[prop][0].size}`);
|
||||
console.log(foldername + "/files/" + formContent.split("tmp/")[1]);
|
||||
|
||||
const blobName = foldername + "/" + formContent.split("tmp/")[1];
|
||||
const blobName = foldername + "/files/" + formContent.split("tmp/")[1];
|
||||
console.log(blobName);
|
||||
|
||||
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
||||
@@ -546,7 +546,7 @@ export const uploadPDFCaseFiles = async (
|
||||
foldername
|
||||
);
|
||||
|
||||
const blobName = foldername + "/" + formContent.split("tmp/")[1];
|
||||
const blobName = foldername + "/files/" + formContent.split("tmp/")[1];
|
||||
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
||||
const uploadBlobResponse = await blockBlobClient.uploadFile(formContent);
|
||||
|
||||
@@ -756,7 +756,7 @@ export const getCaseBlob = async (
|
||||
formContent
|
||||
) => {
|
||||
const content = JSON.stringify(formContent);
|
||||
const blobName = caseReference + "/case/" + caseReference + "_case.json";
|
||||
const blobName = caseReference + "/" + caseReference + "_case.json";
|
||||
|
||||
const containerBlobToken = await createBlobSas(containerName, blobName);
|
||||
|
||||
@@ -783,7 +783,7 @@ export const getCaseBlob = async (
|
||||
};
|
||||
|
||||
export const getTempCaseBlob = async (containerName, caseReference) => {
|
||||
const blobName = caseReference + "/case/" + caseReference + "_case.json";
|
||||
const blobName = caseReference + "/" + caseReference + "_case.json";
|
||||
const containerToken = await createContainerSas(containerName);
|
||||
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||
const containerClient = new ContainerClient(sasUrl);
|
||||
@@ -823,7 +823,7 @@ export const getProgressBlobs = async (containerName, caseReference) => {
|
||||
"name": blob.name.split("/")[1],
|
||||
"path": blob.name,
|
||||
"versionId": blob.versionId,
|
||||
"caseObj": caseReference + "/case/" + caseReference + "_case.json",
|
||||
"caseObj": caseReference + "/" + caseReference + "_case.json",
|
||||
"isCurrentVersion": blob.isCurrentVersion,
|
||||
"contentLength": blob.properties.contentLength,
|
||||
"contentType": blob.contentType,
|
||||
@@ -883,7 +883,7 @@ export const getAllProgressBlobs = async (containerName) => {
|
||||
//"versionId": blob.versionId,
|
||||
"caseObj":
|
||||
blob.name.split("/")[0] +
|
||||
"/case/" +
|
||||
"/" +
|
||||
blob.name.split("/")[0] +
|
||||
"_case.json",
|
||||
// "isCurrentVersion": blob.isCurrentVersion,
|
||||
@@ -1012,7 +1012,7 @@ export const createCaseCompleteMessage = async (
|
||||
|
||||
const message = {
|
||||
containerName: containerName,
|
||||
casepath:
|
||||
appealpath:
|
||||
endpointURL +
|
||||
"/" +
|
||||
containerName +
|
||||
@@ -1021,8 +1021,15 @@ export const createCaseCompleteMessage = async (
|
||||
"/" +
|
||||
caseReference +
|
||||
"_appeal.json",
|
||||
casecontentpath:
|
||||
endpointURL + "/" + containerName + "/" + caseReference + "/case",
|
||||
casepath:
|
||||
endpointURL +
|
||||
"/" +
|
||||
containerName +
|
||||
"/" +
|
||||
caseReference +
|
||||
"/" +
|
||||
caseReference +
|
||||
"_case.json",
|
||||
filespath:
|
||||
endpointURL + "/" + containerName + "/" + caseReference + "/files",
|
||||
|
||||
|
||||
+18
-1
@@ -23,6 +23,20 @@ const WEBAPI_URL =
|
||||
process.env.RELAY_ROOT ||
|
||||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
|
||||
|
||||
export const getIP = (req) => {
|
||||
const forwarded = req.headers["x-forwarded-for"];
|
||||
|
||||
const ip =
|
||||
typeof forwarded === "string"
|
||||
? forwarded.split(/, /)[0]
|
||||
: req.socket.remoteAddress;
|
||||
|
||||
console.log(
|
||||
"\n====================\n Client IP address: " + ip,
|
||||
"\n=====================\n"
|
||||
);
|
||||
};
|
||||
|
||||
export const consoleLogger = (err) => {
|
||||
var errStr =
|
||||
"\n\n/////////////////////////////////////////////////\nServer Error " +
|
||||
@@ -31,6 +45,8 @@ export const consoleLogger = (err) => {
|
||||
? err.response.status +
|
||||
" : " +
|
||||
err.response.statusText +
|
||||
"\nRequest IP: " +
|
||||
err.response.request.socket.remoteAddress +
|
||||
"\nRequest URL: " +
|
||||
err.response.config.url +
|
||||
"\nRequest Time: " +
|
||||
@@ -503,7 +519,8 @@ export const getAppealsTypes = () => {
|
||||
.get(BASE_URL + "/api/endpoint/getappealtypes_api")
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
//console.log(error);
|
||||
consoleLogger(error);
|
||||
|
||||
let ErrResponse = {
|
||||
value: [],
|
||||
errorCode: error.response.status,
|
||||
|
||||
@@ -30,6 +30,8 @@ module.exports = {
|
||||
"/searchresults": ["search", "case"],
|
||||
"/viewall": ["search"],
|
||||
"/case": ["case"],
|
||||
"/case/*": ["case"],
|
||||
"/case/[ticketnumber]": ["case"],
|
||||
"/myportal/representation": ["case", "myrepresentations", "common"],
|
||||
"/myportal/error": ["myportal", "common"],
|
||||
"/newappeal": ["newappeal"],
|
||||
|
||||
@@ -17,7 +17,7 @@ import { JSONPath as jsonpath } from "jsonpath-plus";
|
||||
import { reduxForm, formValueSelector } from "redux-form";
|
||||
|
||||
import RegisterForm from "../../components/account/registerform";
|
||||
import { dehashString, hashAPIPath } from "../../actions";
|
||||
import { dehashString, hashAPIPath, getIP } from "../../actions";
|
||||
import { getSession, useSession, signIn, signOut } from "next-auth/react";
|
||||
|
||||
const Home = (props) => {
|
||||
@@ -159,6 +159,7 @@ const Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
|
||||
let thisSession = await getSession(ctx);
|
||||
|
||||
|
||||
@@ -52,9 +52,14 @@ export default async function ApiProxy(req, res) {
|
||||
"')) and pinswg_appealcasetype ne null and pinswg_publishtoweb eq true&$orderby=createdon desc&$count=true";
|
||||
|
||||
console.log(
|
||||
"basic search ",
|
||||
queryUrl,
|
||||
WEBAPI_URL + queryUrl + hashAPIPath(queryUrl)
|
||||
"\n==========================================\n",
|
||||
"basic search: " + queryUrl,
|
||||
"\n\n",
|
||||
"basic search relay link: " +
|
||||
WEBAPI_URL +
|
||||
queryUrl +
|
||||
hashAPIPath(queryUrl),
|
||||
"\n==========================================\n"
|
||||
);
|
||||
|
||||
var apiResponse = _.isEmpty(req.query)
|
||||
|
||||
@@ -65,7 +65,14 @@ export default async function ApiProxy(req, res) {
|
||||
|
||||
queryUrl = queryUrl + getSelectQuery(appealTypeName);
|
||||
|
||||
console.log("///////////\nquery: ", queryUrl, "<<<<end query");
|
||||
console.log(
|
||||
"\n==========================================\n",
|
||||
"\ndetails query: ",
|
||||
queryUrl,
|
||||
"\n\n",
|
||||
"<<<<end query",
|
||||
"\n==========================================\n"
|
||||
);
|
||||
|
||||
return axios
|
||||
.get(
|
||||
|
||||
@@ -45,7 +45,12 @@
|
||||
import axios from "axios";
|
||||
import CryptoJS from "crypto-js";
|
||||
import _ from "lodash";
|
||||
import { getToken, azureHeadersPagedCustom } from "../../../actions";
|
||||
import {
|
||||
getToken,
|
||||
azureHeadersPagedCustom,
|
||||
consoleLogger,
|
||||
getIP,
|
||||
} from "../../../actions";
|
||||
|
||||
const WORDKEY = process.env.HASHKEY;
|
||||
|
||||
@@ -127,7 +132,7 @@ export default async function ApiProxy(req, res) {
|
||||
return res.status(200).json(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(consoleLogger(err));
|
||||
consoleLogger(err);
|
||||
res.status(400).json(err);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import useTranslation from "next-translate/useTranslation";
|
||||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import { connect } from "react-redux";
|
||||
import { getBasicDNSURLSearch } from "../../actions";
|
||||
import { getBasicDNSURLSearch, getIP } from "../../actions";
|
||||
import CookieBanner from "../../components/cookieBanner";
|
||||
import Footer from "../../components/footer";
|
||||
import Header from "../../components/header";
|
||||
@@ -88,6 +88,7 @@ const CaseHome = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
const { cookies } = req;
|
||||
|
||||
console.log(cookies);
|
||||
|
||||
+2
-1
@@ -4,7 +4,7 @@ import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import { setCookie } from "nookies";
|
||||
import { connect } from "react-redux";
|
||||
import { getToken, hashString, getPortalLogin } from "../actions";
|
||||
import { getToken, hashString, getPortalLogin, getIP } from "../actions";
|
||||
import CookieBanner from "../components/cookieBanner";
|
||||
import Footer from "../components/footer";
|
||||
import Header from "../components/header";
|
||||
@@ -151,6 +151,7 @@ const Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
|
||||
let thisSession = await getSession(ctx);
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
getPartSavedAppeal,
|
||||
getFilesFromBlob,
|
||||
getProgressFromBlob,
|
||||
getIP,
|
||||
} from "../../actions";
|
||||
import Breadcrumbs from "../../components/breadcrumbs";
|
||||
import CookieBanner from "../../components/cookieBanner";
|
||||
@@ -212,6 +213,7 @@ let Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
const { cookies } = req;
|
||||
|
||||
//console.log(cookies);
|
||||
|
||||
@@ -3,7 +3,12 @@ import useTranslation from "next-translate/useTranslation";
|
||||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import { connect } from "react-redux";
|
||||
import { getAppealsTypes, getLPA, getPersonalAccount } from "../../actions";
|
||||
import {
|
||||
getAppealsTypes,
|
||||
getLPA,
|
||||
getPersonalAccount,
|
||||
getIP,
|
||||
} from "../../actions";
|
||||
import Breadcrumbs from "../../components/breadcrumbs";
|
||||
import CookieBanner from "../../components/cookieBanner";
|
||||
import CRMError from "../../components/crmError";
|
||||
@@ -67,6 +72,7 @@ const Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
console.log("query-", query);
|
||||
|
||||
const { cookies } = req;
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
getPortalModuleDetails,
|
||||
getWatchedCases,
|
||||
getPersonalAccount,
|
||||
getIP,
|
||||
} from "../../actions";
|
||||
import Breadcrumbs from "../../components/breadcrumbs";
|
||||
import CookieBanner from "../../components/cookieBanner";
|
||||
@@ -74,6 +75,7 @@ const Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
console.log("query-", query);
|
||||
//console.log("search array:", Object.entries(query));
|
||||
const { cookies } = req;
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
getDNSCoords,
|
||||
getPortalModuleDetails,
|
||||
getWatchedCases,
|
||||
getIP,
|
||||
} from "../../actions";
|
||||
|
||||
import Breadcrumbs from "../../components/breadcrumbs";
|
||||
@@ -130,6 +131,7 @@ const Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
console.log("query-", query);
|
||||
|
||||
const { cookies } = req;
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
getCase,
|
||||
getPortalLogin,
|
||||
createContainerProxy,
|
||||
getIP,
|
||||
} from "../../actions";
|
||||
import Breadcrumbs from "../../components/breadcrumbs";
|
||||
import CookieBanner from "../../components/cookieBanner";
|
||||
@@ -162,6 +163,7 @@ const Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
console.log("The query", query);
|
||||
|
||||
const { cookies } = req;
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
getWatchedCases,
|
||||
consoleLogger,
|
||||
getPortalLogin,
|
||||
getIP,
|
||||
} from "../../actions";
|
||||
import Breadcrumbs from "../../components/breadcrumbs";
|
||||
import CookieBanner from "../../components/cookieBanner";
|
||||
@@ -76,6 +77,7 @@ const Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
console.log("query-", query);
|
||||
|
||||
const { cookies } = req;
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
getPickLists,
|
||||
getFilesFromBlob,
|
||||
getProgressFromBlob,
|
||||
getIP,
|
||||
} from "../../actions";
|
||||
import Breadcrumbs from "../../components/breadcrumbs";
|
||||
import CookieBanner from "../../components/cookieBanner";
|
||||
@@ -213,6 +214,7 @@ let Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
const { cookies } = req;
|
||||
|
||||
console.log(cookies);
|
||||
|
||||
@@ -2,7 +2,7 @@ import useTranslation from "next-translate/useTranslation";
|
||||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import { connect } from "react-redux";
|
||||
import { getBasicSearch } from "../actions";
|
||||
import { getBasicSearch, getIP } from "../actions";
|
||||
import Breadcrumbs from "../components/breadcrumbs";
|
||||
import CookieBanner from "../components/cookieBanner";
|
||||
import Footer from "../components/footer";
|
||||
@@ -119,6 +119,7 @@ const Home = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
console.log("query-", query);
|
||||
|
||||
let isLinked =
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
import { wrapper } from "../store/store";
|
||||
|
||||
import Head from "next/head";
|
||||
import { getIP } from "../actions";
|
||||
|
||||
const ShowStorage = (props) => {
|
||||
const { container } = props;
|
||||
@@ -25,6 +26,7 @@ const ShowStorage = (props) => {
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
getIP(req);
|
||||
|
||||
console.log(
|
||||
"have therese?:",
|
||||
|
||||
Reference in New Issue
Block a user