From 770e73fc72bc7990d36735bc79a7982b1b088ccd Mon Sep 17 00:00:00 2001 From: Dmitry Tretyakov <76806170+tretdm@users.noreply.github.com> Date: Wed, 19 Apr 2023 14:37:37 +0700 Subject: [PATCH 1/5] Added Tinelix OVK Instance --- README_RU.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README_RU.md b/README_RU.md index 6b03dda3..c13236c3 100644 --- a/README_RU.md +++ b/README_RU.md @@ -22,6 +22,7 @@ _[English](README.md)_ * [social.fetbuk.ru](http://social.fetbuk.ru/) * [vepurovk.xyz](http://vepurovk.xyz/) * **[vepurovk.fun](http://vepurovk.fun)** (зеркало без TLS) +* [ovk.tinelix.ru](https://ovk.tinelix.ru) (зеркало [без TLS](http://ovk.tinelix.ru)) ## Могу ли я создать свою собственную инстанцию OpenVK? From 027a38a69c3a731de8ae671ebc970942235d0fb5 Mon Sep 17 00:00:00 2001 From: Dmitry Tretyakov <76806170+tretdm@users.noreply.github.com> Date: Wed, 19 Apr 2023 14:39:22 +0700 Subject: [PATCH 2/5] Unlined Tinelix OVK Instance without TLS --- README_RU.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README_RU.md b/README_RU.md index c13236c3..360b6de1 100644 --- a/README_RU.md +++ b/README_RU.md @@ -22,7 +22,8 @@ _[English](README.md)_ * [social.fetbuk.ru](http://social.fetbuk.ru/) * [vepurovk.xyz](http://vepurovk.xyz/) * **[vepurovk.fun](http://vepurovk.fun)** (зеркало без TLS) -* [ovk.tinelix.ru](https://ovk.tinelix.ru) (зеркало [без TLS](http://ovk.tinelix.ru)) +* [ovk.tinelix.ru](https://ovk.tinelix.ru) + * [зеркало без TLS](http://ovk.tinelix.ru) ## Могу ли я создать свою собственную инстанцию OpenVK? From 34b585747f4f6167139b1063ead2f417d89c8533 Mon Sep 17 00:00:00 2001 From: Dmitry Tretyakov <76806170+tretdm@users.noreply.github.com> Date: Wed, 19 Apr 2023 15:12:05 +0700 Subject: [PATCH 3/5] Refactoring login and register button in sidebar (#864) For Firefox 10.0 and other old 2000s browsers compatibillity --- Web/Presenters/templates/@layout.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Web/Presenters/templates/@layout.xml b/Web/Presenters/templates/@layout.xml index bb0d172e..82a4031a 100644 --- a/Web/Presenters/templates/@layout.xml +++ b/Web/Presenters/templates/@layout.xml @@ -218,8 +218,8 @@ - - {_registration}

+ +

{_forgot_password} {/ifset} From b89bbdcec2ebd9950e2cb938c4ca957f2b7c50e7 Mon Sep 17 00:00:00 2001 From: Dmitry Tretyakov <76806170+tretdm@users.noreply.github.com> Date: Wed, 19 Apr 2023 17:44:01 +0700 Subject: [PATCH 4/5] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1937c38a..992e68f0 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ We will release OpenVK as soon as it's ready. As for now, you can: * [social.fetbuk.ru](http://social.fetbuk.ru/) * [vepurovk.xyz](http://vepurovk.xyz/) * [vepurovk.fun](http://vepurovk.fun/) (mirror without TLS) +* [ovk.tinelix.ru](https://ovk.tinelix.ru) + * [mirror without TLS](http://ovk.tinelix.ru) ## Can I create my own OpenVK instance? From 2f8612bb24ede631a8d912199dab987043323eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=BE=D0=BA=D0=BE=D1=82=D0=BE=D0=BA?= <47851014+lokot0k@users.noreply.github.com> Date: Wed, 19 Apr 2023 14:02:33 +0300 Subject: [PATCH 5/5] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=B0=20=D0=BD=D0=B0=D0=B4=D0=B5=D0=B6=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D0=BF=D0=B0=D1=80=D0=BE=D0=BB=D1=8C=20(#862)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Проверка на надежный пароль * fixed typos in locales/ru.strings Co-authored-by: Alexander Minkin * подправил локаль --------- Co-authored-by: Alexander Minkin --- Web/Presenters/AuthPresenter.php | 6 +++++- Web/Util/Validator.php | 4 ++++ locales/en.strings | 1 + locales/ru.strings | 1 + openvk-example.yml | 1 + 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Web/Presenters/AuthPresenter.php b/Web/Presenters/AuthPresenter.php index bb9d7272..bbb45d28 100644 --- a/Web/Presenters/AuthPresenter.php +++ b/Web/Presenters/AuthPresenter.php @@ -80,7 +80,11 @@ final class AuthPresenter extends OpenVKPresenter if(!Validator::i()->emailValid($this->postParam("email"))) $this->flashFail("err", tr("invalid_email_address"), tr("invalid_email_address_comment")); - + + if(OPENVK_ROOT_CONF['openvk']['preferences']['security']['forceStrongPassword']) + if(!Validator::i()->passwordStrong($this->postParam("password"))) + $this->flashFail("err", tr("error"), tr("error_weak_password")); + if (strtotime($this->postParam("birthday")) > time()) $this->flashFail("err", tr("invalid_birth_date"), tr("invalid_birth_date_comment")); diff --git a/Web/Util/Validator.php b/Web/Util/Validator.php index aa30a8b5..51085a3d 100644 --- a/Web/Util/Validator.php +++ b/Web/Util/Validator.php @@ -22,5 +22,9 @@ class Validator return (bool) preg_match("/^(?:t.me\/|@)?([a-zA-Z0-9_]{0,32})$/", $telegram); } + function passwordStrong(string $password): bool{ + return (bool) preg_match("/^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,}$/", $password); + } + use TSimpleSingleton; } diff --git a/locales/en.strings b/locales/en.strings index 669bfc8b..87961ebc 100644 --- a/locales/en.strings +++ b/locales/en.strings @@ -992,6 +992,7 @@ "error_upload_failed" = "Failed to upload a photo"; "error_old_password" = "Old password does not match"; "error_new_password" = "New password does not match"; +"error_weak_password" = "Password isn't strong enough. It should has at least 8 symbols, at least one capital letter and at least one digit." "error_shorturl_incorrect" = "The short address has an incorrect format."; "error_repost_fail" = "Failed to share post"; "error_data_too_big" = "Attribute '$1' must be at most $2 $3 long"; diff --git a/locales/ru.strings b/locales/ru.strings index ac7a537d..98928cd5 100644 --- a/locales/ru.strings +++ b/locales/ru.strings @@ -905,6 +905,7 @@ "error_upload_failed" = "Не удалось загрузить фото"; "error_old_password" = "Старый пароль не совпадает"; "error_new_password" = "Новые пароли не совпадает"; +"error_weak_password" = "Ненадёжный пароль. Пароль должен содержать не менее 8 символов, цифры, прописные и строчные буквы"; "error_shorturl_incorrect" = "Короткий адрес имеет некорректный формат."; "error_repost_fail" = "Не удалось поделиться записью"; "error_data_too_big" = "Аттрибут '$1' не может быть длиннее $2 $3"; diff --git a/openvk-example.yml b/openvk-example.yml index c2f794e4..4b6ab4aa 100644 --- a/openvk-example.yml +++ b/openvk-example.yml @@ -27,6 +27,7 @@ openvk: requirePhone: false forcePhoneVerification: false forceEmailVerification: false + forceStrongPassword: false enableSu: true rateLimits: actions: 5