Commit Graph

20 Commits

Author SHA1 Message Date
Henry f1f4e9dcb9 add CSRF protection
updates #14
2021-02-17 12:22:05 +01:00
Henry a528002361 cleanup internal sqlite error 2021-02-15 17:21:06 +01:00
Henry 58f795d5e6 route with query params instead of named routers
Since we don't use the web/router through and through to setup handler
functions, accessing the named route varaibles doesn't work inside those
handler functions.

Since I dont find it acceptable to juggle two concepts here I switch the
url generation to classical get query paramters (route?varA=xyz&varB=2).
2021-02-15 14:43:55 +01:00
Henry 6416d1c215 allow list interface 2021-02-15 14:43:32 +01:00
Henry 99c2e95aa3 setup logging in http handlers (fixes #10)
in a http.Handler you can now do the following to log events:

logger := logging.FromContext(req.Context())
level.Info(logger).Log("event", "happend", ...)
2021-02-11 16:43:37 +01:00
Henry 431e917fd2 eliminate global state in handlers/http_test.go 2021-02-11 15:34:03 +01:00
Henry beea19f93e seperate room state from muxrpc handler
There is a new roomstate package now with a Manager which is shared between muxrpc and the http
handler(s).

Also adds a list of peers in the room to admin dashboard.
2021-02-11 15:30:51 +01:00
Henry fec92d428c change name to go-ssb-room
It has been brought to my attention that "gossb" reads like "gossip..?"
to the untrained eye. That's just confusing.

Also the project hosts a single room so the plural was just wrong.
2021-02-09 17:38:51 +01:00
Henry 34aa8dd2c4 fix web/handlers tests
used the route name in palce of the url
2021-02-09 17:35:17 +01:00
Henry 31cbf00c93 use new auth.SetErrorHandler option 2021-02-09 13:40:57 +01:00
Henry 0a44d19b4b add missing license headers 2021-02-09 12:53:33 +01:00
Henry 743de1d1f6 add simple authenticated navigation
{{is_logged_in}} returns a *admindb.User value or nil depending on their
state. This can be used to build conditional rendering.
2021-02-09 12:39:57 +01:00
Henry ef4a2f3f22 sqlite and auth setup 2021-02-08 17:47:42 +01:00
Henry 01ed66d6df basic auth middleware setup 2021-02-08 13:02:45 +01:00
Henry 025a5be7ad add embedded assets server 2021-02-04 17:46:51 +01:00
Henry 2d38db1bc7 embedded templates 2021-02-04 17:25:39 +01:00
Henry e9013a0c6b change import path
this is part of the NGI work and should be clearly indicated as such
2021-02-04 16:54:30 +01:00
Henry f741065836 add i18n support
TODO: default files once embedded assets are there
2021-02-04 16:52:55 +01:00
Henry 98ca4f8408 examples for the news/ section 2021-02-04 12:00:12 +01:00
Henry fdf11f9a23 start http and html skelleton 2021-02-04 11:36:02 +01:00