Commit graph

12 commits

Author SHA1 Message Date
Matt Baer
a2088c1646 Restrict API read access based on Private setting
This verifies that a user is authenticated before getting to the actual
handler on API endpoints where a user is reading content.

Ref T576
2019-06-16 20:24:47 -04:00
Matt Baer
b3a36a3be7 Allow completely private instances, part 1
This is the start of all changes needed to support entirely private
instances, where all blogs are only visible to other authenticated users
on an instance (ref T576). It begins by changing how Handler methods check an
endpoint's permissions.

- Renames UserLevelLEVEL consts to UserLevelLEVELType
- Adds UserLevelLEVEL funcs with same names as previous consts. Each
  returns a UserLevel
- Adds a new UserLevelReader that restricts access based on app
  configuration. This is now used on collections and posts.
- Changes routing a bit so static files are always accessible
2019-06-16 18:55:50 -04:00
Matt Baer
26a0990014 Save config via Apper interface from Admin dash
Ref T613
2019-06-13 21:56:13 -04:00
Matt Baer
034db22f8c Break functionality out of Serve() func
- Adds a new interface, Apper, that enables loading and persisting
  instance-level data in new ways
- Converts some initialization funcs to methods
- Exports funcs and methods needed for intialization
- In general, moves a ton of stuff around

Overall, this should maintain all existing functionality, but with the
ability to now better manage a WF instance.

Ref T613
2019-06-13 18:50:23 -04:00
Matt Baer
d8937e89a8 Make App struct public 2019-05-12 17:19:38 -04:00
Matt Baer
8513def899 Send correct status on 410/500 in handleHTTPError 2019-01-03 15:43:44 -05:00
Matt Baer
19215b0355 Send correct status on 404 in handleHTTPError 2019-01-03 12:27:52 -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
7d87aad55a Add basic admin dashboard with app stats
Start of T538
2018-11-18 20:18:22 -05:00
Matt Baer
704558114d Remove r.Host from server logs 2018-11-11 09:40:18 -05:00
Matt Baer
a30fc5b52b Add handler, page, template loading 2018-11-07 23:50:50 -05:00