diff --git a/README.md b/README.md index 7fb1226..8ff17f3 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,17 @@ cd LLMGuard npm install ``` +#### (Optional but recommended) Create virtual environment + +```bash +pip install virtualenv + +python3 -m venv .venv + +source .venv/bin/activate # for linux +.venv\Scripts\activate # for windows +``` + #### Python Dependencies ```bash @@ -108,7 +119,7 @@ npm run dev ### 2. Initialize Network Topology ```bash -python3 commands/init_network.py +python3 commands/init_network.py --state-file ./public/simplified_state.json ``` ### 3. Access the Application diff --git a/commands/init_network.py b/commands/init_network.py index 5ee2dbf..8bdec14 100644 --- a/commands/init_network.py +++ b/commands/init_network.py @@ -84,7 +84,7 @@ def get_container_image_and_config(self, node_type: str) -> tuple[str, Dict[str, """Get Docker image and config for node type""" configs = { 'firewall': { - 'image': 'alpine:latest', + 'image': 'alpine:3.19.8', 'command': 'sh -c "apk add --no-cache iptables traceroute && tail -f /dev/null"', 'cap_add': ['NET_ADMIN'], 'privileged': True, @@ -98,28 +98,28 @@ def get_container_image_and_config(self, node_type: str) -> tuple[str, Dict[str, 'ports': {'80/tcp': None, '443/tcp': None} }, 'router': { - 'image': 'alpine:latest', + 'image': 'alpine:3.19.8', 'command': 'sh -c "apk add --no-cache iproute2 iptables traceroute && echo 1 > /proc/sys/net/ipv4/ip_forward && tail -f /dev/null"', 'cap_add': ['NET_ADMIN'], 'privileged': True, 'ports': {} }, 'switch': { - 'image': 'alpine:latest', + 'image': 'alpine:3.19.8', 'command': 'sh -c "apk add --no-cache bridge-utils iptables iproute2 && tail -f /dev/null"', 'cap_add': ['NET_ADMIN'], 'privileged': True, 'ports': {} }, 'user': { - 'image': 'alpine:latest', + 'image': 'alpine:3.19.8', 'command': 'sh -c "sleep 3 && apk add --no-cache iptables && tail -f /dev/null"', 'cap_add': [], 'privileged': True, # TODO: Change to non-privileged 'ports': {} }, 'external': { - 'image': 'alpine:latest', + 'image': 'alpine:3.19.8', 'command': 'sh -c "apk add --no-cache iptables iproute2 && tail -f /dev/null"', 'cap_add': ['NET_ADMIN'], 'privileged': True,