feat(tkds): 독립 대시보드 서비스 분리 (tkds.technicalkorea.net)
대시보드를 gateway(tkfb)에서 분리하여 독립 서비스 tkds로 이동. - tkds/web: nginx + dashboard.html 신규 서비스 (port 30780) - gateway: /login 복원, /dashboard → tkds 301 리다이렉트 - 전체 시스템 getLoginUrl() → tkds.technicalkorea.net/dashboard로 변경 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -416,6 +416,21 @@ services:
|
||||
# AI Service — 맥미니로 이전됨 (~/docker/tk-ai-service/)
|
||||
# =================================================================
|
||||
|
||||
# =================================================================
|
||||
# Dashboard (tkds)
|
||||
# =================================================================
|
||||
|
||||
tkds-web:
|
||||
build:
|
||||
context: ./tkds/web
|
||||
dockerfile: Dockerfile
|
||||
container_name: tk-tkds-web
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "30780:80"
|
||||
networks:
|
||||
- tk-network
|
||||
|
||||
# =================================================================
|
||||
# Gateway
|
||||
# =================================================================
|
||||
@@ -470,6 +485,7 @@ services:
|
||||
- TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}
|
||||
depends_on:
|
||||
- gateway
|
||||
- tkds-web
|
||||
- system2-web
|
||||
- system3-web
|
||||
- tkpurchase-web
|
||||
|
||||
@@ -62,10 +62,10 @@
|
||||
var loginUrl;
|
||||
|
||||
if (hostname.includes('technicalkorea.net')) {
|
||||
loginUrl = window.location.protocol + '//tkfb.technicalkorea.net/dashboard';
|
||||
loginUrl = window.location.protocol + '//tkds.technicalkorea.net/dashboard';
|
||||
} else {
|
||||
// 개발 환경: Gateway 포트 (30000)
|
||||
loginUrl = window.location.protocol + '//' + hostname + ':30000/dashboard';
|
||||
// 개발 환경: tkds 포트 (30780)
|
||||
loginUrl = window.location.protocol + '//' + hostname + ':30780/dashboard';
|
||||
}
|
||||
|
||||
if (redirect) {
|
||||
|
||||
@@ -7,21 +7,16 @@ server {
|
||||
# ===== Gateway 자체 페이지 (포털, 로그인) =====
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# 대시보드 (로그인 + 네비게이션 허브 통합)
|
||||
location = /dashboard {
|
||||
# 로그인 페이지
|
||||
location = /login {
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
try_files /dashboard.html =404;
|
||||
try_files /login.html =404;
|
||||
}
|
||||
|
||||
# 루트 → 대시보드 리다이렉트
|
||||
location = / {
|
||||
return 302 /dashboard$is_args$args;
|
||||
}
|
||||
|
||||
# 로그인 → 대시보드 리다이렉트
|
||||
location = /login {
|
||||
return 302 /dashboard$is_args$args;
|
||||
# 대시보드 → tkds로 리다이렉트 (북마크 깨짐 방지)
|
||||
location = /dashboard {
|
||||
return 301 $scheme://tkds.technicalkorea.net/dashboard;
|
||||
}
|
||||
|
||||
# 공유 JS/CSS (nav-header 등)
|
||||
|
||||
@@ -52,10 +52,10 @@ if ('caches' in window) {
|
||||
window.getLoginUrl = function() {
|
||||
var hostname = window.location.hostname;
|
||||
if (hostname.includes('technicalkorea.net')) {
|
||||
return window.location.protocol + '//tkfb.technicalkorea.net/login?redirect=' + encodeURIComponent(window.location.href);
|
||||
return window.location.protocol + '//tkds.technicalkorea.net/dashboard?redirect=' + encodeURIComponent(window.location.href);
|
||||
}
|
||||
// 개발 환경: 게이트웨이 SSO 로그인 페이지
|
||||
return '/login?redirect=' + encodeURIComponent(window.location.href);
|
||||
// 개발 환경: tkds 포트 (30780)
|
||||
return window.location.protocol + '//' + hostname + ':30780/dashboard?redirect=' + encodeURIComponent(window.location.href);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,8 +16,8 @@ function getToken() { return _cookieGet('sso_token') || localStorage.getItem('ss
|
||||
function getLoginUrl() {
|
||||
const h = location.hostname;
|
||||
const t = Date.now();
|
||||
if (h.includes('technicalkorea.net')) return location.protocol + '//tkfb.technicalkorea.net/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
return location.protocol + '//' + h + ':30000/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
if (h.includes('technicalkorea.net')) return location.protocol + '//tkds.technicalkorea.net/dashboard?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
return location.protocol + '//' + h + ':30780/dashboard?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
}
|
||||
function decodeToken(t) { try { const b = atob(t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/')); return JSON.parse(new TextDecoder().decode(Uint8Array.from(b, c => c.charCodeAt(0)))); } catch { return null; } }
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ if ('serviceWorker' in navigator) {
|
||||
var hostname = window.location.hostname;
|
||||
var t = Date.now();
|
||||
if (hostname.includes('technicalkorea.net')) {
|
||||
return window.location.protocol + '//tkfb.technicalkorea.net/login?redirect=' + encodeURIComponent(window.location.href) + '&_t=' + t;
|
||||
return window.location.protocol + '//tkds.technicalkorea.net/dashboard?redirect=' + encodeURIComponent(window.location.href) + '&_t=' + t;
|
||||
}
|
||||
return window.location.protocol + '//' + hostname + ':30000/login?redirect=' + encodeURIComponent(window.location.href) + '&_t=' + t;
|
||||
return window.location.protocol + '//' + hostname + ':30780/dashboard?redirect=' + encodeURIComponent(window.location.href) + '&_t=' + t;
|
||||
};
|
||||
|
||||
window.clearSSOAuth = function() {
|
||||
|
||||
@@ -92,9 +92,9 @@ class AuthManager {
|
||||
_getLoginUrl() {
|
||||
const hostname = window.location.hostname;
|
||||
if (hostname.includes('technicalkorea.net')) {
|
||||
return window.location.protocol + '//tkfb.technicalkorea.net/login?redirect=' + encodeURIComponent(window.location.href);
|
||||
return window.location.protocol + '//tkds.technicalkorea.net/dashboard?redirect=' + encodeURIComponent(window.location.href);
|
||||
}
|
||||
return window.location.protocol + '//' + hostname + ':30000/login?redirect=' + encodeURIComponent(window.location.href);
|
||||
return window.location.protocol + '//' + hostname + ':30780/dashboard?redirect=' + encodeURIComponent(window.location.href);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
5
tkds/web/Dockerfile
Normal file
5
tkds/web/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM nginx:alpine
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY dashboard.html /usr/share/nginx/html/dashboard.html
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -326,22 +326,22 @@
|
||||
if (hostname.includes('technicalkorea.net')) {
|
||||
return protocol + '//' + name + '.technicalkorea.net';
|
||||
}
|
||||
var ports = { tkreport: 30180, tkqc: 30280, tkuser: 30380, tkpurchase: 30480, tksafety: 30580, tksupport: 30680 };
|
||||
var ports = { tkfb: 30000, tkreport: 30180, tkqc: 30280, tkuser: 30380, tkpurchase: 30480, tksafety: 30580, tksupport: 30680 };
|
||||
return protocol + '//' + hostname + ':' + (ports[name] || 30000);
|
||||
}
|
||||
|
||||
// ===== Card Definitions =====
|
||||
var DAILY_CARDS = [
|
||||
{ id: 'tbm', name: 'TBM', icon: '\uD83D\uDCCB', href: '/pages/work/tbm.html', pageKey: 's1.work.tbm' },
|
||||
{ id: 'report', name: '\uC791\uC5C5\uBCF4\uACE0\uC11C', icon: '\uD83D\uDCDD', href: '/pages/work/report-create.html', pageKey: 's1.work.report_create' },
|
||||
{ id: 'tbm', name: 'TBM', icon: '\uD83D\uDCCB', subdomain: 'tkfb', path: '/pages/work/tbm.html', pageKey: 's1.work.tbm' },
|
||||
{ id: 'report', name: '\uC791\uC5C5\uBCF4\uACE0\uC11C', icon: '\uD83D\uDCDD', subdomain: 'tkfb', path: '/pages/work/report-create.html', pageKey: 's1.work.report_create' },
|
||||
{ id: 'issue', name: '\uC548\uC804\uC2E0\uACE0', icon: '\u26A0\uFE0F', subdomain: 'tkreport', path: '/pages/safety/issue-report.html', accessKey: 'system2' },
|
||||
{ id: 'checkin', name: '\uCD9C\uD1F4\uADFC \uCCB4\uD06C', icon: '\u23F0', href: '/pages/attendance/checkin.html', pageKey: 's1.inspection.checkin' },
|
||||
{ id: 'vacation', name: '\uB0B4 \uC5F0\uCC28 \uC815\uBCF4', icon: '\uD83C\uDFD6\uFE0F', href: '/pages/attendance/my-vacation-info.html', pageKey: 's1.attendance.my_vacation_info' },
|
||||
{ id: 'leave', name: '\uD734\uAC00 \uC2E0\uCCAD', icon: '\uD83D\uDCC5', href: '/pages/attendance/vacation-request.html', pageKey: 's1.attendance.vacation_request' }
|
||||
{ id: 'checkin', name: '\uCD9C\uD1F4\uADFC \uCCB4\uD06C', icon: '\u23F0', subdomain: 'tkfb', path: '/pages/attendance/checkin.html', pageKey: 's1.inspection.checkin' },
|
||||
{ id: 'vacation', name: '\uB0B4 \uC5F0\uCC28 \uC815\uBCF4', icon: '\uD83C\uDFD6\uFE0F', subdomain: 'tkfb', path: '/pages/attendance/my-vacation-info.html', pageKey: 's1.attendance.my_vacation_info' },
|
||||
{ id: 'leave', name: '\uD734\uAC00 \uC2E0\uCCAD', icon: '\uD83D\uDCC5', subdomain: 'tkfb', path: '/pages/attendance/vacation-request.html', pageKey: 's1.attendance.vacation_request' }
|
||||
];
|
||||
|
||||
var SYSTEM_CARDS = [
|
||||
{ id: 'factory', name: '\uACF5\uC7A5\uAD00\uB9AC', icon: '\uD83C\uDFED', href: '/pages/dashboard.html', pageKey: 's1.dashboard', color: '#1a56db' },
|
||||
{ id: 'factory', name: '\uACF5\uC7A5\uAD00\uB9AC', icon: '\uD83C\uDFED', subdomain: 'tkfb', path: '/pages/dashboard.html', pageKey: 's1.dashboard', color: '#1a56db' },
|
||||
{ id: 'report_sys', name: '\uC2E0\uACE0', icon: '\uD83D\uDEA8', subdomain: 'tkreport', accessKey: 'system2', color: '#dc2626' },
|
||||
{ id: 'quality', name: '\uBD80\uC801\uD569\uAD00\uB9AC', icon: '\uD83D\uDCCA', subdomain: 'tkqc', pageKey: 'issues_dashboard', color: '#059669' }
|
||||
];
|
||||
@@ -578,7 +578,7 @@
|
||||
if (user) {
|
||||
// Partner redirect
|
||||
if (user.partner_company_id) {
|
||||
window.location.href = '/pages/partner/partner-portal.html';
|
||||
window.location.href = getSubdomainUrl('tkfb') + '/pages/partner/partner-portal.html';
|
||||
return;
|
||||
}
|
||||
|
||||
38
tkds/web/nginx.conf
Normal file
38
tkds/web/nginx.conf
Normal file
@@ -0,0 +1,38 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
location = /dashboard {
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
root /usr/share/nginx/html;
|
||||
try_files /dashboard.html =404;
|
||||
}
|
||||
|
||||
location = / {
|
||||
return 302 /dashboard$is_args$args;
|
||||
}
|
||||
|
||||
location /auth/ {
|
||||
proxy_pass http://sso-auth:3000/api/auth/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://system1-api:3005/api/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /health {
|
||||
access_log off;
|
||||
return 200 '{"status":"ok","service":"tkds"}';
|
||||
add_header Content-Type application/json;
|
||||
}
|
||||
}
|
||||
@@ -21,8 +21,8 @@ function getToken() { return _cookieGet('sso_token') || localStorage.getItem('ss
|
||||
function getLoginUrl() {
|
||||
const h = location.hostname;
|
||||
const t = Date.now();
|
||||
if (h.includes('technicalkorea.net')) return location.protocol + '//tkfb.technicalkorea.net/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
return location.protocol + '//' + h + ':30000/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
if (h.includes('technicalkorea.net')) return location.protocol + '//tkds.technicalkorea.net/dashboard?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
return location.protocol + '//' + h + ':30780/dashboard?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
}
|
||||
function decodeToken(t) { try { const b = atob(t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/')); return JSON.parse(new TextDecoder().decode(Uint8Array.from(b, c => c.charCodeAt(0)))); } catch { return null; } }
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ function getToken() { return _cookieGet('sso_token') || localStorage.getItem('ss
|
||||
function getLoginUrl() {
|
||||
const h = location.hostname;
|
||||
const t = Date.now();
|
||||
if (h.includes('technicalkorea.net')) return location.protocol + '//tkfb.technicalkorea.net/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
return location.protocol + '//' + h + ':30000/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
if (h.includes('technicalkorea.net')) return location.protocol + '//tkds.technicalkorea.net/dashboard?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
return location.protocol + '//' + h + ':30780/dashboard?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
}
|
||||
function decodeToken(t) { try { const b = atob(t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/')); return JSON.parse(new TextDecoder().decode(Uint8Array.from(b, c => c.charCodeAt(0)))); } catch { return null; } }
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/tksupport-core.js?v=1"></script>
|
||||
<script src="/static/js/tksupport-core.js?v=2"></script>
|
||||
<script>
|
||||
let vacationTypes = [];
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ function getToken() { return _cookieGet('sso_token') || localStorage.getItem('ss
|
||||
function getLoginUrl() {
|
||||
const h = location.hostname;
|
||||
const t = Date.now();
|
||||
if (h.includes('technicalkorea.net')) return location.protocol + '//tkfb.technicalkorea.net/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
return location.protocol + '//' + h + ':30000/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
if (h.includes('technicalkorea.net')) return location.protocol + '//tkds.technicalkorea.net/dashboard?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
return location.protocol + '//' + h + ':30780/dashboard?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
}
|
||||
function decodeToken(t) { try { const b = atob(t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/')); return JSON.parse(new TextDecoder().decode(Uint8Array.from(b, c => c.charCodeAt(0)))); } catch { return null; } }
|
||||
|
||||
@@ -83,7 +83,7 @@ function renderNavbar() {
|
||||
const currentPage = location.pathname.replace(/\//g, '') || 'index.html';
|
||||
const isAdmin = currentUser && ['admin','system'].includes(currentUser.role);
|
||||
const links = [
|
||||
{ href: '/', icon: 'fa-home', label: '대시보드', match: ['index.html', ''] },
|
||||
{ href: '/', icon: 'fa-home', label: '대시보드', match: ['index.html'] },
|
||||
{ href: '/vacation-request.html', icon: 'fa-paper-plane', label: '휴가 신청', match: ['vacation-request.html'] },
|
||||
{ href: '/vacation-status.html', icon: 'fa-calendar-check', label: '내 휴가 현황', match: ['vacation-status.html'] },
|
||||
{ href: '/vacation-approval.html', icon: 'fa-clipboard-check', label: '휴가 승인', match: ['vacation-approval.html'], admin: true },
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/tksupport-core.js?v=1"></script>
|
||||
<script src="/static/js/tksupport-core.js?v=2"></script>
|
||||
<script>
|
||||
let reviewAction = '';
|
||||
let reviewRequestId = null;
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/tksupport-core.js?v=1"></script>
|
||||
<script src="/static/js/tksupport-core.js?v=2"></script>
|
||||
<script>
|
||||
async function initRequestPage() {
|
||||
if (!initAuth()) return;
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/tksupport-core.js?v=1"></script>
|
||||
<script src="/static/js/tksupport-core.js?v=2"></script>
|
||||
<script>
|
||||
async function initStatusPage() {
|
||||
if (!initAuth()) return;
|
||||
|
||||
@@ -16,8 +16,8 @@ function getToken() { return _cookieGet('sso_token') || localStorage.getItem('ss
|
||||
function getLoginUrl() {
|
||||
const h = location.hostname;
|
||||
const t = Date.now(); // 캐시 버스팅
|
||||
if (h.includes('technicalkorea.net')) return location.protocol + '//tkfb.technicalkorea.net/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
return location.protocol + '//' + h + ':30000/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
if (h.includes('technicalkorea.net')) return location.protocol + '//tkds.technicalkorea.net/dashboard?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
return location.protocol + '//' + h + ':30780/dashboard?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
|
||||
}
|
||||
function decodeToken(t) { try { const b = atob(t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/')); return JSON.parse(new TextDecoder().decode(Uint8Array.from(b, c => c.charCodeAt(0)))); } catch { return null; } }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user