Merge pull request #62 from NicolasConstant/develop

0.10.1 PR
This commit is contained in:
Nicolas Constant 2021-01-21 06:54:23 +01:00 committed by GitHub
commit 4bfb0c2847
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 59 additions and 31 deletions

View file

@ -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)

View file

@ -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

13
VARIABLES.md Normal file
View file

@ -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.

View file

@ -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; }

View file

@ -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";
}

View file

@ -4,7 +4,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<UserSecretsId>d21486de-a812-47eb-a419-05682bb68856</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<Version>0.10.0</Version>
<Version>0.10.1</Version>
</PropertyGroup>
<ItemGroup>

View file

@ -1,9 +1,11 @@
<!DOCTYPE html>
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - BirdsiteLIVE</title>
<title>@Configuration.GetSection("Instance")["Name"] - @ViewData["Title"]</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" />
<link rel="stylesheet" href="~/css/birdsite.css" />
@ -12,21 +14,21 @@
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">BirdsiteLIVE</a>
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">@Configuration.GetSection("Instance")["Name"]</a>
@*<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
</ul>
</div>*@
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
</ul>
</div>*@
</div>
</nav>
</header>
@ -36,14 +38,14 @@
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
<footer class="border-top footer text-muted">
<div class="container">
<a href="https://github.com/NicolasConstant/BirdsiteLive">Github</a> @*<a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>*@
<a href="https://github.com/NicolasConstant/BirdsiteLive">Github</a> @*<a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>*@
<span style="float: right;">BirdsiteLIVE @System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString(3)</span>
</div>
</footer>
<span style="float: right;">BirdsiteLIVE @System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString(3)</span>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>

View file

@ -21,8 +21,8 @@
<h4>Mentions Extraction</h4>
<ul>
<li>Current day in descriptions: @Model.ExtractionStatistics.MentionsInDescriptionsExtraction</li>
<li>Current day in statuses: @Model.ExtractionStatistics.MentionsInStatusesExtraction</li>
<li>Last day in descriptions: @Model.ExtractionStatistics.LastMentionsInDescriptionsExtraction</li>
<li>Last day in statuses: @Model.ExtractionStatistics.LastMentionsInStatusesExtraction</li>
<li>In descriptions (current day): @Model.ExtractionStatistics.MentionsInDescriptionsExtraction</li>
<li>In statuses (current day): @Model.ExtractionStatistics.MentionsInStatusesExtraction</li>
<li>In descriptions (last day): @Model.ExtractionStatistics.LastMentionsInDescriptionsExtraction</li>
<li>In statuses (last day): @Model.ExtractionStatistics.LastMentionsInStatusesExtraction</li>
</ul>

View file

@ -10,6 +10,7 @@
},
"AllowedHosts": "*",
"Instance": {
"Name": "BirdsiteLIVE",
"Domain": "domain.name",
"AdminEmail": "me@domain.name",
"ResolveMentionsInProfiles": true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 15 KiB