Skip to content

Commit

Permalink
Merge pull request #68 from muly/chrome-store-issues
Browse files Browse the repository at this point in the history
client id added to dev deployment manifest file
  • Loading branch information
muly authored Dec 31, 2023
2 parents 7f6c86a + 810d9ca commit 3ae1a40
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ prepare_chrome_ext_for_local_deployment:
./scripts/local_mac_chrome_ext.sh 1.1.1

prepare_chrome_ext_for_dev_deployment:
./scripts/dev_mac_chrome_ext.sh 1.1.1
./scripts/dev_mac_chrome_ext.sh 1.1.3
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,25 @@ root cause: unknown.

workaround: generate new client id in gcp console and use the new client id in manifest.json file

## chrome extension: manifest file

**key:**
- for deployment to gcp:
retrieve the correct key from Chrome Developer Dashboard (https://chrome.google.com) -> open the extension page -> Package tab -> click View public key.

**client_id:**
- for deployment to gcp:
1. gcp console: https://console.cloud.google.com/
1. APIs & Services
1. Credentials
1. OAuth 2.0 Client IDs
1. copy the `Client ID` under `Chrome client (for chrome store deployment)`

- for deployment to local:
1. same steps as above except the last step
1. copy the `Client ID` under `Chrome client (for local deployment)`


## privacy policy

dev url: https://smuly-test-ground.ue.r.appspot.com/privacy-policy.html
Expand Down
4 changes: 2 additions & 2 deletions chrome-exten/manifest.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"default_popup": "signin.html",
"default_icon":"logo.png"
},
${KEY}
"key": "${KEY}",
"icons":{
"128":"logo.png"
},
Expand All @@ -18,7 +18,7 @@
"http://localhost:8006/*"
],
"oauth2": {
${CLIENT_ID}
"client_id": "${CLIENT_ID}",
"scopes": ["email"]
},
"options_page":"./signin.html"
Expand Down
8 changes: 3 additions & 5 deletions scripts/dev_mac_chrome_ext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
set -x
set -e

export CLIENT_ID=""
# retrieve the correct key from Chrome Developer Dashboard (https://chrome.google.com) -> open the extension page -> Package tab -> click View public key.
export KEY='"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApy7O4tuda2CWVXMgu3EFrrs4qv4IXnt2KQJG3KC404aYG1Hb8nvjwVpIqIdHG0QGQUH3nxIIuGnQtbFJxXzEF9bgWsWTNFe5jzrC9wKxVEjA/W50jMKIcqmypZb4Yi4D9oTHxhKvIyaNnxnljXR99f7Y8kZ3aDq5pduUPsubsWS76IvTX/7wog8KEjB2esF0+GmhRElA1e1MEZIn0iujhd1TlPvkFtouLg3PgC7mOV7Sgzb2SfbD36N+G/ImO6f0mn3b85GQXZ+mMcrbhPG9Q9feHgBpZVdkcwmmWfx4DxU/CoXyLu/989VIf79n7GgoeoL03RtIGK0TCWK8HXbM9wIDAQAB",'
export CHROME_EXT_VERSION=$1

source ./secrets/dev.sh
export CHROME_EXT_VERSION=$1
envsubst < chrome-exten/manifest.json.tmpl > chrome-exten/manifest.json
zip chrome-exten.zip chrome-exten/*

2 changes: 1 addition & 1 deletion scripts/local_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ go get ./...

go fmt ./...

source ./secrets/gmail_pwd.sh
source ./secrets/local.sh
if [[ -z "$GMAIL_PASSWORD" ]]; then
echo "Must provide GMAIL_PASSWORD in environment" 1>&2
exit 1
Expand Down
5 changes: 1 addition & 4 deletions scripts/local_mac_chrome_ext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
set -x
set -e

export CLIENT_ID='"client_id": "149500152182-1nlfm111isrv0c8828mg3u16q22l434q.apps.googleusercontent.com",'
# retrieve the correct key from where?
export KEY='"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxk66E7tDSLL2ZqxhrAHpJOXRxmwSxCSSyRSzYjgx6B150ZdyGe1lAQWOkMfN4h1aK679mJaNTXRWllvxRNaZ+qNagZoy+96/57H7Au+RnX7U7NPv79jVxNq1fDI/hFp5tVZ1cGS31gNeZewR5cPvsTkekHSNFZv8isUtyDomwsRJrxrvIj1a1sL2O9w70aWcfZ/m8eu2gOWWtzfpOuB6K79DAUHw0xBOJ4pykgfYOfrDeZqrZbEzT0Y5d1kACTdg/h7WrE1KPWe0lUJfs7yvf7wMdjOEORR5Dl9i2DCq4ugHsYWMeQ8KmMSBqrlCLnAWFJ9hxhYCa9UJC6i7PaYncQIDAQAB",'
source ./secrets/local.sh
export CHROME_EXT_VERSION=$1

envsubst < chrome-exten/manifest.json.tmpl > chrome-exten/manifest.json

0 comments on commit 3ae1a40

Please sign in to comment.