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
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ redis/tls
redis/data

k8s/
docker/
docker/*.dockerfile
docker-compose*.yml

*.md
Expand Down
20 changes: 8 additions & 12 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ services:
build:
context: .
dockerfile: ./docker/controller.dockerfile
environment:
- TZ=${TZ:-Asia/Shanghai}
- NETPULSE_REDIS__PASSWORD=${NETPULSE_REDIS__PASSWORD}
- NETPULSE_SERVER__API_KEY=${NETPULSE_SERVER__API_KEY}
env_file:
- .env
volumes:
- ./config:/app/config
- ./redis/tls:/app/redis/tls:ro
Expand All @@ -25,9 +23,8 @@ services:
build:
context: .
dockerfile: ./docker/node_worker.dockerfile
environment:
- TZ=${TZ:-Asia/Shanghai}
- NETPULSE_REDIS__PASSWORD=${NETPULSE_REDIS__PASSWORD}
env_file:
- .env
volumes:
- ./config:/app/config
- ./redis/tls:/app/redis/tls:ro
Expand All @@ -45,9 +42,8 @@ services:
build:
context: .
dockerfile: docker/fifo_worker.dockerfile
environment:
- TZ=${TZ:-Asia/Shanghai}
- NETPULSE_REDIS__PASSWORD=${NETPULSE_REDIS__PASSWORD}
env_file:
- .env
volumes:
- ./config:/app/config
- ./redis/tls:/app/redis/tls:ro
Expand All @@ -60,8 +56,8 @@ services:

redis:
image: redis:7-bookworm
environment:
- TZ=${TZ:-Asia/Shanghai}
env_file:
- .env
volumes:
- ./redis/redis.conf:/etc/redis/redis.conf:ro
- ./redis/tls:/etc/redis/tls:ro
Expand Down
13 changes: 13 additions & 0 deletions docker/fifo_worker.dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
FROM python:3.12-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
openssh-client \
&& rm -rf /var/lib/apt/lists/*

# Create SSH config directory
RUN mkdir -p /root/.ssh

WORKDIR /app

RUN pip3 install --no-cache-dir --upgrade pip

COPY . .

# Copy SSH configuration file
COPY docker/ssh_config /root/.ssh/config
RUN chmod 600 /root/.ssh/config

RUN pip3 install --no-cache-dir -e "."

CMD ["python3", "worker.py", "fifo"]
13 changes: 13 additions & 0 deletions docker/node_worker.dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
FROM python:3.12-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
openssh-client \
&& rm -rf /var/lib/apt/lists/*

# Create SSH config directory
RUN mkdir -p /root/.ssh

WORKDIR /app

RUN pip3 install --no-cache-dir --upgrade pip

COPY . .

# Copy SSH configuration file
COPY docker/ssh_config /root/.ssh/config
RUN chmod 600 /root/.ssh/config

RUN pip3 install --no-cache-dir -e "."

CMD ["python3", "worker.py", "node"]
5 changes: 5 additions & 0 deletions docker/ssh_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SSH configuration - Enable ssh-rsa algorithm globally for legacy device compatibility
Host *
PubkeyAcceptedKeyTypes +ssh-rsa
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
3 changes: 2 additions & 1 deletion netpulse/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ def settings_customise_sources(
dotenv_settings,
file_secret_settings,
):
"""Read settings: env -> yaml -> default"""
"""Read settings: env -> dotenv -> yaml -> default"""
return (
env_settings,
dotenv_settings,
YamlConfigSettingsSource(settings_cls),
init_settings,
)
Expand Down