2
0
mirror of https://github.com/gchq/CyberChef synced 2025-12-19 17:53:34 +00:00

Compare commits

..

5 Commits

Author SHA1 Message Date
n1474335
13e9a4f0da 9.11.8 2019-11-27 12:36:18 +00:00
n1474335
33471a33d6 Merge branch 'fjh1997-master' 2019-11-27 12:36:13 +00:00
fjh1997
d16bbe1e7e Fixed typo in IPV6 alphabet
According to python3 base64.b85decode module https://github.com/python/cpython/blob/3.8/Lib/base64.py
2019-11-24 22:03:37 +08:00
n1474335
610d46a1a4 9.11.7 2019-11-21 14:21:20 +00:00
n1474335
f7acef4642 Fixed module detection issue. Closes #881 2019-11-21 14:13:36 +00:00
4 changed files with 71 additions and 49 deletions

View File

@@ -26,7 +26,7 @@ module.exports = function (grunt) {
grunt.registerTask("prod", grunt.registerTask("prod",
"Creates a production-ready build. Use the --msg flag to add a compile message.", "Creates a production-ready build. Use the --msg flag to add a compile message.",
[ [
"eslint", "clean:prod", "clean:config", "exec:generateConfig", "webpack:web", "eslint", "clean:prod", "clean:config", "exec:generateConfig", "findModules", "webpack:web",
"copy:standalone", "zip:standalone", "clean:standalone", "chmod" "copy:standalone", "zip:standalone", "clean:standalone", "chmod"
]); ]);
@@ -58,6 +58,19 @@ module.exports = function (grunt) {
grunt.registerTask("tests", "test"); grunt.registerTask("tests", "test");
grunt.registerTask("lint", "eslint"); grunt.registerTask("lint", "eslint");
grunt.registerTask("findModules",
"Finds all generated modules and updates the entry point list for Webpack",
function(arg1, arg2) {
const moduleEntryPoints = listEntryModules();
grunt.log.writeln(`Found ${Object.keys(moduleEntryPoints).length} modules.`);
grunt.config.set("webpack.web.entry",
Object.assign({
main: "./src/web/index.js"
}, moduleEntryPoints));
});
// Load tasks provided by each plugin // Load tasks provided by each plugin
grunt.loadNpmTasks("grunt-eslint"); grunt.loadNpmTasks("grunt-eslint");
@@ -83,7 +96,53 @@ module.exports = function (grunt) {
PKG_VERSION: JSON.stringify(pkg.version), PKG_VERSION: JSON.stringify(pkg.version),
}, },
moduleEntryPoints = listEntryModules(), moduleEntryPoints = listEntryModules(),
nodeConsumerTestPath = "~/tmp-cyberchef"; nodeConsumerTestPath = "~/tmp-cyberchef",
/**
* Configuration for Webpack production build. Defined as a function so that it
* can be recalculated when new modules are generated.
*/
webpackProdConf = () => {
return {
mode: "production",
target: "web",
entry: Object.assign({
main: "./src/web/index.js"
}, moduleEntryPoints),
output: {
path: __dirname + "/build/prod",
filename: chunkData => {
return chunkData.chunk.name === "main" ? "assets/[name].js": "[name].js";
},
globalObject: "this"
},
resolve: {
alias: {
"./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
}
},
plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS),
new HtmlWebpackPlugin({
filename: "index.html",
template: "./src/web/html/index.html",
chunks: ["main"],
compileTime: compileTime,
version: pkg.version,
minify: {
removeComments: true,
collapseWhitespace: true,
minifyJS: true,
minifyCSS: true
}
}),
new BundleAnalyzerPlugin({
analyzerMode: "static",
reportFilename: "BundleAnalyzerReport.html",
openAnalyzer: false
}),
]
};
};
/** /**
@@ -154,48 +213,7 @@ module.exports = function (grunt) {
}, },
webpack: { webpack: {
options: webpackConfig, options: webpackConfig,
web: () => { web: webpackProdConf(),
return {
mode: "production",
target: "web",
entry: Object.assign({
main: "./src/web/index.js"
}, moduleEntryPoints),
output: {
path: __dirname + "/build/prod",
filename: chunkData => {
return chunkData.chunk.name === "main" ? "assets/[name].js": "[name].js";
},
globalObject: "this"
},
resolve: {
alias: {
"./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
}
},
plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS),
new HtmlWebpackPlugin({
filename: "index.html",
template: "./src/web/html/index.html",
chunks: ["main"],
compileTime: compileTime,
version: pkg.version,
minify: {
removeComments: true,
collapseWhitespace: true,
minifyJS: true,
minifyCSS: true
}
}),
new BundleAnalyzerPlugin({
analyzerMode: "static",
reportFilename: "BundleAnalyzerReport.html",
openAnalyzer: false
}),
]
};
},
}, },
"webpack-dev-server": { "webpack-dev-server": {
options: { options: {
@@ -345,7 +363,8 @@ module.exports = function (grunt) {
command: "git gc --prune=now --aggressive" command: "git gc --prune=now --aggressive"
}, },
sitemap: { sitemap: {
command: "node --experimental-modules --no-warnings --no-deprecation src/web/static/sitemap.mjs > build/prod/sitemap.xml" command: "node --experimental-modules --no-warnings --no-deprecation src/web/static/sitemap.mjs > build/prod/sitemap.xml",
sync: true
}, },
generateConfig: { generateConfig: {
command: chainCommands([ command: chainCommands([
@@ -354,7 +373,8 @@ module.exports = function (grunt) {
"node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateOpsIndex.mjs", "node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateOpsIndex.mjs",
"node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateConfig.mjs", "node --experimental-modules --no-warnings --no-deprecation src/core/config/scripts/generateConfig.mjs",
"echo '--- Config scripts finished. ---\n'" "echo '--- Config scripts finished. ---\n'"
]) ]),
sync: true
}, },
generateNodeIndex: { generateNodeIndex: {
command: chainCommands([ command: chainCommands([
@@ -362,6 +382,7 @@ module.exports = function (grunt) {
"node --experimental-modules --no-warnings --no-deprecation src/node/config/scripts/generateNodeIndex.mjs", "node --experimental-modules --no-warnings --no-deprecation src/node/config/scripts/generateNodeIndex.mjs",
"echo '--- Node index generated. ---\n'" "echo '--- Node index generated. ---\n'"
]), ]),
sync: true
}, },
opTests: { opTests: {
command: "node --experimental-modules --no-warnings --no-deprecation tests/operations/index.mjs" command: "node --experimental-modules --no-warnings --no-deprecation tests/operations/index.mjs"
@@ -381,6 +402,7 @@ module.exports = function (grunt) {
`cd ${nodeConsumerTestPath}`, `cd ${nodeConsumerTestPath}`,
"npm link cyberchef" "npm link cyberchef"
]), ]),
sync: true
}, },
teardownNodeConsumers: { teardownNodeConsumers: {
command: chainCommands([ command: chainCommands([

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "cyberchef", "name": "cyberchef",
"version": "9.11.6", "version": "9.11.8",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "cyberchef", "name": "cyberchef",
"version": "9.11.6", "version": "9.11.8",
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.", "description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
"author": "n1474335 <n1474335@gmail.com>", "author": "n1474335 <n1474335@gmail.com>",
"homepage": "https://gchq.github.io/CyberChef", "homepage": "https://gchq.github.io/CyberChef",

View File

@@ -20,7 +20,7 @@ export const ALPHABET_OPTIONS = [
}, },
{ {
name: "IPv6", name: "IPv6",
value: "0-9A-Za-z!#$%&()*+\\-;<=>?@^_`{|~}", value: "0-9A-Za-z!#$%&()*+\\-;<=>?@^_`{|}~",
} }
]; ];