Skip to content

feat: Config Sync page — promote platform config across environments#20

Merged
jlc488 merged 2 commits into
mainfrom
feat/config-sync-page
Jun 3, 2026
Merged

feat: Config Sync page — promote platform config across environments#20
jlc488 merged 2 commits into
mainfrom
feat/config-sync-page

Conversation

@jlc488

@jlc488 jlc488 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a Config Sync page (ADR 0003) so an operator can promote platform config — permissions, roles, menus, and (opt-in) users — from one environment (e.g. local) to another (e.g. production), without hand-editing the target.

  • Export — snapshot this server's config as a code-keyed JSON bundle: view, Download JSON, Copy. Counts shown as tags. An Include users toggle adds users to the bundle (by login id, no password).
  • Import — paste or upload a bundle, Preview (dry-run) the diff, then Apply. Apply is gated on a fresh dry-run: any edit to the bundle text, mode, or the users toggle clears the preview, so what you apply is exactly what you previewed.
  • merge / mirror modes. mirror deletes target entities absent from the bundle (warned inline).
  • Sync users toggle on import — create-only: missing users are created with no usable password; existing users are never overwritten.
  • Per-section diff renders Created / Updated / Deleted (mirror) / Skipped with color-coded tags, plus a Users section when user sync ran. Large and readable.
  • New route config-sync + sidebar nav entry under Platform; full ko/en i18n.

Backend

Talks to GET /admin/api/v1/config/export and POST /admin/api/v1/config/import — the kit's config-sync surface (off by default via devslab.kit.config-sync.enabled, refused under a production profile). The mirror mode, deleted/skipped reporting and includeUsers are delivered by devslab-kit #55 (this PR pairs with it); export/import themselves landed in #53 / #54.

Verification

npm run build (vue-tsc typecheck + vite) green locally.


요약 (한국어)

설정 동기화 페이지(ADR 0003)를 추가합니다. 운영자가 플랫폼 설정 — 권한·역할·메뉴, 그리고 (옵트인) 사용자 — 을 한 환경(예: 로컬)에서 다른 환경(예: 운영)으로 대상 서버를 직접 손대지 않고 배포할 수 있습니다.

  • 내보내기 — 코드 기준 JSON 번들로 스냅샷: 보기, JSON 다운로드, 복사. 개수를 태그로 표시. 사용자 포함 토글로 사용자(login id 기준, 비밀번호 제외)를 번들에 추가.
  • 가져오기 — 번들을 붙여넣거나 업로드, 미리보기(dry-run)적용. 적용은 최신 dry-run 에만 활성화 — 번들 텍스트·모드·사용자 토글을 바꾸면 미리보기가 초기화됩니다.
  • 병합 / 미러 모드. mirror 는 번들에 없는 대상 항목을 삭제(화면 경고).
  • 가져오기의 사용자 동기화 토글 — 생성 전용: 없는 사용자만 비밀번호 없이 생성, 기존 사용자는 덮어쓰지 않음.
  • 섹션별 diff 가 생성 / 수정 / 삭제(미러) / 건너뜀 을 색상 태그로, 사용자 동기화 시 사용자 섹션까지 크고 읽기 쉽게 표시.
  • 새 라우트 config-sync + 플랫폼 그룹 사이드바 메뉴; ko/en i18n 완비.

백엔드

GET /admin/api/v1/config/export, POST /admin/api/v1/config/import 호출 — kit 의 config-sync 표면(기본 off: devslab.kit.config-sync.enabled, 운영 프로파일 기동 거부). mirror 모드, deleted/skipped 보고, includeUsers 는 devslab-kit #55 가 제공(이 PR 과 짝); export/import 자체는 #53 / #54 에서 반영됨.

검증

npm run build(vue-tsc 타입체크 + vite) 로컬 green.

Adds a Config Sync screen (ADR 0003) to move definitional config
(permissions, roles, menus) from one environment to another:

- Export: snapshot this server's config as a code-keyed JSON bundle
  (view / download / copy).
- Import: paste or upload a bundle, preview the diff (dry-run, the
  default), then apply. Apply is gated on a fresh dry-run reflecting the
  current text — any edit clears the preview.
- merge / mirror modes. mirror deletes target entities absent from the
  bundle (needs a kit version that supports it; warned in the UI).
- Route + sidebar nav entry under Platform; ko/en i18n.

Talks to GET /config/export and POST /config/import (kit config-sync,
off by default, refused under a production profile).
Follows the kit's config-sync PR (mirror mode + user sync) so the page
exposes the full surface:

- Import/Export gain an "include users" toggle (export carries users with
  no password; import is create-only and never overwrites existing users)
  with an inline hint.
- The diff now renders Deleted (red, mirror only) and Skipped (gray —
  a role still in use, or a user that already exists) alongside
  Created/Updated, plus a Users section when user sync ran.
- Editing the bundle, mode, or the users toggle re-gates Apply behind a
  fresh dry-run.

Built green (vue-tsc + vite).
@jlc488 jlc488 merged commit 9dbd760 into main Jun 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant