修复 配置文件不生效问题
This commit is contained in:
1 parent
767ac54992
commit
c215de731e
2 files changed
+17
-3
No files matched your search
@@ -13,16 +13,21 @@ const CONFIG_CACHE_TTL = 5000; // 5秒缓存
|
||||
function getConfigDir() {
|
||||
// Check if running on fnOS
|
||||
if (process.env.TRIM_PKGVAR) {
|
||||
console.log('📁 配置目录 (fnOS): ' + process.env.TRIM_PKGVAR);
|
||||
return process.env.TRIM_PKGVAR;
|
||||
}
|
||||
|
||||
// Windows
|
||||
if (process.platform === 'win32') {
|
||||
return path.join(process.env.APPDATA || os.homedir(), 'FlyPic');
|
||||
const dir = path.join(process.env.APPDATA || os.homedir(), 'FlyPic');
|
||||
console.log('📁 配置目录 (Windows): ' + dir);
|
||||
return dir;
|
||||
}
|
||||
|
||||
// Linux/Mac
|
||||
return path.join(os.homedir(), '.flypic');
|
||||
const dir = path.join(os.homedir(), '.flypic');
|
||||
console.log('📁 配置目录 (Linux/Mac): ' + dir);
|
||||
return dir;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+10
-1
@@ -16,8 +16,17 @@ if [ -f "$PORT_CONF" ]; then
|
||||
fi
|
||||
APP_PORT="${APP_PORT:-15002}"
|
||||
|
||||
# 导出飞牛环境变量,确保 Node.js 进程能访问
|
||||
export TRIM_PKGVAR
|
||||
export TRIM_PKGETC
|
||||
export TRIM_APPDEST
|
||||
export TRIM_PKGHOME
|
||||
export TRIM_DATA_SHARE_PATHS
|
||||
export DATA_DIR="${DATA_DIR}"
|
||||
export PORT="${APP_PORT}"
|
||||
|
||||
# 启动命令
|
||||
CMD="DATA_DIR=${DATA_DIR} PORT=${APP_PORT} node ${TRIM_APPDEST}/server/server.js"
|
||||
CMD="node ${TRIM_APPDEST}/server/server.js"
|
||||
|
||||
log_msg() {
|
||||
local msg="$(date '+%Y-%m-%d %H:%M:%S') - $1"
|
||||
|
||||
Reference in new issue
Block a user