Skip to content

Commit 3bc0193

Browse files
committed
rule checking for atlas addon
1 parent 95a1f1a commit 3bc0193

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.shellcheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
disable=SC1008

atlas/Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
ARG BUILD_FROM
21
ARG BUILDARCH
32
# Stage 1: Build Go binary and clone repo
4-
FROM --platform=$BUILDARCH golang:1.22 AS builder
3+
FROM golang:1.22 AS builder
54

65
RUN git clone https://github.com/karam-ajaj/atlas.git /atlas-repo
76
WORKDIR /atlas-repo
@@ -13,17 +12,19 @@ RUN go mod init atlas || true
1312
RUN go build -o /atlas .
1413

1514
# Stage 2: Runtime
15+
ARG BUILD_FROM
1616
FROM $BUILD_FROM
1717

1818
RUN apk add --no-cache \
19-
nginx iputils-ping traceroute nmap sqlite net-tools curl jq ca-certificates git py3-pip
19+
nginx iputils-ping traceroute nmap sqlite net-tools curl jq ca-certificates git py3-pip && \
20+
python3 -m venv /opt/venv
2021

2122
# Create a virtual environment
22-
RUN python3 -m venv /opt/venv
23-
ENV PATH="/opt/venv/bin:$PATH"
2423

2524
# Install python packages
26-
RUN . /opt/venv/bin/activate && pip install --no-cache-dir fastapi uvicorn
25+
ENV PATH="/opt/venv/bin:$PATH"
26+
# hadolint ignore=SC1091
27+
RUN source /opt/venv/bin/activate && pip install --no-cache-dir fastapi uvicorn
2728

2829
# Remove default Nginx config
2930
RUN rm -f /etc/nginx/conf.d/default.conf /etc/nginx/sites-enabled/default || true

atlas/rootfs/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ATLAS_API_PORT=$(bashio::addon.port 8889)
1515
# Render Nginx config (IMPORTANT: restrict variables so $uri etc. survive)
1616
if [[ -f /config/nginx/default.conf.template ]]; then
1717
log "Rendering Nginx template (UI:$ATLAS_UI_PORT API:$ATLAS_API_PORT)"
18-
envsubst '${ATLAS_UI_PORT} ${ATLAS_API_PORT}' < /config/nginx/default.conf.template > /etc/nginx/conf.d/default.conf
18+
envsubst "${ATLAS_UI_PORT} ${ATLAS_API_PORT}" < /config/nginx/default.conf.template > /etc/nginx/conf.d/default.conf
1919
else
2020
log "⚠️ Template /config/nginx/default.conf.template missing. Using existing config."
2121
fi
@@ -41,7 +41,7 @@ fi
4141
log "🚀 Starting FastAPI backend on port $ATLAS_API_PORT..."
4242
export PYTHONPATH=/config
4343
uvicorn app:app --host 0.0.0.0 --port "$ATLAS_API_PORT" > /config/logs/uvicorn.log 2>&1 &
44-
API_PID=$!
44+
export API_PID=$!
4545

4646
# Kick off scans (non-blocking)
4747
if [[ -x /config/bin/atlas ]]; then

0 commit comments

Comments
 (0)