보안 감사 결과 CRITICAL 2건, HIGH 5건 발견 → 수정 완료 + 자동화 구축. [보안 수정] - issue-view.js: 하드코딩 비밀번호 → crypto.getRandomValues() 랜덤 생성 - pushSubscriptionController.js: ntfy 비밀번호 → process.env.NTFY_SUB_PASSWORD - DEPLOY-GUIDE.md/PROGRESS.md/migration SQL: 평문 비밀번호 → placeholder - docker-compose.yml/.env.example: NTFY_SUB_PASSWORD 환경변수 추가 [보안 강제 시스템 - 신규] - scripts/security-scan.sh: 8개 규칙 (CRITICAL 2, HIGH 4, MEDIUM 2) 3모드(staged/all/diff), severity, .securityignore, MEDIUM 임계값 - .githooks/pre-commit: 로컬 빠른 피드백 - .githooks/pre-receive-server.sh: Gitea 서버 최종 차단 bypass 거버넌스([SECURITY-BYPASS: 사유] + 사용자 제한 + 로그) - SECURITY-CHECKLIST.md: 10개 카테고리 자동/수동 구분 - docs/SECURITY-GUIDE.md: 운영자 가이드 (워크플로우, bypass, FAQ) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
60 lines
1.9 KiB
JavaScript
60 lines
1.9 KiB
JavaScript
// ✅ /js/calendar.js
|
|
export function renderCalendar(containerId, onDateSelect) {
|
|
const container = document.getElementById(containerId);
|
|
if (!container) return;
|
|
|
|
let currentDate = new Date();
|
|
let selectedDateStr = '';
|
|
|
|
function drawCalendar(date) {
|
|
container.innerHTML = '';
|
|
const year = date.getFullYear();
|
|
const month = date.getMonth();
|
|
const firstDay = new Date(year, month, 1).getDay();
|
|
const lastDate = new Date(year, month + 1, 0).getDate();
|
|
|
|
const nav = document.createElement('div');
|
|
nav.className = 'nav';
|
|
const prev = document.createElement('button');
|
|
prev.textContent = '◀';
|
|
prev.addEventListener('click', () => {
|
|
currentDate = new Date(year, month - 1, 1);
|
|
drawCalendar(currentDate);
|
|
});
|
|
const title = document.createElement('div');
|
|
title.innerHTML = `<strong>${year}년 ${month + 1}월</strong>`;
|
|
const next = document.createElement('button');
|
|
next.textContent = '▶';
|
|
next.addEventListener('click', () => {
|
|
currentDate = new Date(year, month + 1, 1);
|
|
drawCalendar(currentDate);
|
|
});
|
|
nav.append(prev, title, next);
|
|
container.appendChild(nav);
|
|
|
|
['일','월','화','수','목','금','토'].forEach(day => {
|
|
const el = document.createElement('div');
|
|
el.innerHTML = `<strong>${day}</strong>`;
|
|
container.appendChild(el);
|
|
});
|
|
|
|
for (let i = 0; i < firstDay; i++) container.appendChild(document.createElement('div'));
|
|
|
|
for (let i = 1; i <= lastDate; i++) {
|
|
const btn = document.createElement('button');
|
|
const ymd = `${year}-${String(month + 1).padStart(2, '0')}-${String(i).padStart(2, '0')}`;
|
|
btn.textContent = i;
|
|
btn.className = (ymd === selectedDateStr) ? 'selected-date' : '';
|
|
btn.addEventListener('click', () => {
|
|
selectedDateStr = ymd;
|
|
drawCalendar(currentDate);
|
|
onDateSelect(ymd);
|
|
});
|
|
container.appendChild(btn);
|
|
}
|
|
}
|
|
|
|
drawCalendar(currentDate);
|
|
}
|
|
|