From bf1c622c7c30218e449355a7074ea3338b20ac2c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 27 Jan 2020 20:41:00 -0700 Subject: [PATCH 1/6] Update user settings template, replace card shadow with border --- resources/views/settings/template.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/settings/template.blade.php b/resources/views/settings/template.blade.php index ea84bad3c..59cd3f8d5 100644 --- a/resources/views/settings/template.blade.php +++ b/resources/views/settings/template.blade.php @@ -21,7 +21,7 @@
-
+
@include('settings.partial.sidebar') From 3be32597d326eea37c3834e29a1b9e7933c86889 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 27 Jan 2020 20:55:11 -0700 Subject: [PATCH 2/6] Update instance config, cleanup and add restricted mode --- config/instance.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/config/instance.php b/config/instance.php index 28916f92b..de58147fa 100644 --- a/config/instance.php +++ b/config/instance.php @@ -3,10 +3,6 @@ return [ 'description' => env('INSTANCE_DESCRIPTION', null), - 'announcement' => [ - 'enabled' => env('INSTANCE_ANNOUNCEMENT_ENABLED', false), - 'message' => env('INSTANCE_ANNOUNCEMENT_MESSAGE', 'Example announcement message.
Something else here') - ], 'contact' => [ 'enabled' => env('INSTANCE_CONTACT_FORM', false), @@ -15,7 +11,7 @@ return [ 'discover' => [ 'loops' => [ - 'enabled' => false + 'enabled' => env('EXP_LOOPS', false), ], 'tags' => [ 'is_public' => env('INSTANCE_PUBLIC_HASHTAGS', false) @@ -51,5 +47,10 @@ return [ 'stories' => [ 'enabled' => env('STORIES_ENABLED', false), + ], + + 'restricted' => [ + 'enabled' => env('RESTRICTED_INSTANCE', false), + 'level' => 1 ] ]; \ No newline at end of file From b8e7ac270e00198bccdca19eea45659853a907f4 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 27 Jan 2020 20:56:54 -0700 Subject: [PATCH 3/6] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd857a64e..4df087e90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - Updated admin reports, fixed 404 bug ([dbd5c4cf](https://github.com/pixelfed/pixelfed/commit/dbd5c4cf)) - Updated AdminController, abstracted dashboard stats to AdminStatsService ([41abe9d2](https://github.com/pixelfed/pixelfed/commit/41abe9d2)) - Updated StoryCompose component, added upload progress page ([2de3c56f](https://github.com/pixelfed/pixelfed/commit/2de3c56f)) +- Updated instance config, cleanup and add restricted mode ([3be32597](https://github.com/pixelfed/pixelfed/commit/3be32597)) ### Changed From 4d2da2f1b0a93fde98bcb20ae48acee11b266518 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 27 Jan 2020 21:13:53 -0700 Subject: [PATCH 4/6] Update RelationshipSettings Controller, fixes #1605 --- app/Http/Controllers/Settings/RelationshipSettings.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/Http/Controllers/Settings/RelationshipSettings.php b/app/Http/Controllers/Settings/RelationshipSettings.php index a2f1cfea1..1933ce1d4 100644 --- a/app/Http/Controllers/Settings/RelationshipSettings.php +++ b/app/Http/Controllers/Settings/RelationshipSettings.php @@ -22,7 +22,7 @@ trait RelationshipSettings 'mode' => 'nullable|string|in:following,followers,hashtags' ]); - $mode = $request->input('mode'); + $mode = $request->input('mode') ?? 'followers'; $profile = Auth::user()->profile; switch ($mode) { @@ -37,10 +37,6 @@ trait RelationshipSettings case 'hashtags': $data = $profile->hashtagFollowing()->with('hashtag')->simplePaginate(10); break; - - default: - $data = []; - break; } return view('settings.relationships.home', compact('profile', 'mode', 'data')); From 17c1a83d9e5a005753b3782b780cf5b0dc9d598c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 27 Jan 2020 21:16:19 -0700 Subject: [PATCH 5/6] Add RestrictedAccess middleware for Restricted Mode --- app/Http/Middleware/RestrictedAccess.php | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 app/Http/Middleware/RestrictedAccess.php diff --git a/app/Http/Middleware/RestrictedAccess.php b/app/Http/Middleware/RestrictedAccess.php new file mode 100644 index 000000000..b88c838be --- /dev/null +++ b/app/Http/Middleware/RestrictedAccess.php @@ -0,0 +1,32 @@ +check()) { + $p = ['login', 'password*', 'loginAs*']; + if(!$request->is($p)) { + return redirect('/login'); + } + } + } + + return $next($request); + } +} From 22e9e3df08350545484b7d42e496ba594eabb79d Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 27 Jan 2020 21:17:17 -0700 Subject: [PATCH 6/6] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4df087e90..d7ee1304e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.10.7...dev) ### Added - Added ```BANNED_USERNAMES``` .env var, an optional comma separated string to ban specific usernames from being used ([6cdd64c6](https://github.com/pixelfed/pixelfed/commit/6cdd64c6)) +- Added RestrictedAccess middleware for Restricted Mode ([17c1a83d](https://github.com/pixelfed/pixelfed/commit/17c1a83d)) ### Fixed - Fixed Story Compose bug affecting postgres instances ([#1918](https://github.com/pixelfed/pixelfed/pull/1918)) @@ -20,6 +21,7 @@ - Updated AdminController, abstracted dashboard stats to AdminStatsService ([41abe9d2](https://github.com/pixelfed/pixelfed/commit/41abe9d2)) - Updated StoryCompose component, added upload progress page ([2de3c56f](https://github.com/pixelfed/pixelfed/commit/2de3c56f)) - Updated instance config, cleanup and add restricted mode ([3be32597](https://github.com/pixelfed/pixelfed/commit/3be32597)) +- Update RelationshipSettings Controller, fixes #1605 ([4d2da2f1](https://github.com/pixelfed/pixelfed/commit/4d2da2f1)) ### Changed