fix: reduce permissions and fix npm and opencode versions
This commit is contained in:
+23
-23
@@ -1,29 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
CERT_DIR="${CERT_DIR:-/host-certs}"
|
||||
|
||||
if [[ -d "$CERT_DIR" ]]; then
|
||||
shopt -s nullglob
|
||||
certs=("$CERT_DIR"/*.crt "$CERT_DIR"/*.pem)
|
||||
if ((${#certs[@]})); then
|
||||
mkdir -p /usr/local/share/ca-certificates/opencode-host
|
||||
for cert in "${certs[@]}"; do
|
||||
target="/usr/local/share/ca-certificates/opencode-host/$(basename "${cert%.*}").crt"
|
||||
if openssl x509 -in "$cert" -noout >/dev/null 2>&1; then
|
||||
cp -f "$cert" "$target"
|
||||
else
|
||||
echo "WARNING: ignoring invalid CA certificate: $cert" >&2
|
||||
fi
|
||||
done
|
||||
if update-ca-certificates >/tmp/opencode-ca.log 2>&1; then
|
||||
:
|
||||
else
|
||||
echo "WARNING: update-ca-certificates failed; continuing." >&2
|
||||
cat /tmp/opencode-ca.log >&2 || true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
# CERT_DIR="${CERT_DIR:-/host-certs}"
|
||||
#
|
||||
# if [[ -d "$CERT_DIR" ]]; then
|
||||
# shopt -s nullglob
|
||||
# certs=("$CERT_DIR"/*.crt "$CERT_DIR"/*.pem)
|
||||
# if ((${#certs[@]})); then
|
||||
# mkdir -p /usr/local/share/ca-certificates/opencode-host
|
||||
# for cert in "${certs[@]}"; do
|
||||
# target="/usr/local/share/ca-certificates/opencode-host/$(basename "${cert%.*}").crt"
|
||||
# if openssl x509 -in "$cert" -noout >/dev/null 2>&1; then
|
||||
# cp -f "$cert" "$target"
|
||||
# else
|
||||
# echo "WARNING: ignoring invalid CA certificate: $cert" >&2
|
||||
# fi
|
||||
# done
|
||||
# if update-ca-certificates >/tmp/opencode-ca.log 2>&1; then
|
||||
# :
|
||||
# else
|
||||
# echo "WARNING: update-ca-certificates failed; continuing." >&2
|
||||
# cat /tmp/opencode-ca.log >&2 || true
|
||||
# fi
|
||||
# fi
|
||||
# fi
|
||||
|
||||
host_lang="${HOST_LANG:-${LANG:-C.UTF-8}}"
|
||||
host_lc_all="${HOST_LC_ALL:-${LC_ALL:-}}"
|
||||
|
||||
Reference in New Issue
Block a user