From 2dd2c7d651d1856b7d7121c4ddf5108f14b980dd Mon Sep 17 00:00:00 2001 From: Stano Bo Date: Sun, 29 Mar 2020 19:40:35 +0200 Subject: [PATCH 1/9] Add example of SK deployment (#444) * Add SK deployment & config example * Update CODEOWNERS --- CODEOWNERS | 8 +++--- config-examples/sk-config.json | 16 ++++++++++++ ops/sk/README.md | 36 ++++++++++++++++++++++++++ ops/sk/docker-compose.yml | 47 ++++++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 config-examples/sk-config.json create mode 100644 ops/sk/README.md create mode 100644 ops/sk/docker-compose.yml diff --git a/CODEOWNERS b/CODEOWNERS index b0324d43..03be9857 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,9 +1,11 @@ * @fossecode -/static/no/ @fossecode -/static/nl/ @Kilian +/app/countrySpecific/sk-* @sbocinec /app/locales/nl.json @Kilian /app/locales/no.json @michaelmcmillan /app/locales/sk*.json @sbocinec -*.md @michaelmcmillan /app/repository/ @Snikanes /app/views/ @fossecode +/app/views/privacy-statements/sk-privacy-statement.ejs @sbocinec +/ops/sk/ @sbocinec +/static/no/ @fossecode +/static/nl/ @Kilian diff --git a/config-examples/sk-config.json b/config-examples/sk-config.json new file mode 100644 index 00000000..bcb3574f --- /dev/null +++ b/config-examples/sk-config.json @@ -0,0 +1,16 @@ +{ + "BASE_URL": "coronastatus.sk", + "LOCALE": "sk", + "COUNTRY":"Slovakia", + "COUNTRY_CODE":"sk", + "DB_PATH": "./covid_db", + "MAP_CENTER": "19.2688, 48.7269", + "MAP_ZOOM": 7, + "MAP_MAX_ZOOM": 13, + "PASSCODE_LENGTH": 4, + "REDIRECT_TO_GOVERNMENT": false, + "TWITTER": "coronastatusSK", + "ZIP_GUIDE": false, + "ZIP_LENGTH": 5, + "ZIP_PLACEHOLDER": "12345" +} diff --git a/ops/sk/README.md b/ops/sk/README.md new file mode 100644 index 00000000..37d5ed69 --- /dev/null +++ b/ops/sk/README.md @@ -0,0 +1,36 @@ +# SK deployment + +This deployment is very simple: +* requires only a VM with git client, docker engine, docker-compose installed, a TLS certificate/key pair and you are good to go. +* [Traefik v1](https://traefik.io/) edge router is used as an application proxy that is routing requests to the app on the VM. Both run as docker containers. +* [Cloudflare (free plan)](https://support.cloudflare.com/hc/en-us/articles/115000479507-Managing-Cloudflare-Origin-CA-certificates) is used at the edge as a DNS/CDN/WAF/proxy. The deployment uses [Cloudflare origin CA certificates](https://support.cloudflare.com/hc/en-us/articles/115000479507-Managing-Cloudflare-Origin-CA-certificates) on the server. It's configured to: + * rewrite all HTTP-> HTTPS (allow only TLS 1.2+) + * Redirect www.coronastatus.tld to coronastatus.tld. + * Perform the CSS/JS/HTML compression +* You can also use builtin support of Traefik to autogenerate Let's encrypt TLS certs if you don't need any LB at the edge. + +## Installation + +1. Create a VM with any OS that can run docker engine and git client - minimal/slim versions of Ubuntu 18.04 or Debian buster are recommended. +2. Install following dependencies: +- [git](https://git-scm.com/downloads) +- [Docker CE](https://docs.docker.com/install/) +- [Docker Compose](https://docs.docker.com/compose/install/) +3. Create a non-privileged user for the application: `useradd -m -s /bin/bash app` +4. Add user to `docker` group: `usermod -a -G docker app` +5. Enable docker to start on boot: `systemctl enable --now docker` +6. Apply latest OS updates +7. Do some basic system hardening (configure firewall, stop unused services, ...) and OS tuning + +## App deployment & configuration + +1. Login to the VM, switch to the app user: `sudo -i -u app` +2. Clone the repository: `git clone https://github.com/BustByte/coronastatus` +3. Move into the newly cloned directory: `cd coronastatus` +4. Create a configuration file from the example provided in this repo: `cp config.example.json config.json` +5. Review the `docker-compose.yml` file in this deployment directory +6. Create the `certs` directory and copy the Cloudflare TLS certificate/key there: `certs/tls.crt`, `certs/tls.key` +7. Install node modules: `docker-compose run --rm app yarn` +8. Start the project: `docker-compose up -d`. Containers will be automatically re/started on boot/container crash. +9. Display the logs to see everything is running properly: `docker-compose logs -f` +10. Enjoy :-) diff --git a/ops/sk/docker-compose.yml b/ops/sk/docker-compose.yml new file mode 100644 index 00000000..3788994c --- /dev/null +++ b/ops/sk/docker-compose.yml @@ -0,0 +1,47 @@ +version: "3.7" +services: + app: + image: node:lts-buster-slim + command: yarn serve + depends_on: + - proxy + environment: + - NODE_ENV=production + labels: + - "traefik.enable=true" + - "traefik.app.backend.port=7272" + - "traefik.app.frontend.rule=Host:coronastatus.sk,www.coronastatus.sk" + ports: + - "127.0.0.1:7272:7272" + networks: + - cs + restart: unless-stopped + volumes: + - ./:/app + - node_modules:/app/node_modules + working_dir: /app + proxy: + image: traefik:v1.7.23 + command: + - "--docker" + - "--docker.watch=true" + - "--docker.exposedByDefault=false" + - "--entryPoints=Name:http Address::80 Redirect.EntryPoint:https" + - "--entryPoints=Name:https Address::443 TLS:/tls.crt,/tls.key" + - "--defaultEntryPoints=http,https" + networks: + - cs + ports: + - 80:80 + - 443:443 + restart: unless-stopped + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - ./certs/tls.crt:/tls.crt + - ./certs/tls.key:/tls.key +networks: + cs: + driver: bridge +volumes: + node_modules: + driver: local From 1dacddfd30820434ca82e4f3c8850b47085b5a94 Mon Sep 17 00:00:00 2001 From: Michael McMillan Date: Sun, 29 Mar 2020 20:00:04 +0200 Subject: [PATCH 2/9] added portugal to list of sites --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a8982972..67ef5ec9 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ We don't know how many people have COVID-19. So we made a website where people c - 🇲🇹 Malta: https://coronastatusmt.com - 🇨🇱 Chile: https://coronastatus.cl - 🇮🇳 India: https://corona-status.in +– 🇵🇹 Portugal: https://coronastatus.pt - 🇸🇪 Sweden: coming soon - 🇵🇭 Philippines: coming soon - 🇹🇷 Turkey: coming soon (work group Telegram chat: https://t.me/turkeycoronastatus) From 8736795b3709c08727a3b4fe6ea7a3869675bc0a Mon Sep 17 00:00:00 2001 From: Michael McMillan Date: Sun, 29 Mar 2020 20:01:32 +0200 Subject: [PATCH 3/9] use dash instead of em-dash to make md list --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67ef5ec9..4f9abff9 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ We don't know how many people have COVID-19. So we made a website where people c - 🇲🇹 Malta: https://coronastatusmt.com - 🇨🇱 Chile: https://coronastatus.cl - 🇮🇳 India: https://corona-status.in -– 🇵🇹 Portugal: https://coronastatus.pt +- 🇵🇹 Portugal: https://coronastatus.pt - 🇸🇪 Sweden: coming soon - 🇵🇭 Philippines: coming soon - 🇹🇷 Turkey: coming soon (work group Telegram chat: https://t.me/turkeycoronastatus) From b1ca9f31c40e9d735a4e0c8441cfa5c19d9a1aac Mon Sep 17 00:00:00 2001 From: Adriaan Date: Sun, 29 Mar 2020 20:13:36 +0200 Subject: [PATCH 4/9] Fixed PR "Added banner for mobile" (#475) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * added banner for mobile * corrected no translation * added en-us locale, en-us routes, and us domain to README * Update tr.json * Update it.json * Update sk.json * Update sk.json * Update nl.json * Update es-ES.json (#427) Change translation of "clear this form" to "borrar el formulario" * Add (#434) * add more sites * Statistics: always show a data point at the current time, Fix #431 * added italy and correct austrlias domain (#435) * fixed wrong url for argentina * Setup for Bangladesh (#439) * Setup for Bangladesh * adding bangla * Hide passcode in URL and add SRI to external scripts (#438) * Add SRI * Obfuscate path when on profile * Move obfuscatePath boolean to report.ejs * coronastatus.cl 🇨🇱 (#429) * Add es-CL settings * Add Chile to README * Fix lint error Co-authored-by: Eirik Fosse * Add privacy statement (#440) Make language to less formal Rename files to capitalize CL * differentiate between locale and country (#351) * differentiate between locale and country * rename privacy statements to use country code * update readme * fallback to english text in case someone forgets to update their configs * list of all servers (#441) * start making list of all servers * added urls and malta * fixed sk * added ukraine * added rest * added denmark * updated sk * added luke for ch * added deji adesoga to nigeria * removed duped canada * updated name of TK running * filled in remaining columns and rows * Add Malaysia and Singapore (#445) * added Nigeria files by @desoga10 (#443) * added files by @desoga10 * added urls for nigeria * Add other contributors, fix repo link (#433) * Add other contributors * Add country flags as suggested * moved nigerian specific files to right dir (#449) * Add es-CL zipcode data (#446) * Add geo data * Add zipGuide texts * Small text changes fof consistency with casual tone (#450) * added indian locale and country specific files to correct dir (#451) * added indian locale and country specific files to correct dir * added urls for india as well * typo in indias post code file * added missing indian word list * added india * Fix ttranslation (#452) * Check stats.length > 0 (#453) * Add India social media image (#454) * correct twitter handle for india (#459) * correct twitter handle for india * fixed url as well * Update SK privacy policy & translations (#457) * Generate social images (#388) * create page with social media images * clean up head * simplify dom structure * add puppeteer script to generate images * extra guards * make social images route only available on dev * add description * fix banner font weight * fit text to available width automatically * switch to ts-node and import from config.ts * import from config.ts correctly * update script to match new config Co-authored-by: Eirik Fosse * add instructions for generating social images in guide for new language * use country code instead of locale for folder when saving social media images (#464) * Add Ukrainian locale (#465) * Add Ukrainian locale * Update config example * Add pt-PT setup (#426) * Add pt-PT setup. - Changes zipCode pattern to support dashes (eg. Portuguese postal codes are in the format 0000-000) - Add pt-PT translations - Add pt-PT municipalities - Add pt-PT postal codes - Add pt-PT words list - Add pt-PT urls * move municipalities etc to correct folder * add english privacy statement for now * add portuguese example config * add social media images Co-authored-by: Painatalman * add flags to more easily cross reference with frontpage (#467) * add flags to more easily cross reference with frontpage * fix alignment * Adjusted to Brazil Version (#461) * Translated file with phrases and added word list * finalizados ajustes de idioma * adjusting the map coordinates * Modified pt-BR files * Adjusted .json files * added population * added all ceps brazil * Rollback Locale * removed package.lock.json * Adjusted space to lint Co-authored-by: sergio.prates * Fixes to Argentina (#437) * Add Argentina * case insensitive fix * add Argentina to README * buenos aires zip-codes * zip code finder * Argentina domain * social media ar * fix merge conflict * specify zip pattern instead of zip length in config (#468) * specify zip pattern instead of zip length in config * add maltese config * use very general fallback pattern * Add share options (#456) * Add share options * Add translations for every language in English * Add Danish * Add other languages via Google Translate * Add move lang * Delete commented code * Fix all English languages * Updated EN.json * Fix Canada * Update SK.json & fix whatsapp ref (#463) * Update SK.json * Fix whatsapp ref * Add spanish translations for share options (#460) * norwegian translations * english malaysian translations * Update spain line * Update tr.json * Add UA translation thanks to @tarasmatsyk * Missing Swedish translations (#466) * Missing Swedish translations * Removed duplicated, korona -> corona Co-authored-by: Pontus Freyhult Co-authored-by: Amrit Nagi Co-authored-by: Stano Bo Co-authored-by: Julian Betancourt Co-authored-by: Eirik Fosse Co-authored-by: Berkay Co-authored-by: Pontus Frehult Co-authored-by: Pontus Freyhult * Remove <<< Co-authored-by: Berkay Co-authored-by: zacel <54048016+zacel@users.noreply.github.com> Co-authored-by: Jesús García Martínez Co-authored-by: Michael McMillan Co-authored-by: Sondre Hjetland Co-authored-by: Yousuf Zaman Co-authored-by: Ruben Torres Co-authored-by: Eirik Fosse Co-authored-by: Kong Jin Jie Co-authored-by: Stano Bo Co-authored-by: Kilian Valkhof Co-authored-by: Taras Matsyk Co-authored-by: André Jonas Co-authored-by: Painatalman Co-authored-by: sergioprates Co-authored-by: sergio.prates Co-authored-by: Walter Gammarota Co-authored-by: Amrit Nagi Co-authored-by: Julian Betancourt Co-authored-by: Pontus Frehult Co-authored-by: Pontus Freyhult --- app/countrySpecific/geonames-converter.py | 4 ++-- app/locales/en-AU.json | 2 ++ app/locales/en-IN.json | 2 ++ app/locales/en-MT.json | 2 ++ app/locales/en-NG.json | 2 ++ app/locales/en-SG.json | 2 ++ app/locales/en-US.json | 2 ++ app/locales/en.json | 2 ++ app/locales/es-AR.json | 2 ++ app/locales/es-CO.json | 2 ++ app/locales/es-ES.json | 2 ++ app/locales/es-MX.json | 2 ++ app/locales/fr-FR.json | 2 ++ app/locales/it.json | 2 ++ app/locales/nl.json | 4 +++- app/locales/no.json | 2 ++ app/locales/pt-BR.json | 2 ++ app/locales/pt-PT.json | 2 ++ app/locales/sk.json | 2 ++ app/locales/tr.json | 2 ++ app/locales/uk-UA.json | 2 ++ app/views/partials/banner.ejs | 2 +- app/views/partials/header.ejs | 17 +++++++++++++++++ 23 files changed, 61 insertions(+), 4 deletions(-) diff --git a/app/countrySpecific/geonames-converter.py b/app/countrySpecific/geonames-converter.py index 75b153f3..2dbea149 100644 --- a/app/countrySpecific/geonames-converter.py +++ b/app/countrySpecific/geonames-converter.py @@ -4,7 +4,7 @@ # Set the country code you want to create JSON files for COUNTRY_CODE = 'bd' -# Parse CSV for a given country from Geonames.org +# Parse CSV for a given country from Geonames.org rows = [] with open('%s.txt' % COUNTRY_CODE.upper(), 'r') as f: fieldnames = [ @@ -32,7 +32,7 @@ if not municipality in municipalities: municipalities[municipality] = {'postalCodes': []} municipalities[municipality]['postalCodes'].append(row.get('postal code')) - + with open('%s-municipalities.json' % COUNTRY_CODE, 'w') as f: write_as_json(municipalities, f, indent=2, separators=(',', ': ')) diff --git a/app/locales/en-AU.json b/app/locales/en-AU.json index 93820717..866bab0a 100644 --- a/app/locales/en-AU.json +++ b/app/locales/en-AU.json @@ -182,6 +182,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Some questions and alternatives were not a part of the form from the beginning:", "March 27": "March 27", "Other": "Other", + "This page is not affiliated with the authorities.": "This page is not affiliated with the authorities.", + "Learn more!": "Learn more!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "CALL TO ALL AUSTRALIAN CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.", "Contribute and share {{ hostname }} on": "Contribute and share {{ hostname }} on", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Fill out this form - it takes 1 minute - and help Australia gain control over COVID-19.", diff --git a/app/locales/en-IN.json b/app/locales/en-IN.json index bde7cc36..a68e93ec 100644 --- a/app/locales/en-IN.json +++ b/app/locales/en-IN.json @@ -185,6 +185,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Some questions and alternatives were not a part of the form from the beginning:", "March 27": "March 27", "Other": "Other", + "This page is not affiliated with the authorities.": "This page is not affiliated with the authorities.", + "Learn more!": "Learn more!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "CALL TO ALL CITIZENS FROM INDIA: This is how we defeat the corona virus: together we make the invisible virus visible.", "Contribute and share {{ hostname }} on": "Contribute and share {{ hostname }} on", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Fill out this form - it takes 1 minute - and help India gain control over COVID-19.", diff --git a/app/locales/en-MT.json b/app/locales/en-MT.json index 05f28c0e..a5da90d0 100644 --- a/app/locales/en-MT.json +++ b/app/locales/en-MT.json @@ -184,6 +184,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Some questions and alternatives were not a part of the form from the beginning:", "March 27": "March 27", "Other": "Other", + "This page is not affiliated with the authorities.": "This page is not affiliated with the authorities.", + "Learn more!": "Learn more!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "CALL TO ALL MALTESE CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.", "Contribute and share {{ hostname }} on": "Contribute and share {{ hostname }} on", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Fill out this form - it takes 1 minute - and help Malta gain control over COVID-19.", diff --git a/app/locales/en-NG.json b/app/locales/en-NG.json index d1950434..72201f4a 100644 --- a/app/locales/en-NG.json +++ b/app/locales/en-NG.json @@ -184,6 +184,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Some questions and alternatives were not a part of the form from the beginning:", "March 27": "March 27", "Other": "Other", + "This page is not affiliated with the authorities.": "This page is not affiliated with the authorities.", + "Learn more!": "Learn more!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "CALL TO ALL NIGERIAN CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.", "Contribute and share {{ hostname }} on": "Contribute and share {{ hostname }} on", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Fill out this form - it takes 1 minute - and help Nigeria gain control over COVID-19.", diff --git a/app/locales/en-SG.json b/app/locales/en-SG.json index 0d8f8452..8d6c9175 100644 --- a/app/locales/en-SG.json +++ b/app/locales/en-SG.json @@ -184,6 +184,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Some questions and alternatives were not a part of the form from the beginning:", "March 27": "March 27", "Other": "Other", + "This page is not affiliated with the authorities.": "This page is not affiliated with the authorities.", + "Learn more!": "Learn more!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "CALL TO ALL SINGAPOREAN CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.", "Contribute and share {{ hostname }} on": "Contribute and share {{ hostname }} on", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Fill out this form - it takes 1 minute - and help Singapore gain control over COVID-19.", diff --git a/app/locales/en-US.json b/app/locales/en-US.json index a6803f3f..19f80025 100644 --- a/app/locales/en-US.json +++ b/app/locales/en-US.json @@ -184,6 +184,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Some questions and alternatives were not a part of the form from the beginning:", "March 27": "March 27", "Other": "Other", + "This page is not affiliated with the authorities.": "This page is not affiliated with the authorities.", + "Learn more!": "Learn more!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.", "Contribute and share {{ hostname }} on": "Contribute and share {{ hostname }} on", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.", diff --git a/app/locales/en.json b/app/locales/en.json index bc7fa637..1850a984 100644 --- a/app/locales/en.json +++ b/app/locales/en.json @@ -185,6 +185,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Some questions and alternatives were not a part of the form from the beginning:", "March 27": "March 27", "Other": "Other", + "This page is not affiliated with the authorities.": "This page is not affiliated with the authorities.", + "Learn more!": "Learn more!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "CALL TO ALL UK CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.", "Contribute and share {{ hostname }} on": "Contribute and share {{ hostname }} on", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Fill out this form - it takes 1 minute - and help the United Kingdom gain control over COVID-19.", diff --git a/app/locales/es-AR.json b/app/locales/es-AR.json index 08779964..c096c7be 100644 --- a/app/locales/es-AR.json +++ b/app/locales/es-AR.json @@ -183,6 +183,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Algunas preguntas no fueron incluidas desde el inicio:", "March 27": "Marzo 27", "Other": "Otro", + "This page is not affiliated with the authorities.": "Esta página no está afiliada con las autoridades.", + "Learn more!": "¡Conoce más!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "QUERIDOS ARGENTINOS: Así es como podemos derrotar al coronavirus: juntos podemos hacer visible el virus invisible.", "Contribute and share {{ hostname }} on": "Comparta {{ hostname }} en", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Complete este formulario (se tarda 1 minuto) y ayude a Argentina a controlar el COVID-19.", diff --git a/app/locales/es-CO.json b/app/locales/es-CO.json index 0b58f050..3421fc92 100644 --- a/app/locales/es-CO.json +++ b/app/locales/es-CO.json @@ -185,6 +185,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Algunas preguntas no fueron incluidas desde el inicio:", "March 27": "Marzo 27", "Other": "Otro", + "This page is not affiliated with the authorities.": "Esta página no está afiliada con las autoridades.", + "Learn more!": "¡Conoce más!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "QUERIDOS COLOMBIANOS: Así es como podemos derrotar al coronavirus: juntos podemos hacer visible el virus invisible.", "Contribute and share {{ hostname }} on": "Comparta {{ hostname }} en", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Complete este formulario (se tarda 1 minuto) y ayude a Colombia a controlar el COVID-19.", diff --git a/app/locales/es-ES.json b/app/locales/es-ES.json index 2b4c04dd..46fd881a 100644 --- a/app/locales/es-ES.json +++ b/app/locales/es-ES.json @@ -181,6 +181,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Algunas preguntas no fueron incluidas desde el inicio:", "March 27": "Marzo 27", "Other": "Otro", + "This page is not affiliated with the authorities.": "Esta página no está afiliada con las autoridades.", + "Learn more!": "¡Conoce más!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "QUERIDOS ESPAÑOLES: Así es como podemos derrotar al coronavirus: juntos podemos hacer visible el virus invisible.", "Contribute and share {{ hostname }} on": "Comparta {{ hostname }} en", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Complete este formulario (se tarda 1 minuto) y ayude a España a controlar el COVID-19.", diff --git a/app/locales/es-MX.json b/app/locales/es-MX.json index 6fe03a79..3b70956c 100644 --- a/app/locales/es-MX.json +++ b/app/locales/es-MX.json @@ -181,6 +181,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Algunas preguntas y sus respuestas no formaban parte del formulario original:", "March 27": "Marzo 27", "Other": "Otro", + "This page is not affiliated with the authorities.": "Esta página no está afiliada con las autoridades.", + "Learn more!": "¡Conoce más!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "QUERIDOS MEXICANOS: Así es como podemos derrotar al coronavirus: juntos podemos hacer visible el virus invisible.", "Contribute and share {{ hostname }} on": "Comparta {{ hostname }} en", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Complete este formulario (se tarda 1 minuto) y ayude a México a controlar el COVID-19.", diff --git a/app/locales/fr-FR.json b/app/locales/fr-FR.json index 0426d9cb..245b6494 100644 --- a/app/locales/fr-FR.json +++ b/app/locales/fr-FR.json @@ -181,6 +181,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Certaines questions ou alternatives n'étaient pas présentes au début:", "March 27": "27 mars", "Other": "Autre", + "This page is not affiliated with the authorities.": "Cette page n'est pas affiliée aux autorités", + "Learn more!": "En savoir plus!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "APPEL À TOUS LES CITOYENS FRANÇAIS: C'est ainsi que nous vainquons le virus corona: ensemble, nous rendons visible le virus invisible.", "Contribute and share {{ hostname }} on": "Contribuez et partagez {{ hostname }} sur", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Remplissez ce formulaire - cela prend 1 minute - et aidez les États-Unis à prendre le contrôle de COVID-19.", diff --git a/app/locales/it.json b/app/locales/it.json index dba54605..f304d6f2 100644 --- a/app/locales/it.json +++ b/app/locales/it.json @@ -49,6 +49,8 @@ "NB!": "Importante!", "This page is currently not affiliated with the authorities in any way.": "Questa pagina non è in alcun modo legata alle autorità italiane.", "Read how the data you enter is processed here!": "Leggi qui come vengono elaborati i tuoi dati!", + "This page is not affiliated with the authorities.":"Questo sito non è legato alle autorità italiane.", + "Learn more!":"Scopri di più!", "Use the link you noted down last time to update your health condition": "Utilizza il link che ti eri annotato per aggiornare la tua condizione di salute.", "Unreported cases": "Casi non segnalati", "The spread of COVID-19 in our country is unknown. Help us create a better overview.": "Non conosciamo la diffusione del COVID-19 nel nostro Paese, aiutaci quindi ad avere un quadro della situazione più dettagliato.", diff --git a/app/locales/nl.json b/app/locales/nl.json index 8311ea1f..1f2cc42b 100644 --- a/app/locales/nl.json +++ b/app/locales/nl.json @@ -47,8 +47,10 @@ "Make your voluntary contribution to the health care system and register your health condition now. Together we can create an overview.": "Doe uw vrijwillige bijdrage aan de gezondheidszorg en registreer nu uw gezondheidstoestand. Samen creëren we een overzicht.", "Share on": "Deel op", "NB!": "NB!", - "This page is currently not affiliated with the authorities in any way.": "Deze pagina is momenteel op geen enkele manier gelieerd aan de Nederlandse autoriteiten.", + "This page is currently not affiliated with the authorities in any way.": "Deze pagina is momenteel niet gelieerd aan de Nederlandse overheid.", "Read how the data you enter is processed here!": "Lees hier hoe de door u ingevulde gegevens worden verwerkt!", + "This page is not affiliated with the authorities.":"Deze pagina is niet gelieerd aan de overheid.", + "Learn more!":"Lees meer!", "Use the link you noted down last time to update your health condition": "Gebruik de door u opgeslagen link om uw veranderde gezondheid door te geven", "Unreported cases": "Ongemelde gevallen", "The spread of COVID-19 in our country is unknown. Help us create a better overview.": "De verspreiding van COVID-19 in ons land is onbekend. Help ons een beter overzicht te creëren.", diff --git a/app/locales/no.json b/app/locales/no.json index 0fcf0c92..eddb7100 100644 --- a/app/locales/no.json +++ b/app/locales/no.json @@ -49,6 +49,8 @@ "NB!": "NB!", "This page is currently not affiliated with the authorities in any way.": "Denne siden er p.t. ikke tilknyttet FHI eller norske myndigheter på noen måte.", "Read how the data you enter is processed here!": "Les hvordan dataen du oppgir blir behandlet her!", + "This page is not affiliated with the authorities.":"Denne siden er ikke tilknyttet myndighetene.", + "Learn more!":"Les mer!", "Use the link you noted down last time to update your health condition": "Bruk lenken du noterte deg sist for å endre din helsetilstand.", "Unreported cases": "Store mørketall", "The spread of COVID-19 in our country is unknown. Help us create a better overview.": "Spredningen av COVID-19 i landet vårt er ukjent. Hjelp oss med å skape en bedre oversikt.", diff --git a/app/locales/pt-BR.json b/app/locales/pt-BR.json index 1e3c70fb..55148e9f 100644 --- a/app/locales/pt-BR.json +++ b/app/locales/pt-BR.json @@ -182,6 +182,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Algumas perguntas e alternativas não faziam parte do formulário desde o início:", "March 27": "Março 27", "Other": "Outro", + "This page is not affiliated with the authorities.": "Este site não está afiliados às autoridades.", + "Learn more!": "Saber mais!", "View Website Statistics": "Ver estatísticas do website", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "Chamada de atenção a todos os cidadãos portugueses: É assim que vencemos o coronavírus: juntos tornamos visível, o vírus invisível.", "Contribute and share {{ hostname }} on": "Contribui e partilha {{hostname}} no", diff --git a/app/locales/pt-PT.json b/app/locales/pt-PT.json index fe7aa06f..edc0452d 100644 --- a/app/locales/pt-PT.json +++ b/app/locales/pt-PT.json @@ -184,6 +184,8 @@ "Some questions and alternatives were not a part of the form from the beginning:": "Algumas perguntas e alternativas não fizeram parte do formulário desde o início:", "March 27": "27 de Março", "Other": "Outro", + "This page is not affiliated with the authorities.": "Este site não está afiliados às autoridades.", + "Learn more!": "Saber mais!", "View Website Statistics": "Ver estatísticas do website", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "Chamada de atenção a todos os cidadãos portugueses: É assim que vencemos o coronavírus: juntos tornamos visível, o vírus invisível.", "Contribute and share {{ hostname }} on": "Contribui e partilha {{hostname}} no", diff --git a/app/locales/sk.json b/app/locales/sk.json index 6f777f1d..d45be242 100644 --- a/app/locales/sk.json +++ b/app/locales/sk.json @@ -48,6 +48,8 @@ "Share on": "Zdieľajte na", "NB!": "Upozornenie!", "This page is currently not affiliated with the authorities in any way.": "Táto stránka je nezávislou iniciatívou dobrovoľníkov, nesúvisí so štátnými orgánmi.", + "This page is not affiliated with the authorities.":"Táto stránka je nezávislou iniciatívou.", + "Learn more!":"Zisti viac!", "Read how the data you enter is processed here!": "Prečítajte si ako sú vami zadané dáta spracovávané", "Use the link you noted down last time to update your health condition": "Použite uložený odkaz, ktorý sa zobrazil pri vašej poslednej aktualizácii vášho zdravotného stavu", "Unreported cases": "Neoznámené prípady", diff --git a/app/locales/tr.json b/app/locales/tr.json index 51ffa87c..204f8ebd 100644 --- a/app/locales/tr.json +++ b/app/locales/tr.json @@ -49,6 +49,8 @@ "NB!": "Önemli!", "This page is currently not affiliated with the authorities in any way.": "Bu sayfa hiçbir şekilde yetkili birimlere bağlı değildir.", "Read how the data you enter is processed here!": "Girdiğiniz verilerin nasıl işlendiğini öğrenin!", + "This page is not affiliated with the authorities.":"Bu sayfa yetkili birimlere bağlı değildir.", + "Learn more!":"Daha fazla bilgi edin!", "Use the link you noted down last time to update your health condition": "Daha önceden not aldığınız bağlantıyı kullanarak sağlık durumunuzu güncelleyin.", "Unreported cases": "Bildirilmemiş vakalar", "The spread of COVID-19 in our country is unknown. Help us create a better overview.": "COVID-19'un ülkemizde yayılımı bilinmemektedir. Daha iyi bir genel bakış oluşturmamıza yardımcı olun.", diff --git a/app/locales/uk-UA.json b/app/locales/uk-UA.json index 5e6e1a99..9b20822c 100644 --- a/app/locales/uk-UA.json +++ b/app/locales/uk-UA.json @@ -186,6 +186,8 @@ "Other": "Інша", "What is my Zip code?": "Як знайти свій поштовий індекс?", "https://www.whatismyzip.com": "https://postcode.in.ua/", + "This page is not affiliated with the authorities.": "Ця сторінка ніяк не зв'язана із владою.", + "Learn more!": "Дізнатися більше!", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "ПРОХАННЯ ДО УСІХ ГРОМАДЯН: Так ми можемо перемогти коронавірус: разом ми робимо невидимий вірус - видими", "Contribute and share {{ hostname }} on": "Допомогти та поділитися {{ hostname }} у", "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Заповнення форми займає 1 хвилину і допомагає України розуміти стан поширення COVID-19.", diff --git a/app/views/partials/banner.ejs b/app/views/partials/banner.ejs index 76afb205..a2273633 100644 --- a/app/views/partials/banner.ejs +++ b/app/views/partials/banner.ejs @@ -1,7 +1,7 @@ <% const { id = null, link = null, start = null, close = false, onclick = null, style = ''} = locals; %>
> diff --git a/app/views/partials/header.ejs b/app/views/partials/header.ejs index d98c3fe1..0f6fbb59 100644 --- a/app/views/partials/header.ejs +++ b/app/views/partials/header.ejs @@ -25,6 +25,23 @@ onclick: 'hasSubmittedAlertOnClick()' }) -%>
+
+ <%- include('partials/banner', { + start: __('NB!'), + message: __('This page is not affiliated with the authorities.'), + link: urls.privacyPolicy, + linkText: __('Learn more!'), + color: '#efbc2e' + }) -%> + <%- include('partials/banner', { + start: __('Important'), + message: __('Use the link you noted down last time to update your health condition'), + color: '#62C4C3', + style: 'display: none;', + id: 'has-submitted-alert', + onclick: 'hasSubmittedAlertOnClick()' + }) -%> +
From 9e3b8a83b0c3c3bacce0d12dc07d3e6ffe5473c1 Mon Sep 17 00:00:00 2001 From: Adriaan Date: Sun, 29 Mar 2020 20:17:41 +0200 Subject: [PATCH 5/9] Make text of NL fit in twitter limit of 280 chars (#473) --- app/locales/nl.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/locales/nl.json b/app/locales/nl.json index 1f2cc42b..5f22cc57 100644 --- a/app/locales/nl.json +++ b/app/locales/nl.json @@ -186,7 +186,7 @@ "Other": "Anders / zeg ik liever niet", "CALL TO ALL US CITIZENS: This is how we defeat the corona virus: together we make the invisible virus visible.": "OPROEP AAN ALLE NEDERLANDERS: Zo verslaan we samen het coronavirus: we maken het onzichtbare virus zichtbaar.", "Contribute and share {{ hostname }} on": "Draag bij en deel {{ hostname }} via", - "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Vul dit formulier in - het kost 1 minuut - en help Nederland controle te krijgen over corona.", + "Fill out this form - it takes 1 minute - and help the United States gain control over COVID-19.": "Vul dit formulier in en help Nederland controle te krijgen over corona.", "One more thing": "Nog één dingetje", "To defeat the corona virus we need to make the invisible virus visible.": "Om het coronavirus te verslaan moeten we het onzichtbare virus zichtbaar maken.", "{{ amount }} people already shared their health status.": "Al {{ amount }} mensen hebben hun gezondheidsstatus ingevuld.", From bd084043e035828ec13349ffe3929c150aff1830 Mon Sep 17 00:00:00 2001 From: Eirik Fosse Date: Sun, 29 Mar 2020 20:42:40 +0200 Subject: [PATCH 6/9] remove info wrong info from zip code label --- app/locales/pt-PT.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/locales/pt-PT.json b/app/locales/pt-PT.json index edc0452d..b2fb7ec6 100644 --- a/app/locales/pt-PT.json +++ b/app/locales/pt-PT.json @@ -74,7 +74,7 @@ "Biological gender": "Sexo", "Female": "Feminino", "Male": "Masculino", - "Zip code": "Código Postal (primeiros 4 dígitos)", + "Zip code": "Código Postal", "Testing and symptoms": "Teste e sintomas", "Have you been in close contact with someone who was tested positive for COVID-19?": "Esteve em contacto próximo com alguém que testou positivo para COVID-19?", "Yes": "Sim", From 67c00633873eb22c22d6b3a43702fa79abd74f35 Mon Sep 17 00:00:00 2001 From: Michael McMillan Date: Sun, 29 Mar 2020 20:43:14 +0200 Subject: [PATCH 7/9] extract all flags from readme for github repo description (#477) * put all flags on one line so that we can easily update github repo description * strip whitespace --- ops/extract-flags-from-readme-for-github-repo-description.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 ops/extract-flags-from-readme-for-github-repo-description.sh diff --git a/ops/extract-flags-from-readme-for-github-repo-description.sh b/ops/extract-flags-from-readme-for-github-repo-description.sh new file mode 100755 index 00000000..e42cdbc8 --- /dev/null +++ b/ops/extract-flags-from-readme-for-github-repo-description.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +cat ./README.md | grep '^\-' | grep 'https://corona' | cut -c3-4 | paste -sd " " - | sed 's/ //g' From 843576eb297cc4d8a8255dcadbe5a2bf2f50e8e1 Mon Sep 17 00:00:00 2001 From: Michael McMillan Date: Sun, 29 Mar 2020 21:05:29 +0200 Subject: [PATCH 8/9] added section on how to help out early in readme (#478) --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f9abff9..4d480c7c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,11 @@ We don't know how many people have COVID-19. So we made a website where people can self-report symptoms. We plot the submissions on a map and show graphs with trends. -### Countries where Coronastatus launches +## How can I help? + +We need people who can help translate the site, develop new features, project leads for new and existing countries, and much more. Join our group chat: https://t.me/onzecorona + +### In what countries have you launched Coronastatus? - 🇳🇴 Norway: https://coronastatus.no - 🇳🇱 The Netherlands: https://coronastatus.nl From 0c19f3b88d13a797cd20724ffaa24b1a7413ed20 Mon Sep 17 00:00:00 2001 From: Adriaan Date: Sun, 29 Mar 2020 21:37:34 +0200 Subject: [PATCH 9/9] Fix number formating and move function to server.ts (#479) * Fix number formating and move function to server.ts * Remove thousandSeparator --- app/server.ts | 7 ++++++- app/views/pages/report.ejs | 16 ++++++---------- app/views/pages/statistics.ejs | 17 ++++++++--------- app/views/pages/thank-you.ejs | 4 +--- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/app/server.ts b/app/server.ts index b2c0826a..9524e864 100644 --- a/app/server.ts +++ b/app/server.ts @@ -74,7 +74,12 @@ app.use((req, res, next) => { res.locals.zipPattern = config.ZIP_PATTERN; res.locals.zipPlaceHolder = config.ZIP_PLACEHOLDER; res.locals.redirectToGovernment = config.REDIRECT_TO_GOVERNMENT; - res.locals.thousandSeparator = config.THOUSAND_SEPARATOR; + + // eslint-disable-next-line @typescript-eslint/ban-ts-ignore + // @ts-ignore + res.locals.formatNumber = x => + x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, config.THOUSAND_SEPARATOR); + next(); }); diff --git a/app/views/pages/report.ejs b/app/views/pages/report.ejs index 03002d76..ccdb80b4 100644 --- a/app/views/pages/report.ejs +++ b/app/views/pages/report.ejs @@ -3,7 +3,7 @@ profile, passcode, baseUrl, - thousandSeparator = ' ', + formatNumber, urls } = locals; const age = profile && locals.profile.age; @@ -31,10 +31,6 @@ const symptomSlimeCough = symptoms && symptoms['SLIME_COUGH']; const symptomRunnyNose = symptoms && symptoms['RUNNY_NOSE']; const symptomNauseaOrVomiting = symptoms && symptoms['NAUSEA_OR_VOMITING']; - - function numberWithSpaces(x) { - return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, thousandSeparator); - } %> <%- include('partials/header', { home: true, menu: false }) -%> @@ -82,25 +78,25 @@ <%- include('partials/app-stats-block', { image: '/static/images/napkin.svg', title: __('Total reports'), - number: numberWithSpaces(aggregated.numberOfReports) + number: formatNumber(aggregated.numberOfReports) }) -%> <%- include('partials/app-stats-block', { image: '/static/images/temperature-check.svg', title: __('Infected / Have been tested'), - number: `${numberWithSpaces(aggregated.numberOfConfirmedInfected)}/${numberWithSpaces(aggregated.numberOfTested)}` + number: `${formatNumber(aggregated.numberOfConfirmedInfected)}/${formatNumber(aggregated.numberOfTested)}` }) -%> <%- include('partials/app-stats-block', { image: '/static/images/transfer.svg', title: __(`In close contact with someone who's infected`), - number: numberWithSpaces(aggregated.numberOfContacts) + number: formatNumber(aggregated.numberOfContacts) }) -%> <%- include('partials/app-stats-block', { image: '/static/images/symptoms.svg', title: __('Has symptoms'), - number: numberWithSpaces(aggregated.numberOfPeopleShowingSymptoms) + number: formatNumber(aggregated.numberOfPeopleShowingSymptoms) }) -%>
@@ -448,7 +444,7 @@

<%= __(`Contribute and share {{ hostname }} on`, { hostname: baseUrl }) %>

- <%- include('partials/share', { amount: numberWithSpaces(aggregated.numberOfReports) }) -%> + <%- include('partials/share', { amount: formatNumber(aggregated.numberOfReports) }) -%>
diff --git a/app/views/pages/statistics.ejs b/app/views/pages/statistics.ejs index 55beadcc..cb385afa 100644 --- a/app/views/pages/statistics.ejs +++ b/app/views/pages/statistics.ejs @@ -2,8 +2,7 @@ locals.inContactWithInfectedStats.total; const totalInfectedPeopleWithSymptoms = locals.infectedStats.symptomStats.total; const totalPeopleWithSymptoms = locals.allSymptomsStats.symptomStats.total; const totalTested = -locals.totalTested; function numberWithSpaces(x) { return -x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "); } %> +locals.totalTested; const { formatNumber } = locals; %> @@ -30,8 +29,8 @@ x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "); } %> <%= __(`COVID-19 infected`) %>

