mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
Speed up devcontainer with ramdisk
This commit is contained in:
@@ -7,15 +7,19 @@
|
|||||||
"target": "devcontainer"
|
"target": "devcontainer"
|
||||||
},
|
},
|
||||||
"workspaceFolder": "/workspaces/NetAlertX",
|
"workspaceFolder": "/workspaces/NetAlertX",
|
||||||
|
|
||||||
"runArgs": [
|
"runArgs": [
|
||||||
"--privileged",
|
"--add-host=host.docker.internal:host-gateway",
|
||||||
"--cap-add=NET_ADMIN",
|
"--security-opt", "apparmor=unconfined" // for alowing ramdisk mounts
|
||||||
"--cap-add=NET_RAW",
|
|
||||||
// Ensure containers can resolve host.docker.internal to the host (required on Linux)
|
|
||||||
"--add-host=host.docker.internal:host-gateway"
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
"capAdd": [
|
||||||
|
"SYS_ADMIN", // For mounting ramdisks
|
||||||
|
"NET_ADMIN", // For network interface configuration
|
||||||
|
"NET_RAW" // For raw packet manipulation
|
||||||
|
],
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"postStartCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/setup.sh",
|
"postStartCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/setup.sh",
|
||||||
|
|
||||||
"customizations": {
|
"customizations": {
|
||||||
|
|||||||
@@ -67,6 +67,10 @@ configure_source() {
|
|||||||
echo "[1/3] Configuring Source..."
|
echo "[1/3] Configuring Source..."
|
||||||
echo " -> Linking source to ${INSTALL_DIR}"
|
echo " -> Linking source to ${INSTALL_DIR}"
|
||||||
echo "Dev">${INSTALL_DIR}/.VERSION
|
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}/api ${INSTALL_DIR}/api
|
||||||
safe_link ${SOURCE_DIR}/back ${INSTALL_DIR}/back
|
safe_link ${SOURCE_DIR}/back ${INSTALL_DIR}/back
|
||||||
safe_link "${SOURCE_DIR}/config" "${INSTALL_DIR}/config"
|
safe_link "${SOURCE_DIR}/config" "${INSTALL_DIR}/config"
|
||||||
@@ -95,12 +99,16 @@ configure_source() {
|
|||||||
sudo rm "${INSTALL_DIR}"/api/user_notifications.json
|
sudo rm "${INSTALL_DIR}"/api/user_notifications.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo " -> Setting ownership and permissions"
|
echo " -> Setting ownership and permissions"
|
||||||
sudo find ${INSTALL_DIR}/ -type d -exec chmod 775 {} \;
|
sudo find ${INSTALL_DIR}/ -type d -exec chmod 775 {} \;
|
||||||
sudo find ${INSTALL_DIR}/ -type f -exec chmod 664 {} \;
|
sudo find ${INSTALL_DIR}/ -type f -exec chmod 664 {} \;
|
||||||
sudo date +%s > "${INSTALL_DIR}/front/buildtimestamp.txt"
|
sudo date +%s > "${INSTALL_DIR}/front/buildtimestamp.txt"
|
||||||
sudo chmod 640 "${INSTALL_DIR}/config/${CONF_FILE}" || true
|
sudo chmod 640 "${INSTALL_DIR}/config/${CONF_FILE}" || true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo " -> Setting up log directory"
|
echo " -> Setting up log directory"
|
||||||
install -d -o netalertx -g www-data -m 777 ${INSTALL_DIR}/log/plugins
|
install -d -o netalertx -g www-data -m 777 ${INSTALL_DIR}/log/plugins
|
||||||
|
|
||||||
|
|||||||
0
api/.git-placeholder
Normal file
0
api/.git-placeholder
Normal file
2
api/.gitignore
vendored
2
api/.gitignore
vendored
@@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
||||||
3
log/.gitignore
vendored
3
log/.gitignore
vendored
@@ -1,3 +0,0 @@
|
|||||||
*
|
|
||||||
!*/
|
|
||||||
!.gitignore
|
|
||||||
0
log/plugins/.git-placeholder
Normal file
0
log/plugins/.git-placeholder
Normal file
3
log/plugins/.gitignore
vendored
3
log/plugins/.gitignore
vendored
@@ -1,3 +0,0 @@
|
|||||||
*
|
|
||||||
!*/
|
|
||||||
!.gitignore
|
|
||||||
Reference in New Issue
Block a user