Skip to content

Commit 9d239ba

Browse files
authored
Merge pull request #48 from shriyanss/dev
v1.2.1-beta.1 ### Added ### Changed - Added `-k` as shorthand flag to the `run` module - Added standard exit codes to the application ### Fixed - Fix errors when the target is using a CDN - Fix "possible EventEmitter memory leak detected" error - Fix "Maximum call stack size exceeded" error in resolveNodeValue - Fix "UND_ERR_HEADERS_OVERFLOW" error
2 parents 8292bae + 20df24c commit 9d239ba

File tree

20 files changed

+420
-247
lines changed

20 files changed

+420
-247
lines changed

.github/workflows/build-and-prettify.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v4
1313
- name: Check version mismatch
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1416
run: |
1517
echo "[i] Checking if the version in the CHANGELOG.md and package.json version matches"
1618
PACKAGE_JSON_VERSION=$(cat package.json | jq ".version" -r)
1719
CHANGELOG_VERSION=$(cat CHANGELOG.md | grep -E "^## [0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta)(\.[0-9]+)?)?" | head -n 1 | sed -E 's/^## ([0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta)(\.[0-9]+)?)?).*/\1/')
18-
GLOBALS_FILE_VERSION=$(grep -E '^const version =.+' src/globalConfig.ts | sed -E 's/^const version = "(.*)";/\1/')
20+
GLOBALS_FILE_VERSION=$(grep -E '^const version =.+' src/globalConfig.ts | sed -E 's/^const version = \"(.*)\";/\1/')
1921
if [[ "$PACKAGE_JSON_VERSION" != "$CHANGELOG_VERSION" ]]; then
2022
echo "Version number mismatch between PACKAGE_JSON_VERSION and CHANGELOG_VERSION"
2123
exit 1
@@ -24,19 +26,25 @@ jobs:
2426
exit 1
2527
else
2628
echo "[✓] Version matches"
29+
echo "[i] Checking if the version already exists on GitHub"
30+
if gh release view "v$PACKAGE_JSON_VERSION" >/dev/null 2>&1; then
31+
echo "Version v$PACKAGE_JSON_VERSION already exists on GitHub."
32+
exit 1
33+
else
34+
echo "[✓] Version v$PACKAGE_JSON_VERSION does not exist on GitHub."
35+
fi
2736
fi
2837
2938
prettier:
3039
runs-on: ubuntu-latest
3140
needs: version_check
32-
permissions:
33-
contents: write
3441
steps:
3542
- name: Checkout
3643
uses: actions/checkout@v4
3744
with:
3845
# Make sure the action checks out the repository to the pull request branch
3946
ref: ${{ github.ref_name }}
47+
ssh-key: ${{ secrets.DEPLOY_KEY }}
4048

4149
- name: Set up Node.js
4250
uses: actions/setup-node@v4
@@ -83,3 +91,14 @@ jobs:
8391
run: npm ci
8492
- name: Build code
8593
run: npm run build
94+
build-docker:
95+
needs: build
96+
runs-on: ubuntu-latest
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@v4
100+
with:
101+
# Make sure the action checks out the repository to the pull request branch
102+
ref: ${{ github.ref_name }}
103+
- name: Build docker container
104+
run: docker build -t shriyanss/js-recon .

.github/workflows/pr_checker.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: PR Branch Checker
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
check-branch:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check source branch
13+
if: github.head_ref != 'dev'
14+
env:
15+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
PR_URL: ${{ github.event.pull_request.html_url }}
17+
BRANCH_NAME: ${{ github.head_ref }}
18+
run: |
19+
git config user.name "github-actions[bot]"
20+
git config user.email "github-actions[bot]@users.noreply.github.com"
21+
gh pr comment $PR_URL --body "This merge is not possible. Create a PR for $BRANCH_NAME -> dev"
22+
gh pr close $PR_URL

