Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/*

42 changes: 42 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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]
}
13 changes: 13 additions & 0 deletions .devcontainer/fetchMasWebsite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail

repo_url="https://github.com/OWASP/mas-website.git"
dir="/workspace/mas-website"

if [ -d "${dir}/.git" ]; then

git -C "${dir}" fetch --depth 1 origin
git -C "${dir}" reset --hard origin/HEAD
else
git clone --depth 1 "${repo_url}" "${dir}"
fi