1
0
Fork 0

Compare commits

...

5 Commits

Author SHA1 Message Date
chris 7d03ac49e3 allow 30 char usernames
raise maximum username length, because why not?
2024-02-19 16:15:14 +01:00
chris eab2c517eb 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.
2024-02-19 16:15:09 +01:00
chris c49bcecdc6 point to modified sourcecode
as per AGPL license of original source, modifications must be disclosed.
2024-02-19 16:15:02 +01:00
chris 2b39d60d91 hardcode discovery settings
force enable discovery (as dynamic settings are not saved properly)
2024-02-19 16:14:56 +01:00
chris 5193a8f90c remove IP logging
Replace unneeded logging of IPs and User-Agent strings with meaningless static data.
2024-02-19 16:14:50 +01:00
12 changed files with 33 additions and 30 deletions

View File

@ -285,8 +285,8 @@ class ApiV1Dot1Controller extends Controller
$log->action = 'account.edit.password';
$log->message = 'Password changed';
$log->link = null;
$log->ip_address = $request->ip();
$log->user_agent = $request->userAgent();
$log->ip_address = "127.0.0.23";
$log->user_agent = "Pixelfed.de";
$log->save();
Mail::to($request->user())->send(new PasswordChange($user));
@ -310,7 +310,7 @@ class ApiV1Dot1Controller extends Controller
abort_if(BouncerService::checkIp($request->ip()), 404);
}
$agent = new Agent();
$currentIp = $request->ip();
$currentIp = "127.0.0.23";
$activity = AccountLog::whereUserId($user->id)
->whereAction('auth.login')
@ -323,8 +323,8 @@ class ApiV1Dot1Controller extends Controller
return [
'id' => $item->id,
'action' => $item->action,
'ip' => $item->ip_address,
'ip_current' => $item->ip_address === $currentIp,
'ip' => "127.0.0.23",
'ip_current' => "127.0.0.23" === $currentIp,
'is_mobile' => $agent->isMobile(),
'device' => $agent->device(),
'browser' => $agent->browser(),
@ -487,7 +487,7 @@ class ApiV1Dot1Controller extends Controller
abort_if(BouncerService::checkIp($request->ip()), 404);
}
$rl = RateLimiter::attempt('pf:apiv1.1:iar:'.$request->ip(), config('pixelfed.app_registration_rate_limit_attempts', 3), function(){}, config('pixelfed.app_registration_rate_limit_decay', 1800));
$rl = RateLimiter::attempt('pf:apiv1.1:iar:'.Str::Random(10), config('pixelfed.app_registration_rate_limit_attempts', 3), function(){}, config('pixelfed.app_registration_rate_limit_decay', 1800));
abort_if(!$rl, 400, 'Too many requests');
$this->validate($request, [
@ -559,7 +559,7 @@ class ApiV1Dot1Controller extends Controller
$user->email = $email;
$user->password = Hash::make($password);
$user->register_source = 'app';
$user->app_register_ip = $request->ip();
$user->app_register_ip = "127.0.0.23";
$user->app_register_token = Str::random(40);
$user->save();
@ -616,7 +616,7 @@ class ApiV1Dot1Controller extends Controller
abort_if(BouncerService::checkIp($request->ip()), 404);
}
$rl = RateLimiter::attempt('pf:apiv1.1:iarc:'.$request->ip(), config('pixelfed.app_registration_confirm_rate_limit_attempts', 20), function(){}, config('pixelfed.app_registration_confirm_rate_limit_decay', 1800));
$rl = RateLimiter::attempt('pf:apiv1.1:iarc:'.Str::Random(10), config('pixelfed.app_registration_confirm_rate_limit_attempts', 20), function(){}, config('pixelfed.app_registration_confirm_rate_limit_decay', 1800));
abort_if(!$rl, 429, 'Too many requests');
$this->validate($request, [

View File

@ -109,8 +109,8 @@ class LoginController extends Controller
$log->action = 'auth.login';
$log->message = 'Account Login';
$log->link = null;
$log->ip_address = $request->ip();
$log->user_agent = $request->userAgent();
$log->ip_address = "127.0.0.23";
$log->user_agent = "Pixelfed.de";
$log->save();
}

View File

@ -70,7 +70,7 @@ class RegisterController extends Controller
$usernameRules = [
'required',
'min:2',
'max:15',
'max:30',
'unique:users',
function ($attribute, $value, $fail) {
$dash = substr_count($value, '-');

View File

@ -279,16 +279,16 @@ class DiscoverController extends Controller
}
return [
'hashtags' => [
'enabled' => false,
'enabled' => true,
],
'memories' => [
'enabled' => false,
'enabled' => true,
],
'insights' => [
'enabled' => false,
'enabled' => true,
],
'friends' => [
'enabled' => false,
'enabled' => true,
],
'server' => [
'enabled' => false,

View File

@ -320,7 +320,7 @@ class RemoteAuthController extends Controller
'webfinger' => $res['_webfinger'],
], [
'software' => 'mastodon',
'ip_address' => $request->ip(),
'ip_address' => "127.0.0.23",
'bearer_token' => $token,
'verify_credentials' => $res,
'last_verify_credentials_at' => now(),
@ -702,7 +702,7 @@ class RemoteAuthController extends Controller
'email' => $data['email'],
'password' => Hash::make($data['password']),
'email_verified_at' => config('remote-auth.mastodon.contraints.skip_email_verification') ? now() : null,
'app_register_ip' => request()->ip(),
'app_register_ip' => "127.0.0.23",
'register_source' => 'mastodon'
])));

View File

@ -230,8 +230,8 @@ class SeasonalController extends Controller
'action' => 'seasonal.my2020.view'
],
[
'ip_address' => $request->ip(),
'user_agent' => $request->userAgent()
'ip_address' => "127.0.0.23",
'user_agent' => "Pixelfed.de"
]
]);
return response()->json(200);

