Commit graph

99 commits

Author SHA1 Message Date
Matt Baer
dbd7eff7ea
Merge pull request #284 from writeas/high-load-error-page
Show 503 page on blogs under high load
2020-03-27 11:52:28 -04:00
Matt Baer
1d25b38eb7
Merge pull request #282 from writeas/patch-ap-mentions
Clean up ActivityPub mentions
2020-03-27 09:07:57 -04:00
Matt Baer
cf4f08b264 Merge branch 'develop' into T713-oauth-account-management 2020-03-19 12:02:33 -04:00
Matt Baer
9e25979e37 Run go fmt on modified GitLab files 2020-03-18 16:17:06 -04:00
Matt Baer
0285a9b0bd Show 503 page on collections under high load
This acknowledges "too many connections" and "max user connections"
errors in MySQL and propagates the error up the chain so we can notify
the user and return the correct HTTP code.
2020-03-18 16:14:05 -04:00
Matt Baer
97aec9c158 Fix error / info logging around AP mentions
This fixes log formatting and makes verbiage consistent & concise.
2020-03-17 13:42:51 -04:00
Matt Baer
471a9e0602 Store AP handles consistently
This ensures handles are always stored without leading @ symbol.
2020-03-17 13:42:09 -04:00
Kyle Robbertze
c292512b9d add Gitlab OAuth 2020-03-12 10:50:55 +02:00
Matt Baer
7fe281df69 Use NULL for new attach_user_id column
Ref T713
2020-02-10 15:24:39 -05:00
Matt Baer
f846cada4b Merge branch 'develop' into T713-oauth-account-management 2020-02-09 14:05:12 -05:00
Matt Baer
f70c1dfaa5 Merge branch 'develop' into rename-account-suspend 2020-02-09 11:14:51 -05:00
Matt Baer
468bbf2187 Merge branch 'develop' into rename-account-suspend 2020-02-09 11:14:14 -05:00
Matt Baer
1a10bb3ed6 Merge pull request #252 from writeas/fix-mix-of-collations
Restrict /invite/{code} route to valid chars
2020-02-08 15:25:15 -05:00
Matt Baer
af14bcbb78 Clean up oauth_users table on account deletion
Ref T319
2020-02-08 13:51:38 -05:00
Matt Baer
c9faff178d Don't float posts on account deletion
Ref T319
2020-02-08 13:51:14 -05:00
Matt Baer
9d360f0e41 Merge branch 'develop' into T319-delete-account 2020-02-08 13:42:46 -05:00
Matt Baer
9589612d0e Add TODOs for improving GetProfilePageFromHandle() 2020-02-08 13:05:54 -05:00
Matt Baer
bb63e64883 Clean up getProfilePageFromHandle
- Export the func
- Remove commented-out code
- Use log, not fmt for debug messages
- Remove named return parameters
- Use standard var naming schemes
- Fix spacing in queries and remove unnecessary chars
2020-02-08 12:10:47 -05:00
Matt Baer
68d63d3fef Merge branch 'develop' into activitypub-mentions 2020-02-08 11:51:18 -05:00
Matt Baer
51700cc7da Ignore "mix of collations" error on invite SELECT
This adds the `isIgnorableError` method and calls it when error checking
in `GetUserInvite()`, returning "not found" if the rror comes up.
2020-01-30 10:36:29 +01:00
Nick Gerakines
c0317b4e93 Implemented oauth attach functionality, oauth detach functionality, and required data migration. T713 2020-01-15 13:16:59 -05:00
Nick Gerakines
9170c84617 Merged in final changes from PR 225 into T705-oauth-slack. T710 2019-12-31 11:48:08 -05:00
Nick Gerakines
b5f716135b Changed oauth table names per PR feedback. T705 2019-12-31 11:28:05 -05:00
Nick Gerakines
cf87ae9096 Code cleanup in prep for PR. T710 2019-12-30 13:32:06 -05:00
Nick Gerakines
462f87919a Feature complete on MVP slack auth integration. T710 2019-12-28 15:15:47 -05:00
Nick Gerakines
13121cb266 Merging T705-oauth into T710-oauth-slack. T705,T710 2019-12-27 13:40:11 -05:00
Nick Gerakines
4266154749 Code cleanup from PR 255 feedback. T705 2019-12-27 13:35:48 -05:00
Nick Gerakines
bf3b6a5ba0 Unit tests, integration testing, and code cleanup for oauth support. Part of T705. 2019-12-23 14:30:32 -05:00
Nick Gerakines
7a0863f71b Added oauth handlers and tests with mocks. Part of T705. 2019-12-19 11:51:19 -05:00
Matt Baer
d8df15855c Merge branch 'develop' into activitypub-mentions 2019-11-26 13:19:20 -05:00
Rob Loranger
7e014ca659
Rename Suspend status to Silence
This changes all variables and functions from using Suspend{ed} to using
Silence{d} as well as documentation, errors and logging.
2019-11-11 15:25:19 -08:00
Matt Baer
7f96e8c384 Rename UserSuspended to UserSilenced
Some of the work needed to have the backend match user-facing wording.

