Skip to content

Commit bd7e3a4

Browse files
authored
Update the check for office ip (#117)
* Update the check for office ip * update readme and changelog
1 parent 16a574f commit bd7e3a4

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.19.0 (2024-10-02)
2+
### Features
3+
* feat(sendgrid): ✨ Update checking of correct ip before accessing the Sendgrid api
14

25
## 2.18.0 (2024-04-11)
36
### Features

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { checkLisaVersion } from "./lib/versions.js"
2727
import { generateVaultPass } from "./tasks/trellis.js"
2828

2929
export const program = new Command()
30-
export const LISA_VERSION = "2.18.0"
30+
export const LISA_VERSION = "2.19.0"
3131

3232
resetConf()
3333
checkNodeVersion()

lib/triggerfish.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1+
import ip from "ip"
12
import fetch from "node-fetch"
23

34
import { writeError, writeStep } from "./write.js"
45

6+
const { cidrSubnet } = ip
57
export async function isTriggerfishOfficeIp() {
68
writeStep(
79
"Checking if you are in the Triggerfish office (or using the VPN)...",
810
)
9-
11+
const cidr = "155.4.226.178/28"
1012
const ipCorrect = await fetch("https://icanhazip.com/")
1113
.then((response) => response.text())
12-
.then((ip) => ip.trim() === "158.174.69.114")
14+
.then((ip) => cidrSubnet(cidr).contains(ip.trim()))
1315

1416
if (!ipCorrect) {
1517
writeError(

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@triggerfishab/lisa-cli",
3-
"version": "2.18.0",
3+
"version": "2.19.0",
44
"description": "CLI commands to generate a new project based on Lisa",
55
"main": "./index.js",
66
"bin": {
@@ -25,6 +25,7 @@
2525
"commander": "^11.0.0",
2626
"conf": "^11.0.0",
2727
"generate-password": "^1.6.1",
28+
"ip": "^2.0.1",
2829
"js-yaml": "^4.1.0",
2930
"node-fetch": "3",
3031
"oauth-1.0a": "^2.2.6",

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,6 +2435,11 @@ internal-slot@^1.0.5:
24352435
has "^1.0.3"
24362436
side-channel "^1.0.4"
24372437

2438+
ip@^2.0.1:
2439+
version "2.0.1"
2440+
resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.1.tgz#e8f3595d33a3ea66490204234b77636965307105"
2441+
integrity sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==
2442+
24382443
is-array-buffer@^3.0.1, is-array-buffer@^3.0.2:
24392444
version "3.0.2"
24402445
resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe"

0 commit comments

Comments
 (0)