Skip to content

[Chore/#7] 환경별 웹 주소 주입 방식 정리 - #8

Merged
tnals0924 merged 1 commit into
mainfrom
chore/#7-eas-build-env
Sep 23, 2026
Merged

tnals0924 merged 1 commit into
mainfrom
chore/#7-eas-build-env

Conversation

@leegain1

@leegain1 leegain1 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

#️⃣연관된 이슈

🎯 해결하려는 문제가 무엇인가요?

1. .env.example에 특정 개발 PC의 LAN IP가 박혀 있었다.

EXPO_PUBLIC_WEB_URL=http://192.168.0.2:5173

클론한 사람이 cp .env.example .env.local 하면 자기 환경에서는 닿지 않는 주소가 기본값이 된다. 앱은 "페이지를 불러오지 못했습니다"를 띄우는데, 값이 채워져 있으니 설정 문제로 보이지 않아 네트워크나 웹 서버부터 의심하게 된다.

2. 배포 빌드에 주소를 넘길 방법이 없었다.

EXPO_PUBLIC_*는 런타임이 아니라 빌드 시점에 번들에 문자열로 박힌다. .env.local은 gitignore 대상이라 EAS 클라우드 빌드에는 존재하지 않는다. 저장소에 eas.json이 없어서 빌드 프로필별로 주소를 나눌 수단 자체가 없었다.

❓ 왜 해결해야 하나요?

웹 dev 환경이 이미 배포됐다 — https://dev.stream.billilge.site (stream-client-web#52의 Coolify 자동 배포). 이제 웹을 로컬에 띄우지 않고도 앱을 볼 수 있는데, 그러려면 그 주소를 어디에 어떻게 넣는지가 정해져 있어야 한다.

그리고 배포 빌드를 처음 돌리는 시점에 eas.json이 없으면, 급한 김에 .env.local을 커밋하거나 주소를 소스에 박는 식으로 흘러가기 쉽다.

⭐ 어떻게 해결했나요?

.env.example — 기본값을 http://localhost:5173으로 바꿨다. 특정 PC에 묶이지 않고, iOS 시뮬레이터에서는 그대로 동작한다. 배포된 dev 주소를 선택지로 안내하는 줄을 추가했다.

eas.json — 프로필별로 EXPO_PUBLIC_WEB_URL을 주입한다.

프로필 EXPO_PUBLIC_WEB_URL 이유
development 주입하지 않음 개발 클라이언트는 로컬 metro에서 번들을 받고, 그 metro가 .env.local을 읽는다
preview https://dev.stream.billilge.site 내부 테스트 배포
production 비워 둠 운영 주소가 아직 없다

production을 비운 건 의도적이다. 값 없이 빌드하면 앱이 WEB_URL이 빈 문자열인 걸 보고 "웹 주소가 설정되지 않았습니다" 안내 화면을 띄운다. dev 주소를 넣어두면 그게 그대로 운영으로 나갈 수 있어서, 눈에 띄게 실패하는 쪽을 택했다.

문서 — eas.json은 JSON이라 주석을 못 단다. production을 왜 비웠는지, 왜 .env.local이 배포에 안 쓰이는지를 README에 적고 docs/local-development.md에서 링크했다.

🧩 이 PR의 한계 & 트레이드오프

  • eas build를 실제로 돌려보지 못했다. EAS 계정이 붙어 있지 않고, app.json에 extra.eas.projectId가 없다. 그건 eas init이 채우는 값이라 이 PR 범위 밖으로 뒀다. 즉 이 eas.json은 스키마상 유효한 초안이고, 첫 빌드 때 조정이 필요할 수 있다
  • production 프로필이 미완성인 채로 들어간다. 운영 주소가 정해지면 한 줄 채우면 된다. 비워 두는 것과 프로필 자체를 빼는 것 중 전자를 택했다 — 프로필이 있어야 어디를 채워야 하는지 보인다
  • cli.appVersionSource: "remote" 는 EAS 권장 기본값을 따랐다. 로컬에서 버전을 관리하고 싶으면 "local"로 바꿔야 한다
  • .env.example 기본값을 iOS 시뮬레이터 기준으로 잡았다. 안드로이드 에뮬레이터 사용자는 여전히 10.0.2.2로 고쳐야 한다. 한쪽은 고쳐야 하는데, 주석에 표로 안내돼 있고 localhost가 "고쳐야 할 수도 있는 값"으로 더 잘 읽힌다고 봤다

⛓️ 기존 기능에 미치는 영향

앱 코드는 건드리지 않았다. .env.example(템플릿)·eas.json(신규)·문서 2개뿐이다.

이미 .env.local을 만들어 쓰는 사람에게는 영향이 없다. .env.example은 복사 원본일 뿐이라 기존 .env.local을 덮지 않는다.

eas.json이 새로 생기지만 eas build를 돌리기 전까지는 아무 동작도 하지 않는다. pnpm start/ios/android는 그대로다.

🔀 Edge Case & 실패 시나리오

  • 배포 주소 확인 — https://dev.stream.billilge.site가 200으로 응답하고 실제 STREAM 웹을 서빙하는 것을 브라우저로 확인했다(타이틀 stream-client, 홈 화면과 Bottom Nav 렌더)
  • eas.json 유효성 — JSON 파싱과 프로필별 env 주입 여부를 확인했다. development=(주입 안 함) | preview=https://dev.stream.billilge.site | production=(주입 안 함)
  • production을 비운 채 빌드 — WEB_URL이 빈 문자열이 되고 WebViewScreen의 첫 분기가 안내 화면을 띄운다. 흰 화면이나 오류로 끝나지 않는다
  • 주소 끝 슬래시 — isSameOrigin이 정규식으로 origin만 뽑으므로 https://dev.stream.billilge.site와 .../ 둘 다 같게 본다. 외부 링크 분기가 깨지지 않는다
  • 저장소에 남은 하드코딩 IP — grep -rn "192.168" 결과 없음
  • pnpm check 통과

📋 검토한 대안과 선택 이유

  • production에 dev 주소를 넣어두기 — 빌드는 바로 되지만 운영에 dev 웹이 나갈 수 있다. 조용한 사고보다 눈에 띄는 실패가 낫다
  • EAS 환경변수/시크릿으로만 관리하고 eas.json에는 안 적기 — 웹 주소는 비밀이 아니고, 저장소만 봐도 어느 빌드가 어딜 가리키는지 보이는 편이 낫다. 비밀값이 생기면 그때는 시크릿을 써야 한다
  • .env.example을 빈 값으로 두기 — 무조건 채우게 되지만 iOS 시뮬레이터 사용자도 한 번 더 찾아봐야 한다. localhost면 가장 흔한 경우가 바로 동작한다
  • app.config.ts로 바꿔서 주소를 코드로 분기 — 지금 app.json으로 충분하고, 빌드 프로필과 주소를 한곳에서 보는 게 단순하다

💬 리뷰 포인트

  • [r] production 프로필을 비워 두는 게 맞는지 — 운영 주소가 이미 정해져 있다면 알려주면 채우겠다
  • [c] .env.example 기본값을 localhost로 한 것 — 안드로이드 위주로 개발한다면 빈 값이 나을 수도 있다
  • [c] cli.appVersionSource: "remote" — EAS가 버전을 관리하는 설정이다. 로컬 관리가 편하면 바꾸는 게 낫다
  • [a] 배포 관련 설명을 README에 뒀다. 길어지면 docs/deployment.md로 빼는 게 나을 수 있다

Summary by CodeRabbit

  • New Features

    • Added deployment configuration for development, preview, and production builds.
    • Preview builds now use the deployed development web environment when configured.
    • Production builds support automatic version increments and submission configuration.
  • Documentation

    • Clarified local network addresses for iOS simulators, Android emulators, and physical devices.
    • Documented deployed web access, build-specific web URLs, and behavior when a production URL is unavailable.
    • Added guidance for safely handling public configuration values and secrets.

.env.example 기본값이 특정 개발 PC의 LAN IP(192.168.0.2)였다. 클론한 사람이
그대로 복사하면 닿지 않는 주소가 기본값이 되는데, 값이 채워져 있어서 설정
문제로 보이지 않는다. localhost로 바꾸고 배포된 dev 주소를 선택지로 안내한다.

EXPO_PUBLIC_*는 빌드 시점에 번들에 박히고 .env.local은 git에 없어서 EAS
클라우드 빌드에 주소를 넘길 방법이 없었다. eas.json을 추가해 프로필별로
주입한다. development는 로컬 metro가 .env.local을 읽으므로 주입하지 않고,
preview는 dev 배포 주소를 쓴다.

production은 운영 주소가 정해지지 않아 비워 뒀다. 값 없이 빌드하면 앱이
안내 화면을 띄우므로 잘못된 주소로 조용히 나가지 않는다.
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: d526d9cc-b743-4bdf-ab0d-66e5c546a14f

📥 Commits

Reviewing files that changed from the base of the PR and between d2fb8ac and b73998f.

📒 Files selected for processing (4)
  • .env.example
  • README.md
  • docs/local-development.md
  • eas.json

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds EAS build profiles and documents web URL configuration. Local development defaults to localhost, preview builds use the deployed development URL, and production remains without a web URL.

Changes

EAS URL configuration

Layer / File(s) Summary
EAS build profiles
eas.json
Adds development, preview, and production build profiles, plus a production submit profile. The preview profile injects EXPO_PUBLIC_WEB_URL.
Local and deployment URL guidance
.env.example, docs/local-development.md, README.md
Replaces the LAN IP default with http://localhost:5173. Documents the deployed development URL, profile-based EAS injection, missing production URL behavior, and EXPO_PUBLIC_* security constraints.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to b7399

The EAS configuration is valid, and no actionable merge risk remains in the reviewed URL configuration and documentation changes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning eas.json의 cli.appVersionSource: remote, production.autoIncrement: true, submit.production 설정은 #7의 웹 주소 주입과 프로필별 EXPO_PUBLIC_WEB_URL 요구사항을 구현하지 않는다. 이 설정들은 이슈가 별도 작업으로 남긴 EAS 초기화 범위와도 관련이 없지만… #7의 웹 주소 주입에 필요하지 않은 cli.appVersionSource, production.autoIncrement, submit.production 설정을 제거하거나, 이 PR에 포함할 별도 요구사항과 근거를 명시한다.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: organizing environment-specific web URL injection. It is concise and directly related to the changes.
Description check ✅ Passed The description covers all required template sections, including the issue, rationale, implementation, trade-offs, impact, edge cases, alternatives, and review points. It also documents the EAS profil…
Linked Issues check ✅ Passed PR #7의 코딩 요구사항을 충족한다. .env.example은 LAN IP 대신 http://localhost:5173을 사용하고 https://dev.stream.billilge.site를 안내한다. eas.json은 development에서 웹 주소를 주입하지 않고, preview에 dev 주소를 주입하며, production…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Out of Scope Changes check

Explanation

eas.json의 cli.appVersionSource: remote, production.autoIncrement: true, submit.production 설정은 #7의 웹 주소 주입과 프로필별 EXPO_PUBLIC_WEB_URL 요구사항을 구현하지 않는다. 이 설정들은 이슈가 별도 작업으로 남긴 EAS 초기화 범위와도 관련이 없지만, 해당 기능을 요구하지 않는다. developmentClient와 distribution은 빌드 프로필 정의를 지원하므로 범위 내로 볼 수 있다.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@tnals0924
tnals0924 merged commit cfc025d into main Sep 23, 2026
2 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.

배포 빌드용 EAS 설정 추가하고 .env.example의 로컬 IP 정리

2 participants