Commit Graph

74 Commits

Author SHA1 Message Date
Henry 98468e93a5 Invite endpoints
* Add revoke and created templates
* Render invite accept with domain
* Flesh out accept page
2021-03-10 09:33:55 +01:00
Henry c7bcef4339 invite form testing 2021-03-10 09:33:15 +01:00
Henry bbcab73cb5 add admindb.InviteService
interface methods: create, consume, list and revoke.

SQLite implementation and some light testing.

Related changes:

* have authfallback.Create return the user id

At some point we will need to not assume that authfallback is our users
table but that will not become relevant before we start adding
moderation roles.

* Update package documentation of admindb and admindb/sqlite

* remove leftover generated.db

now using the roomdb file created by TestSimple

Review comments by @cblgh

* better documentation of hashed token storage
* space between %d and `bytes`
* make interface assertion comments less scary
2021-03-05 08:42:11 +01:00
Henry 1ec3e8b064 list, set and get pinned notices 2021-02-25 10:07:47 +01:00
Henry e5a07fd8bc (Pinned)Notices
Notices are pages that admins can fill with their content to describe
and customize the room.

Pinned notices are common notices that each room has. Like a description
and privacy policy.

* update models
* simple crud test for basic notices
* edit and save notices as admin
2021-02-25 10:07:44 +01:00
Henry 8285c68417 remove -development falg from server cli
use -tags dev like we do in the rest of the code
2021-02-22 15:51:58 +01:00
Henry 6a4c1e54d9 add default CSP and some other browser mitigations
Though, CSP is primarily a tool against cross-site scripting and we
don't plan to host any user-generated or 3rd party content it's still a
good practice.  The primary requirment with this rule is
 to move all inline style tags to a seperate file.
2021-02-22 14:39:45 +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 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 2f907a1753 build fixes 2021-02-09 17:29:42 +01:00
Henry 830678c914 admindb: add migrations based on rubenv/sql-migrate
This removes the nasty need for creating the database manually.

Migrations are kept in an embedded filesystem, just like the templates
and assets for the web frontend. The same -tags dev trick applies for
them.
2021-02-09 16:49:48 +01:00
Henry 0a44d19b4b add missing license headers 2021-02-09 12:53:33 +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 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 0a67bf690b some cleanup and a Readme 2021-02-04 14:13:52 +01:00
Henry fdf11f9a23 start http and html skelleton 2021-02-04 11:36:02 +01:00
Henry 668e3dd766 simple authorized_keys file 2021-01-28 15:06:51 +01:00
Henry b176ff51c4 whoops 2021-01-25 18:41:36 +01:00
Henry 6b90c96a5d room sever skeleton 2021-01-25 13:50:51 +01:00
Henry f325ed5cf3 init 2021-01-25 11:39:05 +01:00