diff --git a/INSTALLATION.md b/INSTALLATION.md index da4b7cc..17a60f7 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -151,3 +151,7 @@ docker-compose pull # Start a new container, automatically removes old one docker-compose up -d ``` + +## More options + +You can find more options available [here](https://github.com/NicolasConstant/BirdsiteLive/blob/master/VARIABLES.md) \ No newline at end of file diff --git a/README.md b/README.md index 916a8a0..241316e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ You can find an official (and temporary) instance here: [beta.birdsite.live](htt ## Installation -I'm providing a [Docker build](https://hub.docker.com/r/nicolasconstant/birdsitelive), to install it on your own server, please follow [those instructions](https://github.com/NicolasConstant/BirdsiteLive/blob/master/INSTALLATION.md). +I'm providing a [docker build](https://hub.docker.com/r/nicolasconstant/birdsitelive). To install it on your own server, please follow [those instructions](https://github.com/NicolasConstant/BirdsiteLive/blob/master/INSTALLATION.md). More [options](https://github.com/NicolasConstant/BirdsiteLive/blob/master/VARIABLES.md) are also available. ## License diff --git a/VARIABLES.md b/VARIABLES.md new file mode 100644 index 0000000..3536069 --- /dev/null +++ b/VARIABLES.md @@ -0,0 +1,13 @@ +# Environment variables + +You can configure some of BirdsiteLIVE's settings via environment variables (those are optionnals): + +## Logging + +* `Logging:Type` (default: none) set the type of the logging and monitoring system, currently the only type supported is `insights` for *Azure Application Insights* (PR welcome to support other types) +* `Logging:InstrumentationKey` the instrumentation key for Azure Application Insights + +## Instance customization + +* `Instance:Name` (default: BirdsiteLIVE) the name of the instance +* `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. \ No newline at end of file diff --git a/src/BirdsiteLive.Common/Settings/InstanceSettings.cs b/src/BirdsiteLive.Common/Settings/InstanceSettings.cs index 2ce9715..fe303a7 100644 --- a/src/BirdsiteLive.Common/Settings/InstanceSettings.cs +++ b/src/BirdsiteLive.Common/Settings/InstanceSettings.cs @@ -2,6 +2,7 @@ { public class InstanceSettings { + public string Name { get; set; } public string Domain { get; set; } public string AdminEmail { get; set; } public bool ResolveMentionsInProfiles { get; set; } diff --git a/src/BirdsiteLive.Twitter/Extractors/TweetExtractor.cs b/src/BirdsiteLive.Twitter/Extractors/TweetExtractor.cs index 1d27ddb..f4bb8d1 100644 --- a/src/BirdsiteLive.Twitter/Extractors/TweetExtractor.cs +++ b/src/BirdsiteLive.Twitter/Extractors/TweetExtractor.cs @@ -89,8 +89,8 @@ namespace BirdsiteLive.Twitter.Extractors switch (mediaType) { case "photo": - var ext = Path.GetExtension(mediaUrl); - switch (ext) + var pExt = Path.GetExtension(mediaUrl); + switch (pExt) { case ".jpg": case ".jpeg": @@ -101,8 +101,15 @@ namespace BirdsiteLive.Twitter.Extractors return null; case "animated_gif": + var vExt = Path.GetExtension(mediaUrl); + switch (vExt) + { + case ".gif": + return "image/gif"; + case ".mp4": + return "video/mp4"; + } return "image/gif"; - case "video": return "video/mp4"; } diff --git a/src/BirdsiteLive/BirdsiteLive.csproj b/src/BirdsiteLive/BirdsiteLive.csproj index 01e0094..4729487 100644 --- a/src/BirdsiteLive/BirdsiteLive.csproj +++ b/src/BirdsiteLive/BirdsiteLive.csproj @@ -4,7 +4,7 @@ netcoreapp3.1 d21486de-a812-47eb-a419-05682bb68856 Linux - 0.10.0 + 0.10.1 diff --git a/src/BirdsiteLive/Views/Shared/_Layout.cshtml b/src/BirdsiteLive/Views/Shared/_Layout.cshtml index 5275267..f9f571a 100644 --- a/src/BirdsiteLive/Views/Shared/_Layout.cshtml +++ b/src/BirdsiteLive/Views/Shared/_Layout.cshtml @@ -1,9 +1,11 @@ - +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration + - @ViewData["Title"] - BirdsiteLIVE + @Configuration.GetSection("Instance")["Name"] - @ViewData["Title"] @@ -12,21 +14,21 @@
@@ -36,14 +38,14 @@ - diff --git a/src/BirdsiteLive/Views/Statistics/Index.cshtml b/src/BirdsiteLive/Views/Statistics/Index.cshtml index 9a0b536..c3dd57f 100644 --- a/src/BirdsiteLive/Views/Statistics/Index.cshtml +++ b/src/BirdsiteLive/Views/Statistics/Index.cshtml @@ -21,8 +21,8 @@

Mentions Extraction

\ No newline at end of file diff --git a/src/BirdsiteLive/appsettings.json b/src/BirdsiteLive/appsettings.json index d0c49bf..57bf945 100644 --- a/src/BirdsiteLive/appsettings.json +++ b/src/BirdsiteLive/appsettings.json @@ -10,6 +10,7 @@ }, "AllowedHosts": "*", "Instance": { + "Name": "BirdsiteLIVE", "Domain": "domain.name", "AdminEmail": "me@domain.name", "ResolveMentionsInProfiles": true diff --git a/src/BirdsiteLive/wwwroot/favicon.ico b/src/BirdsiteLive/wwwroot/favicon.ico index a3a7999..508b109 100644 Binary files a/src/BirdsiteLive/wwwroot/favicon.ico and b/src/BirdsiteLive/wwwroot/favicon.ico differ