.github/workflows/publish-js-recon.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,10 @@ jobs:
139139
- publish-docker
140140
- publish-ghcr
141141
runs-on: ubuntu-latest
142-
permissions:
143-
contents: write
144142
steps:
145143
- uses: actions/checkout@v4
146144
with:
145+
ssh-key: ${{ secrets.DEPLOY_KEY }}
147146
fetch-depth: 0
148147
- name: Merge main and dev
149148
run: |

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Change Log
22

3+
## 1.2.1-beta.1 - 2025.08.07
4+
5+
### Added
6+
7+
### Changed
8+
9+
- Added `-k` as shorthand flag to the `run` module
10+
- Added standard exit codes to the application
11+
12+
### Fixed
13+
14+
- Fix errors when the target is using a CDN
15+
- Fix "possible EventEmitter memory leak detected" error
16+
- Fix "Maximum call stack size exceeded" error in resolveNodeValue
17+
- Fix "UND_ERR_HEADERS_OVERFLOW" error
18+
319
## 1.2.1-alpha.2 - 2025.08.06
420

521
### Added

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ USER pptruser
1616
RUN npx puppeteer browsers install chrome
1717

1818
ENV IS_DOCKER=true
19+
ENV NODE_OPTIONS="--max-http-header-size=99999999"
1920
ENTRYPOINT ["node", "build/index.js"]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shriyanss/js-recon",
3-
"version": "1.2.1-alpha.2",
3+
"version": "1.2.1-beta.1",
44
"description": "JS Recon Tool",
55
"main": "build/index.js",
66
"type": "module",

src/analyze/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const analyze = async (
6969

7070
if (!allValidated) {
7171
console.log(chalk.red("[!] Some rules are invalid"));
72-
process.exit(1);
72+
process.exit(20);
7373
}
7474

7575
if (validate) {

src/api_gateway/genReq.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ const get = async (url: string, headers: {} = {}): Promise<string> => {
185185

186186
if (isFireWallBlocking) {
187187
console.log(chalk.magenta("[!] Please try again without API Gateway"));
188-
process.exit(1);
188+
process.exit(18);
189189
}
190190

191191
return body;

src/globalConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const githubURL = "https://github.com/shriyanss/js-recon";
22
const modulesDocs = "https://js-recon.io/docs/category/modules";
3-
const version = "1.2.1-alpha.2";
3+
const version = "1.2.1-beta.1";
44
const toolDesc = "JS Recon Tool";
55
const axiosNonHttpMethods = ["isAxiosError"]; // methods available in axios, which are not for making HTTP requests
66

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ program
168168
for (const aiType of globalsUtil.getAi()) {
169169
if (aiType !== "" && !validAiOptions.includes(aiType)) {
170170
console.log(chalk.red(`[!] Invalid AI option: ${aiType}`));
171-
return;
171+
process.exit(1);
172172
}
173173
}
174174
}
@@ -241,7 +241,7 @@ program
241241
.option("--openai-api-key <key>", "OpenAI API key")
242242
.option("--model <model>", "AI model to use", "gpt-4o-mini")
243243
.option("--map-openapi-chunk-tag", "Add chunk ID tag to OpenAPI spec for each request found (map module)", false)
244-
.option("--insecure", "Disable SSL certificate verification", false)
244+
.option("-k, --insecure", "Disable SSL certificate verification", false)
245245
.action(async (cmd) => {
246246
globalsUtil.setAi(cmd.ai?.split(",") || []);
247247
globalsUtil.setOpenaiApiKey(cmd.openaiApiKey);
@@ -256,7 +256,7 @@ program
256256
for (const aiType of globalsUtil.getAi()) {
257257
if (aiType !== "" && !validAiOptions.includes(aiType)) {
258258
console.log(chalk.red(`[!] Invalid AI option: ${aiType}`));
259-
return;
259+
process.exit(2);
260260
}
261261
}
262262
}

0 commit comments

Comments
 (0)