From 7dd5d9727936b1aaa37d4401f16b60485467b594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20M=C3=BCller-Downing?= Date: Sun, 6 Sep 2020 15:44:56 +1000 Subject: [PATCH 1/7] Use GitHub Container Registry for Docker images GHCR allows images to be pulled anonymously --- .github/workflows/main.yml | 29 +++++++++++++++++++++-------- README.md | 21 ++++++++++++++++----- docker-compose.yml | 2 +- 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aecd76dc..bab1852d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,7 @@ on: - release: - types: [published] + push: + branches: + - feat/push-to-github-container-registry jobs: @@ -13,17 +14,29 @@ jobs: uses: actions/checkout@v2 - name: Build PostgreSQL container image - run: docker build --build-arg DATABASE_TYPE=postgresql --tag docker.pkg.github.com/mikecao/umami/umami:postgresql-$(echo $GITHUB_SHA | head -c7) . + run: | + docker build --build-arg DATABASE_TYPE=postgresql \ + --tag ghcr.io/$GITHUB_ACTOR/umami:postgresql-$(echo $GITHUB_SHA | head -c7) \ + --tag ghcr.io/$GITHUB_ACTOR/umami:postgresql-latest \ + . - name: Build MySQL container image - run: docker build --build-arg DATABASE_TYPE=mysql --tag docker.pkg.github.com/mikecao/umami/umami:mysql-$(echo $GITHUB_SHA | head -c7) . + run: | + docker build --build-arg DATABASE_TYPE=mysql \ + --tag ghcr.io/$GITHUB_ACTOR/umami:mysql-$(echo $GITHUB_SHA | head -c7) \ + --tag ghcr.io/$GITHUB_ACTOR/umami:mysql-latest \ + . - name: Docker login env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: docker login -u mikecao -p $GITHUB_TOKEN docker.pkg.github.com + CR_PAT: ${{ secrets.CR_PAT }} + run: docker login -u $GITHUB_ACTOR -p $CR_PAT ghcr.io - name: Push image to GitHub run: | - docker push docker.pkg.github.com/mikecao/umami/umami:postgresql-$(echo $GITHUB_SHA | head -c7) - docker push docker.pkg.github.com/mikecao/umami/umami:mysql-$(echo $GITHUB_SHA | head -c7) + # Push each image individually, avoiding pushing to umami:latest + # as MySQL or PostgreSQL are required + docker push ghcr.io/$GITHUB_ACTOR/umami:postgresql-$(echo $GITHUB_SHA | head -c7) + docker push ghcr.io/$GITHUB_ACTOR/umami:postgresql-latest + docker push ghcr.io/$GITHUB_ACTOR/umami:mysql-$(echo $GITHUB_SHA | head -c7) + docker push ghcr.io/$GITHUB_ACTOR/umami:mysql-latest diff --git a/README.md b/README.md index 078829a6..a241d409 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ The `HASH_SALT` is used to generate unique values for your installation. ### Build the application -``` +```bash npm run build ``` ### Start the application -``` +```bash npm start ``` @@ -78,15 +78,26 @@ or change the [port](https://nextjs.org/docs/api-reference/cli#production) to se To build the umami container and start up a Postgres database, run: -``` +```bash docker-compose up ``` +Alternatively, to pull just the Umami Docker image with PostgreSQL support: +```bash +docker pull ghcr.io/mikecao/umami:postgresql-latest +``` + +Or with MySQL support: +```bash +docker pull ghcr.io/mikecao/umami:mysql-latest +``` + + ## Getting updates To get the latest features, simply do a pull, install any new dependencies, and rebuild: -``` +```bash git pull npm install npm run build @@ -94,4 +105,4 @@ npm run build ## License -MIT \ No newline at end of file +MIT diff --git a/docker-compose.yml b/docker-compose.yml index 7f1b42ff..7a12e83d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: umami: - build: . + image: ghcr.io/mikecao/umami:postgresql-latest ports: - "3000:3000" environment: From a60cdc873a88f0d1ba61a8d9ccc214e3ebb3aac7 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Mon, 7 Sep 2020 02:15:48 -0700 Subject: [PATCH 2/7] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bab1852d..ab56cb38 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ on: push: branches: - - feat/push-to-github-container-registry + - master jobs: From d8d15a6d7c66f30bb3d87593f56383d6f53fce51 Mon Sep 17 00:00:00 2001 From: MoltenCoffee <13321277+MoltenCoffee@users.noreply.github.com> Date: Tue, 8 Sep 2020 09:42:43 +0200 Subject: [PATCH 3/7] Added Dutch language --- lang/nl.json | 236 +++++++++++++++++++++++++++++++++++++++++++++++++++ lib/lang.js | 6 +- 2 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 lang/nl.json diff --git a/lang/nl.json b/lang/nl.json new file mode 100644 index 00000000..a10b86b7 --- /dev/null +++ b/lang/nl.json @@ -0,0 +1,236 @@ +{ + "active-users.message": { + "defaultMessage": "{x} actieve {x, plural, one {bezoeker} other {bezoekers}}" + }, + "button.add-account": { + "defaultMessage": "Account toevoegen" + }, + "button.add-website": { + "defaultMessage": "Website toevoegen" + }, + "button.back": { + "defaultMessage": "Terug" + }, + "button.cancel": { + "defaultMessage": "Annuleren" + }, + "button.change-password": { + "defaultMessage": "Wachtwoord wijzigen" + }, + "button.copy-to-clipboard": { + "defaultMessage": "Kopiëer naar klembord" + }, + "button.delete": { + "defaultMessage": "Verwijderen" + }, + "button.edit": { + "defaultMessage": "Bewerken" + }, + "button.login": { + "defaultMessage": "Inloggen" + }, + "button.more": { + "defaultMessage": "Toon meer" + }, + "button.save": { + "defaultMessage": "Opslaan" + }, + "button.view-details": { + "defaultMessage": "Meer details" + }, + "footer.powered-by": { + "defaultMessage": "gesteund door" + }, + "header.nav.dashboard": { + "defaultMessage": "Dashboard" + }, + "header.nav.settings": { + "defaultMessage": "Instellingen" + }, + "label.adminsitrator": { + "defaultMessage": "Administrator" + }, + "label.confirm-password": { + "defaultMessage": "Wachtwoord bevestigen" + }, + "label.current-password": { + "defaultMessage": "Huidig wachtwoord" + }, + "label.domain": { + "defaultMessage": "Domein" + }, + "label.enable-share-url": { + "defaultMessage": "Delen via URL aanzetten" + }, + "label.invalid": { + "defaultMessage": "Ongeldig" + }, + "label.invalid-domain": { + "defaultMessage": "Ongeldig domein" + }, + "label.last-days": { + "defaultMessage": "Laatste {x} dagen" + }, + "label.last-hours": { + "defaultMessage": "Laatste {x} uur" + }, + "label.logged-in-as": { + "defaultMessage": "Ingelogd als {username}" + }, + "label.logout": { + "defaultMessage": "Uitloggen" + }, + "label.name": { + "defaultMessage": "Naam" + }, + "label.new-password": { + "defaultMessage": "Nieuw wachtwoord" + }, + "label.password": { + "defaultMessage": "Wachtwoord" + }, + "label.passwords-dont-match": { + "defaultMessage": "Wachtwoorden komen niet overeen" + }, + "label.required": { + "defaultMessage": "Verplicht" + }, + "label.this-month": { + "defaultMessage": "Deze maand" + }, + "label.this-week": { + "defaultMessage": "Deze week" + }, + "label.this-year": { + "defaultMessage": "Dit jaar" + }, + "label.today": { + "defaultMessage": "Vandaag" + }, + "label.username": { + "defaultMessage": "Gebruikersnaam" + }, + "message.confirm-delete": { + "defaultMessage": "Weet je zeker dat je {target} wilt verwijderen?" + }, + "message.copied": { + "defaultMessage": "Gekopiëerd!" + }, + "message.delete-warning": { + "defaultMessage": "Alle verwante gegezens zullen ook verwijderd worden." + }, + "message.failure": { + "defaultMessage": "Er is iets misgegaan." + }, + "message.incorrect-username-password": { + "defaultMessage": "Incorrecte gebruikersnaam/wachtwoord." + }, + "message.save-success": { + "defaultMessage": "Opslaan succesvol." + }, + "message.share-url": { + "defaultMessage": "Met deze URL kan {target} openbaar gedeeld worden." + }, + "message.track-stats": { + "defaultMessage": "Om statistieken voor {target} bij te houden, plaats je de volgende code in het {head} gedeelte van je website." + }, + "message.type-delete": { + "defaultMessage": "Type {delete} in onderstaande veld om dit te bevestigen." + }, + "metrics.actions": { + "defaultMessage": "Acties" + }, + "metrics.average-visit-time": { + "defaultMessage": "Gemiddelde bezoektijd" + }, + "metrics.bounce-rate": { + "defaultMessage": "Bouncepercentage" + }, + "metrics.browsers": { + "defaultMessage": "Browsers" + }, + "metrics.countries": { + "defaultMessage": "Landen" + }, + "metrics.devices": { + "defaultMessage": "Apparaten" + }, + "metrics.events": { + "defaultMessage": "Gebeurtenissen" + }, + "metrics.filter.combined": { + "defaultMessage": "Gecombineerd" + }, + "metrics.filter.domain-only": { + "defaultMessage": "Alleen domein" + }, + "metrics.filter.raw": { + "defaultMessage": "Ruw" + }, + "metrics.operating-system": { + "defaultMessage": "Besturingssystem" + }, + "metrics.page-views": { + "defaultMessage": "Paginaweergaven" + }, + "metrics.pages": { + "defaultMessage": "Pagina's" + }, + "metrics.referrers": { + "defaultMessage": "Verwijzers" + }, + "metrics.unique-visitors": { + "defaultMessage": "Unieke bezoekers" + }, + "metrics.views": { + "defaultMessage": "Weergaven" + }, + "metrics.visitors": { + "defaultMessage": "Bezoekers" + }, + "placeholder.message.go-to-settings": { + "defaultMessage": "Naar instellingen" + }, + "placeholder.message.no-websites-configured": { + "defaultMessage": "Je hebt geen websites ingesteld." + }, + "settings.accounts": { + "defaultMessage": "Accounts" + }, + "settings.profile": { + "defaultMessage": "Profiel" + }, + "settings.websites": { + "defaultMessage": "Websites" + }, + "title.add-account": { + "defaultMessage": "Account toevoegen" + }, + "title.add-website": { + "defaultMessage": "Website toevoegen" + }, + "title.delete-account": { + "defaultMessage": "Account verwijderen" + }, + "title.delete-website": { + "defaultMessage": "Website verwijderen" + }, + "title.edit-account": { + "defaultMessage": "Account bewerken" + }, + "title.edit-website": { + "defaultMessage": "Website bewerken" + }, + "title.share-url": { + "defaultMessage": "URL delen" + }, + "title.tracking-code": { + "defaultMessage": "Tracking code" + }, + "tooltip.get-share-url": { + "defaultMessage": "Maak openbare URL" + }, + "tooltip.get-tracking-code": { + "defaultMessage": "Maak tracking code" + } +} diff --git a/lib/lang.js b/lib/lang.js index da4f98c9..0b4f3883 100644 --- a/lib/lang.js +++ b/lib/lang.js @@ -1,20 +1,24 @@ import enMessages from 'lang-compiled/en.json'; +import nlMessages from 'lang-compiled/nl.json'; import zhCNMessages from 'lang-compiled/zh-CN.json'; import { format } from 'date-fns'; -import { enUS, zhCN } from 'date-fns/locale'; +import { enUS, nl, zhCN } from 'date-fns/locale'; export const messages = { en: enMessages, + nl: nlMessages, 'zh-CN': zhCNMessages, }; export const dateLocales = { en: enUS, + nl: nl, 'zh-CN': zhCN, }; export const menuOptions = [ { label: 'English', value: 'en', display: 'EN' }, + { label: 'Nederlands', value: 'nl', display: 'NL' }, { label: '中文 (Chinese Simplified)', value: 'zh-CN', display: '中文' }, ]; From 1ba9538bc77dab8178430852dcfaa5ad43d02cc9 Mon Sep 17 00:00:00 2001 From: MoltenCoffee <13321277+MoltenCoffee@users.noreply.github.com> Date: Tue, 8 Sep 2020 10:22:26 +0200 Subject: [PATCH 4/7] Slight changes to dutch --- lang/nl.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/nl.json b/lang/nl.json index a10b86b7..7db64fca 100644 --- a/lang/nl.json +++ b/lang/nl.json @@ -60,7 +60,7 @@ "defaultMessage": "Domein" }, "label.enable-share-url": { - "defaultMessage": "Delen via URL aanzetten" + "defaultMessage": "Sta delen via openbare URL toe" }, "label.invalid": { "defaultMessage": "Ongeldig" @@ -228,9 +228,9 @@ "defaultMessage": "Tracking code" }, "tooltip.get-share-url": { - "defaultMessage": "Maak openbare URL" + "defaultMessage": "Openbare URL" }, "tooltip.get-tracking-code": { - "defaultMessage": "Maak tracking code" + "defaultMessage": "Tracking code" } } From da1ec3f429a3d48e80aa3da9b24cc76abb3c23d9 Mon Sep 17 00:00:00 2001 From: MoltenCoffee <13321277+MoltenCoffee@users.noreply.github.com> Date: Tue, 8 Sep 2020 10:35:24 +0200 Subject: [PATCH 5/7] Added correct(??) BCP47 codes --- lib/lang.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lang.js b/lib/lang.js index 0b4f3883..aafc08ec 100644 --- a/lib/lang.js +++ b/lib/lang.js @@ -6,19 +6,19 @@ import { enUS, nl, zhCN } from 'date-fns/locale'; export const messages = { en: enMessages, - nl: nlMessages, + 'nl-NL': nlMessages, 'zh-CN': zhCNMessages, }; export const dateLocales = { en: enUS, - nl: nl, + 'nl-NL': nl, 'zh-CN': zhCN, }; export const menuOptions = [ { label: 'English', value: 'en', display: 'EN' }, - { label: 'Nederlands', value: 'nl', display: 'NL' }, + { label: 'Nederlands', value: 'nl-NL', display: 'NL' }, { label: '中文 (Chinese Simplified)', value: 'zh-CN', display: '中文' }, ]; From dd2a2ea8a1e27026ca3a4e44ede2d4f9c725388d Mon Sep 17 00:00:00 2001 From: MoltenCoffee <13321277+MoltenCoffee@users.noreply.github.com> Date: Tue, 8 Sep 2020 10:48:05 +0200 Subject: [PATCH 6/7] Minor string update --- lang/nl.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/nl.json b/lang/nl.json index 7db64fca..3348e7ea 100644 --- a/lang/nl.json +++ b/lang/nl.json @@ -39,7 +39,7 @@ "defaultMessage": "Meer details" }, "footer.powered-by": { - "defaultMessage": "gesteund door" + "defaultMessage": "mogelijk gemaakt door" }, "header.nav.dashboard": { "defaultMessage": "Dashboard" From a31a104577d8ac712edaaf63cdef22497cefb2e9 Mon Sep 17 00:00:00 2001 From: MoltenCoffee <13321277+MoltenCoffee@users.noreply.github.com> Date: Tue, 8 Sep 2020 10:59:56 +0200 Subject: [PATCH 7/7] Used full country code instead of just nl --- lang/{nl.json => nl-NL.json} | 0 lib/lang.js | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename lang/{nl.json => nl-NL.json} (100%) diff --git a/lang/nl.json b/lang/nl-NL.json similarity index 100% rename from lang/nl.json rename to lang/nl-NL.json diff --git a/lib/lang.js b/lib/lang.js index aafc08ec..63ea9745 100644 --- a/lib/lang.js +++ b/lib/lang.js @@ -1,5 +1,5 @@ import enMessages from 'lang-compiled/en.json'; -import nlMessages from 'lang-compiled/nl.json'; +import nlMessages from 'lang-compiled/nl-NL.json'; import zhCNMessages from 'lang-compiled/zh-CN.json'; import { format } from 'date-fns'; import { enUS, nl, zhCN } from 'date-fns/locale';