Skip to content

Commit

Permalink
Merge pull request #50 from muly/chrome-extn-deployment-cleanup
Browse files Browse the repository at this point in the history
Chrome extn deployment cleanup
  • Loading branch information
muly authored Dec 20, 2023
2 parents c6d5f8b + 422ecc6 commit d5d705d
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 9 deletions.
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@

# ide related
.vscode
.DS_Store

# generated by deployment scripts
product-track
app.yaml
product-track
product-track.exe
*.zip
chrome-exten/manifest.json

#
# no secrets
secrets

.vscode
.DS_Store
# no dependencies, as some of the dependencies are private repos
vendor/*

6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ deploy_local_windows:
deploy_local_mac:
./scripts/local_mac.sh

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

deploy_dev:
./scripts/dev.sh
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
# product-track
online product price and availability tracking

## deploying app engine api

TODO: need to add notes here

## deploying chrome extension

### first time deploying chrome extension

TODO: need to add the detailed steps associated with the chrome webstore review and publish process.

### re-deploying chrome extension to chrome store
step 1. generate the zip file:

`make prepare_chrome_ext_for_dev_deployment` (this command might change, see makefile)

step 2: use the generated chrome-exten.zip file to update to chrome webstore:
1. -> https://chrome.google.com/webstore/devconsole/
1. -> product-track
1. -> build
1. -> package
1. -> upload new package
1. -> browse and pick the zip file


### deploying chrome extension to local chrome store
temp notes required to update the script to deploy local chromestore
- for local chrome deployment:

step 1: gcp console
1. -> APIs & Services
1. -> credentials
1. -> OAuth 2.0 Client IDs
1. -> Chrome client (for chrome store deployment)
1. -> copy client id

step 2:

1. update oauth2
1. -> client_id value in chrome-exten/manifest.json file.


## known errors:


Expand All @@ -13,3 +54,7 @@ error:
root cause: unknown.

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

## privacy policy

dev url: https://smuly-test-ground.ue.r.appspot.com/privacy-policy.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"manifest_version": 3,
"name": "product-track",
"description": "track your product price and availability",
"version": "1.0",
"version": "${CHROME_EXT_VERSION}",
"action": {
"default_popup": "signin.html",
"default_icon":"logo.png"
},
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxk66E7tDSLL2ZqxhrAHpJOXRxmwSxCSSyRSzYjgx6B150ZdyGe1lAQWOkMfN4h1aK679mJaNTXRWllvxRNaZ+qNagZoy+96/57H7Au+RnX7U7NPv79jVxNq1fDI/hFp5tVZ1cGS31gNeZewR5cPvsTkekHSNFZv8isUtyDomwsRJrxrvIj1a1sL2O9w70aWcfZ/m8eu2gOWWtzfpOuB6K79DAUHw0xBOJ4pykgfYOfrDeZqrZbEzT0Y5d1kACTdg/h7WrE1KPWe0lUJfs7yvf7wMdjOEORR5Dl9i2DCq4ugHsYWMeQ8KmMSBqrlCLnAWFJ9hxhYCa9UJC6i7PaYncQIDAQAB",
${KEY}
"icons":{
"128":"logo.png"
},
Expand All @@ -18,7 +18,7 @@
"http://localhost:8006/*"
],
"oauth2": {
"client_id": "149500152182-1nlfm111isrv0c8828mg3u16q22l434q.apps.googleusercontent.com",
${CLIENT_ID}
"scopes": ["email"]
},
"options_page":"./signin.html"
Expand Down
59 changes: 59 additions & 0 deletions chrome-exten/privacy-policy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Privacy Policy</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
max-width: 600px;
margin: 20px auto;
padding: 0 20px;
color: #333;
}

p {
margin-bottom: 15px;
}

ul {
list-style-type: square;
margin-bottom: 15px;
}

a {
color: #007BFF;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}
</style>
</head>

<body>
<p>This Privacy Policy outlines our data collection and usage practices for the use of our Chrome extension:</p>

<ul>
<li>User's email address is collected for sending requested product updates.</li>
<li>Pincodes/zipcodes are collected to track availability of the product that the user requested</li>
</ul>

<p>No cookies or ad networks are utilized.</p>

<p>Data collection occurs when user uses our Chrome extension.</p>

<p>Currently, there is no explicit opt-out option. For concerns, contact us.</p>

<p>Users can request data deletion or download by contacting us. We are actively working on implementing a process for this.</p>

<p>Email: <a href="mailto:[email protected]">[email protected]</a></p>

<p>This Privacy Policy was last updated on Dec 20, 2023.</p>
</body>

</html>
2 changes: 2 additions & 0 deletions chrome-exten/signin.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ body {





4 changes: 3 additions & 1 deletion chrome-exten/signin.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ document.getElementById('signInBtn').addEventListener('click', function() {
console.error('Error retrieving user email:', error);
});
});
});
});


3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func main() {
http.ServeFile(w, r, "./integration_testing/mock_websites/"+path)
})

router.GET("/privacy-policy.html", func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
http.ServeFile(w, r, "./chrome-exten/privacy-policy.html")
})
// Start the server
log.Fatal(http.ListenAndServe(":"+port, router))

Expand Down
17 changes: 17 additions & 0 deletions postman/product-track.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@
}
},
"response": []
},
{
"name": "{{host}}/privacy-policy.html",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{host}}/privacy-policy.html",
"host": [
"{{host}}"
],
"path": [
"privacy-policy.html"
]
}
},
"response": []
}
]
}
9 changes: 9 additions & 0 deletions scripts/dev_mac_chrome_ext.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -x
set -e

export CLIENT_ID=""
export CHROME_EXT_VERSION=$1

envsubst < chrome-exten/manifest.json.tmpl > chrome-exten/manifest.json
zip chrome-exten.zip chrome-exten/*
9 changes: 9 additions & 0 deletions scripts/local_mac_chrome_ext.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -x
set -e

export CLIENT_ID='"client_id": "149500152182-1nlfm111isrv0c8828mg3u16q22l434q.apps.googleusercontent.com",'
export KEY='"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxk66E7tDSLL2ZqxhrAHpJOXRxmwSxCSSyRSzYjgx6B150ZdyGe1lAQWOkMfN4h1aK679mJaNTXRWllvxRNaZ+qNagZoy+96/57H7Au+RnX7U7NPv79jVxNq1fDI/hFp5tVZ1cGS31gNeZewR5cPvsTkekHSNFZv8isUtyDomwsRJrxrvIj1a1sL2O9w70aWcfZ/m8eu2gOWWtzfpOuB6K79DAUHw0xBOJ4pykgfYOfrDeZqrZbEzT0Y5d1kACTdg/h7WrE1KPWe0lUJfs7yvf7wMdjOEORR5Dl9i2DCq4ugHsYWMeQ8KmMSBqrlCLnAWFJ9hxhYCa9UJC6i7PaYncQIDAQAB",'
export CHROME_EXT_VERSION=$1

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

0 comments on commit d5d705d

Please sign in to comment.