Skip to content

Commit

Permalink
Merge pull request #58 from karthikuj/release-sasori
Browse files Browse the repository at this point in the history
First release changes
  • Loading branch information
karthikuj authored May 16, 2024
2 parents a16f13c + 6ec5984 commit f9c7fee
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ The `crawler` section contains settings related to the behavior of the crawler.
- **enabled**: (boolean) Specifies whether basic authentication is enabled.
- **username**: (string) Username for basic authentication. Required if `enabled` is `true`.
- **password**: (string) Password for basic authentication. Required if `enabled` is `true`.
- **scriptAuth**: (object) Configuration for script-based authentication.
- **enabled**: (boolean) Specifies whether script-based authentication is enabled.
- **pptrRecording**: (string) Path to Puppeteer recording script for authentication. Required if `enabled` is `true`.
- **recorderAuth**: (object) Configuration for recorder based authentication.
- **enabled**: (boolean) Specifies whether recorder based authentication is enabled.
- **pptrRecording**: (string) Path to Puppeteer recording for authentication. Required if `enabled` is `true`.

Example:

Expand All @@ -146,7 +146,7 @@ Example:
"username": "user",
"password": "password"
},
"scriptAuth": {
"recorderAuth": {
"enabled": false,
"pptrRecording": "/path/to/pptr/recording.json"
}
Expand Down
2 changes: 1 addition & 1 deletion config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"username": "username",
"password": "password"
},
"scriptAuth": {
"recorderAuth": {
"enabled": false,
"pptrRecording": "/path/to/pptrRecording.json"
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sasori-crawl",
"version": "0.0.1",
"version": "0.2.0",
"description": "Sasori is a dynamic web crawler powered by Puppeteer, designed for lightning-fast endpoint discovery.",
"main": "bin/index.js",
"author": "Karthik UJ",
Expand Down
1 change: 1 addition & 0 deletions src/browser/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Browser {
args.push(
`--proxy-server=${configJson.proxy.host}:${configJson.proxy.port}`,
);
args.push('--ignore-certificate-errors');
}
if (configJson.slowMo) {
browserConfig.slowMo = configJson.slowMo;
Expand Down
4 changes: 2 additions & 2 deletions src/crawler/crawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class Crawler {
*/
async startAuthentication(browser, page) {
this.authInProgress = true;
await authenticate(browser, page, path.resolve(__dirname, this.crawlerConfig.authentication.scriptAuth.pptrRecording));
await authenticate(browser, page, path.resolve(__dirname, this.crawlerConfig.authentication.recorderAuth.pptrRecording));
this.authInProgress = false;
await this.maximizeViewport(page);
}
Expand Down Expand Up @@ -423,7 +423,7 @@ class Crawler {
console.log(chalk.greenBright(`[INFO] Scope manager started successfully!`));

// Start authentication if enabled.
if (this.crawlerConfig.authentication.scriptAuth && this.crawlerConfig.authentication.scriptAuth.enabled) {
if (this.crawlerConfig.authentication.recorderAuth && this.crawlerConfig.authentication.recorderAuth.enabled) {
console.log(chalk.greenBright(`[INFO] Running initial authentication...`));
await this.startAuthentication(browser, page);
}
Expand Down
6 changes: 3 additions & 3 deletions src/models/configModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const basicAuthModel = Joi.object({
}).required();

/**
* Script auth model for pptr script based auth configurations.
* Recorder auth model for pptr recorder based auth configurations.
*/
const scriptAuthModel = Joi.object({
const recorderAuthModel = Joi.object({
enabled: Joi.boolean().required(),
pptrRecording: Joi.string().when('enabled', {
is: true,
Expand All @@ -51,7 +51,7 @@ const scriptAuthModel = Joi.object({
*/
const authenticationModel = Joi.object({
basicAuth: basicAuthModel,
scriptAuth: scriptAuthModel,
recorderAuth: recorderAuthModel,
});

/**
Expand Down

0 comments on commit f9c7fee

Please sign in to comment.