## This project uses GULP to obfuscate the javascript code. **DO NOT DEPLOY the unminified** versions of the js files (the ones without .min in the file extension)

### How to install required packages (gulp, javascript obfuscator...)?
* * *
Run the package.json file
* * *

### How to run the gulp default task?
* * *
First edit the "scripts" section to include the following code: 
```
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "gulp": "gulp"
  }
```
Add gulpfile.js to the project directory and run the following command:
```
npm run gulp
```
* * *
###How to edit the .htaccess?
***
The following code should be included in the .htaccess file 
```
# blocking for known crawlers
   RewriteEngine On
   RewriteCond %{HTTP_USER_AGENT} ^HTTrack [OR]
   RewriteCond %{HTTP_USER_AGENT} ^SiteSucker [OR]
   RewriteCond %{HTTP_USER_AGENT} ^WebZip [OR]
   RewriteCond %{HTTP_USER_AGENT} ^WebCopier [OR]
   RewriteCond %{HTTP_USER_AGENT} ^Zeus [OR]
   RewriteCond %{HTTP_USER_AGENT} ^Nikto [OR]
   RewriteCond %{HTTP_USER_AGENT} ^Dirbuster [OR]
   RewriteCond %{HTTP_USER_AGENT} ^SQLmap
   RewriteRule ^.*$ - [NC,F,L]
```
replace example1\.com with the current domain and use '|' for the following domains in the following code:
```   
#hotlink-protection
   RewriteEngine on
   RewriteCond %{HTTP_REFERER} !.*(example1\.com|example2\.com).*$ [OR]
   RewriteCond %{HTTP_REFERER} ^$
   RewriteRule \.(gif|jpg|jpeg|bmp|zip|rar|mp3|mp4|mov|webm|mkb|avi|flv|swf|xml|png|css|js|pdf)$ - [NC,F,L]
```
***

###How to add the image protection?
***
The following code adds the image as unique loader
```

```
copy the unique-loader.png image file in the images folder (or change the destination in the image variable in the gulpfile.js) and the javascript from CSSUniqueImage.js added somewhere in the code 
***

###!!!IMPORTANT!!!
***
Keep in mind that there is cache and the content might not be unavailable right away! 
***
### Notes
1. .min.js files are ignored by the task
2. The gulp task automatically adds CSSUniqueProperty.js file at the top of each js file before obfuscation
3. CSSUniqueImage.js can be found in the integration folder intgrtn/js/CSSUniqueImage.js