<%= __(`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 dbebd559..f1e909d3 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') -%>
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()'
+ }) -%>
+
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/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'
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