Skip to content

Commit dc8121e

Browse files
authored
Merge branch 'master' into master
2 parents 73a39fa + 554a3b0 commit dc8121e

File tree

273 files changed

+38482
-19548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+38482
-19548
lines changed

.cspell.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "0.2",
3+
"language": "en,en-gb",
4+
"words": [],
5+
"dictionaries": [
6+
"npm",
7+
"softwareTerms",
8+
"node",
9+
"html",
10+
"css",
11+
"bash",
12+
"en-gb",
13+
"misc"
14+
],
15+
"ignorePaths": ["package.json", "package-lock.json", "node_modules"]
16+
}
17+

.devcontainer/devcontainer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
3+
{
4+
"name": "CyberChef",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bookworm",
7+
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
"features": {
10+
"ghcr.io/devcontainers/features/github-cli": "latest"
11+
},
12+
13+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
14+
"forwardPorts": [8080],
15+
16+
// Use 'postCreateCommand' to run commands after the container is created.
17+
"postCreateCommand": {
18+
"npm": "bash -c \"sudo chown node node_modules && npm install\""
19+
},
20+
21+
"containerEnv": {
22+
"DISPLAY": ":99"
23+
},
24+
25+
"mounts": [
26+
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume"
27+
],
28+
29+
// Configure tool-specific properties.
30+
"customizations": {
31+
"vscode": {
32+
"extensions": [
33+
"dbaeumer.vscode-eslint",
34+
"GitHub.vscode-github-actions"
35+
]
36+
}
37+
}
38+
39+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
40+
// "remoteUser": "root"
41+
}

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
build

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 116 deletions
This file was deleted.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/master.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919

2020
- name: Install
2121
run: |
22+
export DETECT_CHROMEDRIVER_VERSION=true
2223
npm install
2324
npm run setheapsize
2425

.github/workflows/pull_requests.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818

1919
- name: Install
2020
run: |
21+
export DETECT_CHROMEDRIVER_VERSION=true
2122
npm install
2223
npm run setheapsize
2324
@@ -33,6 +34,20 @@ jobs:
3334
if: success()
3435
run: npx grunt prod
3536

37+
- name: Production Image Build
38+
if: success()
39+
id: build-image
40+
uses: redhat-actions/buildah-build@v2
41+
with:
42+
# Not being uploaded to any registry, use a simple name to allow Buildah to build correctly.
43+
image: cyberchef
44+
containerfiles: ./Dockerfile
45+
platforms: linux/amd64
46+
oci: true
47+
# Webpack seems to use a lot of open files, increase the max open file limit to accomodate.
48+
extra-args: |
49+
--ulimit nofile=10000
50+
3651
- name: UI Tests
3752
if: success()
3853
run: |

.github/workflows/releases.yml

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
tags:
77
- 'v*'
88

9+
env:
10+
REGISTRY: ghcr.io
11+
REGISTRY_USER: ${{ github.actor }}
12+
REGISTRY_PASSWORD: ${{ github.token }}
13+
IMAGE_NAME: ${{ github.repository }}
14+
915
jobs:
1016
main:
1117
runs-on: ubuntu-latest
@@ -19,7 +25,8 @@ jobs:
1925

2026
- name: Install
2127
run: |
22-
npm install
28+
export DETECT_CHROMEDRIVER_VERSION=true
29+
npm ci
2330
npm run setheapsize
2431
2532
- name: Lint
@@ -31,17 +38,48 @@ jobs:
3138
npm run testnodeconsumer
3239
3340
- name: Production Build
34-
if: success()
3541
run: npx grunt prod
3642

3743
- name: UI Tests
38-
if: success()
3944
run: |
4045
sudo apt-get install xvfb
4146
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
4247
48+
- name: Image Metadata
49+
id: image-metadata
50+
uses: docker/metadata-action@v4
51+
with:
52+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
53+
tags: |
54+
type=semver,pattern={{major}}
55+
type=semver,pattern={{major}}.{{minor}}
56+
type=semver,pattern={{version}}
57+
58+
- name: Production Image Build
59+
id: build-image
60+
uses: redhat-actions/buildah-build@v2
61+
with:
62+
tags: ${{ steps.image-metadata.outputs.tags }}
63+
labels: ${{ steps.image-metadata.outputs.labels }}
64+
containerfiles: ./Dockerfile
65+
platforms: linux/amd64,linux/arm64
66+
oci: true
67+
# enable build layer caching between platforms
68+
layers: true
69+
# Webpack seems to use a lot of open files, increase the max open file limit to accomodate.
70+
extra-args: |
71+
--ulimit nofile=10000
72+
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 }}
81+
4382
- name: Upload Release Assets
44-
if: success()
4583
id: upload-release-assets
4684
uses: svenstaro/upload-release-action@v2
4785
with:
@@ -53,7 +91,6 @@ jobs:
5391
body: "See the [CHANGELOG](https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md) and [commit messages](https://github.com/gchq/CyberChef/commits/master) for details."
5492

5593
- name: Publish to NPM
56-
if: success()
5794
uses: JS-DevTools/npm-publish@v1
5895
with:
5996
token: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ npm-debug.log
33
travis.log
44
build
55
.vscode
6+
.idea
67
.*.swp
78
src/core/config/modules/*
89
src/core/config/OperationConfig.json

0 commit comments

Comments
 (0)