GCP相关
Google Cloud Platform SSH 连接配置
https://www.jianshu.com/p/57e85cf3e50b
密钥
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQgQlFDNZbD9RTmekn3sM7e。。。。中间省略。。。。AVvSyqfIC/8yAeFE= zoework8@LAPTOP-VJD1JHBT
利用私钥登陆GCE虚拟机
ssh -i myKey zoework8@34.84.57.233
安装java11 (8已经不在Debain中支持 https://serverfault.com/questions/974992/why-isnt-there-a-openjdk-8-jdk-package-on-debian-anymore)
`sudo apt-get install openjdk-11-jre`
复制本地文件到gcp (在私钥myKey所属的文件夹下用git bash执行)
scp -i myKey verify-gcp-server-1.jar zoework8@34.84.57.233:/tmp
上传代码 到github
git push https://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@github.com/lotuswmm/gcp.git
git-upload-token:
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
Launcher.main(JarLauncher.java:88)
Caused by: java.lang.IllegalArgumentException: Project ID is required to access messaging service. Use a service account credential or set the project ID explicitly via FirebaseOptions. Alternatively you can also set the project ID via the GOOGLE_CLOUD_PROJECT environment variable.
Caused by: java.lang.IllegalArgumentException: Project ID is required to access messaging service. Use a service account credential or set the project ID explicitly via FirebaseOptions.
将服务帐号添加到 Firebase 项目
https://cloud.google.com/architecture/mobile-firebase-app-engine-flexible?hl=zh-cn#adding_a_service_account_to_the_firebase_project
gcloud compute instances set-service-account [INSTANCE_NAME] \
[--service-account [SERVICE_ACCOUNT_EMAIL] | --no-service-account] \
[--no-scopes | --scopes [SCOPES,...]]
gcloud compute instances set-service-account instance-1 \
--service-account access-fcm-service-account@test-gcp-verify.iam.gserviceaccount.com \
--scopes firebase-rw
gcloud run & Firebase Admin SDK
https://stackoverflow.com/questions/60697470/gcloud-run-firebase-admin-sdk
https://stackoverflow.com/questions/60697470/gcloud-run-firebase-admin-sdk
access-fcm-service-account@test-gcp-verify.iam.gserviceaccount.com access-fcm-service-account
編集者
Firebase Admin SDK 管理者サービス エージェント
Firebase Authentication 管理者
Firebase Cloud Messaging 管理者
Firebase Service Management サービス エージェント
サービス アカウント ユーザー
編集者
Firebase Admin SDK 管理者サービス エージェント
Firebase Authentication 管理者
Firebase Cloud Messaging 管理者
Firebase Service Management サービス エージェント
サービス アカウント ユーザー