docker run -d -P -p 9005:9005 -p 2222:22 -v C:\Users\user\Downloads\ooxxooxx\public_html:/project --name test_sshd rastasheep/ubuntu-sshd:18.04 > apt update > apt install curl > curl -sL https://deb.nodesource.com/setup_16.x | bash - > apt-get install -y nodejs > npm install -g firebase-tools > cd /project > firebase login > firebase deploy
This problem, let me think my stupid manager and Smart Information Security Consultant before company.
Information Security Consultant Say GCP is very safe… Ya safe so customer lose.
oooxxxoooxxx: vpc Connector name
aaabbbaaabbb: your firebase project
Firebase deploy default vpcConnector vpc-Connector
node_modules\firebase-tools\lib\gcp\cloudfunctions.js
_createFunction
const data ADD
vpcConnector: ‘oooxxxoooxxx’,
Failed gcloud VPC
VPC_CONNECTOR=dosportsapi-redis01
projects/aaabbbaaabbb/locations/us-central1/connectors/oooxxxoooxxx
gcloud beta functions deploy api \
--runtime nodejs10 \
--trigger-http \
--region us-central1 \
--vpc-connector $VPC_CONNECTOR \
--egress-settings private-ranges-only \
--memory 2048MB
https://firebase.google.com/docs/hosting/manage-cache?hl=zh-cn#using_cookies
将 Firebase 托管与 Cloud Functions 或 Cloud Run 搭配使用时,Cookie 通常会从传入的请求中剥离出来。这是实现高效的 CDN 缓存行为所必需的。只有特别指定的 __session Cookie 可以传入应用执行过程中。 __session Cookie(如果存在)会自动成为缓存键的一部分,也就是说,使用不同 Cookie 的两个用户绝不会收到彼此的已缓存响应。只有在您的应用根据用户授权提供不同的内容时,您才能使用 __session Cookie。
const bookListsQuery = await modules.firestore.collection('books') .get(); const sortedObj = Object.values(bookListsQuery.docs).sort(function(a, b){ console.log('a %s b %s', a.data().order, b.data().order) return Number(a.data().order) > Number(b.data().order); }); sortedObj.forEach(function(doc){ console.log(doc.data()) }); other way object use map to array, then it sorted.
const bookListsQuery = await modules.firestore.collection('books') .get(); const sortedArr = bookListsQuery.docs.map(function (doc) { // 轉換成array return doc.data() }); sortedArr.sort(function compare(a, b) { return a.order > b.order; // 升 小->大 }); sortedArr.forEach(function(data){ console.log(data.data()) }) ==========
https://firebase.googleblog.com/2017/06/keep-your-promises-when-using-cloud.html?fbclid=IwAR2FuvlU2CbwjV-I75q7-WIkJyLHRYT-R3cyleEUWF3Fsq42THMCwZN6by8
const ref_p1_state = root.child(`player_states/${game_state.p1uid}`) const ref_p2_state = root.child(`player_states/${game_state.p2uid}`) const pr_update_p1 = ref_p1_state.update(update_p1) const pr_update_p2 = ref_p2_state.update(update_p2) return Promise.all([pr_update_p1, pr_update_p2]) ==========
https://stackoverflow.com/questions/55430079/promise-all-does-not-wait-for-firestore-query-to-loop
使用 https://github.com/dalenguyen/firestore-backup-restore
base on https://github.com/dalenguyen/firestore-import-export
能處理timestamp