[全量] 初始化项目代码、配置、文档及Agent协同harness

This commit is contained in:
2026-04-02 11:36:05 +08:00
parent 0553309cdf
commit 87e571d9ec
1133 changed files with 221948 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
# 覆盖 jar 内过期的 application-yj.yml当前 jar 仍含远程库 123.57.146.97,不配本会长时间卡 Druid
# 完整 spring.redis + spring.datasource 与源码 application-yj.yml 对齐(本地 Docker 33306
logging:
file:
name: ${user.home}/.gangyan/logs/spring.log
spring:
redis:
open: true
database: 0
host: 127.0.0.1
port: 6379
password: ""
timeout: 6000
lettuce:
pool:
max-active: 1000
max-wait: -1
max-idle: 10
min-idle: 5
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:33306/chat_gpt_yj?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2B8
username: root
password: "1234567890"
druid:
initialSize: 5
minIdle: 10
maxActive: 20
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
maxEvictableIdleTimeMillis: 900000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: true
testOnReturn: false
keepAlive: true
phyTimeoutMillis: 600000
connectTimeout: 60000
poolPreparedStatements: true
filters: stat,wall,slf4j,config
useGlobalDataSourceStat: true
stat:
log-slow-sql: true
merge-sql: true
slow-sql-millis: 10000
chat:
modelName: deepseek-v3

49
backend/start_local.sh Executable file
View File

@@ -0,0 +1,49 @@
#!/bin/bash
# 启动 Java 后端。profile=yj。
# MySQL 33306 / Redis 等统一见同目录 application-local.yml与 scripts/backend-restart.sh 一致,勿再写 -D 数据源以免和 yml 冲突)。
set -euo pipefail
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export PATH="$JAVA_HOME/bin:$PATH"
PROJECT_DIR=/opt/download/oss_files/gangyan-deploy/gangyan/backend
JAR_FILE="$PROJECT_DIR/chat_web_yj.jar"
LOCAL_CFG="$PROJECT_DIR/application-local.yml"
if [[ ! -f "$JAR_FILE" ]]; then
echo "Error: JAR file not found at $JAR_FILE"
exit 1
fi
pkill -f "chat_web_yj.jar" 2>/dev/null || true
sleep 2
# 日志目录logback 写 /opt/apps/...);非 root 启动时需可写
mkdir -p "$PROJECT_DIR/logs" /opt/apps/logs/chat-server-backend-cast 2>/dev/null || true
LOG_OUT="$PROJECT_DIR/nohup.out"
if ! ( umask 022; : >>"$LOG_OUT" ) 2>/dev/null; then
LOG_OUT="/tmp/chat_web_yj_nohup.log"
fi
EXTRA_JAVA=()
[[ -f "$LOCAL_CFG" ]] && EXTRA_JAVA=(-Dspring.config.additional-location="file:${LOCAL_CFG}")
nohup java \
-Djava.net.useSystemProxies=false \
-Dhttp.nonProxyHosts="localhost|127.*|[::1]|*.local" \
-Xms512m \
-Xmx2048m \
"${EXTRA_JAVA[@]}" \
-Dspring.profiles.active=yj \
-jar "$JAR_FILE" >>"$LOG_OUT" 2>&1 &
sleep 10
if pgrep -f "chat_web_yj.jar" > /dev/null; then
echo "OK PID $(pgrep -n -f 'java .*chat_web_yj\.jar' | head -1) log:$LOG_OUT"
else
tail -50 "$LOG_OUT" 2>/dev/null || true
exit 1
fi

1
backend/startup.sh Executable file
View File

@@ -0,0 +1 @@
nohup /home/gc/gangyan/backend/jdk1.8.0_161/bin/java -jar -Xms8g -Xmx8g -DserverUrlPrefix=http://localhost:3000 -DserverFrontUrlPrefix=/chat_web -Dspring.profiles.active=yj -Dspring.redis.database=3 -Dspring.redis.password=Redis_897653 -Dchat.modelName=zhipu-api /home/gc/gangyan/backend/chat_web_yj.jar > /home/gc/gangyan/backend/nohup.out 2>&1 &

1
backend/stop.sh Executable file
View File

@@ -0,0 +1 @@
ps -ef|grep chat_web_yj | grep -v grep | awk '{print $2}' | xargs kill -9