From 71d91cfcbf9e84411e41bf320d8f67e523ecb648 Mon Sep 17 00:00:00 2001 From: bernhste Date: Sat, 12 Sep 2026 19:38:55 +0000 Subject: [PATCH 1/2] added new devcontainer which is compatible mas siblings --- .devcontainer/Dockerfile | 21 ++++++++++++++++ .devcontainer/devcontainer.json | 42 ++++++++++++++++++++++++++++++++ .devcontainer/fetchMasWebsite.sh | 24 ++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/fetchMasWebsite.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..01ae3859a --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,21 @@ +FROM mcr.microsoft.com/devcontainers/base:trixie + +# Note: If the requiremtnes change for this image, we need to update it in all MAS sibling projects: +# +# - https://github.com/OWASP/mas-website +# - https://github.com/OWASP/masvs +# - https://github.com/OWASP/maswe +# - https://github.com/OWASP/mastg + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + python3 \ + python3-pip \ + python3-venv \ + git \ + libxml2-dev \ + libxslt1-dev \ + zlib1g-dev \ + build-essential build-essential \ + && rm -rf /var/lib/apt/lists/* + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..674863d9d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +{ + "name": "masvs", + "build": { + "dockerfile": "Dockerfile" + }, + + "workspaceFolder": "/workspace/masvs", + "workspaceMount": "source=${localWorkspaceFolder},target=${containerWorkspaceFolder},type=bind,consistency=cached", + + "mounts": [ + "source=mastg,target=/workspace/mastg,type=volume", + "source=maswe,target=/workspace/maswe,type=volume", + "source=mas-website,target=/workspace/mas-website,type=volume" + ], + + "remoteUser": "vscode", + "postCreateCommand": "sudo chown -R vscode:vscode /workspace/* && .devcontainer/fetchMasWebsite.sh && /workspace/mas-website/.devcontainer/setupShellAlias.sh && /workspace/mas-website/.devcontainer/fetchMasProject.sh maswe mastg", + "postStartCommand": "/workspace/mas-website/.devcontainer/runMasWebsite.sh", + + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.shell.linux": "/bin/bash", + "debug.javascript.usePreview": false + }, + "extensions": [ + "yzhang.markdown-all-in-one", + "redhat.vscode-yaml", + "shardulm94.trailing-spaces", + "oderwat.indent-rainbow", + "msjsdiag.debugger-for-chrome", + "ms-python.python", + "ms-python.debugpy", + "davidanson.vscode-markdownlint", + "timonwong.shellcheck", + "ms-python.vscode-pylance" + ] + } + }, + + "forwardPorts": [8000] +} diff --git a/.devcontainer/fetchMasWebsite.sh b/.devcontainer/fetchMasWebsite.sh new file mode 100755 index 000000000..96413522a --- /dev/null +++ b/.devcontainer/fetchMasWebsite.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -euo pipefail + +# TODO: REVERT before PR +repo_url="https://github.com/bernhste/mas-website.git" +# repo_url="https://github.com/OWASP/mas-website.git" +dir="/workspace/mas-website" + +# TODO: REMOVE before PR +branch="new-devcontainer" + +if [ -d "${dir}/.git" ]; then + # TODO: REVERT before PR + # git -C "${dir}" fetch --depth 1 origin + # git -C "${dir}" reset --hard origin/HEAD + git -C "${dir}" fetch --depth 1 origin "${branch}" + git -C "${dir}" checkout -B "${branch}" FETCH_HEAD + git -C "${dir}" reset --hard FETCH_HEAD +else + # git clone --depth 1 "${repo_url}" "${dir}" + git clone --depth 1 --branch "${branch}" --single-branch "${repo_url}" "${dir}" +fi + + From bd7831d8399cc48af9cc1f73b3d3da2c978061fa Mon Sep 17 00:00:00 2001 From: bernhste Date: Sat, 12 Sep 2026 20:07:45 +0000 Subject: [PATCH 2/2] updated fetchMasWebsite to fetch from upstream --- .devcontainer/fetchMasWebsite.sh | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/.devcontainer/fetchMasWebsite.sh b/.devcontainer/fetchMasWebsite.sh index 96413522a..bf9268b33 100755 --- a/.devcontainer/fetchMasWebsite.sh +++ b/.devcontainer/fetchMasWebsite.sh @@ -1,24 +1,13 @@ #!/usr/bin/env bash set -euo pipefail -# TODO: REVERT before PR -repo_url="https://github.com/bernhste/mas-website.git" -# repo_url="https://github.com/OWASP/mas-website.git" +repo_url="https://github.com/OWASP/mas-website.git" dir="/workspace/mas-website" -# TODO: REMOVE before PR -branch="new-devcontainer" - if [ -d "${dir}/.git" ]; then - # TODO: REVERT before PR - # git -C "${dir}" fetch --depth 1 origin - # git -C "${dir}" reset --hard origin/HEAD - git -C "${dir}" fetch --depth 1 origin "${branch}" - git -C "${dir}" checkout -B "${branch}" FETCH_HEAD - git -C "${dir}" reset --hard FETCH_HEAD + + git -C "${dir}" fetch --depth 1 origin + git -C "${dir}" reset --hard origin/HEAD else - # git clone --depth 1 "${repo_url}" "${dir}" - git clone --depth 1 --branch "${branch}" --single-branch "${repo_url}" "${dir}" + git clone --depth 1 "${repo_url}" "${dir}" fi - -