Skip to content

Commit a40aed2

Browse files
authored
Merge branch 'master' into add-php-serialization
2 parents c0e84dc + 1b8c229 commit a40aed2

File tree

225 files changed

+31333
-19034
lines changed

Some content is hidden

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

225 files changed

+31333
-19034
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: 39 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,7 @@ jobs:
1925

2026
- name: Install
2127
run: |
22-
npm install
28+
npm ci
2329
npm run setheapsize
2430
2531
- name: Lint
@@ -31,17 +37,38 @@ jobs:
3137
npm run testnodeconsumer
3238
3339
- name: Production Build
34-
if: success()
3540
run: npx grunt prod
3641

3742
- name: UI Tests
38-
if: success()
3943
run: |
4044
sudo apt-get install xvfb
4145
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
4246
47+
- name: Image Metadata
48+
id: image-metadata
49+
uses: docker/metadata-action@v4
50+
with:
51+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
52+
tags: |
53+
type=semver,pattern={{major}}
54+
type=semver,pattern={{major}}.{{minor}}
55+
type=semver,pattern={{version}}
56+
57+
- name: Production Image Build
58+
id: build-image
59+
uses: redhat-actions/buildah-build@v2
60+
with:
61+
tags: ${{ steps.image-metadata.outputs.tags }}
62+
labels: ${{ steps.image-metadata.outputs.labels }}
63+
containerfiles: ./Dockerfile
64+
platforms: linux/amd64
65+
oci: true
66+
# Webpack seems to use a lot of open files, increase the max open file limit to accomodate.
67+
extra-args: |
68+
--ulimit nofile=10000
69+
70+
4371
- name: Upload Release Assets
44-
if: success()
4572
id: upload-release-assets
4673
uses: svenstaro/upload-release-action@v2
4774
with:
@@ -53,7 +80,14 @@ jobs:
5380
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."
5481

5582
- name: Publish to NPM
56-
if: success()
5783
uses: JS-DevTools/npm-publish@v1
5884
with:
5985
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 }}

.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)