diff --git a/resources/views/site/help/community-guidelines.blade.php b/resources/views/site/help/community-guidelines.blade.php
index 2ece56545..122113203 100644
--- a/resources/views/site/help/community-guidelines.blade.php
+++ b/resources/views/site/help/community-guidelines.blade.php
@@ -6,21 +6,58 @@
Community Guidelines
-
-
-
-
-
-
This page isn't available
-
We haven't finished it yet, it will be updated soon!
-
-
-
-
+ @if($page)
+
+ {!!$page->content!!}
+
+
This document was last updated {{$page->created_at->format('M d, Y')}}.
+
Originally adapted from the Mastodon Code of Conduct.
+ @else
+
+
The following guidelines are not a legal document, and final interpretation is up to the administration of {{config('pixelfed.domain.app')}}; they are here to provide you with an insight into our content moderation policies:
+
+
The following types of content will be removed from the public timeline:
+
+ - Excessive advertising
+ - Uncurated news bots posting from third-party news sources
+ - Untagged nudity, pornography and sexually explicit content, including artistic depictions
+ - Untagged gore and extremely graphic violence, including artistic depictions
+
+
+
+
+
The following types of content will be removed from the public timeline, and may result in account suspension and revocation of access to the service:
+
+ - Racism or advocation of racism
+ - Sexism or advocation of sexism
+ - Discrimination against gender and sexual minorities, or advocation thereof
+ - Xenophobic and/or violent nationalism
+
+
+
+
+
The following types of content are explicitly disallowed and will result in revocation of access to the service:
+
+ - Sexual depictions of children
+ - Content illegal in Canada, Germany and/or France, such as holocaust denial or Nazi symbolism
+ - Conduct promoting the ideology of National Socialism
+
+
+
+
+
Any conduct intended to stalk or harass other users, or to impede other users from utilizing the service, or to degrade the performance of the service, or to harass other users, or to incite other users to perform any of the aforementioned actions, is also disallowed, and subject to punishment up to and including revocation of access to the service. This includes, but is not limited to, the following behaviors:
+
+ - Continuing to engage in conversation with a user that has specifically has requested for said engagement with that user to cease and desist may be considered harassment, regardless of platform-specific privacy tools employed.
+ - Aggregating, posting, and/or disseminating a person's demographic, personal, or private data without express permission (informally called doxing or dropping dox) may be considered harassment.
+ - Inciting users to engage another user in continued interaction or discussion after a user has requested for said engagement with that user to cease and desist (informally called brigading or dogpiling) may be considered harassment.
+
+
+
+
These provisions notwithstanding, the administration of the service reserves the right to revoke any user's access permissions, at any time, for any reason, except as limited by law.
+
+
This document was last updated Jun 26, 2019.
+
Originally adapted from the Mastodon Code of Conduct.
+
+ @endif
@endsection
diff --git a/resources/views/site/help/partial/sidebar.blade.php b/resources/views/site/help/partial/sidebar.blade.php
index 05f6ec99f..2278eb7a3 100644
--- a/resources/views/site/help/partial/sidebar.blade.php
+++ b/resources/views/site/help/partial/sidebar.blade.php
@@ -30,11 +30,11 @@
- {{-- --}}
+
{{--
{{__('helpcenter.whatIsTheFediverse')}}
--}}
diff --git a/resources/views/site/terms.blade.php b/resources/views/site/terms.blade.php
index 6ede08305..5a2e51fb2 100644
--- a/resources/views/site/terms.blade.php
+++ b/resources/views/site/terms.blade.php
@@ -43,7 +43,9 @@
Pixelfed may revise these terms of service for its website at any time without notice. By using this website you are agreeing to be bound by the then current version of these terms of service.
8. Governing Law
These terms and conditions are governed by and construed in accordance with the laws of Canada and you irrevocably submit to the exclusive jurisdiction of the courts in that State or location.
-
9. Additional Rules
+
9. Community Guidelines
+
You can view our Community Guidelines here.
+
10. Additional Rules
This website does not have any additional rules.
@endif
@endsection
diff --git a/routes/web.php b/routes/web.php
index ee4da9733..a7a591c21 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -192,10 +192,10 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact
Route::get('privacy/blocked-users', 'SettingsController@blockedUsers')->name('settings.privacy.blocked-users');
Route::post('privacy/blocked-users', 'SettingsController@blockedUsersUpdate');
Route::get('privacy/blocked-instances', 'SettingsController@blockedInstances')->name('settings.privacy.blocked-instances');
- Route::post('privacy/blocked-instances', 'SettingsController@blockedInstanceStore');
+ Route::post('privacy/blocked-instances', 'SettingsController@blockedInstanceStore')->middleware('throttle:maxInstanceBansPerDay,1440');
Route::post('privacy/blocked-instances/unblock', 'SettingsController@blockedInstanceUnblock')->name('settings.privacy.blocked-instances.unblock');
Route::get('privacy/blocked-keywords', 'SettingsController@blockedKeywords')->name('settings.privacy.blocked-keywords');
-
+ Route::post('privacy/account', 'SettingsController@privateAccountOptions')->name('settings.privacy.account');
Route::get('reports', 'SettingsController@reportsHome')->name('settings.reports');
// Todo: Release in 0.7.2
Route::group(['prefix' => 'remove', 'middleware' => 'dangerzone'], function() {
diff --git a/tests/Unit/APAnnounceStrategyTest.php b/tests/Unit/APAnnounceStrategyTest.php
new file mode 100644
index 000000000..30b2bf1e3
--- /dev/null
+++ b/tests/Unit/APAnnounceStrategyTest.php
@@ -0,0 +1,86 @@
+invalid = [
+ 'id' => 'test',
+ 'type' => 'Announce',
+ 'actor' => null,
+ 'published' => '',
+ 'to' => ['test'],
+ 'cc' => 'test',
+ 'object' => 'test'
+ ];
+
+ $this->mastodon = json_decode('{"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1",{"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","sensitive":"as:sensitive","movedTo":{"@id":"as:movedTo","@type":"@id"},"Hashtag":"as:Hashtag","ostatus":"http://ostatus.org#","atomUri":"ostatus:atomUri","inReplyToAtomUri":"ostatus:inReplyToAtomUri","conversation":"ostatus:conversation","toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","focalPoint":{"@container":"@list","@id":"toot:focalPoint"},"featured":{"@id":"toot:featured","@type":"@id"},"schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value"}],"id":"https://mastodon.social/users/dansup/statuses/100784657480587830/activity","type":"Announce","actor":"https://mastodon.social/users/dansup","published":"2018-09-25T05:03:49Z","to":["https://www.w3.org/ns/activitystreams#Public"],"cc":["https://pleroma.site/users/pixeldev","https://mastodon.social/users/dansup/followers"],"object":"https://pleroma.site/objects/68b5c876-f52b-4819-8d81-de6839d73fbc","atomUri":"https://mastodon.social/users/dansup/statuses/100784657480587830/activity"}', true);
+
+ $this->pleroma = json_decode('{"@context":"https://www.w3.org/ns/activitystreams","actor":"https://pleroma.site/users/pixeldev","cc":["https://www.w3.org/ns/activitystreams#Public"],"context":"tag:mastodon.social,2018-10-14:objectId=59146153:objectType=Conversation","context_id":12325955,"id":"https://pleroma.site/activities/db2273eb-d504-4e3a-8f74-c343d069755a","object":"https://mastodon.social/users/dansup/statuses/100891324792793720","published":"2018-10-14T01:22:18.554227Z","to":["https://pleroma.site/users/pixeldev/followers","https://mastodon.social/users/dansup"],"type":"Announce"}', true);
+ }
+
+ public function testBasicValidation()
+ {
+ $this->assertFalse(Helpers::validateObject($this->invalid));
+ }
+
+ public function testMastodonValidation()
+ {
+ $this->assertTrue(Helpers::validateObject($this->mastodon));
+ }
+
+ public function testPleromaValidation()
+ {
+ $this->assertTrue(Helpers::validateObject($this->pleroma));
+ }
+
+ public function testMastodonAudienceScope()
+ {
+ $scope = Helpers::normalizeAudience($this->mastodon, false);
+ $actual = [
+ "to" => [],
+ "cc" => [
+ "https://pleroma.site/users/pixeldev",
+ "https://mastodon.social/users/dansup/followers",
+ ],
+ "scope" => "public",
+ ];
+
+ $this->assertEquals($scope, $actual);
+ }
+
+ public function testPleromaAudienceScope()
+ {
+ $scope = Helpers::normalizeAudience($this->pleroma, false);
+ $actual = [
+ "to" => [
+ "https://pleroma.site/users/pixeldev/followers",
+ "https://mastodon.social/users/dansup",
+ ],
+ "cc" => [],
+ "scope" => "unlisted",
+ ];
+
+ $this->assertEquals($scope, $actual);
+ }
+
+ public function testInvalidAudienceScope()
+ {
+ $scope = Helpers::normalizeAudience($this->invalid, false);
+ $actual = [
+ 'to' => [],
+ 'cc' => [],
+ 'scope' => 'private'
+ ];
+ $this->assertEquals($scope, $actual);
+ }
+}
diff --git a/tests/Unit/ActivityPub/RemoteFollowTest.php b/tests/Unit/ActivityPub/RemoteFollowTest.php
new file mode 100644
index 000000000..5d97bd55e
--- /dev/null
+++ b/tests/Unit/ActivityPub/RemoteFollowTest.php
@@ -0,0 +1,27 @@
+mastodon = '{"type":"Follow","signature":{"type":"RsaSignature2017","signatureValue":"Kn1/UkAQGJVaXBfWLAHcnwHg8YMAUqlEaBuYLazAG+pz5hqivsyrBmPV186Xzr+B4ZLExA9+SnOoNx/GOz4hBm0kAmukNSILAsUd84tcJ2yT9zc1RKtembK4WiwOw7li0+maeDN0HaB6t+6eTqsCWmtiZpprhXD8V1GGT8yG7X24fQ9oFGn+ng7lasbcCC0988Y1eGqNe7KryxcPuQz57YkDapvtONzk8gyLTkZMV4De93MyRHq6GVjQVIgtiYabQAxrX6Q8C+4P/jQoqdWJHEe+MY5JKyNaT/hMPt2Md1ok9fZQBGHlErk22/zy8bSN19GdG09HmIysBUHRYpBLig==","creator":"http://mastodon.example.org/users/admin#main-key","created":"2018-02-17T13:29:31Z"},"object":"http://localtesting.pleroma.lol/users/lain","nickname":"lain","id":"http://mastodon.example.org/users/admin#follows/2","actor":"http://mastodon.example.org/users/admin","@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1",{"toot":"http://joinmastodon.org/ns#","sensitive":"as:sensitive","ostatus":"http://ostatus.org#","movedTo":"as:movedTo","manuallyApprovesFollowers":"as:manuallyApprovesFollowers","inReplyToAtomUri":"ostatus:inReplyToAtomUri","conversation":"ostatus:conversation","atomUri":"ostatus:atomUri","Hashtag":"as:Hashtag","Emoji":"toot:Emoji"}]}';
+
+ }
+
+ /** @test */
+ public function validateMastodonFollowObject()
+ {
+ $mastodon = json_decode($this->mastodon, true);
+ $mastodon = Helpers::validateObject($mastodon);
+ $this->assertTrue($mastodon);
+ }
+}
\ No newline at end of file