Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR action test #32

Merged
merged 15 commits into from
May 22, 2024
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/technology-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ assignees: ''

---

You may request a new technology to be added but chances of having it included are greatly improved if you submit a pull request. Please refer to the [contributing guide](https://github.com/AliasIO/wappalyzer/blob/master/CONTRIBUTING.md).
You may request a new technology to be added but chances of having it included are greatly improved if you submit a pull request. Please refer to the [contributing guide](https://github.com/HTTPArchive/wappalyzer/blob/main/CONTRIBUTING.md).
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
run: yarn run validate

- name: Run WebPageTest with unit tests
id: unit-test
env:
WPT_SERVER: "webpagetest.httparchive.org"
WPT_API_KEY: ${{ secrets.HA_API_KEY }}
Expand All @@ -39,6 +40,7 @@ jobs:
echo "::endgroup::"

- name: Run WebPageTest for more websites
id: wpt-test
env:
WPT_SERVER: "webpagetest.httparchive.org"
WPT_API_KEY: ${{ secrets.HA_API_KEY }}
Expand Down Expand Up @@ -79,7 +81,7 @@ jobs:

# Run WebPageTest for each URL
for TEST_WEBSITE in "${URLS[@]}"; do
echo "::group::Detecting technologies for $TEST_WEBSITE"
echo "::group::Running WPT test for $TEST_WEBSITE"
node tests/wpt.js "$TEST_WEBSITE"
echo "::endgroup::"
done
Expand All @@ -89,7 +91,7 @@ jobs:

- name: Add comment with results
uses: mshick/add-pr-comment@v2
if: always()
if: steps.unit-test.outcome == 'success' || steps.wpt-test.outcome == 'success'
with:
refresh-message-position: true
message-path: test-results.md
20 changes: 8 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Contributing

Wappalyzer is an [GPLv3 licensed](https://github.com/wappalyzer/wappalyzer/blob/master/LICENSE), open source project written in JavaScript. Anyone is welcome to contribute.
Wappalyzer is an [GPLv3 licensed](https://github.com/HTTPArchive/wappalyzer/blob/main/LICENSE), open source project written in JavaScript. Anyone is welcome to contribute.

## Getting started

To get started, see the [README](https://github.com/wappalyzer/wappalyzer/blob/master/README.md).
To get started, see the [README](https://github.com/HTTPArchive/wappalyzer/blob/main/README.md).

## Submitting changes

Expand All @@ -15,23 +15,19 @@ To get started, see the [README](https://github.com/wappalyzer/wappalyzer/blob/m

## Adding a new technology

Wappalyzer uses [regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) to fingerprint technologies. Refer to the [specification](https://github.com/wappalyzer/wappalyzer/blob/master/README.md#specification) for detail.
Wappalyzer uses [regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) to fingerprint technologies. Refer to the [specification](https://github.com/HTTPArchive/wappalyzer/blob/main/README.md#specification) for detail.

- Add a new block to [`src/technologies/*.json`](https://github.com/wappalyzer/wappalyzer/blob/master/src/technologies). The filename should match the first letter of the technology name (a-z). Use `_.json` if the first character is a number or symbol.
- Add an icon to [`src/images/icons`](https://github.com/wappalyzer/wappalyzer/tree/master/src/images/icons). The image must be square, either SVG or PNG (32 x 32 pixels).
- Add a new block to [`src/technologies/*.json`](https://github.com/HTTPArchive/wappalyzer/blob/main/src/technologies). The filename should match the first letter of the technology name (a-z). Use `_.json` if the first character is a number or symbol.
- Add an icon to [`src/images/icons`](https://github.com/HTTPArchive/wappalyzer/tree/master/src/images/icons). The image must be square, either SVG or PNG (32 x 32 pixels).

Only widely used technologies are accepted. When creating a pull request, include ten or more links to websites that use the application, a GitHub page with at least 1,000 stars or anything that will help establish the size of the user base.

## Adding a new category

Please [open an issue on GitHub](https://github.com/wappalyzer/wappalyzer/issues) first to discuss the need for a new category.
Please [open an issue on GitHub](https://github.com/HTTPArchive/wappalyzer/issues) first to discuss the need for a new category.

To add a category, edit [`src/categories.json`](https://github.com/wappalyzer/wappalyzer/blob/master/src/categories.json) and update every [locale](https://github.com/wappalyzer/wappalyzer/tree/master/src/_locales). You may use the English category name in all of them.

## Adding a new translation

To add a new translation, copy the `en` folder in [`src/_locales`](https://github.com/wappalyzer/wappalyzer/tree/master/src/_locales), rename it to the relevant two-letter country code and update the containing `messages.json` file.
To add a category, edit [`src/categories.json`](https://github.com/HTTPArchive/wappalyzer/blob/main/src/categories.json) and update every [locale](https://github.com/HTTPArchive/wappalyzer/tree/master/src/_locales). You may use the English category name in all of them.

## Adding a new feature

Please [open an issue on GitHub](https://github.com/wappalyzer/wappalyzer/issues) first. New features and large changes are rarely accepted without prior discussion.
Please [open an issue on GitHub](https://github.com/HTTPArchive/wappalyzer/issues) first. New features and large changes are rarely accepted without prior discussion.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Validate](https://github.com/wappalyzer/wappalyzer/actions/workflows/validate.yml/badge.svg)](https://github.com/wappalyzer/wappalyzer/actions/workflows/validate.yml)
[![Test](https://github.com/HTTPArchive/wappalyzer/actions/workflows/test.yml/badge.svg)](https://github.com/HTTPArchive/wappalyzer/actions/workflows/test.yml)
[![Github Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&link=https://github.com/sponsors/AliasIO)](https://github.com/sponsors/AliasIO)

<a href="https://www.wappalyzer.com/?utm_source=readme&utm_medium=github&utm_campaign=wappalyzer"><img src="https://www.wappalyzer.com/images/logo/icon_192.png" height="72" alt="Wappalyzer" align="left" /></a>
Expand All @@ -18,7 +18,7 @@
## Quick start

```sh
git clone https://github.com/wappalyzer/wappalyzer.git
git clone https://github.com/HTTPArchive/wappalyzer.git
cd wappalyzer
yarn install
```
Expand All @@ -27,7 +27,7 @@ yarn install

### Chrome extension

- Go to `about:extensions`
- Go to `chrome:extensions`
- Enable 'Developer mode'
- Click 'Load unpacked'
- Select `src`
Expand All @@ -42,9 +42,9 @@ yarn install

A long list of [regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) is used to identify technologies on web pages. Wappalyzer inspects HTML code, as well as JavaScript variables, response headers and more.

Patterns (regular expressions) are kept in [`src/technologies/`](https://github.com/wappalyzer/wappalyzer/blob/master/src/technologies). The following is an example of an application fingerprint.
Patterns (regular expressions) are kept in [`src/technologies/`](https://github.com/HTTPArchive/wappalyzer/tree/main/src/technologies). The following is an example of an application fingerprint.

#### Example
### Example

```json
"Example": {
Expand Down Expand Up @@ -104,7 +104,7 @@ Patterns (regular expressions) are kept in [`src/technologies/`](https://github.

## JSON fields

Find the JSON schema at [`schema.json`](https://github.com/wappalyzer/wappalyzer/blob/master/schema.json).
Find the JSON schema at [`schema.json`](https://github.com/HTTPArchive/wappalyzer/blob/main/schema.json).

### Required properties

Expand Down
2 changes: 1 addition & 1 deletion src/technologies/e.json
Original file line number Diff line number Diff line change
Expand Up @@ -2299,4 +2299,4 @@
},
"website": "https://experiencedcms.berkearas.de"
}
}
}
2 changes: 1 addition & 1 deletion src/technologies/j.json
Original file line number Diff line number Diff line change
Expand Up @@ -1012,4 +1012,4 @@
"website": "https://www.jsdelivr.com/",
"xhr": "cdn\\.jsdelivr\\.net"
}
}
}
1 change: 1 addition & 0 deletions src/technologies/p.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@
],
"css": "--made-with-panda",
"description": "Panda is a styling engine that generates styling primitives to author atomic CSS and recipes in a type-safe and readable manner.",
"icon": "PandaCSS.svg",
"oss": true,
"website": "https://panda-css.com/"
},
Expand Down
19 changes: 17 additions & 2 deletions tests/unit-tests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,26 @@ const assert = require('assert')
const { runWPTTest } = require('./wpt.js')
const testWebsite = 'https://almanac.httparchive.org/en/2022/'

let responseData
let responseData, firstView
beforeAll(async () => {
responseData = await runWPTTest(testWebsite)
firstView = responseData.runs['1'].firstView
}, 400000)

test('wappalyzer successful', () => {
assert.ok(responseData.runs['1'].firstView.wappalyzer_failed === 0)
assert(
firstView.wappalyzer_failed === undefined,
'wappalyzer_failed key is present'
)
assert(
typeof firstView.detected === 'object' &&
typeof firstView.detected_apps === 'object' &&
typeof firstView.detected_technologies === 'object' &&
typeof firstView.detected_raw === 'object',
'not all technology lists are present'
)
assert(
firstView.detected_raw.length > 1,
'number of technologies detected <=1'
)
})
8 changes: 4 additions & 4 deletions tests/wpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const wpt = new WebPageTest(wptServer, wptApiKey)
* Runs a WebPageTest (WPT) test for a given URL.
*
* @param {string} url - The URL to run the test on.
* @returns {Promise<object>} A promise that resolves with an object containing the custom metrics.
* @returns {Promise<object>} A promise that resolves with a test result JSON.
* @throws {Error} If the test run fails or the response status code is not 200.
*/
function runWPTTest(url) {
Expand All @@ -35,10 +35,10 @@ function runWPTTest(url) {
fs.appendFileSync(
'test-results.md',
'<details>\n' +
`<summary><strong>Custom metrics for ${url}</strong></summary>\n\n` +
`WPT test run results: ${response.data.summary}\n` +
`<summary><strong>WPT test run for ${url}</strong></summary>\n\n` +
`Results: ${response.data.summary}\n` +
(isDirectRun
? 'Changed custom metrics values:\n' +
? 'Detected technologies:\n' +
`\`\`\`json\n${JSON.stringify(technologies, null, 4)}\n\`\`\`\n`
: '') +
'</details>\n'
Expand Down