mirror of
https://github.com/lintsinghua/DeepAudit.git
synced 2026-10-25 18:11:29 +08:00
- Merge upstream v3.0.0 changes - Fix security vulnerabilities (SSRF, Path Traversal) by introducing `parse_repository_url` utility - Fix token leakage and handling in `scanner.py` and `projects.py` - Fix `NameError` in `scanner.py` - Fix `frontend/docker-entrypoint.sh` API URL escaping - Standardize Gitea token naming to `gitea_token`
17 lines
516 B
Bash
17 lines
516 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
# 替换 API 地址占位符
|
|
# 默认为 /api/v1,这样即使用户不传参,也能配合默认的 nginx 代理工作
|
|
API_URL="${VITE_API_BASE_URL:-/api/v1}"
|
|
|
|
echo "Injecting API URL: $API_URL"
|
|
|
|
# 在所有 JS 文件中替换占位符
|
|
# 注意:这里路径必须是 nginx 实际存放文件的路径
|
|
ESCAPED_API_URL=$(echo "${API_URL}" | sed 's/[&/|]/\\&/g')
|
|
find /usr/share/nginx/html -name '*.js' -exec sed -i "s|__API_BASE_URL__|${ESCAPED_API_URL}|g" {} \;
|
|
|
|
# 执行原始命令
|
|
exec "$@"
|