Coderabit suggestions

This commit is contained in:
Adam Outler
2025-10-18 13:45:48 -04:00
parent 7483e46dce
commit 028335c1a9
8 changed files with 30 additions and 23 deletions

View File

@@ -5,8 +5,7 @@
# Prefer to place dev-only setup here; use setup.sh only for runtime fixes.
FROM runner AS netalertx-devcontainer
ENV INSTALL_DIR=/app
ENV INSTALL_DIR=/app
ENV PYTHONPATH=/workspaces/NetAlertX/test:/workspaces/NetAlertX/server:/app:/app/server:/opt/venv/lib/python3.12/site-packages
ENV PATH=/services:${PATH}
@@ -30,4 +29,4 @@ RUN /bin/sh -c '(/opt/venv/bin/python3 -m pip install --no-cache-dir debugpy) ||
sed -i -e 's|:/app:|:/workspaces:|' /etc/passwd && \
python -m pip install -U pytest pytest-cov
ENTRYPOINT ["/bin/sh","-c","sleep infinity"]
ENTRYPOINT ["/bin/sh","-c","sleep infinity"]

View File

@@ -1,4 +1,4 @@
#! /bin/sh
#!/bin/bash
# Runtime setup for devcontainer (executed after container starts).
# Prefer building setup into resources/devcontainer-Dockerfile when possible.
# Use this script for runtime-only adjustments (permissions, sockets, ownership,
@@ -31,7 +31,7 @@ main() {
sleep 1
echo "Setting up ${SOURCE_DIR}..."
sudo chown $(id -u):$(id -g) /workspaces
sudo chown 755 /workspaces
sudo chmod 755 /workspaces
configure_source
echo "--- Starting Development Services ---"
@@ -50,7 +50,7 @@ isRamDisk() {
local fstype
fstype=$(df -T "$1" | awk 'NR==2 {print $2}')
if [[ "$fstype" == "tmpfs" || "$fstype" == "ramfs" ]]; then
if [ "$fstype" = "tmpfs" ] || [ "$fstype" = "ramfs" ]; then
return 0 # Success (is a ramdisk)
else
return 1 # Failure (is not a ramdisk)
@@ -108,7 +108,7 @@ configure_source() {
# configure_php: configure PHP-FPM and enable dev debug options
configure_php() {
echo "[3/4] Configuring PHP-FPM..."
sudo chown netalertx:netalertx ${SYSTEM_SERVICES_PHP_RUN} 2>/dev/null || true
sudo chown -R netalertx:netalertx ${SYSTEM_SERVICES_RUN} 2>/dev/null || true
}