add options to change alternate twitter domain label and show 'about instance' on profiles

This commit is contained in:
Miss Pasture 2021-06-16 17:52:37 -04:00
parent b94926be73
commit 1991f2bf88
4 changed files with 23 additions and 9 deletions

View File

@ -47,8 +47,10 @@ If both whitelisting and blacklisting are set, only the whitelisting will be act
* `Instance:ResolveMentionsInProfiles` (default: true) to enable or disable mentions parsing in profile's description. Resolving it will consume more User's API calls since newly discovered account can also contain references to others accounts as well. On a big instance it is recommended to disable it.
* `Instance:PublishReplies` (default: false) to enable or disable replies publishing.
* `Instance:UnlistedTwitterAccounts` (default: null) to enable unlisted publication for selected twitter accounts, separated by `;` (please limit this to brands and other public profiles).
* `Instance:TwitterDomain` (default: twitter.com) redirect to a different domain (i.e. a Nitter instance) instead of Twitter
* `Instance:InfoBanner` (default: '') text to show in a banner on the front page
* `Instance:TwitterDomain` (default: twitter.com) redirect to a different domain (i.e. a Nitter instance) instead of Twitter in most areas
* `Instance:TwitterDomainLabel` (default: "") if TwitterDomain is set, use this label on profile pages instead of the domain itself (i.e. you can set this to "Nitter" to show that on profiles instead of "twiiit.com")
* `Instance:InfoBanner` (default: "") text to show in a banner on the front page
* `Instance:ShowAboutInstanceOnProfiles` (default: true) show "About [instance name]" on profiles with a link to /About
# Docker Compose full example
@ -81,7 +83,9 @@ services:
+ - Instance:PublishReplies=true
+ - Instance:UnlistedTwitterAccounts=cocacola;twitter
+ - Instance:TwitterDomain=twiiit.com
+ - Instance:TwitterDomainLabel=Nitter
+ - Instance:InfoBanner=This is my BirdsiteLIVE instance. There are many like it, but this one is mine.
+ - Instance:ShowAboutInstanceOnProfiles=true
networks:
[...]

View File

@ -14,5 +14,10 @@
public string TwitterDomain { get; set; }
public string InfoBanner { get; set; }
public string TwitterDomainLabel { get; set; }
public bool ShowAboutInstanceOnProfiles { get; set; }
}
}

View File

@ -79,7 +79,7 @@ namespace BirdsiteLive.Domain
attachments.Add(new UserAttachment
{
type = "PropertyValue",
name = _instanceSettings.TwitterDomain,
name = _instanceSettings.TwitterDomainLabel != "" ? _instanceSettings.TwitterDomainLabel : _instanceSettings.TwitterDomain,
value = $"<a href=\"https://{_instanceSettings.TwitterDomain}/{acct}\" rel=\"me nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">{_instanceSettings.TwitterDomain}/{acct}</span></a>"
});
@ -93,12 +93,15 @@ namespace BirdsiteLive.Domain
});
}
attachments.Add(new UserAttachment
if (_instanceSettings.ShowAboutInstanceOnProfiles)
{
type = "PropertyValue",
name = $"About {_instanceSettings.Name}",
value = $"<a href=\"https://{_instanceSettings.Domain}/About\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">{_instanceSettings.Domain}/About</span></a>"
});
attachments.Add(new UserAttachment
{
type = "PropertyValue",
name = $"About {_instanceSettings.Name}",
value = $"<a href=\"https://{_instanceSettings.Domain}/About\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">{_instanceSettings.Domain}/About</span></a>"
});
}
var user = new Actor
{

View File

@ -23,7 +23,9 @@
"MaxUsersCapacity": 1500,
"UnlistedTwitterAccounts": null,
"TwitterDomain": "twitter.com",
"InfoBanner": ""
"TwitterDomainLabel": "",
"InfoBanner": "",
"ShowAboutInstanceOnProfiles": true
},
"Db": {
"Type": "postgres",