Skip to content

Commit 0a94c4a

Browse files
authored
Merge branch 'master' into master
2 parents 2c32a64 + 7c8be12 commit 0a94c4a

34 files changed

+4499
-538
lines changed

.github/workflows/releases.yml

+14-10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525

2626
- name: Install
2727
run: |
28+
export DETECT_CHROMEDRIVER_VERSION=true
2829
npm ci
2930
npm run setheapsize
3031
@@ -61,12 +62,22 @@ jobs:
6162
tags: ${{ steps.image-metadata.outputs.tags }}
6263
labels: ${{ steps.image-metadata.outputs.labels }}
6364
containerfiles: ./Dockerfile
64-
platforms: linux/amd64
65+
platforms: linux/amd64,linux/arm64
6566
oci: true
67+
# enable build layer caching between platforms
68+
layers: true
6669
# Webpack seems to use a lot of open files, increase the max open file limit to accomodate.
6770
extra-args: |
6871
--ulimit nofile=10000
6972
73+
- name: Publish to GHCR
74+
uses: redhat-actions/push-to-registry@v2
75+
with:
76+
image: ${{ steps.build-image.outputs.image }}
77+
tags: ${{ steps.build-image.outputs.tags }}
78+
registry: ${{ env.REGISTRY }}
79+
username: ${{ env.REGISTRY_USER }}
80+
password: ${{ env.REGISTRY_PASSWORD }}
7081

7182
- name: Upload Release Assets
7283
id: upload-release-assets
@@ -81,13 +92,6 @@ jobs:
8192

8293
- name: Publish to NPM
8394
uses: JS-DevTools/npm-publish@v1
95+
if: false
8496
with:
85-
token: ${{ secrets.NPM_TOKEN }}
86-
87-
- name: Publish to GHCR
88-
uses: redhat-actions/push-to-registry@v2
89-
with:
90-
tags: ${{ steps.build-image.outputs.tags }}
91-
registry: ${{ env.REGISTRY }}
92-
username: ${{ env.REGISTRY_USER }}
93-
password: ${{ env.REGISTRY_PASSWORD }}
97+
token: ${{ secrets.NPM_TOKEN }}

Dockerfile

+31-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
1-
FROM node:18-alpine AS build
1+
#####################################
2+
# Build the app to a static website #
3+
#####################################
4+
# Modifier --platform=$BUILDPLATFORM limits the platform to "BUILDPLATFORM" during buildx multi-platform builds
5+
# This is because npm "chromedriver" package is not compatiable with all platforms
6+
# For more info see: https://docs.docker.com/build/building/multi-platform/#cross-compilation
7+
FROM --platform=$BUILDPLATFORM node:18-alpine AS builder
28

9+
WORKDIR /app
10+
11+
COPY package.json .
12+
COPY package-lock.json .
13+
14+
# Install dependencies
15+
# --ignore-scripts prevents postinstall script (which runs grunt) as it depends on files other than package.json
16+
RUN npm ci --ignore-scripts
17+
18+
# Copy files needed for postinstall and build
319
COPY . .
4-
RUN npm ci
20+
21+
# npm postinstall runs grunt, which depends on files other than package.json
22+
RUN npm run postinstall
23+
24+
# Build the app
525
RUN npm run build
626

7-
FROM nginx:1.25-alpine3.18 AS cyberchef
27+
#########################################
28+
# Package static build files into nginx #
29+
#########################################
30+
# We are using Github Actions: redhat-actions/buildah-build@v2 which needs manual selection of arch in base image
31+
# Remove TARGETARCH if docker buildx is supported in the CI release as --platform=$TARGETPLATFORM will be automatically set
32+
ARG TARGETARCH
33+
ARG TARGETPLATFORM
34+
FROM ${TARGETARCH}/nginx:stable-alpine AS cyberchef
835

9-
COPY --from=build ./build/prod /usr/share/nginx/html/
36+
COPY --from=builder /app/build/prod /usr/share/nginx/html/

package-lock.json

+24-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
"d3": "7.9.0",
124124
"d3-hexbin": "^0.2.2",
125125
"diff": "^5.2.0",
126+
"dompurify": "^3.2.5",
126127
"es6-promisify": "^7.0.0",
127128
"escodegen": "^2.1.0",
128129
"esprima": "^4.0.1",
@@ -134,8 +135,8 @@
134135
"highlight.js": "^11.9.0",
135136
"ieee754": "^1.2.1",
136137
"jimp": "^0.22.12",
138+
"jq-web": "^0.5.1",
137139
"jquery": "3.7.1",
138-
"js-crc": "^0.2.0",
139140
"js-sha3": "^0.9.3",
140141
"jsesc": "^3.0.2",
141142
"json5": "^2.2.3",

src/core/config/Categories.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
"Avro to JSON",
7373
"CBOR Encode",
7474
"CBOR Decode",
75+
"YAML to JSON",
76+
"JSON to YAML",
7577
"Caret/M-decode",
7678
"Rison Encode",
7779
"Rison Decode",
@@ -193,7 +195,9 @@
193195
"Parse SSH Host Key",
194196
"Parse CSR",
195197
"Public Key from Certificate",
196-
"Public Key from Private Key"
198+
"Public Key from Private Key",
199+
"SM2 Encrypt",
200+
"SM2 Decrypt"
197201
]
198202
},
199203
{
@@ -441,9 +445,7 @@
441445
"Fletcher-64 Checksum",
442446
"Adler-32 Checksum",
443447
"Luhn Checksum",
444-
"CRC-8 Checksum",
445-
"CRC-16 Checksum",
446-
"CRC-32 Checksum",
448+
"CRC Checksum",
447449
"TCP/IP Checksum"
448450
]
449451
},
@@ -465,8 +467,10 @@
465467
"CSS Minify",
466468
"XPath expression",
467469
"JPath expression",
470+
"Jq",
468471
"CSS selector",
469472
"PHP Deserialize",
473+
"PHP Serialize",
470474
"Microsoft Script Decoder",
471475
"Strip HTML tags",
472476
"Diff",

src/core/lib/Base32.mjs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// import Utils from "../Utils.mjs";
2+
3+
/**
4+
* Base32 resources.
5+
*
6+
* @author Peter C-S [[email protected]]
7+
* @license Apache-2.0
8+
*/
9+
10+
/**
11+
* Base32 alphabets.
12+
*/
13+
export const ALPHABET_OPTIONS = [
14+
{
15+
name: "Standard", // https://www.rfc-editor.org/rfc/rfc4648#section-6
16+
value: "A-Z2-7=",
17+
},
18+
{
19+
name: "Hex Extended", // https://www.rfc-editor.org/rfc/rfc4648#section-7
20+
value: "0-9A-V=",
21+
},
22+
];
23+

0 commit comments

Comments
 (0)