Update mastodon:setup task warning about trademark to match masto but ignore subdomains (#40143)
This commit is contained in:
parent
ddfdc1fef3
commit
1c66ebe821
@ -27,10 +27,16 @@ namespace :mastodon do
|
|||||||
q.messages[:valid?] = 'Invalid domain. If you intend to use unicode characters, enter punycode here'
|
q.messages[:valid?] = 'Invalid domain. If you intend to use unicode characters, enter punycode here'
|
||||||
end
|
end
|
||||||
|
|
||||||
if env['LOCAL_DOMAIN'].include?('mastodon') || env['LOCAL_DOMAIN'].include?('mstdn')
|
begin
|
||||||
prompt.warn 'The Mastodon name is a trademark and its use is restricted.'
|
# This strips subdomains, only keeping one label + a public suffix
|
||||||
prompt.warn 'You can read the trademark policy at https://joinmastodon.org/trademark'
|
domain = Addressable::URI.new(host: env['LOCAL_DOMAIN']).domain
|
||||||
next prompt.warn 'Nothing saved. Bye!' if prompt.no?('Continue anyway?')
|
if domain.include?('masto') || domain.include?('mstdn')
|
||||||
|
prompt.warn 'The Mastodon name is a trademark and its use is restricted.'
|
||||||
|
prompt.warn 'You can read the trademark policy at https://joinmastodon.org/trademark'
|
||||||
|
next prompt.warn 'Nothing saved. Bye!' if prompt.no?('Continue anyway?')
|
||||||
|
end
|
||||||
|
rescue Addressable::URI::InvalidURIError
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
prompt.say "\n"
|
prompt.say "\n"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user