Commit Graph

293 Commits

Author SHA1 Message Date
Tim Nordenfur
7c068f2df1 inserted missing paren 2021-06-04 06:39:19 +02:00
Henry
d147d0642a
fix rendering non-members on the dashboard (#238)
* fix rendering non-members on the dashboard

fixes #236

* remove alias or feedref code from template

doing this in the template was hard to read and inefficient.

also: rename OnlineMembers to OnlineUsers since it is a misnomer.
There are other connected peers in a room in certain privacy modes.
2021-06-01 14:23:42 +02:00
Henry
580830be76 went a bit too far with search+replace 2021-05-31 14:53:53 +02:00
Henry
4d3610e2fb prepare v2 release 2021-05-31 14:51:05 +02:00
Andre Staltz
4b616ffaad
theme the favicon with pink and peach colors 2021-05-31 12:20:09 +03:00
Henry
f83bf65bb9 don't block dasboard rendering for too long
updates #210
2021-05-31 07:38:52 +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
e7b4d171d9 add deployment version of style.css 2021-05-18 18:34:02 +02:00
Henry
81c05a663d Support open invites (fixes #102) 2021-05-17 10:16:26 +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
aa50cb4aeb tweak css a bit 2021-05-14 08:06:45 +02:00
Henry
7c356fa407 change []byte password to string 2021-05-13 07:39:19 +02:00
Henry
be35f154b7 add tests for new password features
* reset link creation
* own password change
* setPasswordWithToken
* also: move member handler funcs to own file
2021-05-13 07:39:19 +02:00
Henry
336596552e fix HTML in i18n strings
previously it just worked on errors
2021-05-13 07:39:19 +02:00
Henry
4558b208ee implement password update flow with reset tokens (fixes #98)
also update AuthFallback database

* re-write fallback auth to use alias or ssbid
* replace Create() with SetPassword() which does an upsert
* Add reset tokens to sqlite
* add test for SetPassword with reset token
2021-05-13 07:39:14 +02:00
Henry
5bfb5316f8 minor fixes
remove unsed about page and fix some typos
2021-05-11 10:17:02 +02:00
Henry
653d0926f7 add password change form 2021-05-11 10:16:35 +02:00
Henry
3d9c567cf6 add link to own member details on the top right 2021-05-11 08:29:55 +02:00
Henry
eaaed06fba add label to own entry in members list
Shows a green "this is you" label on the members list. Green because
that's also the color of the tag on the top right.

Also changes the color of the  moderator label from green to blue to be
less confusing.
2021-05-11 08:18:35 +02:00
Henry
5385ef65bb add middleware to check roles
fixes #176
2021-05-10 13:52:45 +02:00
Henry
691f0e75b9 add test for notice creation role check
updates #176
2021-05-10 13:52:45 +02:00
Henry
e72f1a3787 cleanup redirect mess for denied removal
updates #205
2021-05-10 13:51:29 +02:00
Henry
3651432b42 use errHandler in admin tests 2021-04-26 09:29:22 +02:00
cae80e385e make alias mockdb return alias entry 2021-04-26 09:29:22 +02:00
f0b4c7a534 test that alias resolving is turned off for restricted rooms 2021-04-26 09:29:22 +02:00
ab06233f28 test invite creation under community & restricted for admin, mod & member
Update web/handlers/admin/setup_test.go

Co-authored-by: Henry <111202+cryptix@users.noreply.github.com>
2021-04-26 09:29:17 +02:00
80686dec26 cherrypick: ts.User is now pointer 2021-04-23 13:25:13 +02:00
Henry
57c1375e54 fix missing context 2021-04-23 11:25:35 +02:00
Henry
e6ca0ed74b remove unused argument 2021-04-23 08:56:01 +02:00
User Cryptix
fc5d3e440e add json response for invite facade (fixes #188) 2021-04-23 08:55:50 +02:00
Andre Staltz
2f0afe8f33 improve sign-in with ssb JS for Firefox 2021-04-23 08:55:26 +02:00
Andre Staltz
3beb656b9c change join-room to claim-http-invite 2021-04-23 08:54:29 +02:00
cec5f93fb6 tests for restricted UI behavior
* add tests for privacy mode settings
* test privacy mode settings for member role
* test default language settings
* test denied keys interface for each role
* test adding new member interface depending on role
* test member details depending on role
* test invite button is disabled pending on user role
2021-04-23 08:34:27 +02:00
2c9fdcb98e update HTML UI to reflect role access restrictions
* disable ui if user is unelevated
* disable revoke button if unelevated and not own invite
* improve styling of disabled elements
* remove revoke if alias not made my current user
2021-04-23 08:33:20 +02:00
Andre Staltz
34eef5fb9b
rename address field in alias JSON resolver 2021-04-21 19:46:45 +03:00
16985bba8d rewrite list_languages function to use html/template 2021-04-20 11:49:24 +02:00
c6077337d1 use more robust identifier for test 2021-04-20 10:36:40 +02:00
a5f7701437 Apply suggestions from code review
Co-authored-by: Henry <111202+cryptix@users.noreply.github.com>

use eh.Handle
2021-04-20 10:36:34 +02:00
0574c9a235 test language picking 2021-04-20 09:22:53 +02:00
1c5c0b9867 make tests more robust when validating specific csrf token 2021-04-20 09:22:53 +02:00
7759e8f898 add de translation, use []TagTranslation, and sort
to make sure the list of languages is sorted, we now use a slice of
TagTranslation{Tag: string, Translation: string} structs, sorted
by `TagTranslation.Tag`.
2021-04-20 09:22:53 +02:00
b9fe27b0ca fix inconsistent cookies, set csrf cookie path
while working on the /set-language route, i noticed that i was getting a
csrf error for all /admin views when setting the language, while it
worked well on non-admin routes.

the issue, it turned out, was that we needed to configure gorilla's csrf
feature to set all cookies on the same route. when unconfigured, the
set cookies will only be set for the path they are being set at.

see more in the gorilla.csrf documentation (in particular the csrf.Path
option): https://pkg.go.dev/github.com/gorilla/csrf?utm_source=godoc#Path
2021-04-20 09:22:53 +02:00
c97b7d44c3 add default language admin ui functionality 2021-04-20 09:22:49 +02:00
534bdfcb6d improve api comment for ListLanguages 2021-04-20 09:12:15 +02:00
682283374d mock injected functions for tests 2021-04-20 09:12:15 +02:00
ee185e5f43 don't render language picker if we have less than 2 translations 2021-04-20 09:12:15 +02:00
93f84e04b0 redirect with 303 See Other 2021-04-20 09:12:15 +02:00
f535aa8f9c set & use language cookie 2021-04-20 09:12:13 +02:00
9863c6b166 add template func for listing languages 2021-04-20 09:11:41 +02:00
8c32b88cce add helper i18n.ListLanguages()
i18n.ListLanguages() returns a map, mapping language tags ('en', 'sv')
to the names of their corresponding languages (as translated by the
language itself).

This functionality will be used in the language picker, to present a
nice list of the translated languages.

I renamed testing.go to conform to go's testing conventions, and
added a test for i18n.ListLanguages().
2021-04-20 09:09:57 +02:00