-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathentrypoint.sh
More file actions
40 lines (37 loc) · 1.1 KB
/
entrypoint.sh
File metadata and controls
40 lines (37 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
set -e
cd /app
# Create essential files if missing so the web UI can manage them
if [ ! -f .env ]; then
echo "" > .env
fi
if [ ! -f target-list.txt ]; then
touch target-list.txt
fi
if [ ! -f whitelisted_ips.txt ]; then
touch whitelisted_ips.txt
fi
mkdir -p reports
# Trust custom root certificates placed in project root (.crt or .pem)
FOUND_CA=false
for f in /app/*.crt /app/*.pem; do
if [ -f "$f" ]; then
FOUND_CA=true
base=$(basename "$f")
dest="/usr/local/share/ca-certificates/${base}"
# update-ca-certificates scans only .crt files; rename .pem to .crt
case "$dest" in
*.pem) dest="/usr/local/share/ca-certificates/${base%.pem}.crt" ;;
esac
echo "Installing custom CA: $base"
cp "$f" "$dest" || true
fi
done
if [ "$FOUND_CA" = "true" ]; then
update-ca-certificates || true
# Ensure Python requests uses the system CA bundle (includes the custom CAs)
export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
fi
# Run the web app on configured port (default 8001)
exec python -m repchecker.web_app