Commit Graph

30 Commits

Author SHA1 Message Date
Matt Baer 53586d9cb8 Merge branch 'develop' into T661-disable-accounts 2019-11-12 01:46:37 +09:00
Matt Baer fcf074cf40
Merge pull request #166 from writeas/159-follow-panic
fix panic on duplicate remoteuser key
2019-11-07 12:26:57 +09:00
Rob Loranger f85f0751a3
address PR comments
- update error messages to be correct
- move suspended message into template and include for other pages
- check suspended status on all relevant pages and show message if
logged in user is suspended.
- fix possible nil pointer error
- remove changes to db schema files
- add version comment to migration
- add UserStatus type with UserActive and UserSuspended
- change database table to use status column instead of suspended
- update toggle suspended handler to be toggle status in prep for
possible future inclusion of further user statuses
2019-10-25 12:04:24 -07:00
Matt Baer 9873fc443f Merge branch 'develop' into T661-disable-accounts 2019-10-24 13:22:26 -04:00
Rob Loranger 77f7b4a522
Add account suspension features
This renders all requests for that user's posts, collections and related
ActivityPub endpoints with 404 responses.

While suspended, users may not create or edit posts or collections.

User status is listed in the admin user page

Admin view of user details shows status and now has a button to activate
or suspend a user.
2019-08-29 09:09:11 -07:00
Rob Loranger 95a98234eb
fix panic on duplicate remoteuser key
this changes handleFetchCollectionInbox to log _all_ errors after
attempting to insert an actor in the remoteusers table. previously
checking for all errors _except_ duplicate keys would cause a panic if
an actor made a request to follow while already having followed.
2019-08-09 14:04:15 -07:00
Matt Baer ff7828c558 Link hashtags to Reader when Chorus mode enabled
instead of linking to posts only on a user's blog.

Ref T681
2019-08-07 09:40:07 -04:00
Matt Baer 86a128483b Fix more missing hostNames
This fixes places, especially around federation, where the Collection's
`hostName` wasn't set.
2019-06-20 21:08:30 -04:00
Matt Baer f38a135bfa Remove global hostName var
This moves `hostName` to the `Collection` struct, where it's needed. The
field is populated after successful `GetCollection...()` calls.

This isn't the cleanest way to do things, but it accomplishes the goal.
Eventually, we should accept the AppCfg to `GetCollection...()` calls,
or make them `App` methods, instead of `datastore` methods.

Ref T613
2019-06-14 18:54:04 -04:00
Matt Baer d5c2fe47da
Merge branch 'develop' into librarization 2019-06-13 20:44:55 -04:00
Matt Baer 830b859421 Fix activitypub.go imports 2019-06-13 20:44:13 -04:00
Matt Baer a10a4e9a28 Merge branch 'develop' into librarization 2019-06-13 20:39:52 -04:00
Matt Baer 23acabaeb3 Use db.isDuplicateKeyErr() in activitypub.go
(instead of writing out the logic of that helper function)

Ref T613
2019-06-13 13:47:37 -04:00
Matt Baer c87b7ab39e
Merge pull request #111 from writeas/gh100
support pubgate
2019-06-03 16:37:36 -04:00
Rob Loranger d8fa85432d
fix for Pubgate user not having SharedInbox 2019-06-03 11:53:17 -07:00
Noëlle Anthony 95e84a1d0e Change GetPosts() to have includePinned parameter, change all calls to match 2019-05-28 14:54:56 -04:00
Rob Loranger ff2d3fc3d5
fixes issue #100 - can't follow from pubgate
this moves the unmarshaling of a remote actor out into a new helper which
accounts for the possibility of a context being a list or a single entity.
i.e. a string or an object.

basics tests are provided for both situations

also go fmt'd the file activitypub.go
2019-05-21 07:02:35 -07:00
Matt Baer d8937e89a8 Make App struct public 2019-05-12 17:19:38 -04:00
Matt Baer 2942a6818e Fix AP follower INSERT with SQLite
Previously the query would fail with "no such function: NOW"

Closes #56
2019-01-07 14:35:47 -05:00
Matt Baer 3ae45bc156 Fix spacing around copyright notices 2018-12-31 01:05:26 -05:00
Matt Baer 1274914207 Add copyright / license notices to .go files 2018-12-24 12:45:15 -05:00
Matt Baer 94badbc838 Only log ActivityPub info when debugging 2018-11-26 08:39:15 -05:00
Matt Baer b58cb1e541 Fix Novel blog post order in feeds and outbox 2018-11-17 21:59:04 -05:00
Matt Baer 3595c8163c Use Accept ID on blog's origin
instead of the requesting user's. This closes #16
2018-11-15 17:05:33 -05:00
Matt Baer 58d163d2e0 Properly handle failed AP requests 2018-11-14 18:30:24 -05:00
Matt Baer ecac59bf62 Fix Accept IDs
Prepend with hash, not hyphen

This closes #16
2018-11-12 19:31:21 -05:00
Matt Baer c996ae1cad Add To and CC on Create activities
Part of #8
2018-11-11 13:11:01 -05:00
Matt Baer 393f6d6834 Add ID on Accept activities
Part of #8
2018-11-11 13:10:39 -05:00
Matt Baer 771d0a8d2f Use hostname in AP requests' User-Agent header 2018-11-08 12:08:48 -05:00
Matt Baer 6dbf0c8764 Add ActivityPub components, routes, handlers 2018-11-08 01:28:08 -05:00