Skip to content
Merged
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
16 changes: 10 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
"target": "devcontainer"
},
"workspaceFolder": "/workspaces/NetAlertX",

"runArgs": [
"--privileged",
"--cap-add=NET_ADMIN",
"--cap-add=NET_RAW",
// Ensure containers can resolve host.docker.internal to the host (required on Linux)
"--add-host=host.docker.internal:host-gateway"
"--add-host=host.docker.internal:host-gateway",
"--security-opt", "apparmor=unconfined" // for alowing ramdisk mounts
],

"capAdd": [
"SYS_ADMIN", // For mounting ramdisks
"NET_ADMIN", // For network interface configuration
"NET_RAW" // For raw packet manipulation
],



"postStartCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/setup.sh",

"customizations": {
Expand Down
8 changes: 8 additions & 0 deletions .devcontainer/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ configure_source() {
echo "[1/3] Configuring Source..."
echo " -> Linking source to ${INSTALL_DIR}"
echo "Dev">${INSTALL_DIR}/.VERSION

echo " -> Mounting ramdisks for /log and /api"
sudo mount -t tmpfs -o size=256M tmpfs "${SOURCE_DIR}/log"
sudo mount -t tmpfs -o size=512M tmpfs "${SOURCE_DIR}/api"
safe_link ${SOURCE_DIR}/api ${INSTALL_DIR}/api
safe_link ${SOURCE_DIR}/back ${INSTALL_DIR}/back
safe_link "${SOURCE_DIR}/config" "${INSTALL_DIR}/config"
Expand Down Expand Up @@ -94,13 +98,17 @@ configure_source() {
echo " -> Removing existing user_notifications.json"
sudo rm "${INSTALL_DIR}"/api/user_notifications.json
fi



echo " -> Setting ownership and permissions"
sudo find ${INSTALL_DIR}/ -type d -exec chmod 775 {} \;
sudo find ${INSTALL_DIR}/ -type f -exec chmod 664 {} \;
sudo date +%s > "${INSTALL_DIR}/front/buildtimestamp.txt"
sudo chmod 640 "${INSTALL_DIR}/config/${CONF_FILE}" || true



echo " -> Setting up log directory"
install -d -o netalertx -g www-data -m 777 ${INSTALL_DIR}/log/plugins

Expand Down
Empty file added api/.git-placeholder
Empty file.
2 changes: 0 additions & 2 deletions api/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions log/.gitignore

This file was deleted.

Empty file added log/plugins/.git-placeholder
Empty file.
3 changes: 0 additions & 3 deletions log/plugins/.gitignore

This file was deleted.