mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-15 22:51:37 -07:00
110 lines
4.1 KiB
JSON
Executable File
110 lines
4.1 KiB
JSON
Executable File
{
|
|
"name": "NetAlertX DevContainer",
|
|
"remoteUser": "netalertx",
|
|
"workspaceFolder": "/workspaces/NetAlertX",
|
|
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/NetAlertX,type=bind,consistency=cached",
|
|
"onCreateCommand": "mkdir -p /tmp/api /tmp/log",
|
|
"build": {
|
|
"dockerfile": "./Dockerfile", // Dockerfile generated by script
|
|
"context": "../", // Context is the root of the repository
|
|
"target": "netalertx-devcontainer"
|
|
},
|
|
"capAdd": [
|
|
"SYS_ADMIN", // For mounting ramdisks
|
|
"NET_ADMIN", // For network interface configuration
|
|
"NET_RAW", // For raw packet manipulation
|
|
"NET_BIND_SERVICE" // For privileged port binding (e.g., UDP 137)
|
|
],
|
|
"runArgs": [
|
|
"--security-opt",
|
|
"apparmor=unconfined", // for allowing ramdisk mounts
|
|
"--add-host=host.docker.internal:host-gateway"
|
|
|
|
// Uncomment --network=host to run full NetAlertX scanning capabilities of network scanning in
|
|
// container. This runs too slowly in a large network to be practical for development purposes.
|
|
// You can start services such as avahi on the host, in other containers within the network, or
|
|
// even within this container and connect to them as needed.
|
|
// "--network=host",
|
|
],
|
|
"mounts": [
|
|
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" //used for testing various conditions in docker
|
|
],
|
|
// ATTENTION: If running with --network=host, COMMENT `forwardPorts` OR ELSE THERE WILL BE NO WEBUI!
|
|
"forwardPorts": [20211, 20212, 5678],
|
|
"portsAttributes": { // the ports we care about
|
|
"20211": {
|
|
"label": "Frontend:Nginx+PHP"
|
|
},
|
|
"20212": {
|
|
"label": "Backend:GraphQL"
|
|
},
|
|
"9003": {
|
|
"label": "PHP Debug:Xdebug"
|
|
},
|
|
"5678": {
|
|
"label": "Python Debug:debugpy"
|
|
}
|
|
},
|
|
|
|
"postCreateCommand": {
|
|
"Install Pip Requirements": "/opt/venv/bin/pip3 install pytest docker debugpy selenium",
|
|
"Workspace Instructions": "printf '\n\n� DevContainer Ready! Starting Services...\n\n📁 To access /tmp folders in the workspace:\n File → Open Workspace from File → NetAlertX.code-workspace\n\n📖 See .devcontainer/WORKSPACE.md for details\n\n'"
|
|
},
|
|
"postStartCommand": {
|
|
"Build test-container":"echo To speed up tests, building test container in background... && setsid docker buildx build -t netalertx-test . > /tmp/build.log 2>&1 && echo '🧪 Unit Test Docker image built: netalertx-test' &",
|
|
"Start Environment":"${containerWorkspaceFolder}/.devcontainer/scripts/setup.sh"
|
|
},
|
|
"customizations": {
|
|
"vscode": {
|
|
"extensions": [
|
|
"ms-python.python",
|
|
"ms-azuretools.vscode-docker",
|
|
"felixfbecker.php-debug",
|
|
"bmewburn.vscode-intelephense-client",
|
|
"xdebug.php-debug",
|
|
"ms-python.vscode-pylance",
|
|
"coderabbit.coderabbit-vscode",
|
|
"ms-python.black-formatter",
|
|
"jeff-hykin.better-dockerfile-syntax",
|
|
"GitHub.codespaces",
|
|
"ms-azuretools.vscode-containers",
|
|
"ms-python.vscode-python-envs",
|
|
"dbaeumer.vscode-eslint",
|
|
"esbenp.prettier-vscode",
|
|
"eamodio.gitlens",
|
|
"alexcvzz.vscode-sqlite",
|
|
"mkhl.shfmt",
|
|
"charliermarsh.ruff",
|
|
"ms-python.flake8",
|
|
"exiasr.hadolint",
|
|
"timonwong.shellcheck"
|
|
],
|
|
"settings": {
|
|
"terminal.integrated.cwd": "${containerWorkspaceFolder}",
|
|
"terminal.integrated.profiles.linux": {
|
|
"zsh": {
|
|
"path": "/bin/zsh",
|
|
"args": ["-l"]
|
|
}
|
|
},
|
|
"terminal.integrated.defaultProfile.linux": "zsh",
|
|
|
|
// Python testing configuration
|
|
"python.testing.pytestEnabled": true,
|
|
"python.testing.unittestEnabled": false,
|
|
"python.testing.pytestArgs": ["test"],
|
|
"python.testing.cwd": "${containerWorkspaceFolder}",
|
|
// Make sure we discover tests and import server correctly
|
|
"python.analysis.extraPaths": [
|
|
"/workspaces/NetAlertX",
|
|
"/workspaces/NetAlertX/server",
|
|
"/app",
|
|
"/app/server"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
|
|
"shutdownAction": "stopContainer" // stop container when VSCode is closed
|
|
}
|