From 3f1355c8b82d79d34ea871d446379386c8811498 Mon Sep 17 00:00:00 2001 From: Douglas Barone Date: Thu, 3 Dec 2020 16:10:20 -0400 Subject: [PATCH] Added env var --- server/.env.example | 1 + server/src/utils/paloalto.js | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/server/.env.example b/server/.env.example index 6913ddc..025d43d 100755 --- a/server/.env.example +++ b/server/.env.example @@ -38,6 +38,7 @@ CISCO_USER=serti.xx CISCO_PASSWORD=senhadacontroladoracisco # Palo Alto +PA_HOST=10.1.0.2 PA_USER=pti PA_PASSWORD=senhadopaloaltocompermissaoparaapi PA_NET=10.7. \ No newline at end of file diff --git a/server/src/utils/paloalto.js b/server/src/utils/paloalto.js index 972bd3d..dfce05e 100644 --- a/server/src/utils/paloalto.js +++ b/server/src/utils/paloalto.js @@ -29,24 +29,25 @@ async function updateUserIdMappings() { await Promise.all( wifiDevices.map(async device => { + const cmd = ` + + 1.0 + update + + + + + + + + ` return axios.get( - 'https://10.7.0.2/api/', + `https://${process.env.PA_HOST}/api/`, { params: { type: 'user-id', - cmd: ` - - 1.0 - update - - - - - - - - ` + cmd }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, httpsAgent: agent,