feat(sso): dbx-main SSO 통합, /corm/ 서브경로 호스팅, 인증 미들웨어 적용
- SessionMiddleware 추가 (dbx-main/OMS 와 동일 SECRET_KEY/COOKIE_NAME/MAX_AGE).
미설정 시 fail-fast.
- AuthGuardMiddleware: 미인증 시 HTML 요청은 dbx-main /login?next=... 으로 302,
API 요청은 401 JSON. 예외 경로: /static/, /health, OAuth 콜백, /login, /logout.
- /health/db 엔드포인트 추가 (DB ping) — dbx-main 헬스 배지가 폴링.
- /login, /logout 라우트 추가 (자체 OAuth 없음, dbx-main 으로 302 위임).
- APP_ROOT_PATH 환경변수 도입 — Dockerfile 의 uvicorn --root-path 로 전달.
- templates/index.html: 모든 /static/, /js 절대경로를 {{ root_path }} 기반으로,
window.APP_BASE_PATH 변수 주입.
- static/js/app.js: fetch wrapper 1개로 /api/* 호출에 APP_BASE_PATH prepend,
401 응답 시 dbx-main 로그인으로 자동 이동. 32 곳 호출 사이트는 그대로 둠.
- Cafe24 OAuth 콜백의 hard-coded redirect 도 root_path 인지하도록 수정.
- docker-compose.yml: 호스트 포트 바인딩 제거(0.0.0.0:8002 노출 차단),
expose 추가, web_net(npm_default) 외부 네트워크 attach, healthcheck 추가.
- .env.example 에 SSO/네트워크 항목 추가.
This commit is contained in:
@@ -6,8 +6,12 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<title>[No.1 King] CS 통합 관리앱 (미라클주방)</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/static/css/styles.css?v=5">
|
||||
<link rel="stylesheet" href="{{ root_path }}/static/css/styles.css?v=5">
|
||||
<script src="https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js"></script>
|
||||
<script>
|
||||
// 서브경로 호스팅 정보 — JS 가 fetch 시 prefix 로 사용한다.
|
||||
window.APP_BASE_PATH = "{{ root_path }}";
|
||||
</script>
|
||||
<style>
|
||||
.hover-row:hover {
|
||||
background-color: #a8e0ff !important;
|
||||
@@ -891,7 +895,7 @@
|
||||
{% include 'version_history.html' %}
|
||||
</main>
|
||||
</div>
|
||||
<script src="/static/js/app.js?v=30"></script>
|
||||
<script src="{{ root_path }}/static/js/app.js?v=30"></script>
|
||||
|
||||
<!-- Toast Notification -->
|
||||
<div id="toast-notification"
|
||||
|
||||
Reference in New Issue
Block a user