Vagrant + Docker development environment

main
Elbert Alias 10 years ago
parent f08a5dde4d
commit c73cd005b4

6
.gitignore vendored

@ -1,9 +1,7 @@
wappalyzer-chrome.zip
wappalyzer-firefox.xpi
wappalyzer.xpi
!.gitkeep
.vagrant
node_modules/*
drivers/npm/node_modules/

20
Vagrantfile vendored

@ -0,0 +1,20 @@
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'
SYNCED_FOLDER = "/home/wappalyzer/synced"
Vagrant.configure("2") do |config|
config.vm.synced_folder ".", SYNCED_FOLDER
config.vm.provider "docker" do |d|
d.image = "wappalyzer/dev"
d.has_ssh = true
d.remains_running = true
end
config.ssh.port = "22"
config.ssh.username = "wappalyzer"
config.ssh.private_key_path = "docker/insecure.key"
config.vm.provision "shell", path: "bin/links"
config.vm.provision "shell", inline: "echo Finished"
end

@ -0,0 +1,35 @@
#!/bin/sh
dir="/home/wappalyzer/synced/src"
ln -f $dir/wappalyzer.js $dir/drivers/firefox/lib
ln -f $dir/apps.json $dir/drivers/firefox/data
ln -f $dir/icons/*.png $dir/drivers/firefox/data/images/icons
ln -f $dir/wappalyzer.js $dir/drivers/chrome/js
ln -f $dir/apps.json $dir/drivers/chrome
ln -f $dir/icons/*.png $dir/drivers/chrome/images/icons
ln -f $dir/wappalyzer.js $dir/drivers/bookmarklet/js
ln -f $dir/icons/*.png $dir/drivers/bookmarklet/images/icons
ln -f $dir/wappalyzer.js $dir/drivers/html/js
ln -f $dir/apps.json $dir/drivers/html
ln -f $dir/icons/*.png $dir/drivers/html/images/icons
ln -f $dir/wappalyzer.js $dir/drivers/php/js
ln -f $dir/apps.json $dir/drivers/php
ln -f $dir/wappalyzer.js $dir/drivers/python/js
ln -f $dir/apps.json $dir/drivers/python
ln -f $dir/wappalyzer.js $dir/drivers/phantomjs/js
ln -f $dir/apps.json $dir/drivers/phantomjs
ln -f $dir/wappalyzer.js $dir/drivers/ruby/js
ln -f $dir/apps.json $dir/drivers/ruby
ln -f $dir/wappalyzer.js $dir/drivers/npm
ln -f $dir/apps.json $dir/drivers/npm
echo "Hard links created"

@ -0,0 +1,44 @@
FROM phusion/baseimage
MAINTAINER Elbert Alias <elbert@alias.io>
ENV DEBIAN_FRONTEND noninteractive
# Install packages
RUN apt-get update && apt-get install -y nodejs npm
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN ln -s /usr/bin/nodejs /usr/bin/node
RUN npm install jsonlint -g
# Add user
RUN useradd -ms /bin/bash wappalyzer && echo "wappalyzer:wappalyzer" | chpasswd
RUN echo 'wappalyzer ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
WORKDIR /home/wappalyzer
RUN su wappalyzer -c "mkdir -p synced"
RUN echo "cd /home/wappalyzer/synced" >> .bashrc
RUN echo "export PATH=$PATH:/home/wappalyzer/synced/bin" >> .bashrc
# SSH
RUN rm -f /etc/service/sshd/down
RUN su wappalyzer -c "mkdir .ssh && chmod 700 .ssh"
ADD insecure.key.pub /tmp/insecure.key.pub
RUN su wappalyzer -c "cat /tmp/insecure.key.pub >> .ssh/authorized_keys && chmod 600 .ssh/authorized_keys" && rm -f /tmp/insecure.key.pub
# Fix the `stdin: is not a tty` error in Vagrant
RUN sed -i 's/^mesg n$/tty -s \&\& mesg n/g' /root/.profile
EXPOSE 22
RUN echo "/usr/sbin/sshd -D" > /etc/my_init.d/sshd.sh
CMD ["/sbin/my_init"]

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAqVo54bv3J4K62IDCUIVY7gF2iBOR8fub5c9t6j4MbsRQDmU0
yxhN1+7fMCERcoMSelAb/SYSzKE8azLugP7hsq4t+/xJijCB22uriFhKMpu4ySoA
6PVNbfbIptaVo6holVIMRKPXTg1hU6lr2DWMKB5AlGmz7ZHmQgX9iBoV8PmMYOF5
UpiwfokcNnIwDiCCpd19G/lT6FlCVZHZdeZh41FWke8oQgWevM8fdGJkZ+a7Lgdm
6A3WlvI0AIz9KWfXlXAOvthi4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PChFuDk1Z
L5lAB7g0ALFKSJepcfpeJdlX+QEcBRPIlc69x/zamRgGb16RXA6EmP8xVMhP/h7e
ZsYxIQKBgBqOaZNHwaG6PqP2HCjc1keH4wQVx9eTV5y4/B5FJbMeK05vV2rBHoxA
P/dXE85olj8D/9E88xJ1V716kBeONcKFdbd3VfY5bo2VBz+piOaG3EBQOLIbd4/C
KVtgOWqI7WTLPIgpXlG5MA801RwhVyk1phmwhvW/Kb3lWsK1vkOe
-----END RSA PRIVATE KEY-----

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCpWjnhu/cngrrYgMJQhVjuAXaIE5Hx+5vlz23qPgxuxFAOZTTLGE3X7t8wIRFygxJ6UBv9JhLMoTxrMu6A/uGyri37/EmKMIHba6uIWEoym7jJKgDo9U1t9sim1pWjqGiVUgxEo9dODWFTqWvYNYwoHkCUabPtkeZCBf2IGhXw+Yxg4XlSmLB+iRw2cjAOIIKl3X0b+VPoWUJVkdl15mHjUVaR7yhCBZ68zx90YmRn5rsuB2boDdaW8jQAjP0pZ9eVcA6+2GLhCUHhK9ILBFBsp0dtblQFFKG5yOVx7eFk71DpE4JNrXOC+xyV4p3rfIdJDXxnb6PW3lPccnOE6fXL elbert@home

@ -1,122 +0,0 @@
:: Copyright (c) 2012 q-- <https://github.com/q-->
::
:: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
::
:: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
::
:: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
:: ln == mklink /h
:: hard link folders (dir junction) = mklink /j dir1 dir2
:: hard link files = mklink /h
:: ln -f for folder: if exist FOLDER_TO_REPLACE_WITH_LINK rmdir /s FOLDER_TO_REPLACE_WITH_LINK&&mklink /j FOLDER_TO_REPLACE_WITH_LINK FOLDER_TO_LINK_TO
:: ln -f for file: if exist FILE_TO_REPLACE_WITH_LINK del FILE_TO_REPLACE_WITH_LINK&&mklink /h FILE_TO_REPLACE_WITH_LINK FILE_TO_LINK_TO
:: FIREFOX SKD
::
::Sync icons folder
::ln -f share\images\icons drivers\firefox\images\icons
if exist drivers\firefox\images\icons rmdir /q /s drivers\firefox\images\icons
mklink /j drivers\firefox\images\icons share\images\icons
::Sync apps JSON
::ln -f share\apps.json drivers\firefox\data
if exist drivers\firefox\data\apps.json del drivers\firefox\data\apps.json
mklink /h drivers\firefox\data\apps.json share\apps.json
::Sync Wappalyzer.js
::ln -f share\js\wappalyzer.js drivers\firefox\lib
if exist drivers\firefox\lib\wappalyzer.js del drivers\firefox\lib\wappalyzer.js
mklink /h drivers\firefox\lib\wappalyzer.js share\js\wappalyzer.js
:: CHROME EXTENSION
::
::Sync icons folder
::ln -f share\images\icons drivers\chrome\images\icons
if exist drivers\chrome\images\icons rmdir /q /s drivers\chrome\images\icons
mklink /j drivers\chrome\images\icons share\images\icons
::Sync apps JSON
::ln -f share\apps.json drivers\chrome
if exist drivers\chrome\apps.json del drivers\chrome\apps.json
mklink /h drivers\chrome\apps.json share\apps.json
::Sync Wappalyzer.js
::ln -f share\js\wappalyzer.js drivers\chrome\js
if exist drivers\chrome\js\wappalyzer.js del drivers\chrome\js\wappalyzer.js
mklink /h drivers\chrome\js\wappalyzer.js share\js\wappalyzer.js
:: BOOKMARKLET
::
::Sync icons folder
::ln -f share\images\icons drivers\bookmarklet\images\icons
if exist drivers\bookmarklet\images\icons rmdir /q /s drivers\bookmarklet\images\icons
mklink /j drivers\bookmarklet\images\icons share\images\icons
::Sync Wappalyzer.js
::ln -f share\js\wappalyzer.js drivers\bookmarklet\js
if exist drivers\bookmarklet\js\wappalyzer.js del drivers\bookmarklet\js\wappalyzer.js
mklink /h drivers\bookmarklet\js\wappalyzer.js share\js\wappalyzer.js
:: HTML DRIVER
::
::Sync icons folder
::ln -f share\images\icons drivers\html\images\icons
if exist drivers\html\images\icons rmdir /q /s drivers\html\images\icons
mklink /j drivers\html\images\icons share\images\icons
::Sync apps JSON
::ln -f share\apps.json drivers\html
if exist drivers\html\apps.json del drivers\html\apps.json
mklink /h drivers\html\apps.json share\apps.json
::Sync Wappalyzer.js
::ln -f share\js\wappalyzer.js drivers\html\js
if exist drivers\html\js\wappalyzer.js del drivers\html\js\wappalyzer.js
mklink /h drivers\html\js\wappalyzer.js share\js\wappalyzer.js
:: PHP DRIVER
::
::Sync apps JSON
if exist drivers\php\apps.json del drivers\php\apps.json
mklink /h drivers\php\apps.json share\apps.json
::Sync Wappalyzer.js
if exist drivers\php\js\wappalyzer.js del drivers\php\js\wappalyzer.js
mklink /h drivers\php\js\wappalyzer.js share\js\wappalyzer.js
:: Ruby DRIVER
::
::Sync apps JSON
if exist drivers\ruby\apps.json del drivers\ruby\apps.json
mklink /h drivers\ruby\apps.json share\apps.json
::Sync Wappalyzer.js
if exist drivers\ruby\js\wappalyzer.js del drivers\ruby\js\wappalyzer.js
mklink /h drivers\ruby\js\wappalyzer.js share\js\wappalyzer.js
:: PhantomJS driver
if exist drivers\phantomjs\apps.json del drivers\phantomjs\apps.json
mklink /h drivers\phantomjs\apps.json share\apps.json
if exist drivers\phantomjs\js\wappalyzer.js del drivers\phantomjs\js\wappalyzer.js
mklink /h drivers\phantomjs\js\wappalyzer.js share\js\wappalyzer.js
:: NPM Module
if exist drivers\npm\apps.json del drivers\npm\apps.json
mklink /h drivers\npm\apps.json share\apps.json
if exist drivers\npm\wappalyzer.js del drivers\npm\wappalyzer.npm
mklink /h drivers\npm\wappalyzer.js share\wappalyzer.js

@ -1,31 +0,0 @@
#!/bin/sh
ln -f share/images/icons/*.png drivers/firefox/data/images/icons
ln -f share/apps.json drivers/firefox/data
ln -f share/js/wappalyzer.js drivers/firefox/lib
ln -f share/images/icons/*.png drivers/chrome/images/icons
ln -f share/apps.json drivers/chrome
ln -f share/js/wappalyzer.js drivers/chrome/js
ln -f share/images/icons/*.png drivers/bookmarklet/images/icons
ln -f share/js/wappalyzer.js drivers/bookmarklet/js
ln -f share/images/icons/*.png drivers/html/images/icons
ln -f share/apps.json drivers/html
ln -f share/js/wappalyzer.js drivers/html/js
ln -f share/apps.json drivers/php
ln -f share/js/wappalyzer.js drivers/php/js
ln -f share/apps.json drivers/python
ln -f share/js/wappalyzer.js drivers/python/js
ln -f share/apps.json drivers/phantomjs
ln -f share/js/wappalyzer.js drivers/phantomjs/js
ln -f share/apps.json drivers/ruby
ln -f share/js/wappalyzer.js drivers/ruby/js
ln -f share/apps.json drivers/npm
ln -f share/js/wappalyzer.js drivers/npm

@ -1,61 +0,0 @@
:: package.cmd
:: Copyright (c) 2012-2014 q-- <https://github.com/q-->
::
:: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
::
:: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
::
:: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@echo off
::Links
call links.cmd
::Remove old packages
if exist wappalyzer-chrome.zip del wappalyzer-chrome.zip
if exist wappalyzer-firefox.xpi del wappalyzer-firefox.xpi
::Check if where.exe is present
where.exe /Q cmd.exe
IF NOT %ERRORLEVEL%==0 GOTO noWhere
::Check for 7-Zip
where.exe 7z.exe
IF %ERRORLEVEL%==0 GOTO sevenZipIsInPath
::Ok, WHERE can't find 7-Zip. Check at the default install location
IF EXIST "C:\Program Files\7-zip\7z.exe" (
set zip="C:\Program Files\7-zip\7z.exe"
GOTO Package
) ELSE (
echo.7-Zip was not found.
echo.Please download 7-Zip from http://7-zip.org/ and add 7z.exe ^(the command-line edition^) to PATH.
pause
goto :end
)
::WHERE command isn't found. Try it anyway.
::(WHERE is present by default in Vista and newer, older Windows versions require that you install it yourself.)
:noWhere
echo.WHERE.exe was not found on your system.
echo.If the script fails, please download 7-Zip from http://7-zip.org/ and add 7z.exe (the command-line edition) to PATH.
::7-Zip command line is found in PATH
:sevenZipIsInPath
set zip=7z.exe
:Package
::Pack Chrome extension
cd drivers\chrome&&%zip% a -tzip -mx9 ..\..\wappalyzer-chrome.zip *
cd..\..
::Pack Firefox extension
::cd drivers\firefox&&%zip% a -tzip -mx9 ..\..\wappalyzer-firefox.xpi *
::cd..\..
:end
@echo on

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 281 B

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 665 B

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 634 B

After

Width:  |  Height:  |  Size: 634 B

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 373 B

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Before

Width:  |  Height:  |  Size: 613 B

After

Width:  |  Height:  |  Size: 613 B

Before

Width:  |  Height:  |  Size: 634 B

After

Width:  |  Height:  |  Size: 634 B

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Some files were not shown because too many files have changed in this diff Show More