Commit Graph

322 Commits

Author SHA1 Message Date
Henry dbf0fe5801 show login error above form 2021-04-12 14:09:09 +02:00
Henry cec7bc0e44 add flash message helper 2021-04-12 14:09:09 +02:00
Henry da62b1eecc add recovery helper to help with panics in handlers 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
cblgh 22a2348187 create /settings, move privacy modes ui into it 2021-04-12 13:42:31 +02:00
André Staltz 3eaee9c9e3 Update web/assets/login-events.js
Co-authored-by: Henry <111202+cryptix@users.noreply.github.com>
2021-04-12 13:42:31 +02:00
André Staltz 5bc7b5ef0a Update web/assets/login-events.js
Co-authored-by: Henry <111202+cryptix@users.noreply.github.com>
2021-04-12 13:42:31 +02:00
Andre Staltz 02a1f8ab5b fix server-initiated success redirect JS 2021-04-12 13:42:31 +02:00
André Staltz 28bded7c52
Merge pull request #133 from ssb-ngi-pointer/tweak-urls
support /login?ssb-http-auth=1
2021-04-11 21:31:30 +03:00
Alexander Cobleigh ff028699d2
Apply suggestions from code review
Co-authored-by: André Staltz <andre@staltz.com>
2021-04-09 14:35:06 +02:00
cblgh ac1ede43be clean up privacy mode logic 2021-04-09 13:50:15 +02:00
cblgh 092ce82ab1 wip logic for setting privacy modes 2021-04-09 13:25:40 +02:00
Andre Staltz aee9b7ad69
support /login?ssb-http-auth=1 2021-04-09 13:44:12 +03:00
cblgh 99f168e81e add english translations 2021-04-08 15:42:22 +02:00
cblgh b79d46d36e remake grid using tailwind 2021-04-08 15:42:22 +02:00
cblgh 3c75fcc6b0 start styling privacy modes ui 2021-04-08 15:42:22 +02:00
André Staltz 5dec9bd44b
Merge pull request #128 from ssb-ngi-pointer/style-invites3
restyle the invites page
2021-04-08 15:04:41 +03:00
Andre Staltz 6a48bb8149
update bottom margin in notice/show.tmpl 2021-04-08 13:36:20 +03:00
Andre Staltz 822e43e56f
update tests for invites-list admin page 2021-04-08 13:34:43 +03:00
Andre Staltz 23f3a844b4
show home on the footer, and edit notice when logged in 2021-04-08 13:28:08 +03:00
Andre Staltz 67877407b8
restyle the invites page 2021-04-08 13:10:45 +03:00
André Staltz aeb0f9f824
Merge pull request #123 from ssb-ngi-pointer/style-members3
combine aliases page with members page
2021-04-08 11:58:03 +03:00
Andre Staltz 326b9453f6
replace a hard-coded internal URL with urlTo 2021-04-07 19:28:05 +03:00
Andre Staltz 60c0b36f04
add tests for member-details 2021-04-07 14:58:31 +03:00
Andre Staltz 4f70c62ab2
combine aliases page with members page 2021-04-07 14:38:03 +03:00
cblgh d11839c3ce fix call count 2021-04-07 13:03:14 +02:00
cblgh 7ea79b3e33 test invite consumption being denied 2021-04-07 13:01:28 +02:00
cblgh 35d1d27c5f deny invite consumption for banned keys 2021-04-07 12:58:03 +02:00
Henry 01cd99b3e6 fix dashboard styling and invite count 2021-04-07 09:54:33 +02:00
Henry e9534a0dec set default privacy mode for all tests 2021-04-06 17:24:46 +02:00
cblgh 1b366dcf9f wip fix tests after new roomdb.RoomConfig interface added 2021-04-06 17:21:41 +02:00
cblgh 09eff17712 implement review suggestions 2021-04-06 16:52:54 +02:00
cblgh 75c60dbb16 implement SetPrivacyMode, rework -mode flag to use 2021-04-06 16:52:54 +02:00
cblgh b0761783f9 persist privacy mode in sqlite :> 2021-04-06 16:52:54 +02:00
cblgh faae7c0324 get started with privacy modes, parse -mode flag 2021-04-06 16:52:51 +02:00
André Staltz 106e961ce9
Fix web/handlers/invites.go
Co-authored-by: Henry <111202+cryptix@users.noreply.github.com>
2021-04-06 13:17:50 +03:00
André Staltz 4a066fd7e5
buildJoinRoomURI function returns template.URL
Co-authored-by: Henry <111202+cryptix@users.noreply.github.com>
2021-04-06 13:12:11 +03:00
Andre Staltz 2aa82bcfbf
update tests for invite web handlers 2021-04-06 12:32:29 +03:00
Andre Staltz ed4c50dcaf
add a loading indicator on invite facade 2021-04-06 11:43:42 +03:00
Andre Staltz 08c8b0cced
style the join (claim invite) pages 2021-03-30 18:04:07 +03:00
Andre Staltz 371109c136
style the admin/invite-created template 2021-03-30 17:38:52 +03:00
Andre Staltz d81198b78d
change Count() to return uint and error 2021-03-30 11:50:13 +03:00
Andre Staltz 6ee11a3fce
add Count() to Members, Invites, DeniedKeys 2021-03-30 11:50:13 +03:00
Andre Staltz a9027250d3
update tests for new dashboard template 2021-03-30 11:49:22 +03:00
Andre Staltz 313405d469
style the dashboard template 2021-03-30 11:49:21 +03:00
Henry 375e0a95e3
Merge pull request #111 from ssb-ngi-pointer/fix-favicon
add favicon
2021-03-30 10:44:47 +02:00
Henry da2bf3b898 add favicon (fixes #50) 2021-03-29 17:02:21 +02:00
Henry 377f3512a2 remove member nickname and alias suggestion
insert-user: remove nickname
2021-03-29 15:53:33 +02:00
Henry d1d108b9b7 Add support for invite consumption via JSON 2021-03-29 15:53:30 +02:00
Henry 921626b829 move NetworkInfo to network package
... and implement MultiserverAddress() there.
2021-03-29 12:29:01 +02:00
Andre Staltz 52e8ad078d
add tests for start-http-auth msaddr 2021-03-29 12:56:30 +03:00
Andre Staltz c6397c50d3
support multiserverAddress in start-http-auth URI 2021-03-29 12:34:38 +03:00
Henry f96b916177 final fixes
* fix auth test
* fix notices test and parallelize
* cleanup unused input lookup
2021-03-26 18:27:14 +01:00
Andre Staltz 09fcd573b4 style all the sign-in pages 2021-03-26 18:16:26 +01:00
Henry 1170275816 rename ClientRequest to ClientPayload 2021-03-26 17:58:03 +01:00
Henry 544c05b290
Apply suggestions from code review
change variable declaration in login-events.js to const

Co-authored-by: André Staltz <andre@staltz.com>
2021-03-26 14:49:04 +01:00
Andre Staltz 1dd3f2891e style the logged-in indicator to include PubKey.Ref 2021-03-26 13:45:21 +01:00
Andre Staltz c70fad79fe style the server-initiated ssb-http-auth template 2021-03-26 13:45:21 +01:00
Henry 7eeca8533d add tests for SSE-powered login
* add test for sse login
* add test for invalid solution
2021-03-26 13:45:21 +01:00
Henry e9883a049b various fixes 2021-03-26 13:45:21 +01:00
Henry 7a03e5b479 unify login pages 2021-03-26 13:45:21 +01:00
Henry 3b092885fb cleanup 2021-03-26 13:45:21 +01:00
Henry 428ffb0bda finalize sse login
* redirect and save the cookie
* supress a warning and redirect immediatly
2021-03-26 13:45:21 +01:00
Henry 4325e0fb3d various fixes
* fill in sid and sc
* fix logout
* cascade member removal
* fix links
* trim suffix from signature
* fix /sse/login link
* fix sse links and filenames
* fix logout
* fix typos
* fix test compilation
* fix bridge test
* correct alias url test
* add some comments
* fix potentiall "can't send" deadlock on bridge

some documentation and license headers
2021-03-26 13:45:17 +01:00
Henry 9aa676e040 add ssb-uri for invite consumption 2021-03-26 13:36:48 +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 abaff98f77 move aliases signing to internal 2021-03-23 17:13:06 +01:00
Henry 07feacb558 review comments for PR #91 2021-03-23 08:09:45 +01:00
Henry dde6549f02 rename package web/user to web/members 2021-03-22 15:26:11 +01:00
Henry 4f723ab050 dashboard: change user roles
* implement SetRole on sqlite
* add dropdown form to members table
* add http endpoint for processing
* Add comment to denied keys overview
* update ban remove confirm page
2021-03-22 13:02:39 +01:00
Henry a0be3e998b various fixes 2021-03-22 13:02:39 +01:00
Henry fdedccfc8b more denied-keys fixes 2021-03-22 13:02:39 +01:00
Henry 1b6f7f5006 add denied templates and handlers
copy of previous allow-list stuff
2021-03-22 13:02:39 +01:00
Henry 36d46a8576 fix denied list in sqlite 2021-03-22 13:02:39 +01:00
Henry 8c48b4a2b8 web/handlers 2021-03-22 13:02:37 +01:00
Henry 92a6dcfb55 web/handlers/admin overhaul 2021-03-22 12:59:52 +01:00
Andre Staltz 6509cdeeef
change datetime format in invite-list.tmpl tooltip to ISO 8601 2021-03-17 13:12:30 +02:00
Andre Staltz 8f63eb0abb
change datetime format in invite-list.tmpl tooltip to ISO 8601 2021-03-17 13:12:26 +02:00
Andre Staltz 4c007d3cd0
tweak paddings and widths in invite-list.tmpl 2021-03-17 13:06:28 +02:00
Henry d8d8b38f13 add tailwind powered tooltip 2021-03-17 08:58:39 +01:00
Henry dc4645ac57 fix numbers of rows 2021-03-16 18:15:23 +01:00
Henry e6b65e3d5d fix AdminInvitesCount pluralization 2021-03-16 17:49:26 +01:00
Henry 6126e46a2a add createdAt formating 2021-03-16 17:19:38 +01:00
Henry d39d1ac6e9 go fmt ./... the last PR 2021-03-16 15:13:05 +01:00
cblgh 40d121f55e rename main branch's prev. use of webassert 2021-03-16 14:17:33 +01:00
Alexander Cobleigh 110e7813a8
Apply suggestions from code review
Co-authored-by: Henry <111202+cryptix@users.noreply.github.com>
2021-03-16 14:13:33 +01:00
cblgh 6cd0974a94 fix review feedback 2021-03-16 14:09:04 +01:00
cblgh 991df6c013 add tests for checking SaveCallCount 2021-03-16 14:09:01 +01:00
cblgh c535410d5d verify that adding a translation works as expected 2021-03-16 14:09:01 +01:00
cblgh f970f9f8c7 content / title can't be empty when adding new translation 2021-03-16 14:09:01 +01:00
cblgh 83920aa646 saving notice without content, title should not work 2021-03-16 14:09:01 +01:00
cblgh 362e40e473 add test for checking incomplete notice save requests 2021-03-16 14:09:01 +01:00
cblgh 8be59c9575 route add/language returns 405 for non-POST req 2021-03-16 14:08:54 +01:00
cblgh a8061c0f20 rename webassert.InputsInForm->ElementsInForm
* webasserts.InputsInForm now also takes a Tag as arg
2021-03-16 14:08:30 +01:00
cblgh e8b577719a refactor tests to use internal webassert module 2021-03-16 14:08:30 +01:00
cblgh cc17f97077 update to use roomdb instead of admindb 2021-03-16 14:08:12 +01:00
cblgh ba2fbbef8e notice edit test cleanup 2021-03-16 14:08:12 +01:00
cblgh 76fe1ec8d2 wip: verify edit form has required inputs 2021-03-16 14:08:12 +01:00
cblgh 0a90dd1c60 update some comments 2021-03-16 14:08:12 +01:00
Henry ae44a878b8 add test for visibility of notice edit buttons 2021-03-16 14:08:12 +01:00
cblgh 3db514fd66 add more tests 2021-03-16 14:08:12 +01:00
cblgh 8d35860cde add basic smoke tests for notices 2021-03-16 14:08:12 +01:00
Henry 206a776917
Merge pull request #78 from ssb-ngi-pointer/aliases
Aliases: database and web/muxrpc handlers
2021-03-16 11:35:50 +01:00
Henry ca3ee626db
Update web/handlers/aliases.go
Co-authored-by: André Staltz <andre@staltz.com>
2021-03-16 10:28:00 +01:00
André Staltz 90634b0c96
Merge pull request #80 from ssb-ngi-pointer/css-invite-pages
style the invite-list page
2021-03-16 10:29:41 +02:00
Henry 416bc9c089 fix tag closing 2021-03-16 09:22:37 +01:00
Henry 5092f8ef9e add more godoc strings 2021-03-16 09:10:44 +01:00
Henry 757b14d419 Apply suggestions from code review
Co-authored-by: Alexander Cobleigh <cblgh@cblgh.org>
2021-03-16 08:49:58 +01:00
Henry e47fa57c73 small fixes
* fix address on JSON response
* show address on HTML page
* add TODO for ssb-uri
2021-03-16 08:49:58 +01:00
Henry b9bcbb42ec alias JSON endpoint and testing 2021-03-16 08:49:58 +01:00
Henry 50e4ebbaca aliases: add overview and revoke handlers 2021-03-16 08:49:47 +01:00
Andre Staltz 6dc7fb1788
localize invite-list page 2021-03-12 16:57:03 +02:00
Andre Staltz 25663d4d8f
support mobile layout on invite-list 2021-03-12 16:56:46 +02:00
Andre Staltz bd9c521fcf
fix typo in AdminInvitesWelcome 2021-03-12 13:35:09 +02:00
Andre Staltz 134d9124bf
style the invite-list page 2021-03-12 13:25:27 +02:00
Henry ccee696507 use exported InputsInForm helper in web/handlers/admin 2021-03-11 12:08:54 +01:00
Henry 96b57b7562 split up http_test and move assertion helpers into a new package 2021-03-11 09:55:38 +01:00
Henry 639bffeffa typo in web/handlers/invites.go
Co-authored-by: Alexander Cobleigh <cblgh@cblgh.org>
2021-03-11 09:32:17 +01:00
Henry ad7c01fb10 web/handlers: streamline receiver names 2021-03-11 09:32:03 +01:00
Henry 117cad48a7 rename admindb to roomdb 2021-03-10 16:44:46 +01:00
Henry b95c8de8be add room v1 "invite" until we have ssb-uri finalized 2021-03-10 09:35:54 +01:00
Henry b21e2b2062 More testing
* test for invite accept form rendering
* show placeholder if there is no suggested alias
* accept form and consume endpoint
2021-03-10 09:35:30 +01:00
Henry fd21dfc60a Various fixes
* fix accept and consumed view
* Apply suggestions from Alex' code review
* define admin.Databases options struct
* structify database parameters of web/handlers
2021-03-10 09:34:36 +01:00
Henry 672647cd4d Add GetByID and GetByToken to invite service 2021-03-10 09:34:36 +01:00
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 9f1fef1916 more consistent type names for handlers 2021-03-10 09:33:27 +01:00
Henry fd5312b04a disambiguate redirect url 2021-03-10 09:33:27 +01:00
Henry 91dd6017e0 add user.FromContext middleware
A helper package so that handler and render code isnt directly tied to
the authentication package.

Also reduces db lookup overhead to one request to sqlite per request for
the user lookup.
2021-03-10 09:33:27 +01:00
Henry 3c58a1361c add endpoint for create 2021-03-10 09:33:27 +01:00
Henry 97554069b5 re-use pagination code 2021-03-10 09:33:27 +01:00
Henry c7bcef4339 invite form testing 2021-03-10 09:33:15 +01:00
Andre Staltz 11d1c8cdee
fix CSS for long code blocks 2021-03-02 16:29:35 +02:00
Andre Staltz 254fd4d0c6
style the markdown body 2021-03-01 18:09:06 +02:00
Andre Staltz e5cc68696d
fix tests of the landing page 2021-03-01 17:10:38 +02:00
Andre Staltz 1f3c7e1dc5
add urlToNotice in tests 2021-03-01 14:16:52 +02:00
Andre Staltz e5162fea5d
style the notice-edit page 2021-03-01 12:21:05 +02:00
Andre Staltz 2156ed1af0
style the notices page 2021-02-25 18:42:00 +02:00
Andre Staltz 03fb9b9833
don't show menu button on mobile menu page 2021-02-25 18:40:42 +02:00
Andre Staltz 7700eb6d4f
don't show footer in mobile menu 2021-02-25 18:38:13 +02:00
Andre Staltz 874a37cbbc
format the HTML in allow-list.tmpl 2021-02-25 18:18:58 +02:00
Andre Staltz 2b7200512f
move the notices-list link to the admin nav 2021-02-25 18:17:51 +02:00
Andre Staltz 70e82752cb
style the landing page 2021-02-25 18:15:18 +02:00
Andre Staltz 96b6e097dc
display description notice on the landing page 2021-02-25 18:00:57 +02:00
Andre Staltz b02932228e
style the show notice page 2021-02-25 17:42:57 +02:00
Andre Staltz ce98eeb377
style the footer and notice links 2021-02-25 17:23:51 +02:00
Andre Staltz 62d31f08b9
implement new template func "urlToNotice" 2021-02-25 17:18:51 +02:00
Henry 6e630f9cd5 fix tests 2021-02-25 11:25:43 +01:00
Henry ec7e57d2f5 place list of notices in the top nav 2021-02-25 11:22:25 +01:00