Ref T661
2019-11-12 00:41:25 +09:00
Matt Baer
f7550a0da8 Change more suspension check logic
From u.Status == UserSuspended to u.IsSuspended()

Ref T661
2019-11-12 00:04:36 +09:00
Rob Loranger
41166e5c35
CLI delete account by username and delete posts
this changed the CLI flag to use the username instead of the userID
leaving the underlying database function as is.

also now posts are all deleted with no option to skip as this is likely
never needed.
2019-11-05 09:14:20 -08:00
Rob Loranger
c87ca11a52
add account deletion
CLI only but backend supports calls from app.db.DeleteAccount already

takes --delete-account user_id_number with optional --posts to also
delete posts. if --posts is omitted all user posts will be updated to
anonymous posts
2019-10-31 15:20:18 -07: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
Michael Demetriou
db14f04b59 Redirects from the intermediate page work and if there's an old mention
there it updates the table to include the handle.

migrations WIP
2019-10-10 16:04:43 +03:00
Rob Loranger
d954b7c8e3
add user invite instructions
this adds a new page with instructions for sharing user invites

if a user clicks the link for one of their own invite codes they are
directed to a page with clear instructions for it's use.

if a user clicks another users link they are redirectec to their account
settings witha flash telling them they do not need to register.
2019-09-13 10:58:17 -07:00
Matt Baer
40ffb3a5f9 Merge branch 'develop' into chorus 2019-09-10 21:41:28 +02:00
Matt Baer
9256293123
Merge pull request #169 from writeas/future-pins
prevent future posts from showing in pins
2019-09-10 21:37:28 +02:00
Matt Baer
ca388d6536 Merge branch 'develop' into chorus 2019-09-09 17:26:40 +02: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
55dc1917fe
use established future posts pattern 2019-08-12 14:13:02 -07:00
Rob Loranger
ca957c4b6d
fix missing collection hostname
GetCollections and GetPublishableCollections now take a hostname
parameter to allow setting the collecion hostname.

All collections used in memory now have their hostname set.
2019-08-12 12:35:17 -07:00
Rob Loranger
b373aad298
prevent future posts from showing in pins
this changes GetPinnedPosts to accept an includeFutre bool, which
returns future dated pinned posts when true.
2019-08-12 09:58:30 -07:00
Matt Baer
deec914ccb Merge branch 'develop' into chorus 2019-08-08 07:55:49 -04:00
Matt Baer
adfcc82241
Merge pull request #148 from writeas/default-visibility
Support setting default blog visibility on instance

Resolves T675
2019-08-07 17:44:37 -04:00
Matt Baer
f8d57d9e75 Return correct public state on collection creation
(in returned JSON data)

Ref T675
2019-08-07 16:22:35 -04:00
Matt Baer
afadf6fdf6 Set default visibility in datastore.CreateCollection
instead of updating it later. This is more correct behavior, prevents an
additional query, and ensures that potential collection-creation when
claiming posts also respects the default (which it didn't before).

Ref T675
2019-08-07 16:20:32 -04:00