This commit is contained in:
Jason Liu 2021-09-28 03:02:24 -04:00
commit d317514dd8
13 changed files with 144 additions and 25 deletions

5
.env.local Normal file
View File

@ -0,0 +1,5 @@
API_BASE_URL=http://localhost
VERIFIER_HOST=http://localhost:5001/grassroot-verifier/us-central1
HITCOUNT_HOST=http://localhost:8080
REGISTRATION_HOST=http://localhost:5001/grassroot-verifier/us-central1
FUNCTION_SUFFIX=v2

2
.gitignore vendored
View File

@ -26,11 +26,9 @@ yarn-error.log*
# local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
# Idea files
.idea
.env.production

112
SETUP.md Normal file
View File

@ -0,0 +1,112 @@
# Environment Setup
The whole solution is made up of 4 repos.
1. covidpass (Wallet Pass creation front-end, port 3000)
2. covidpassApiDotNet (Wallet Pass signing service, Apple specific, port 80)
3. verifier (web app for scanning, port 5001; GCP cloud functions /register /verify in support of #1)
4. hit-counter (simple python script running in VM, web enabled using flask, port 8080)
The steps were tested against a standard ubuntu LTS 18 vm running in GCP
## GCP console - Firewall - New Firewall Rule
* allow-covidpass-ports, port 3000,80,5001,5003,8080 tcp/inbound
## GCP console - VM setup
* ubuntu LTS 18, 2 core, 4Gb RAM, allow all GCP API, network tag (allow-covidpass-ports), fixed external ip will be helpful
ssh into the newly created vm
Install docker
* https://docs.docker.com/engine/install/ubuntu/
Enable non-root usage of docker
```sh
sudo groupadd docker
sudo usermod -aG docker ${USER}
```
exit SSH session and login again
Install yarn
```sh
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
```
Upgrade node to 14
```sh
sudo apt-get install -y nodejs
```
Prepare to start
```sh
mkdir web
cd web
```
Repo 1 (https://github.com/billylo1/covidpass)
git clone https://github.com/billylo1/covidpass.git
cd covidpass
yarn install
note external IP of your dev machines
modify .env.local and replace localhost with your {vm-external-ip}
yarn dev
access it from your workstation's browser (http://vm-external-ip:3000)
you should see on the yarn output compiling... sentry initialized and browser showing page
Repo 2 (https://github.com/billylo1/CovidPassApiNet)
cd ~/web
git clone https://github.com/billylo1/CovidPassApiNet
cd CovidPassApiNet/CovidPassApiNet
cp appsettings.example.json appsettings.json
setup Apple Developer Certificate (assume current directory is the above)
1. Sign into your Apple Developer Account
2. Go to Certificates, Identifiers and Profiles
3. Register a new Pass Type Identifier under the Identifiers tab
4. Create a new Pass Type ID Certificate under the Certificates tab
5. Select your previously created Pass Type Identifier in the process
6. Move your new certificate to the My Certificates tab in the keychain
7. Export your certificate as a .p12 file (make a note of passphrase)
8. Create a text file named AppleDeveloperPassword with your passphrase in it
9. Install node.js and download the passkit-keys script
10. Create a keys folder and put the .p12 file inside
11. Run ./passkit-keys <path to your keys folder>
12. copy the .pem file to ~/web/CovidPassApiNet/CovidPassApiNet/AppDeveloperCerticate.pem
13. Open keychain - System Keychain - Certificates
14. Export Apple Developer Relations Certification Authority to AppleCaCertificate.pem
15. chmod 600 Apple*.pem
(Reminder: pls protect these files as they contain private key and passphrases. Do not add them to your repo.)
docker build . -t covidpassapinet
docker run covidpassapinet -p 80:80
Repo 3 (https://github.com/billylo1/verifier)
cd ~/web
git clone https://github.com/billylo1/verifier
sudo npm install -g firebase-tools
firebase init
sudo apt install default-jre
firebase emulators:start
Repo 4 (https://github.com/billylo1/hit-counter)
cd ~/web
git clone https://github.com/billylo1/hit-counter
sudo apt-get install python3.8 python3-pip
python3 server.py

View File

@ -1,5 +1,6 @@
docker build . -t covidpass -t gcr.io/broadcast2patients/covidpass
docker push gcr.io/broadcast2patients/covidpass
docker image prune
#gcloud config set project broadcast2patients
#gcloud config set run/region us-east1
#gcloud run deploy covidpass --image gcr.io/broadcast2patients/covidpass:latest --platform managed

View File

@ -326,13 +326,14 @@ function Form(): JSX.Element {
<div className="space-y-5">
<p>
{t('index:visit')}&nbsp;
<Link href="https://covid19.ontariohealth.ca">
<a className="underline" target="_blank">
{t('index:ontarioHealth')}
</a>
</Link>&nbsp;
{t('index:downloadSignedPDF')}
{t('index:downloadSignedPDF')}<br/><br/>
{t('index:reminderNotToRepeat')}
</p>
<button id="ontariohealth" onClick={gotoOntarioHealth}
@ -345,7 +346,6 @@ function Form(): JSX.Element {
<Card step="2" heading={t('index:selectCertificate')} content={
<div className="space-y-5">
<p>{t('index:selectCertificateDescription')}</p>
<p>{t('index:selectCertificateReminder')}</p>
<div className="grid grid-cols-1 md:grid-cols-2 gap-5">
<button
type="button"

View File

@ -25,7 +25,7 @@ function Logo(): JSX.Element {
</svg>
<h1 className="text-3xl font-bold">
{t('common:title')}
{displayPassCount}
{/* {displayPassCount} */}
</h1>
</a>
</Link>

View File

@ -13,14 +13,10 @@ interface PageProps {
function Page(props: PageProps): JSX.Element {
const { t } = useTranslation('common');
const passCount = usePassCount();
const displayPassCount = (passCount? ` - ${passCount} receipts processed to date!` : '');
return (
<div className="md:w-2/3 xl:w-2/5 md:mx-auto flex flex-col min-h-screen justify-center px-5 py-12">
<Head>
<title>{t('common:title')}{displayPassCount}</title>
<title>{t('common:title')}</title>
<link rel="icon" href="/favicon.ico"/>
<script src='patch-arrayBuffer.js' />
</Head>
@ -40,7 +36,7 @@ function Page(props: PageProps): JSX.Element {
<a href="https://github.com/billylo1/covidpass" className="underline">{t('common:gitHub')}</a>
<a href="https://vaccine-ontario.ca" className="underline">{t('common:returnToMainSite')}</a>
</nav>
<div className="flex pt-4 flex-row space-x-4 justify-center text-md flex-wrap">Last updated: 2021-09-25 (v1.9.8)</div>
<div className="flex pt-4 flex-row space-x-4 justify-center text-md flex-wrap">Last updated: 2021-09-27 (v1.9.9)</div>
</footer>
</main>
</div>

View File

@ -4,3 +4,4 @@ gcloud config set project broadcast2patients
gcloud config set run/region us-east1
gcloud run services update-traffic covidpass --to-latest
gcloud run deploy covidpass --image gcr.io/broadcast2patients/covidpass:latest --platform managed
docker image prune

View File

@ -13,10 +13,10 @@ function Faq(): JSX.Element {
{description: "How is my private information handled?", answer: 'Your proof-of-vaccination PDF (and most of the information in it) never leaves your device, and does NOT get sent to our server - the only information we send and store is non-personally-identifiable information such as vaccine type, date, and which organization gave you the vaccine. We share your concern about personal data being stored and lost, which is why we chose not to store or send any of it to our servers so there is no chance of it being lost or leaked.'},
{description: 'Do you have plans for Android support?', answer: 'Yes. We are working with Google to gain access to the APIs required. Meanwhile, you can also use this tool to download an Apple Wallet pass and import that into Google Pay Wallet using apps such as Pass2Pay or simply save it as a photo.'},
{description: 'I have a Red/White OHIP card. Can I still use this tool?', answer: 'Yes you can! Just call the Provincial Vaccine Contact Centre at 1-833-943-3900. The call centre agent can email you a copy of the receipt.'},
{description: 'I dont\'t have a health card. Can I still use this tool?', answer: 'First contact your local public health unit to verify your identity and receive a COVIDcovid ID/Personal Access Code. You can then call the Provincial Vaccine Contact Centre at 1-833-943-3900 to get an email copy of your receipt.'},
{description: 'I do not have a health card. Can I still use this tool?', answer: 'First contact your local public health unit to verify your identity and receive a COVIDcovid ID/Personal Access Code. You can then call the Provincial Vaccine Contact Centre at 1-833-943-3900 to get an email copy of your receipt.'},
{description: 'I\'m seeing an error message saying “Failed byte range verification." What do I do?', answer: 'If you see this error then please try re-downloading your receipt from the provincial proof-of-vaccination portal and trying again. We have received reports from some people that this has resolved the problem for them.'},
{description: 'What does the colour of the Apple Wallet pass mean?', answer: 'Dose 1 is shown as Orange; dose 2+ in green for easy differentiation without reading the text. For the Janssen (Johnson & Johnson) vaccine, dose 1 is shown as green.'},
{description: 'Should I use the official provincial apps when they come out on 22nd October?', answer: 'YES. Once the official QR code from the province is available, please come back to this site and you will be able to generate a new vaccination receipt which uses that new QR code'},
{description: 'Should I use the official provincial apps when they come out on 22nd October?', answer: 'YES. Once the official QR code from the province is available, please come back to this site and you will be able to generate a new Apple Wallet pass which contains that new QR code'},
{description: 'How is the data on my vaccination receipt processed?', answer: 'Inside your local web browser, it checks the receipt for a digital signature from the provincial proof-of-vaccination system. If present, the receipt data is converted into Apple\'s format and then added into your iOS Wallet app.'},
{description: 'How can organizations validate this QR code?', answer: 'You can use our verifier app at verifier.vaccine-ontario.ca to verify these passes quickly if you are a business - you should also be able to use any normal QR code scanner to scan this code and it will take you to a verification site which tells you whether the receipt is valid or not'},
{description: 'Can I use the same iPhone to store passes for my entire family?', answer: 'Yes.'},

View File

@ -8,10 +8,13 @@ import Page from '../components/Page';
import Alert from '../components/Alert';
import { useEffect, useState } from 'react';
import { isIOS, isSafari, isAndroid} from 'react-device-detect';
import usePassCount from "../src/hooks/use_pass_count";
function Index(): JSX.Element {
const { t } = useTranslation(['common', 'index', 'errors']);
const passCount = usePassCount();
const displayPassCount = (passCount? `${passCount} receipts have been processed successfully to date!` : '');
const [warningMessages, _setWarningMessages] = useState<Array<string>>([]);
@ -70,15 +73,17 @@ function Index(): JSX.Element {
)}
<Card content={
<div><p>{t('common:subtitle')}</p><br /><p>{t('common:subtitle2')}</p><br />
<b>Sept 25 evening updates</b> - Improvements:
<b>{displayPassCount}</b><br/><br/>
Sept 27 afternoon updates:
<br />
<br />
<ul className="list-decimal list-outside" style={{ marginLeft: '20px' }}>
<li>Better support the use of .pkpass files on non-iOS platforms (thx samuelyeungkc)</li>
<li>Improved multiple passes handling</li>
<li>Added FAQ on how critical data (name & date of birth) is protected and they stay private to you.</li>
<li>Simplified instructions</li>
<li>Extra details added to FAQs</li>
</ul><br />
<p>{t('common:continueSpirit')}</p></div>
<p>{t('common:continueSpirit')}</p>
</div>
}/>
<Form/>
</div>

View File

@ -1,9 +1,9 @@
title: Vaccination Receipt to Wallet
subtitle: This utility (created by volunteers) converts your vaccination receipt from Ontario Ministry of Health to an Apple Wallet pass for easy access in the interim.
subtitle2: Once Ontario's official QR code is released on Oct 22, you will be able to update your Apple Wallet pass by visiting this site again.
subtitle2: Once Ontario's official QR code is available on Oct 22, you will be able to update your Apple Wallet pass by visiting this site again.
update1Date: Sep 23 Updates
update1: Thanks so much for all the encouragements and suggestions to make this better. We plan to keep enhancing this to help more Canadians. Stay tuned!
continueSpirit: Continuing the spirit of ❤️ @VaxHuntersCanada ❤️. 820K receipts processed already, thanks for keeping the community safe!
continueSpirit: Continuing the spirit of ❤️ @VaxHuntersCanada ❤️.
privacyPolicy: Privacy Policy
donate: Sponsor
gitHub: GitHub

View File

@ -4,7 +4,7 @@ selectCertificate: Select vaccination receipt (PDF)
selectCertificateDescription: |
Press "Select File", "Browse..." and select the PDF file you have saved in Step 1.
selectCertificateReminder: |
Reminder : Receipts directly downloaded from the provincial web site is required. Emailed copies are not digitally signed and cannot be added to Apple Wallet.
Reminder : Receipts directly downloaded from the provincial web site is required.
#stopCamera: Stop Camera
#startCamera: Start Camera
openFile: Select File
@ -13,7 +13,8 @@ downloadReceipt: Download official receipt from Ontario Ministry of Health
visit: Visit
ontarioHealth: Ontario Ministry of Health
gotoOntarioHealth: Go to Ontario Ministry of Health
downloadSignedPDF: and enter your information to display your official vaccination receipt. Press the Share Icon at the bottom, "Save As Files" to store it onto your iPhone. If you have completed this step before, you can proceed to the next step to prevent downloading the same file multiple times.
downloadSignedPDF: and enter your information to display your official vaccination receipt. Press the Share Icon at the bottom, "Save As Files" to store it onto your iPhone.
reminderNotToRepeat: If you have completed this step before, simply proceed to Step 2.
pickColor: Pick a Color
pickColorDescription: Pick a background color for your pass.
colorWhite: white

View File

@ -3,8 +3,8 @@ import { Integrations } from '@sentry/tracing';
export const initSentry = () => {
SentryModule.init({
release: 'grassroots_covidpass@1.9.8', // App version. Needs to be manually updated as we go unless we make the build smarter
dsn: 'https://51370d7af0994761b465bc148129c1de@o997324.ingest.sentry.io/5955697',
release: 'grassroots_covidpass@1.9.9', // App version. Needs to be manually updated as we go unless we make the build smarter
dsn: 'https://7120dcf8548c4c5cb148cdde2ed6a778@o1015766.ingest.sentry.io/5981424',
integrations: [
new Integrations.BrowserTracing(),
],