diff --git a/.gitignore b/.gitignore index af6546711..19de018bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,11 @@ .vagrant build/* - -drivers/npm/node_modules -drivers/npm/npm-debug.log - src/icons/converted/* -package.json -node_modules/ +node_modules npm-debug.log -Thumbs.db -ehthumbs.db -Desktop.ini -$RECYCLE.BIN/ +tags !.gitkeep diff --git a/bin/wappalyzer-build b/bin/wappalyzer-build index 24e0f788c..6a18d6bb6 100755 --- a/bin/wappalyzer-build +++ b/bin/wappalyzer-build @@ -24,7 +24,7 @@ node $WAPPALYZER_NODE_PATH/node_modules/jsonlint/lib/cli.js -ist $'\t' $WAPPALYZ echo "Compressing PNG and SVG icons..." -node $WAPPALYZER_NODE_PATH/node_modules/imagemin-cli/cli.js $WAPPALYZER_ROOT/src/icons/* $WAPPALYZER_ROOT/src/icons +node $WAPPALYZER_NODE_PATH/node_modules/imagemin-cli/cli.js $WAPPALYZER_ROOT/src/icons/* --out-dir $WAPPALYZER_ROOT/src/icons 2>&1 > /dev/null echo "Converting SVG icons to PNG..." @@ -50,10 +50,6 @@ node $WAPPALYZER_NODE_PATH/node_modules/imagemin-cli/cli.js $WAPPALYZER_ROOT/src wappalyzer links -# Npm Module -mkdir -p $WAPPALYZER_ROOT/build/wappalyzer_npm/ -cp -R $WAPPALYZER_ROOT/src/drivers/npm/* $WAPPALYZER_ROOT/build/wappalyzer_npm/ - # Mozilla Firefox echo "Building Firefox driver..." @@ -70,17 +66,13 @@ pushd $WAPPALYZER_ROOT/src/drivers/chrome > /dev/null zip -qr $WAPPALYZER_ROOT/build/wappalyzer_chrome.zip . -popd > /dev/null - -# Bookmarklet -echo "Building Bookmarklet driver..." - -echo "var json =" > /tmp/bookmarklet +# Google Chrome +echo "Building WebExtension driver..." -cat $WAPPALYZER_ROOT/src/apps.json >> /tmp/bookmarklet +pushd $WAPPALYZER_ROOT/src/drivers/webextension > /dev/null -echo -e ";\n\nwappalyzer.apps = json.apps;\nwappalyzer.categories = json.categories;" >> /tmp/bookmarklet +zip -qr $WAPPALYZER_ROOT/build/wappalyzer_webextension.zip . -mv /tmp/bookmarklet $WAPPALYZER_ROOT/src/drivers/bookmarklet/js/apps.js +popd > /dev/null echo "Done. Builds have been created in $WAPPALYZER_ROOT/build." diff --git a/bin/wappalyzer-links b/bin/wappalyzer-links index 1d033d908..dbb52a483 100755 --- a/bin/wappalyzer-links +++ b/bin/wappalyzer-links @@ -27,44 +27,34 @@ path="$path/src" echo "Creating hard links..." -ln -f $path/wappalyzer.js $path/drivers/firefox/lib -ln -f $path/apps.json $path/drivers/firefox/data -ln -f $path/icons/*.png $path/drivers/firefox/data/images/icons -ln -f $path/icons/*.svg $path/drivers/firefox/data/images/icons -ln -f $path/utils/*.js $path/drivers/firefox/data/js +ln -f $path/wappalyzer.js $path/drivers/phantomjs +ln -f $path/apps.json $path/drivers/phantomjs + +ln -f $path/wappalyzer.js $path/drivers/firefox +ln -f $path/apps.json $path/drivers/firefox/data +ln -f $path/icons/*.png $path/drivers/firefox/data/images/icons +ln -f $path/icons/*.svg $path/drivers/firefox/data/images/icons +ln -f $path/utils/iframe.js $path/drivers/firefox/data/js ln -f $path/wappalyzer.js $path/drivers/chrome/js ln -f $path/apps.json $path/drivers/chrome ln -f $path/icons/*.png $path/drivers/chrome/images/icons +ln -f $path/icons/*.svg $path/drivers/chrome/images/icons ln -f $path/utils/*.js $path/drivers/chrome/js -if [ compgen -G "$path/icons/converted/*.png" > /dev/null ]; then +if [ "$(compgen -G "$path/icons/converted/*.png" | head -n1)" ]; then ln -f $path/icons/converted/*.png $path/drivers/chrome/images/icons/converted fi -ln -f $path/wappalyzer.js $path/drivers/bookmarklet/js -ln -f $path/icons/*.png $path/drivers/bookmarklet/images/icons -ln -f $path/icons/*.svg $path/drivers/bookmarklet/images/icons - -ln -f $path/wappalyzer.js $path/drivers/html/js -ln -f $path/apps.json $path/drivers/html -ln -f $path/icons/*.png $path/drivers/html/images/icons -ln -f $path/icons/*.svg $path/drivers/html/images/icons - -ln -f $path/wappalyzer.js $path/drivers/php/js -ln -f $path/apps.json $path/drivers/php - -ln -f $path/wappalyzer.js $path/drivers/python/js -ln -f $path/apps.json $path/drivers/python +ln -f $path/wappalyzer.js $path/drivers/webextension/js +ln -f $path/apps.json $path/drivers/webextension +ln -f $path/icons/*.png $path/drivers/webextension/images/icons +ln -f $path/icons/*.svg $path/drivers/webextension/images/icons +ln -f $path/utils/*.js $path/drivers/webextension/js -ln -f $path/wappalyzer.js $path/drivers/phantomjs -ln -f $path/apps.json $path/drivers/phantomjs - -ln -f $path/wappalyzer.js $path/drivers/ruby/js -ln -f $path/apps.json $path/drivers/ruby - -ln -f $path/wappalyzer.js $path/drivers/npm -ln -f $path/apps.json $path/drivers/npm +if [ "$(compgen -G "$path/icons/converted/*.png" | head -n1)" ]; then + ln -f $path/icons/converted/*.png $path/drivers/webextension/images/icons/converted +fi echo "OK" diff --git a/bin/wappalyzer-validate b/bin/wappalyzer-validate index d9d09a617..0106c4d18 100755 --- a/bin/wappalyzer-validate +++ b/bin/wappalyzer-validate @@ -1,23 +1,20 @@ #!/bin/bash -path=$1 +path="$1" -if [ -z $path ] -then - if [ -z $WAPPALYZER_ROOT ] - then +if [ -z "$path" ]; then + if [ -z "$WAPPALYZER_ROOT" ]; then echo "-$(basename $0): No path specified" exit 1 fi - path=$WAPPALYZER_ROOT + path="$WAPPALYZER_ROOT" fi set -eu -if [ ! -d $path/src ] -then +if [ ! -d "$path/src" ]; then echo "-$(basename $0): Incorrect path" exit 1 @@ -27,7 +24,7 @@ path="$path/src" echo "Validating apps.json..." -node $WAPPALYZER_NODE_PATH/node_modules/jsonlint/lib/cli.js --quiet -V $WAPPALYZER_ROOT/schema.json $path/apps.json +node "$WAPPALYZER_NODE_PATH/node_modules/jsonlint/lib/cli.js" --quiet -V "$WAPPALYZER_ROOT/schema.json" "$path/apps.json" echo "Validating regular expressions..." diff --git a/bin/wappalyzer-validate-regex b/bin/wappalyzer-validate-regex index 36012c57a..f7976c116 100755 --- a/bin/wappalyzer-validate-regex +++ b/bin/wappalyzer-validate-regex @@ -80,7 +80,7 @@ for ( app in json.apps ) { } }); - if ( /[a-z]+:\/\//i.test(json.apps[app].website) ) { - throw new Error('Do not include the protocol in the website URL\n' + app + ': ' + json.apps[app].website); + if ( !/^https?:\/\//i.test(json.apps[app].website) ) { + throw new Error('Invalid website URL\n' + app + ': ' + json.apps[app].website); } } diff --git a/docker/Dockerfile b/docker/Dockerfile index e4834db06..ec435c0bd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,9 +8,10 @@ ENV WAPPALYZER_ROOT /home/wappalyzer/synced ENV WAPPALYZER_NODE_PATH /home/wappalyzer/node # Install packages -RUN apt-get update && apt-get install -y sudo curl bzip2 zip libfreetype6 libfontconfig +RUN sed -i 's/archive\.ubuntu\.com/au.archive.ubuntu.com/g' /etc/apt/sources.list +RUN apt-get update && apt-get install -y sudo curl RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - -RUN apt-get install -y nodejs +RUN apt-get install -y nodejs bzip2 zip libfreetype6 libfontconfig rsync RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -39,7 +40,6 @@ RUN su wappalyzer -c "mkdir $WAPPALYZER_NODE_PATH" ADD node/package.json $WAPPALYZER_NODE_PATH/package.json -RUN ln -s -f /usr/local/bin/npm /usr/bin/npm RUN su wappalyzer -c "cd $WAPPALYZER_NODE_PATH && npm i" diff --git a/src/apps.json b/src/apps.json index d934d779e..975530295 100755 --- a/src/apps.json +++ b/src/apps.json @@ -7,7 +7,7 @@ "icon": "1and1.svg", "implies": "PHP", "url": "/shop/catalog/browse\\?sessid=", - "website": "1and1.com" + "website": "http://1and1.com" }, "1C-Bitrix": { "cats": [ @@ -21,7 +21,7 @@ "icon": "1C-Bitrix.png", "implies": "PHP", "script": "1c-bitrix", - "website": "www.1c-bitrix.ru" + "website": "http://www.1c-bitrix.ru" }, "2z Project": { "cats": [ @@ -31,7 +31,7 @@ "meta": { "generator": "2z project ([\\d.]+)\\;version:\\1" }, - "website": "2zproject-cms.ru" + "website": "http://2zproject-cms.ru" }, "3DM": { "cats": [ @@ -40,7 +40,7 @@ "html": "
- Drag this button to your bookmarks toolbar: -
- -- Wappalyzer -
- - - - - -