fix: 修正访问控制与插件契约
This commit is contained in:
+8
-3
@@ -6,9 +6,14 @@ bash "$root/scripts/check-env.sh"
|
||||
|
||||
cd "$root"
|
||||
mkdir -p bin
|
||||
gofmt -w cmd internal
|
||||
go mod tidy
|
||||
go test ./...
|
||||
unformatted="$(gofmt -l cmd internal)"
|
||||
if [[ -n "$unformatted" ]]; then
|
||||
echo '以下 Go 文件尚未格式化:' >&2
|
||||
echo "$unformatted" >&2
|
||||
exit 1
|
||||
fi
|
||||
go list -mod=readonly ./... >/dev/null
|
||||
CGO_ENABLED=1 go test ./...
|
||||
CGO_ENABLED=1 go build -tags cshared -buildmode=c-shared -o bin/cpa-ext.so ./cmd/cpa-ext
|
||||
|
||||
echo "Built: $root/bin/cpa-ext.so"
|
||||
|
||||
@@ -3,8 +3,9 @@ set -euo pipefail
|
||||
|
||||
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
runtime="$root/.runtime"
|
||||
pid_file="$runtime/cliproxy.pid"
|
||||
log_file="$runtime/cliproxy.log"
|
||||
binary="$runtime/bin/cli-proxy-api"
|
||||
pid_file="$runtime/cpa.pid"
|
||||
log_file="$runtime/logs/cpa-console.log"
|
||||
|
||||
if [[ -f "$pid_file" ]]; then
|
||||
old_pid="$(cat "$pid_file" || true)"
|
||||
@@ -14,9 +15,15 @@ if [[ -f "$pid_file" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p "$runtime/auths" "$runtime/plugins"
|
||||
if [[ ! -x "$binary" ]]; then
|
||||
echo "CPA test host binary not found: $binary" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$runtime/auths" "$runtime/plugins" "$runtime/logs"
|
||||
: >"$log_file"
|
||||
nohup "$runtime/cliproxy" -config "$runtime/config.yaml" \
|
||||
cd "$runtime"
|
||||
nohup "$binary" --config "$runtime/config.yaml" \
|
||||
>"$log_file" 2>&1 </dev/null &
|
||||
pid=$!
|
||||
echo "$pid" >"$pid_file"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
pid_file="$root/.runtime/cliproxy.pid"
|
||||
pid_file="$root/.runtime/cpa.pid"
|
||||
|
||||
if [[ ! -f "$pid_file" ]]; then
|
||||
echo 'CPA test host is not running.'
|
||||
|
||||
Reference in New Issue
Block a user