- <%= __(`In total`) %> <%= numberWithSpaces(totalInfectedPeopleWithSymptoms) %> - <%= __(`people have reported that they have tested positive for COVID-19 and + <%= __(`In total`) %> <%= formatNumber(totalInfectedPeopleWithSymptoms) %> <%= + __(`people have reported that they have tested positive for COVID-19 and experience symptoms.`) %>

@@ -43,8 +42,8 @@ x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "); } %>

<%= __(`Test results`) %>

- <%= __(`In total`) %> <%= numberWithSpaces(totalTested) %> <%= __(`people - have reported that they have been tested for COVID-19.`) %> + <%= __(`In total`) %> <%= formatNumber(totalTested) %> <%= __(`people have + reported that they have been tested for COVID-19.`) %>

@@ -54,8 +53,8 @@ x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "); } %> <%= __(`Close contacts`) %>

- <%= __(`In total`) %> <%= numberWithSpaces(totalPeopleInContactWithInfected) - %> <%= __(`people have reported that they have been in close contact with a + <%= __(`In total`) %> <%= formatNumber(totalPeopleInContactWithInfected) %> + <%= __(`people have reported that they have been in close contact with a person who was tested positive for COVID-19.`) %>

@@ -102,7 +101,7 @@ x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "); } %> <%= __(`All submissions`) %>

- <%= __("In total") %> <%= numberWithSpaces(totalPeopleWithSymptoms) %> <%= + <%= __("In total") %> <%= formatNumber(totalPeopleWithSymptoms) %> <%= __(`people have reported that they experience symptoms.`) %>

diff --git a/app/views/pages/thank-you.ejs b/app/views/pages/thank-you.ejs index ed9985b2..3ed03e17 100644 --- a/app/views/pages/thank-you.ejs +++ b/app/views/pages/thank-you.ejs @@ -1,6 +1,4 @@ -<% const numberWithSpaces = x => x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, -locals.thousandSeparator || ' '); const amount = -numberWithSpaces(aggregated.numberOfReports) %> +<% const amount = locals.formatNumber(aggregated.numberOfReports) %> <%- include('partials/header') -%>