Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIKey #3

Closed
mitcon opened this issue Aug 9, 2019 · 2 comments
Closed

APIKey #3

mitcon opened this issue Aug 9, 2019 · 2 comments

Comments

@mitcon
Copy link

mitcon commented Aug 9, 2019

firebase.ts内にAPIKeyとか書いてあるのマズくないですか。
最悪の場合、firebaseをガッツリ使用されて請求来る可能性が…?
念のため、Private Repositoryに変更しておいたほうが良いのでは

@tamura2004
Copy link
Owner

tamura2004 commented Aug 9, 2019

この設定値は公開前提のものです。
例えばこいつ、https://dd5tools.web.app/、をHostingで公開していますが、
こちらのurl、https://dd5tools.web.app/__/firebase/init.js、で自動公開されていたりします。

どちらかというと、firestoreのアクセスルールをテストモードにしていると、そちらがリスクになります。テストモードでは、認証状況にかかわらずデータベースの読み書きを許可しているので。

ogisuinoteは、一部を除き認証時のみ読み書き許可しており、例外的にログイン画面に出力するメールドメイン名のみ、認証なしでの読み取りを許可しています。

monetaのfirebaseはテストモードなので、リスクありますが、firebaseの契約が無料のsparkプランなので、ガッツリ使用された場合は1日分の上限に到達して利用できなくなりますが、請求はありません。従量課金プランだと危ないようですが。

monetaはこの3連休でアクセスルール設定の予定です。
より慎重にいくなら、CIツールに環境変数で設定して、ビルド時に環境変数から取得するようにするのかな。ちょっと試してみます。

@mitcon
Copy link
Author

mitcon commented Aug 10, 2019

firebaseに無料プランというモノがあるのを知りませんでした。
従量課金プランだけかと思っていたので勉強になりました。
envファイルにKey等を書き出して非コミットで運用するみたいな手法もあるみたいですね

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

No branches or pull requests

2 participants