View File

@ -139,8 +139,8 @@ trait HomeSettings
$log->action = 'account.edit.password';
$log->message = 'Password changed';
$log->link = null;
$log->ip_address = $request->ip();
$log->user_agent = $request->userAgent();
$log->ip_address = "127.0.0.23";
$log->user_agent = "Pixelfed.de";
$log->save();
Mail::to($request->user())->send(new PasswordChange($user));
@ -186,8 +186,8 @@ trait HomeSettings
$log->action = 'account.edit.email';
$log->message = 'Email changed';
$log->link = null;
$log->ip_address = $request->ip();
$log->user_agent = $request->userAgent();
$log->ip_address = "127.0.0.23";
$log->user_agent = "Pixelfed.de";
$log->save();
}

View File

@ -80,8 +80,8 @@ class UserEmailForgotController extends Controller
{
UserEmailForgot::create([
'user_id' => $user->id,
'ip_address' => $request->ip(),
'user_agent' => $request->userAgent(),
'ip_address' => "127.0.0.23",
'user_agent' => "Pixelfed.de",
'email_sent_at' => now()
]);

View File

@ -122,8 +122,8 @@ class AuthLogin
$device = DB::transaction(function() use($user) {
return UserDevice::firstOrCreate([
'user_id' => $user->id,
'ip' => request()->ip(),
'user_agent' => str_limit(request()->userAgent(), 180),
'ip' => "127.0.0.23",
'user_agent' => "Pixelfed.de",
]);
});
}

View File

@ -41,8 +41,8 @@ class LogFailedLogin
$log->action = 'auth.failed';
$log->message = 'Failed login attempt';
$log->link = null;
$log->ip_address = $request->ip();
$log->user_agent = $request->userAgent();
$log->ip_address = "127.0.0.23";
$log->user_agent = "Pixelfed.de";
$log->save();
}
}

View File

@ -120,6 +120,7 @@ class RemoteAuthService
}
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 +145,7 @@ class RemoteAuthService
public static function lookupWebfingerUses($wf)
{
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 +168,7 @@ class RemoteAuthService
public static function submitToBeagle($ow, $ou, $dw, $du)
{
return;
try {
$url = 'https://beagle.pixelfed.net/api/v1/raa/submit';
$res = Http::throw()->timeout(10)->get($url, [

View File

@ -7,7 +7,7 @@
</div>
<hr>
<section>
<p class="lead">The software that powers this website is called <a href="https://pixelfed.org">Pixelfed</a> and anyone can <a href="https://github.com/pixelfed/pixelfed">download</a> or <a href="https://github.com/pixelfed/pixelfed">view</a> the source code and run their own instance!</p>
<p class="lead">This website runs a modified version of the Pixelfed software, which you can find on <a href="https://git.zknt.org/chris/pixelfed/">Git</a> (original, unmodified software: <a href="https://github.com/pixelfed/pixelfed/">here on Github</a></p>
</section>
@endsection