WOL 호환 API 경로 추가

This commit is contained in:
seo
2026-07-22 01:17:45 +09:00
parent ae7081bd94
commit b7534d8824
2 changed files with 20 additions and 0 deletions
+3
View File
@@ -18,6 +18,7 @@ Seoul은 서버에 흩어진 웹 서비스들을 한 화면에서 찾기 위한
## 주요 진입점
- `index.php`: 바로가기 대시보드
- `api.php`: `seo.chaegeon.com/api.php?action=wake_lan*` 호환 WOL 엔드포인트
- `asset-version.php`: 대시보드 파일 묶음의 현재 hash를 내려주는 JSON 엔드포인트
- `manifest.webmanifest`: PWA manifest
- `sw.js`: 과거 등록된 service worker 정리용 파일
@@ -25,6 +26,7 @@ Seoul은 서버에 흩어진 웹 서비스들을 한 화면에서 찾기 위한
## 구성
- `index.php`: nginx 설정 파싱과 HTML 렌더링
- `api.php`: `wake_lan`, `wake_lan_status` 요청만 `/var/www/control/public/api.php`로 넘기는 호환 파일
- `manifest.webmanifest`: PWA 설치 정보
- `sw.js`: 과거 등록된 service worker 정리용 파일
- `assets/`: 아이콘과 정적 자산
@@ -62,6 +64,7 @@ Seoul은 서버에 흩어진 웹 서비스들을 한 화면에서 찾기 위한
- nginx 설정 읽기는 표시용으로만 사용합니다.
- 생성된 host와 link 값은 렌더링 전에 escape합니다.
- 내부 전용 host와 IP literal은 목록에서 제외해 외부 노출 가능성을 낮춥니다.
- `api.php`는 Control API 전체가 아니라 WOL 관련 액션만 받습니다. 인증과 WOL 전용 토큰 검증은 Control 쪽에서 처리합니다.
## 운영 체크포인트
+17
View File
@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
$action = $_GET['action'] ?? $_POST['action'] ?? '';
if (!in_array($action, ['wake_lan', 'wake_lan_status'], true)) {
http_response_code(404);
header('Content-Type: application/json; charset=utf-8');
header('Cache-Control: no-store');
echo json_encode([
'ok' => false,
'error' => 'unknown_action',
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
exit;
}
require __DIR__ . '/../control/public/api.php';