2017-01-08 20:35:08 +00:00
|
|
|
/*
|
|
|
|
* gulpfile.js
|
|
|
|
*
|
|
|
|
* Description: The Gophish gulpfile
|
|
|
|
*/
|
|
|
|
|
|
|
|
var gulp = require('gulp'),
|
|
|
|
rename = require('gulp-rename'),
|
|
|
|
concat = require('gulp-concat'),
|
|
|
|
uglify = require('gulp-uglify'),
|
|
|
|
cleanCSS = require('gulp-clean-css'),
|
|
|
|
|
|
|
|
js_directory = 'static/js/src/',
|
|
|
|
css_directory = 'static/css/',
|
|
|
|
vendor_directory = js_directory + 'vendor/',
|
|
|
|
app_directory = js_directory + 'app/**/*.js',
|
|
|
|
dest_js_directory = 'static/js/dist/',
|
|
|
|
dest_css_directory = 'static/css/dist/';
|
|
|
|
|
2019-04-21 21:34:52 +00:00
|
|
|
vendorjs = function () {
|
2017-08-06 02:11:50 +00:00
|
|
|
return gulp.src([
|
2017-10-03 00:40:56 +00:00
|
|
|
vendor_directory + 'jquery.js',
|
|
|
|
vendor_directory + 'bootstrap.min.js',
|
|
|
|
vendor_directory + 'moment.min.js',
|
|
|
|
vendor_directory + 'papaparse.min.js',
|
|
|
|
vendor_directory + 'd3.min.js',
|
|
|
|
vendor_directory + 'topojson.min.js',
|
|
|
|
vendor_directory + 'datamaps.min.js',
|
|
|
|
vendor_directory + 'jquery.dataTables.min.js',
|
|
|
|
vendor_directory + 'dataTables.bootstrap.js',
|
|
|
|
vendor_directory + 'datetime-moment.js',
|
|
|
|
vendor_directory + 'jquery.ui.widget.js',
|
|
|
|
vendor_directory + 'jquery.fileupload.js',
|
|
|
|
vendor_directory + 'jquery.iframe-transport.js',
|
|
|
|
vendor_directory + 'sweetalert2.min.js',
|
|
|
|
vendor_directory + 'bootstrap-datetime.js',
|
|
|
|
vendor_directory + 'select2.min.js',
|
|
|
|
vendor_directory + 'core.min.js',
|
2018-06-13 01:37:09 +00:00
|
|
|
vendor_directory + 'highcharts.js',
|
|
|
|
vendor_directory + 'ua-parser.min.js'
|
2017-10-03 00:40:56 +00:00
|
|
|
])
|
2017-01-08 20:35:08 +00:00
|
|
|
.pipe(concat('vendor.js'))
|
|
|
|
.pipe(rename({
|
|
|
|
suffix: '.min'
|
|
|
|
}))
|
|
|
|
.pipe(uglify())
|
|
|
|
.pipe(gulp.dest(dest_js_directory));
|
2019-04-21 21:34:52 +00:00
|
|
|
}
|
2017-01-08 20:35:08 +00:00
|
|
|
|
2019-04-21 21:34:52 +00:00
|
|
|
scripts = function () {
|
2017-01-08 20:35:08 +00:00
|
|
|
// Gophish app files
|
2019-04-21 21:34:52 +00:00
|
|
|
return gulp.src(app_directory)
|
2017-01-08 20:35:08 +00:00
|
|
|
.pipe(rename({
|
|
|
|
suffix: '.min'
|
|
|
|
}))
|
2017-08-06 02:11:50 +00:00
|
|
|
.pipe(uglify().on('error', function (e) {
|
2017-06-19 16:15:28 +00:00
|
|
|
console.log(e);
|
|
|
|
}))
|
2017-01-08 20:35:08 +00:00
|
|
|
.pipe(gulp.dest(dest_js_directory + 'app/'));
|
2019-04-21 21:34:52 +00:00
|
|
|
}
|
2017-01-08 20:35:08 +00:00
|
|
|
|
2019-04-21 21:34:52 +00:00
|
|
|
styles = function () {
|
2017-01-08 20:35:08 +00:00
|
|
|
return gulp.src([
|
2017-10-03 00:40:56 +00:00
|
|
|
css_directory + 'bootstrap.min.css',
|
|
|
|
css_directory + 'main.css',
|
|
|
|
css_directory + 'dashboard.css',
|
|
|
|
css_directory + 'flat-ui.css',
|
|
|
|
css_directory + 'dataTables.bootstrap.css',
|
|
|
|
css_directory + 'font-awesome.min.css',
|
|
|
|
css_directory + 'chartist.min.css',
|
|
|
|
css_directory + 'bootstrap-datetime.css',
|
|
|
|
css_directory + 'checkbox.css',
|
|
|
|
css_directory + 'sweetalert2.min.css',
|
|
|
|
css_directory + 'select2.min.css',
|
|
|
|
css_directory + 'select2-bootstrap.min.css',
|
|
|
|
])
|
|
|
|
.pipe(cleanCSS({
|
|
|
|
compatibilty: 'ie9'
|
|
|
|
}))
|
2017-01-08 20:35:08 +00:00
|
|
|
.pipe(concat('gophish.css'))
|
|
|
|
.pipe(gulp.dest(dest_css_directory));
|
2019-04-21 21:34:52 +00:00
|
|
|
}
|
2017-08-06 02:11:50 +00:00
|
|
|
|
2019-04-21 21:34:52 +00:00
|
|
|
exports.vendorjs = vendorjs
|
|
|
|
exports.scripts = scripts
|
|
|
|
exports.styles = styles
|
|
|
|
exports.build = gulp.parallel(vendorjs, scripts, styles)
|
|
|
|
exports.default = exports.build
|