Commit Graph

50 Commits

Author SHA1 Message Date
decentral1se 00a1452cfc
Migrate to ssbc urls (#336)
* fix: ssbc urls

Closes https://github.com/ssbc/go-ssb-room/issues/332

* fix: go-ssb-refs API changes

* test: go-ssb-refs API changes

Co-authored-by: decentral1se <cellarspoon@riseup.net>
Co-authored-by: André Staltz <andre@staltz.com>
2022-11-07 11:18:13 +02:00
Andre Staltz 642022cb0a fix support for SSB URIs on Android Chrome 2021-11-23 09:20:08 -03:00
Henry Bubert 73415e54c6 small fixes
add missing preremove file
v2 fix goreleaser file
use relative import goreleaser
fix secretstream dependency
2021-06-01 08:03:12 +02:00
Henry 3e53570638 dependency updates
* use LICENSEd version of nocomment
* use forked kitlog
* cleanup of various dependencies
2021-05-25 12:40:00 +02:00
henry 1f680c5cf6 use goreleaser for packaging .deb release
updates #203
2021-05-24 16:31:20 +02:00
Henry 385b98a3a1 add privacy mode and role tests (fixes #185)
* denied/remove
* denied/add
* invites/revoke
* members/remove
* notices/edit
* notices/add

also:
* add members.CheckAction helper
* fix muxrpc abort bug and update to v2.0.5
* strictly use SeeOther not 307 (fixes #149)
2021-05-14 14:27:01 +02:00
Henry 653d0926f7 add password change form 2021-05-11 10:16:35 +02:00
Henry 800023b9fc update muxrpc 2021-05-10 13:52:45 +02:00
Henry 3969372993 reconnect testing 2021-04-26 10:06:34 +02:00
Henry 38148aadcb update muxrpc branch 2021-04-20 18:17:56 +02:00
Henry 940cd2b3d1 Fix ssb-ws connections
The landing path (/) can now also be used as a websocket endpoint.
This enables use of the room server with ssb-browser-demo and similar
applications that can't use TCP connections.

also pin WIP muxrpc branch (fix-stupid-timeout)
2021-04-20 18:10:26 +02:00
Henry cec7bc0e44 add flash message helper 2021-04-12 14:09:09 +02:00
Henry 81bd94344e web/handlers: revamp error localization
fixes #66
2021-04-12 14:09:07 +02:00
Andre Staltz 6ee11a3fce
add Count() to Members, Invites, DeniedKeys 2021-03-30 11:50:13 +03:00
Henry a62ad21165 integrate counterfeiter dependency 2021-03-29 15:33:58 +02:00
Henry 57c6baf43d add ratelimiter middleware for HTTP and relax server timeouts
these timeouts affect server-sent events, too and interfer with sign-in with ssb.
2021-03-26 13:45:21 +01:00
Henry 396961e5e8 implement bridge between muxrcp and http 2021-03-26 13:36:48 +01:00
Henry afa6bee285 add server-sent events handler 2021-03-26 13:36:48 +01:00
Henry a180c74c38 begin sign-in with ssb
* sketch session store
* use session store and unify authentication handling
* sketch muxrpc handlers
2021-03-26 13:36:42 +01:00
Henry 3cea539128 overhauling a bunch of stuff 2021-03-23 08:14:49 +01:00
Henry e6b65e3d5d fix AdminInvitesCount pluralization 2021-03-16 17:49:26 +01:00
Henry 0f82c29f48 track created_at column for invites 2021-03-16 17:13:01 +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 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
Andre Staltz 743cc074d7
implement pagination in allow-list overview 2021-02-24 15:54:36 +02:00
Henry 73471b5ff6 update http/render 2021-02-22 16:20:26 +01:00
Henry 5829cb1197 migrate migrations
had to patch the upstream dependency, nothing too big though. Expecting
a merge after some small backwards compat discussion.
2021-02-22 14:49:11 +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 aefa2a266c update login test to do the csrf dance
also: use pre-release of http/tester with better header handling
2021-02-22 14:19:21 +01:00
Henry f1f4e9dcb9 add CSRF protection
updates #14
2021-02-17 12:22:05 +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 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 31cbf00c93 use new auth.SetErrorHandler option 2021-02-09 13:40: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 2d38db1bc7 embedded templates 2021-02-04 17:25:39 +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 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
Henry f31de7faa1 use newer muxrpc with Handled() 2021-02-02 17:45:17 +01:00
Henry 9b368d79b6 update muxrpc branch 2021-01-28 15:07:55 +01:00
Henry d977998a4c muxrpc with fixed packet skipping 2021-01-28 11:02:11 +01:00
Henry 457d6f2f03 typo.. 2021-01-27 11:50:17 +01:00
Henry b50f052e66 update muxrpc v2 branch 2021-01-27 11:38:45 +01:00
Henry be5f248c93 imports cleanup 2021-01-27 10:01:35 +01:00
Henry 994a76cd67 whoops2 2021-01-25 18:43:32 +01:00
Henry b176ff51c4 whoops 2021-01-25 18:41:36 +01:00
Henry 678720a4a3 pin muxrpc 2021-01-25 18:39:11 +01:00
Henry 6b90c96a5d room sever skeleton 2021-01-25 13:50:51 +01:00