Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff7d4e4b9a | ||
|
|
c0c4cf3ab2 | ||
|
|
9f81c0d03e |
@ -10,14 +10,14 @@ PORT=3005
|
|||||||
# [Development Environment] - Local Windows
|
# [Development Environment] - Local Windows
|
||||||
# ==============================================
|
# ==============================================
|
||||||
# 로컬 개발용 DB (분리됨: sokuree_platform_dev)
|
# 로컬 개발용 DB (분리됨: sokuree_platform_dev)
|
||||||
# DB_NAME=sokuree_platform_dev
|
DB_NAME=sokuree_platform_dev
|
||||||
# DB_PORT=3307
|
DB_PORT=3307
|
||||||
# Windows 환경 호환성 (tcp는 권한 오류 발생 가능)
|
# Windows 환경 호환성 (tcp는 권한 오류 발생 가능)
|
||||||
CCTV_TRANSPORT_OVERRIDE=auto
|
CCTV_TRANSPORT_OVERRIDE=auto
|
||||||
|
|
||||||
# ==============================================
|
# ==============================================
|
||||||
# [Production Environment] - Synology NAS
|
# [Production Environment] - Synology NAS
|
||||||
# ==============================================
|
# ==============================================
|
||||||
DB_NAME=sokuree_platform_prod
|
# DB_NAME=sokuree_platform_prod
|
||||||
DB_PORT=3307
|
# DB_PORT=3307
|
||||||
|
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "smartims",
|
"name": "smartims",
|
||||||
"version": "0.4.0.0",
|
"version": "0.4.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "smartims",
|
"name": "smartims",
|
||||||
"version": "0.4.0.0",
|
"version": "0.4.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dnd-kit/core": "^6.3.1",
|
"@dnd-kit/core": "^6.3.1",
|
||||||
"@dnd-kit/sortable": "^10.0.0",
|
"@dnd-kit/sortable": "^10.0.0",
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "smartims",
|
"name": "smartims",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.4.0.1",
|
"version": "0.4.2.7",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@ -467,13 +467,25 @@ initTables();
|
|||||||
const packageJson = require('./package.json');
|
const packageJson = require('./package.json');
|
||||||
|
|
||||||
app.get('/api/health', (req, res) => {
|
app.get('/api/health', (req, res) => {
|
||||||
// Light-weight health check
|
// Dynamic version check (Light-weight)
|
||||||
const kstOffset = 9 * 60 * 60 * 1000;
|
const kstOffset = 9 * 60 * 60 * 1000;
|
||||||
const kstDate = new Date(Date.now() + kstOffset);
|
const kstDate = new Date(Date.now() + kstOffset);
|
||||||
|
|
||||||
|
let version = packageJson.version;
|
||||||
|
try {
|
||||||
|
const { execSync } = require('child_process');
|
||||||
|
// Check git tag in parent directory (Project root)
|
||||||
|
version = execSync('git describe --tags --abbrev=0', {
|
||||||
|
cwd: path.join(__dirname, '..'),
|
||||||
|
stdio: ['ignore', 'pipe', 'ignore']
|
||||||
|
}).toString().trim().replace(/^v/, '');
|
||||||
|
} catch (e) {
|
||||||
|
// Safe fallback to package.json
|
||||||
|
}
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
status: 'ok',
|
status: 'ok',
|
||||||
version: packageJson.version,
|
version: version,
|
||||||
node_version: process.version,
|
node_version: process.version,
|
||||||
platform: process.platform,
|
platform: process.platform,
|
||||||
arch: process.arch,
|
arch: process.arch,
|
||||||
|
|||||||
4
server/package-lock.json
generated
4
server/package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.4.0.0",
|
"version": "0.4.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.4.0.0",
|
"version": "0.4.0.1",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.13.2",
|
"axios": "^1.13.2",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.4.0.1",
|
"version": "0.4.2.7",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -489,13 +489,22 @@ const getGiteaAuth = async () => {
|
|||||||
// 5. Get Version Info (Current, Remote & History from Tags)
|
// 5. Get Version Info (Current, Remote & History from Tags)
|
||||||
router.get('/version/remote', isAuthenticated, hasRole('admin'), async (req, res) => {
|
router.get('/version/remote', isAuthenticated, hasRole('admin'), async (req, res) => {
|
||||||
try {
|
try {
|
||||||
// Local version detection (No caching)
|
// Local version detection (Dynamic & Robust)
|
||||||
|
const projectRoot = path.join(__dirname, '../..');
|
||||||
let currentVersion = '0.0.0.0';
|
let currentVersion = '0.0.0.0';
|
||||||
try {
|
try {
|
||||||
const rootPkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../../package.json'), 'utf8'));
|
const { execSync } = require('child_process');
|
||||||
currentVersion = rootPkg.version;
|
currentVersion = execSync('git describe --tags --abbrev=0', {
|
||||||
|
cwd: projectRoot,
|
||||||
|
stdio: ['ignore', 'pipe', 'ignore']
|
||||||
|
}).toString().trim().replace(/^v/, '');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
currentVersion = '0.4.2.1';
|
try {
|
||||||
|
const rootPkg = JSON.parse(fs.readFileSync(path.join(projectRoot, 'package.json'), 'utf8'));
|
||||||
|
currentVersion = rootPkg.version;
|
||||||
|
} catch (err) {
|
||||||
|
currentVersion = '0.4.2.7';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare git fetch command
|
// Prepare git fetch command
|
||||||
@ -509,7 +518,7 @@ router.get('/version/remote', isAuthenticated, hasRole('admin'), async (req, res
|
|||||||
fetchCmd = `git fetch ${auth.url} --tags --force --prune`;
|
fetchCmd = `git fetch ${auth.url} --tags --force --prune`;
|
||||||
}
|
}
|
||||||
|
|
||||||
exec(fetchCmd, (err, stdout, stderr) => {
|
exec(fetchCmd, { cwd: projectRoot }, (err, stdout, stderr) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error('Git fetch failed:', err);
|
console.error('Git fetch failed:', err);
|
||||||
const sanitizedError = stderr.replace(/:[^@]+@/g, ':****@');
|
const sanitizedError = stderr.replace(/:[^@]+@/g, ':****@');
|
||||||
@ -526,7 +535,7 @@ router.get('/version/remote', isAuthenticated, hasRole('admin'), async (req, res
|
|||||||
const format = '%(refname:short)|%(contents:subject)|%(contents:body)|%(creatordate:iso8601)';
|
const format = '%(refname:short)|%(contents:subject)|%(contents:body)|%(creatordate:iso8601)';
|
||||||
const historyCmd = `git for-each-ref refs/tags --sort=-creatordate --format="${format}" --count=50`;
|
const historyCmd = `git for-each-ref refs/tags --sort=-creatordate --format="${format}" --count=50`;
|
||||||
|
|
||||||
exec(historyCmd, (err, stdout, stderr) => {
|
exec(historyCmd, { cwd: projectRoot }, (err, stdout, stderr) => {
|
||||||
const lines = stdout ? stdout.trim().split('\n') : [];
|
const lines = stdout ? stdout.trim().split('\n') : [];
|
||||||
const allTags = lines.map(line => {
|
const allTags = lines.map(line => {
|
||||||
const [tag, subject, body, date] = line.split('|');
|
const [tag, subject, body, date] = line.split('|');
|
||||||
|
|||||||
@ -333,7 +333,7 @@ export function BasicSettingsPage() {
|
|||||||
|
|
||||||
{/* Section 2.5: Gitea Repository Update Settings */}
|
{/* Section 2.5: Gitea Repository Update Settings */}
|
||||||
<Card className="overflow-hidden border-slate-200 shadow-sm">
|
<Card className="overflow-hidden border-slate-200 shadow-sm">
|
||||||
<div className="p-6 border-b border-slate-50 bg-slate-50/50">
|
<div className="p-6 border-b border-slate-50 bg-slate-50/50 flex justify-between items-center">
|
||||||
<h2 className="text-lg font-bold text-slate-800 flex items-center gap-2">
|
<h2 className="text-lg font-bold text-slate-800 flex items-center gap-2">
|
||||||
<RefreshCcw size={20} className="text-emerald-600" />
|
<RefreshCcw size={20} className="text-emerald-600" />
|
||||||
시스템 업데이트 저장소 설정 (Gitea)
|
시스템 업데이트 저장소 설정 (Gitea)
|
||||||
|
|||||||
@ -67,8 +67,7 @@ export function VersionPage() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchVersion();
|
fetchVersion();
|
||||||
// Removed fetchRemoteVersion from auto-load to prevent "automatic" sync feeling
|
fetchRemoteVersion();
|
||||||
// fetchRemoteVersion();
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleUpdate = async () => {
|
const handleUpdate = async () => {
|
||||||
|
|||||||
39
update_system.bat
Normal file
39
update_system.bat
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
@echo off
|
||||||
|
echo [Update] Starting update to v0.4.2.6...
|
||||||
|
|
||||||
|
REM Ensure backup directory
|
||||||
|
set BACKUP_PATH=./backup
|
||||||
|
if not exist "%BACKUP_PATH%" mkdir "%BACKUP_PATH%" 2>nul
|
||||||
|
if not exist "%BACKUP_PATH%" (
|
||||||
|
echo [Warning] Global backup failed, using local backup.
|
||||||
|
set BACKUP_PATH=.\server\backups
|
||||||
|
if not exist ".\server\backups" mkdir ".\server\backups"
|
||||||
|
)
|
||||||
|
|
||||||
|
echo [Update] Backing up Config...
|
||||||
|
if exist "server\.env" (
|
||||||
|
copy /Y "server\.env" "%BACKUP_PATH%\.env.backup.2026-01-26-00-58-22"
|
||||||
|
copy /Y "server\.env" "server\.env.tmp"
|
||||||
|
)
|
||||||
|
|
||||||
|
echo [Update] Syncing Source Code...
|
||||||
|
git fetch "https://gitea.qideun.com/SOKUREE/smart_ims.git" --tags --force --prune
|
||||||
|
git checkout -f v0.4.2.6
|
||||||
|
|
||||||
|
echo [Update] Restoring Config...
|
||||||
|
if exist "server\.env.tmp" (
|
||||||
|
copy /Y "server\.env.tmp" "server\.env"
|
||||||
|
del "server\.env.tmp"
|
||||||
|
) else if exist "%BACKUP_PATH%\.env.backup.2026-01-26-00-58-22" (
|
||||||
|
copy /Y "%BACKUP_PATH%\.env.backup.2026-01-26-00-58-22" "server\.env"
|
||||||
|
)
|
||||||
|
|
||||||
|
echo [Update] Installing & Building...
|
||||||
|
call npm install
|
||||||
|
call npm run build
|
||||||
|
cd server
|
||||||
|
call npm install
|
||||||
|
|
||||||
|
echo [Update] Done.
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user