Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moderation #45

Merged
merged 10 commits into from Aug 24, 2019
Merged

moderation #45

merged 10 commits into from Aug 24, 2019

Conversation

ghost
Copy link

@ghost ghost commented Jun 2, 2019

This is a rough initial implementation for subjective (yet sticky) moderation.

When you initialize a cabal, your own key is added as admin for your view of the network. You can optionally set another key in the cabal URL via cabal://modkey@cabalkey. This way you can share a cabal chat with somebody inclusive of a moderation setting so you can share your subjective view of the network (and not have that other person see filtered content that you don't even see).

This patch adds ban/add, ban/remove, mod/add, and mod/remove types. When you add a moderator you can set the role to be admin, mod, or a custom string for custom application purposes. Setting admins and mods can be channel specific or cabal-wide (by not specifying a channel or using the special @ super-user group). Admins can add and remove admins and mods and can add and remove bans. Mods can add and remove bans.

More info: https://github.com/substack/materialized-group-auth

Clients will need to be updated for ban and mod commands once this lands and a lot of other UI work will need to be done.

Copy link
Member

@hackergrrl hackergrrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Could you also update the readme /w the new APIs you've surfaced?

test/mod.js Outdated Show resolved Hide resolved
views/moderation.js Show resolved Hide resolved
views/moderation.js Outdated Show resolved Hide resolved
@hackergrrl
Copy link
Member

Travis is failing because a package-lock.json got introduced. If you rebase from master and force-push you should get more useful results.

@hackergrrl
Copy link
Member

hackergrrl commented Jun 3, 2019

@cblgh @nikolaiwarner @cinnamon-bun (and anyone else): any of you want to block this / request changes?

I'm feeling not 100% on the cabal://modkey@cabalkey URI syntax. It makes the URIs quite long. I wonder what other ways there are of letting folx choose a custom root mod. If we do do the URI approach, I also have a kinda nitpicky preference toward a cabalkey@modkey ordering, since it makes mod info easier to shave off the end and join the cabal /w the default mod setup.

@ghost
Copy link
Author

ghost commented Jun 3, 2019

cabal://modkey@cabalkey is more similar to how the URI schema uses scheme://authority@host which is why I did it that way. I'm also not very attached to this particular scheme. Other options include cabal://cabalkey/modkey or many more.

@cblgh
Copy link
Member

cblgh commented Jun 3, 2019

oh hell yes, i'll review later tonight!

@okdistribute
Copy link
Member

This is great, thanks substack. Excited to use this.

can we use role/update instead of mod/add and mod/remove? It's a bit more flexible

@okdistribute
Copy link
Member

In hyperdrive the syntax folks use is dat://key@seq, not sure if cabal wants to reuse that to refer to a specific message, or come up with another scheme for referring to a message

@cinnamon-bun
Copy link
Member

cinnamon-bun commented Jun 6, 2019

Yay moderation ✨

Cabal keys and user pubkeys are so long that the @ or other separator will be lost in the noise. I'd guess most people will only look at the first couple chars and they will think of that as the name of the cabal.

I don't know which is better to come first:

  • A. If the cabal key comes first, people will think that different admin-views of the same cabal are the same thing, not noticing the difference in admins
  • B. If the mod pubkey comes first, every admin-view will seem like a totally different cabal address

Could you maliciously re-use a pubkey across multiple cabals to make them have similar looking addresses in case B?


Do we care if the whole address can be easily selected by double-clicking?


Personally I feel itchy about cabal://pubkey@cabalkey because, by analogy to email, it seems like it's identifying a user rather than a view. I would choose something like cabal://cabalkey?mod=pubkey to allow for further expansion later, like linking to a specific message.

But I don't want to bikeshed it and we can change it later! I'm excited this is happening 🐰 👍

@cblgh
Copy link
Member

cblgh commented Jun 8, 2019

from IRC:
(bikeshed proposal == cabal://<cabal key>?mod=<public key of mod> instead of mod@cabalkey)

10:22:28 < cblgh> substack: i started adding the bikeshed proposal by rewriting the tests, but i might have found a bug
10:22:28 < cblgh> 1339a78
10:22:35 < cblgh> that should work right?
10:22:54 < cblgh> one's a mod, one's banned, one subscribes to the bans, one doesn't
10:23:12 < cblgh> the test errors out tho, not sure if i'm missing something
10:24:02 < cblgh> also the other test case has been edited to the new mod syntax and still passes
10:24:15 < cblgh> despite me not having changed anything else yet
10:27:54 < cblgh> (that the new mod syntax is part of the other test is a mistake; that's how i started doing stuff and noticed the tests were still passing)

@hackergrrl
Copy link
Member

@hackergrrl
Copy link
Member

Remaining tasks for this PR:

  • utilize the banned users list to hide content from the messages API

Future work:

  • API to expose list of mods and admins and/or list of roles on a user
  • refusing to download hypercores of cabal-wide banned users

@hackergrrl
Copy link
Member

Actually, let's do message pruning in another PR: it's nontrivial and I'm keen to get this in.

@hackergrrl hackergrrl merged commit 756e1a7 into cabal-club:master Aug 24, 2019
@hackergrrl
Copy link
Member

🎉 thank you @substack

@cblgh
Copy link
Member

cblgh commented Aug 24, 2019

🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants