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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.14-slim

ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
Expand All @@ -15,7 +15,7 @@ WORKDIR /app
RUN apt-get update
RUN apt-get install -y mtr-tiny iputils-ping

RUN pip install --no-cache-dir poetry
RUN pip install --upgrade --no-cache-dir pip poetry
COPY pyproject.toml poetry.lock ./
RUN poetry config virtualenvs.create false
RUN poetry install --without=dev --no-root
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:

# Run the development server
run: build
docker run -p 8000:8000 -it nickpegg/looking-glass flask run -h 0.0.0.0 -p 8000
docker run -p 8000:8000 --cap-add net_raw -it nickpegg/looking-glass flask run -h 0.0.0.0 -p 8000

push:
docker push nickpegg/looking-glass:latest
6 changes: 3 additions & 3 deletions lg.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ def do(method: str, target: str) -> str:
return output


def ping(dest: str, count: int = 10) -> CompletedProcess[bytes]:
def ping(dest: str, count: int = 5) -> CompletedProcess[bytes]:
return subprocess.run(["ping", dest, "-c", str(count)], capture_output=True)


def mtr(dest: str, count: int = 10) -> CompletedProcess[bytes]:
def mtr(dest: str, count: int = 5) -> CompletedProcess[bytes]:
return subprocess.run(
["mtr", dest, "-r", "-w", "-c", str(count)], capture_output=True
)


def sanitize(dirty_target: str) -> str:
match = re.match("([\w\.\:\-\_]+)", dirty_target)
match = re.match(r"([\w\.\:\-\_]+)", dirty_target)
if match:
target = match.group(1)
else:
Expand Down
Loading
Loading