refactor: saasMode 분기 제거 — 항상 SaaS(OAuth only)로 동작

Mac/Windows 환경 불일치 해소. BUILD_TIME 상수, CONFIGURE 채널,
개발자 모드 UI 전부 제거. Supabase 설정은 supabase-config.ts SSOT.
This commit is contained in:
yunchan8804 2026-04-13 17:20:55 +09:00
parent feb82abbf7
commit 541f04d02b
12 changed files with 566 additions and 9587 deletions

View file

@ -13,7 +13,8 @@ import {
} from '@supabase/supabase-js'
import { eq, gt } from 'drizzle-orm'
import { getLogger } from './LoggerService'
import { configGet, isSupabaseBuildTimeConfigured } from './ConfigService'
import { configGet } from './ConfigService'
import { SUPABASE_URL, SUPABASE_ANON_KEY } from '@d3ro/core/supabase-config'
import { getDatabase, openForUser, openLocal, closeCurrent } from '../db'
import { history, dictionary, meetingSessions, meetingMemos, meetingDocuments } from '../db/schema'
import { D3ROError, ErrorCode } from '@d3ro/core/errors'
@ -41,11 +42,6 @@ interface CloudSyncState {
userEmail: string | null
lastSyncAt: number | null
syncing: boolean
/**
* SaaS 빌드 타임 모드: Supabase URL/Key가 빌드 시점에 박혀있는지 여부.
* true이면 사용자는 OAuth 로그인만 하면 됨 (URL/Key 입력 화면 노출 금지).
*/
saasMode: boolean
}
interface CloudSyncEvents {
@ -78,15 +74,7 @@ class CloudSyncService extends EventEmitter {
if (this._initialized) return
this._initialized = true
const url = configGet('supabaseUrl') as string | undefined
const anonKey = configGet('supabaseAnonKey') as string | undefined
if (!url || !anonKey) {
logger.info('CloudSync disabled — Supabase URL/key not configured')
return
}
this._client = createClient(url, anonKey, {
this._client = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
auth: {
persistSession: false, // 직접 관리
autoRefreshToken: true,
@ -486,8 +474,7 @@ class CloudSyncService extends EventEmitter {
authenticated: this.isAuthenticated(),
userEmail: this._session?.user?.email ?? null,
lastSyncAt: this._lastSyncAt,
syncing: this._syncing,
saasMode: isSupabaseBuildTimeConfigured()
syncing: this._syncing
}
}