build: separate .env.build for packaging, keep .env dev-only
The previous setup packaged the development `.env` into the installer resources, mixing local server settings (PORT/HOST/SESSION_SECRET) with the build-time site domain. Introduce a dedicated `.env.build`: - electron-builder configs now copy `.env.build` (gitignored) into `resources/`, no longer touching the dev `.env`. - `loadEnv()` prefers `resources/.env.build` first, falling back to `resources/.env` (for operators who hand-edit the packaged file), then `<root>/.env.build`, then `<root>/.env`. - `.env.build.example` documents the build-only keys (SITE_BASE_URL, MANIFEST_URL, MUSIC_CONCURRENCY); server-side keys stay in `.env`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -9,15 +9,17 @@ files:
|
||||
- installer/**
|
||||
- build/icon.*
|
||||
- package.json
|
||||
# 빌드 시점의 .env 를 설치기 옆에 함께 배포(없으면 조용히 패스).
|
||||
# 패키징 후 운영자가 resources/.env 만 교체해서 도메인을 바꿀 수도 있음.
|
||||
# 빌드 전용 `.env.build` 를 설치기 옆에 함께 배포(없으면 조용히 패스).
|
||||
# `.env` 는 서버/개발 실행용이라 빌드 산출물에는 포함되지 않으며, 패키지된 exe
|
||||
# 는 `resources/.env.build` 를 우선 로드함(없으면 `resources/.env` 로 폴백).
|
||||
# 패키징 후 운영자가 `resources/.env.build` 만 교체해서 도메인을 바꿀 수 있음.
|
||||
# locales/ 폴더는 i18n.ts 가 process.resourcesPath/locales/<component>/ko-kr.json
|
||||
# 을 찾아 로드하므로, 빌드된 .exe 에서도 한국어 사전이 적용되도록 함께 배포.
|
||||
extraResources:
|
||||
- from: .
|
||||
to: .
|
||||
filter:
|
||||
- .env
|
||||
- .env.build
|
||||
- from: locales
|
||||
to: locales
|
||||
filter:
|
||||
|
||||
Reference in New Issue
Block a user