port patches

This commit is contained in:
chris 2024-07-01 12:08:22 +02:00
parent 04d4c2935e
commit 5a5d96e4f2
6 changed files with 56 additions and 55 deletions

View file

@ -1,10 +1,11 @@
From 8b8a7c12ee3c9a87623effc46eb75c44438fe1ee Mon Sep 17 00:00:00 2001
From cdd343f06f05c67fedcf5381abe6fd85f63c2858 Mon Sep 17 00:00:00 2001
From: chris <cg@zknt.org>
Date: Sun, 26 May 2024 13:42:01 +0200
Date: Mon, 1 Jul 2024 12:03:09 +0200
Subject: [PATCH 1/6] remove IP logging
Replace unneeded logging of IPs and User-Agent strings with hashed data.
---
.gitattributes | 12 ------------
app/Http/Controllers/Api/ApiV1Dot1Controller.php | 12 ++++++------
app/Http/Controllers/Auth/LoginController.php | 4 ++--
app/Http/Controllers/Auth/RegisterController.php | 2 +-
@ -15,10 +16,29 @@ Replace unneeded logging of IPs and User-Agent strings with hashed data.
app/Http/Controllers/UserEmailForgotController.php | 4 ++--
app/Listeners/AuthLogin.php | 4 ++--
app/Listeners/LogFailedLogin.php | 4 ++--
10 files changed, 24 insertions(+), 24 deletions(-)
11 files changed, 24 insertions(+), 36 deletions(-)
delete mode 100644 .gitattributes
diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 25c1b1b6..00000000
--- a/.gitattributes
+++ /dev/null
@@ -1,12 +0,0 @@
-* text=auto
-*.css linguist-vendored
-*.scss linguist-vendored
-*.js linguist-vendored
-CHANGELOG.md export-ignore
-
-# Collapse diffs for generated files:
-public/**/*.js text -diff
-public/**/*.json text -diff
-public/**/*.css text -diff
-public/img/* binary -diff
-public/fonts/* binary -diff
diff --git a/app/Http/Controllers/Api/ApiV1Dot1Controller.php b/app/Http/Controllers/Api/ApiV1Dot1Controller.php
index 59fb1c93..9a124025 100644
index 7165629c..108211c6 100644
--- a/app/Http/Controllers/Api/ApiV1Dot1Controller.php
+++ b/app/Http/Controllers/Api/ApiV1Dot1Controller.php
@@ -283,8 +283,8 @@ class ApiV1Dot1Controller extends Controller
@ -147,10 +167,10 @@ index a9f1f98c..352eb102 100644
]);
return response()->json(200);
diff --git a/app/Http/Controllers/Settings/HomeSettings.php b/app/Http/Controllers/Settings/HomeSettings.php
index 99326c09..1434cf66 100644
index ce411e4f..cf21aadb 100644
--- a/app/Http/Controllers/Settings/HomeSettings.php
+++ b/app/Http/Controllers/Settings/HomeSettings.php
@@ -139,8 +139,8 @@ trait HomeSettings
@@ -137,8 +137,8 @@ trait HomeSettings
$log->action = 'account.edit.password';
$log->message = 'Password changed';
$log->link = null;
@ -161,7 +181,7 @@ index 99326c09..1434cf66 100644
$log->save();
Mail::to($request->user())->send(new PasswordChange($user));
@@ -186,8 +186,8 @@ trait HomeSettings
@@ -185,8 +185,8 @@ trait HomeSettings
$log->action = 'account.edit.email';
$log->message = 'Email changed';
$log->link = null;
@ -218,5 +238,5 @@ index c6ba3305..eff0cf71 100644
}
}
--
2.45.0
2.45.2

View file

@ -1,6 +1,6 @@
From bbedc315c31eab590f7a680e5f68277cfc540e9d Mon Sep 17 00:00:00 2001
From 5e45b11e0f84ffc83ad55b3bc4969cd7aa9bd805 Mon Sep 17 00:00:00 2001
From: chris <cg@zknt.org>
Date: Sun, 26 May 2024 13:42:23 +0200
Date: Mon, 1 Jul 2024 12:03:28 +0200
Subject: [PATCH 2/6] hardcode discovery settings
force enable discovery (as dynamic settings are not saved properly)
@ -9,10 +9,10 @@ force enable discovery (as dynamic settings are not saved properly)
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/Http/Controllers/DiscoverController.php b/app/Http/Controllers/DiscoverController.php
index c9e93eec..ffeb34b4 100644
index b3047ff7..824e0308 100644
--- a/app/Http/Controllers/DiscoverController.php
+++ b/app/Http/Controllers/DiscoverController.php
@@ -291,16 +291,16 @@ class DiscoverController extends Controller
@@ -292,16 +292,16 @@ class DiscoverController extends Controller
return [
'hashtags' => [
@ -34,5 +34,5 @@ index c9e93eec..ffeb34b4 100644
'server' => [
'enabled' => false,
--
2.45.0
2.45.2

View file

@ -1,6 +1,6 @@
From 3561bc5f8fe01993aceeba2ced7266f4df5ceb90 Mon Sep 17 00:00:00 2001
From 1f4eb893dc805eeaefdb80c673daea4916ff9857 Mon Sep 17 00:00:00 2001
From: chris <cg@zknt.org>
Date: Sun, 26 May 2024 13:42:41 +0200
Date: Mon, 1 Jul 2024 12:03:45 +0200
Subject: [PATCH 3/6] point to modified sourcecode
as per AGPL license of original source, modifications must be disclosed.
@ -22,5 +22,5 @@ index cb2e7c77..63645f0c 100644
@endsection
--
2.45.0
2.45.2

View file

@ -1,62 +1,43 @@
From ab63598acd2b29b19ed1a52380b6dae71b509ff3 Mon Sep 17 00:00:00 2001
From 9c339532d73d5cbd45cb711396d2c42725620f45 Mon Sep 17 00:00:00 2001
From: chris <cg@zknt.org>
Date: Sun, 26 May 2024 13:43:19 +0200
Date: Mon, 1 Jul 2024 12:06:16 +0200
Subject: [PATCH 4/6] disable beagle service
beagle is a remote API service provided by dansup and used for centralised lookups.
Using the beagle service without users explicit consent violates GDPR.
As it's not configurable at the moment this patch disables remote communication with beagle.
As it's not configurable at the moment this patch disables remote communication of user data with beagle.
---
app/Services/Account/RemoteAuthService.php | 4 ++++
app/Services/Internal/BeagleService.php | 1 +
2 files changed, 5 insertions(+)
app/Services/Account/RemoteAuthService.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/Services/Account/RemoteAuthService.php b/app/Services/Account/RemoteAuthService.php
index 4412352a..0c69959f 100644
index 4412352a..abab2151 100644
--- a/app/Services/Account/RemoteAuthService.php
+++ b/app/Services/Account/RemoteAuthService.php
@@ -115,11 +115,13 @@ class RemoteAuthService
@@ -115,6 +115,7 @@ class RemoteAuthService
public static function isDomainCompatible($domain = false)
{
+ return true;
+ return true;
if(!$domain) {
return false;
}
return Cache::remember(self::CACHE_KEY . 'domain-compatible:' . $domain, 14400, function() use($domain) {
+ return true;
try {
$res = Http::timeout(20)->retry(3, 750)->get('https://beagle.pixelfed.net/api/v1/raa/domain?domain=' . $domain);
if(!$res->ok()) {
@@ -144,6 +146,7 @@ class RemoteAuthService
@@ -144,6 +145,7 @@ class RemoteAuthService
public static function lookupWebfingerUses($wf)
{
+ return 0;
+ return 0;
try {
$res = Http::timeout(20)->retry(3, 750)->get('https://beagle.pixelfed.net/api/v1/raa/lookup?webfinger=' . $wf);
if(!$res->ok()) {
@@ -166,6 +169,7 @@ class RemoteAuthService
@@ -166,6 +168,7 @@ class RemoteAuthService
public static function submitToBeagle($ow, $ou, $dw, $du)
{
+ return;
+ return;
try {
$url = 'https://beagle.pixelfed.net/api/v1/raa/submit';
$res = Http::throw()->timeout(10)->get($url, [
diff --git a/app/Services/Internal/BeagleService.php b/app/Services/Internal/BeagleService.php
index 60a4f78e..f8c9442c 100644
--- a/app/Services/Internal/BeagleService.php
+++ b/app/Services/Internal/BeagleService.php
@@ -13,6 +13,7 @@ class BeagleService
public static function getDefaultRules()
{
+ return [];
return Cache::remember(self::DEFAULT_RULES_CACHE_KEY, now()->addDays(7), function() {
try {
$res = Http::withOptions(['allow_redirects' => false])
--
2.45.0
2.45.2

View file

@ -1,6 +1,6 @@
From a3c06f038fd3ff5602bbf0a4e59c614ff186c722 Mon Sep 17 00:00:00 2001
From 147ba26fdc854392c32e81778470c9038c288c6d Mon Sep 17 00:00:00 2001
From: chris <cg@zknt.org>
Date: Sun, 26 May 2024 13:43:34 +0200
Date: Mon, 1 Jul 2024 12:06:48 +0200
Subject: [PATCH 5/6] allow 30 char usernames
raise maximum username length, because why not?
@ -22,5 +22,5 @@ index 72c8b741..2c8a26b4 100644
function ($attribute, $value, $fail) {
$dash = substr_count($value, '-');
--
2.45.0
2.45.2

View file

@ -1,9 +1,9 @@
From 952b84c634d64f003c06aab3ed871c4dae580f79 Mon Sep 17 00:00:00 2001
From 5e9c2e82672839b3712bc6e372848ad38571b361 Mon Sep 17 00:00:00 2001
From: chris <cg@zknt.org>
Date: Sun, 26 May 2024 13:43:52 +0200
Date: Mon, 1 Jul 2024 12:07:04 +0200
Subject: [PATCH 6/6] Link legal notice
local jurisdiction requires a prominent link to a legal notice at the frontpage.
local jurisdiction requires a prominent link to a legal notice at the frontpage
---
public/js/landing.js | 2 +-
resources/assets/components/landing/sections/footer.vue | 2 +-
@ -48,5 +48,5 @@ index 5fb4e27d..6188d2f3 100644
<p class="text-center text-muted small mb-0">
<span class="text-muted">© {{date('Y')}} {{config('pixelfed.domain.app')}}</span>
--
2.45.0
2.45.2