From bd8f72daab4a4afc6d8aa4583bba728da071264f Mon Sep 17 00:00:00 2001 From: Andreas Fuchs Date: Thu, 6 May 2021 10:04:37 +0200 Subject: [PATCH 01/29] fixes #649 prevents crashes if NULL is entered as a referrer in the database. Does not guard against submitting NULL to the database. --- lib/filters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/filters.js b/lib/filters.js index 1c0e7916..733dab94 100644 --- a/lib/filters.js +++ b/lib/filters.js @@ -51,7 +51,7 @@ export const refFilter = (data, { domain, domainOnly, raw }) => { const links = {}; const isValidRef = ref => { - return ref !== '' && !ref.startsWith('/') && !ref.startsWith('#'); + return ref !== '' && ref !== null && !ref.startsWith('/') && !ref.startsWith('#'); }; if (raw) { From cfb13b2d54e891562a17c87e93bb621a99e0aba4 Mon Sep 17 00:00:00 2001 From: Andreas Fuchs Date: Thu, 6 May 2021 10:47:23 +0200 Subject: [PATCH 02/29] enhancement #649 as refFilter, urlFilter is expanded checking agains url !== null. --- lib/filters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/filters.js b/lib/filters.js index 733dab94..bb8b0c38 100644 --- a/lib/filters.js +++ b/lib/filters.js @@ -3,7 +3,7 @@ import { removeTrailingSlash, removeWWW, getDomainName } from './url'; export const urlFilter = (data, { raw }) => { const isValidUrl = url => { - return url !== '' && !url.startsWith('#'); + return url !== '' && url !== null && !url.startsWith('#'); }; if (raw) { From 3d9951661cd176c6334ace2ad9a57e43df8bfec9 Mon Sep 17 00:00:00 2001 From: Zhigang Fang Date: Sat, 8 May 2021 19:48:51 +0800 Subject: [PATCH 03/29] chore(docker): add base_path to build args --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 31ea0054..7d086546 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ # Build image FROM node:12.18-alpine AS build +ARG BASE_PATH ARG DATABASE_TYPE +ENV BASE_PATH=$BASE_PATH ENV DATABASE_URL "postgresql://umami:umami@db:5432/umami" \ DATABASE_TYPE=$DATABASE_TYPE WORKDIR /build From e4412d723dc1f3c9302ea5f82e12db8ad03ae7be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 9 May 2021 11:49:05 +0000 Subject: [PATCH 04/29] build(deps): bump hosted-git-info from 2.8.8 to 2.8.9 Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9. - [Release notes](https://github.com/npm/hosted-git-info/releases) - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md) - [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index aca7b2cc..1ac88095 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4008,9 +4008,9 @@ hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2: react-is "^16.7.0" hosted-git-info@^2.1.4: - version "2.8.8" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" - integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== hosted-git-info@^3.0.6: version "3.0.7" From ba2d9783b7ada315c664e0a153a855e2464b092d Mon Sep 17 00:00:00 2001 From: Ashraf Monshi Date: Tue, 11 May 2021 10:44:41 +0300 Subject: [PATCH 05/29] add arabic language (ar-SA) add arabic language (ar-SA) (arabic saudi arabia) --- lang/ar-SA.json | 100 ++++++++++++++++++++++++++++++++++++++++++++++++ lib/lang.js | 5 +++ 2 files changed, 105 insertions(+) create mode 100644 lang/ar-SA.json diff --git a/lang/ar-SA.json b/lang/ar-SA.json new file mode 100644 index 00000000..07340e25 --- /dev/null +++ b/lang/ar-SA.json @@ -0,0 +1,100 @@ +{ + "label.accounts": "الحسابات", + "label.add-account": "إضافة حساب", + "label.add-website": "إضافة موقع", + "label.administrator": "مدير عام؟", + "label.all": "الكل", + "label.all-events": "كافة الأحداث", + "label.all-websites": "كافة المواقع", + "label.back": "للخلف", + "label.cancel": "إلغاء", + "label.change-password": "تغيير كلمة المرور", + "label.confirm-password": "تأكيد كلمة المرور", + "label.copy-to-clipboard": "نسخ للحافظة", + "label.current-password": "كلمة المرور الحالية", + "label.custom-range": "فترة مخصصة", + "label.dashboard": "الشاشة الرئيسية", + "label.date-range": "فترة مخصصة", + "label.default-date-range": "الفترة المخصصة الافتراضية", + "label.delete": "حذف", + "label.delete-account": "حذف الحساب", + "label.delete-website": "حذف الموقع", + "label.dismiss": "اخفاء", + "label.domain": "نطاق", + "label.edit": "تعديل", + "label.edit-account": "تعديل الحساب", + "label.edit-website": "تعديل الموقع", + "label.enable-share-url": "تفعيل مشاركة الرابط", + "label.invalid": "غير صحيح", + "label.invalid-domain": "النطاق غير صحيح", + "label.last-days": "اخر {x} يوم/ايام", + "label.last-hours": "اخر {x} ساعة/ساعات", + "label.logged-in-as": "تم تسجيل الدخول كـ {username}", + "label.login": "تسجيل الدخول", + "label.logout": "تسجيل الخروج", + "label.more": "المزيد", + "label.name": "الإسم", + "label.new-password": "كلمة مرور جديدة", + "label.password": "كلمة المرور", + "label.passwords-dont-match": "كلمة المرور غير متطابقة", + "label.profile": "الملف الشخصي", + "label.realtime": "الوقت الفعلي", + "label.realtime-logs": "سجلات الوقت الفعلي", + "label.refresh": "تحديث", + "label.required": "اجباري", + "label.reset": "اعادة تعيين", + "label.save": "حفظ", + "label.settings": "اعدادات", + "label.share-url": "مشاركة الرابط", + "label.single-day": "يوم واحد", + "label.this-month": "الشهر الحالي", + "label.this-week": "الاسبوع الحالي", + "label.this-year": "السنة الحالية", + "label.timezone": "المنطقة الزمنية", + "label.today": "اليوم", + "label.tracking-code": "كود التتبع", + "label.unknown": "غير معروف", + "label.username": "اسم المستخدم", + "label.view-details": "عرض التفاصيل", + "label.websites": "المواقع", + "message.active-users": "{x} حاليا {x, plural, one {زائر واحد} other {زوار}}", + "message.confirm-delete": "هل أنت متأكد من حذف {target}?", + "message.copied": "تم النسخ!", + "message.delete-warning": "كافة البيانات المرتبطة سيم حذفها ايضا.", + "message.failure": "حدث خطأ ما.", + "message.get-share-url": "احصل على رابط المشاركة", + "message.get-tracking-code": "احصل على كود التتبع", + "message.go-to-settings": "الذهاب إلى الإعدادات", + "message.incorrect-username-password": "اسم المستخدم او كلمة المرور غير صحيحة.", + "message.log.visitor": "زائر من {country} يستخدم {browser} على {os} {device}", + "message.new-version-available": "توجد نسخة جديدة من umami رقم {version} سارع بالتحديث!", + "message.no-data-available": "لا توجد بيانات متاحة.", + "message.no-websites-configured": "لم تقم بإعداد اي موقع.", + "message.page-not-found": "الصفحة غير موجودة.", + "message.powered-by": "مشغل بواسطة {name}", + "message.save-success": "تم الحفظ بنجاح.", + "message.share-url": "هذا الرابط الذي تم مشاركته بشكل عام لـ {target}.", + "message.track-stats": "لتتبع الاحصاىيات لـ {target}, ضع الكود التالي في منطقة {head} في موقعك.", + "message.type-delete": "اكتب {delete} في الحقل التالي لتأكيد الحذف.", + "metrics.actions": "اجراءات", + "metrics.average-visit-time": "متوسط وقت الزيارة", + "metrics.bounce-rate": "معدل الارتداد", + "metrics.browsers": "المتصفحات", + "metrics.countries": "الدول", + "metrics.device.desktop": "كمبيوتر", + "metrics.device.laptop": "لابتوب", + "metrics.device.mobile": "جوال", + "metrics.device.tablet": "تابلت", + "metrics.devices": "الأجهزة", + "metrics.events": "الأحداث", + "metrics.filter.combined": "مجمعة", + "metrics.filter.domain-only": "نطاق فقط", + "metrics.filter.raw": "مفصلة", + "metrics.operating-systems": "نظام التشغيل", + "metrics.page-views": "مشاهدات الصفحة", + "metrics.pages": "الصفحات", + "metrics.referrers": "التحويلات", + "metrics.unique-visitors": "زائرون فريدون", + "metrics.views": "مشاهدات", + "metrics.visitors": "زوار" +} diff --git a/lib/lang.js b/lib/lang.js index e4e2d9e2..4d5b3bad 100644 --- a/lib/lang.js +++ b/lib/lang.js @@ -1,4 +1,5 @@ import { + arSA, cs, sk, da, @@ -29,6 +30,7 @@ import { zhCN, zhTW, } from 'date-fns/locale'; +import arSAMessages from 'lang-compiled/ar-SA.json'; import enMessages from 'lang-compiled/en-US.json'; import nlMessages from 'lang-compiled/nl-NL.json'; import zhCNMessages from 'lang-compiled/zh-CN.json'; @@ -62,6 +64,7 @@ import faIRMessages from 'lang-compiled/fa-IR.json'; import msMYMessages from 'lang-compiled/ms-MY.json'; export const messages = { + 'ar-SA': arSAMessages, 'en-US': enMessages, 'nl-NL': nlMessages, 'zh-CN': zhCNMessages, @@ -96,6 +99,7 @@ export const messages = { }; export const dateLocales = { + 'ar-SA': arSA, 'en-US': enUS, 'nl-NL': nl, 'zh-CN': zhCN, @@ -130,6 +134,7 @@ export const dateLocales = { }; export const menuOptions = [ + { label: 'العربية', value: 'ar-SA', display: 'ar' }, { label: '中文', value: 'zh-CN', display: 'cn' }, { label: '中文(繁體)', value: 'zh-TW', display: 'tw' }, { label: 'Čeština', value: 'cs-CZ', display: 'cs' }, From 3075f772ec491100716be51355df2488bc22e924 Mon Sep 17 00:00:00 2001 From: Ashraf Monshi Date: Tue, 11 May 2021 10:55:28 +0300 Subject: [PATCH 06/29] Update ar-SA.json fix message.active-users --- lang/ar-SA.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/ar-SA.json b/lang/ar-SA.json index 07340e25..ac46f7b1 100644 --- a/lang/ar-SA.json +++ b/lang/ar-SA.json @@ -57,7 +57,7 @@ "label.username": "اسم المستخدم", "label.view-details": "عرض التفاصيل", "label.websites": "المواقع", - "message.active-users": "{x} حاليا {x, plural, one {زائر واحد} other {زوار}}", + "message.active-users": "{x} حاليا {x, plural, زائر واحد {visitor} زوار {visitors}}", "message.confirm-delete": "هل أنت متأكد من حذف {target}?", "message.copied": "تم النسخ!", "message.delete-warning": "كافة البيانات المرتبطة سيم حذفها ايضا.", From 0126154e3945fbcfae00ede5e2a1267f1d9dc4ac Mon Sep 17 00:00:00 2001 From: Ashraf Monshi Date: Tue, 11 May 2021 11:02:52 +0300 Subject: [PATCH 07/29] Update ar-SA.json revert message.active-users --- lang/ar-SA.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/ar-SA.json b/lang/ar-SA.json index ac46f7b1..07340e25 100644 --- a/lang/ar-SA.json +++ b/lang/ar-SA.json @@ -57,7 +57,7 @@ "label.username": "اسم المستخدم", "label.view-details": "عرض التفاصيل", "label.websites": "المواقع", - "message.active-users": "{x} حاليا {x, plural, زائر واحد {visitor} زوار {visitors}}", + "message.active-users": "{x} حاليا {x, plural, one {زائر واحد} other {زوار}}", "message.confirm-delete": "هل أنت متأكد من حذف {target}?", "message.copied": "تم النسخ!", "message.delete-warning": "كافة البيانات المرتبطة سيم حذفها ايضا.", From 0c13f8d35848baddc57cda1d0a35c62d3c6b669e Mon Sep 17 00:00:00 2001 From: Ashraf Monshi Date: Thu, 13 May 2021 09:15:37 +0300 Subject: [PATCH 08/29] add rtl support --- components/layout/Footer.js | 9 +++++++-- components/layout/Header.js | 8 ++++++-- components/layout/Layout.js | 13 +++++++++++-- lang/ar-SA.json | 3 ++- package.json | 1 + postcss.config.js | 1 + 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/components/layout/Footer.js b/components/layout/Footer.js index 73e010bc..547896c3 100644 --- a/components/layout/Footer.js +++ b/components/layout/Footer.js @@ -1,14 +1,19 @@ import React from 'react'; import classNames from 'classnames'; -import { FormattedMessage } from 'react-intl'; +import { FormattedMessage, useIntl } from 'react-intl'; import Link from 'components/common/Link'; import styles from './Footer.module.css'; import useVersion from 'hooks/useVersion'; export default function Footer() { const { current } = useVersion(); + const intl = useIntl(); + return ( -