Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
13.04k stars 1.5k forks source link

Allow admins to set the created channel suffix, so can be '' or '_channel'; a boolean #1275

Closed McFlat closed 6 years ago

McFlat commented 6 years ago

On my instance after creating a channel I always go into the database manually and remove the suffix from the channel name. It would be cool if we can make this configurable in the config, to add a suffix to the created user username when creating a channel or to not add the suffix. We can just keep the setting like that, as a boolean.

let channelName = userCreated.username + '_channel'

all works fine after I just go into the database manually and remove the suffix so I figure that it won't hurt if we allow admins to modify it, it's only a visual part of the url, but the url can determine if it's a channel or a user by other means instead of the '_channel' suffix.

Chocobozzz commented 6 years ago

all works fine after I just go into the database manually and remove the suffix so I figure that it won't hurt if we allow admins to modify it, it's only a visual part of the url, but the url can determine if it's a channel or a user by other means instead of the '_channel' suffix.

A channel is an actor, a user is an account that is an actor so if you remove the suffix there is a duplicate. If you want a channel with the name you want (without suffix), just create a new one and delete the old one.

McFlat commented 6 years ago

@Chocobozzz It's not a duplicate because one is of type Person while the other one is of type Group, if there was two Groups or two Persons then yeah, but since they are different types they aren't duplicates.

McFlat commented 6 years ago

@rigelk please double check this issue. A Person with the same name as a Group is not a duplicate.

McFlat commented 6 years ago

Please re-open this and merge the change, thank you

Chocobozzz commented 6 years ago

@McFlat Even if the type is different, we need a unique actor name for webfinger discovery.

McFlat commented 6 years ago

@Chocobozzz But it is unique, the actor gets discovered on the url, the url can be a user or channel url. For the most part a user with the same channel name will make it so someone else can't create a user named user+'_channel' to make it look like their user page is someone else's channel page.

I could really use this functionality and I think maybe some other admins could to, it can be configured on a per instance basis. On my instance I would choose to remove the suffix, while some other instances can choose to keep it, that's why it's a boolean and not a string that lets admins use their own suffix.

McFlat commented 6 years ago

Webfinger goes by username right? then there's no issue with webfinger discover because it won't confuse it with a channel, it already knows that the account url is the user url and not the channel url.

data = Goldfinger.finger('acct:gargron@quitter.no')

data.link('http://schemas.google.com/g/2010#updates-from').href
# => "https://quitter.no/api/statuses/user_timeline/7477.atom"

data.aliases
# => ["https://quitter.no/user/7477", "https://quitter.no/gargron"]

data.subject
# => "acct:gargron@quitter.no"
McFlat commented 6 years ago

If anything,, since there is a difference between the username and channel name, another user can go and register a username having the suffix "_channel" in it to pretend to be the other user, but when they are the same, it's not likely.

McFlat commented 6 years ago

@Chocobozzz @rigelk please validate the bug I fixed, a user can create a second channel not having the _channel suffix, I think it invalidates the argument for why to not allow this to be merged. Please merge it.

screen shot 2018-10-17 at 2 26 09 pm