Compare commits

...

5 Commits

Author SHA1 Message Date
991885a9d1
Merge pull request #6 from spaytac/feature/dotnet-8-update
Some checks are pending
Deploy Images to GHCR / push-store-image (push) Waiting to run
**update** github actions updated to .NET 8
2024-03-04 18:37:21 +01:00
5f38392f97 **update** github actions updated to .NET 8 2024-03-04 18:36:15 +01:00
fc6a8b2fbd
Merge pull request #5 from spaytac/feature/dotnet-8-update
Feature/dotnet 8 update
2024-03-04 18:32:58 +01:00
c78d092be5 **update** migrated to .NET 8 2024-03-04 18:29:11 +01:00
070574d32b **update** gitignore 2024-03-04 17:41:39 +01:00
11 changed files with 37 additions and 33 deletions

View File

@ -1,7 +1,7 @@
name: Deploy Images to GHCR
env:
DOTNET_VERSION: '6.0.x'
DOTNET_VERSION: '8.0.x'
on:
push:

4
.gitignore vendored
View File

@ -6,4 +6,6 @@ riderModule.iml
**/.env
.env
compose/
compose-test/
compose-test/
.vscode/
.idea/

View File

@ -4,7 +4,7 @@ LinkdingSync is a collection of tools that make life with [Linkding](https://git
One of the workers is for syncing to [Wallabag](https://wallabag.org/en).
## Getting Started
It is recommended to use the Docker images. Otherwise, a .NET 6 environment is required to customize and build the code.
It is recommended to use the Docker images. Otherwise, a .NET 8 environment is required to customize and build the code.
## Environment Variables
For the containers to work, the environment variables must be passed. This can be done either directly via the Docker run **-e** switch, via the **environment** settings in a Docker compose definition, or via an environment variable file.

View File

@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.0",
"version": "8.0.0",
"rollForward": "latestMinor",
"allowPrerelease": false
}

View File

@ -6,9 +6,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>dotnet-LinkdingService-80165DE2-FA70-4803-B366-DF8F24CF86BE</UserSecretsId>
@ -9,8 +9,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="YamlDotNet" Version="12.3.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="YamlDotNet" Version="15.1.2" />
</ItemGroup>
<ItemGroup>

View File

@ -1,4 +1,4 @@
using System.Net.Http.Headers;
using System.Reflection;
using Linkding.Client;
using Linkding.Client.Options;
using Microsoft.Extensions.Configuration;
@ -18,8 +18,9 @@ public static class ServiceRegistrationExtensions
services.AddHttpClient<LinkdingService>()
.SetHandlerLifetime(TimeSpan.FromMinutes(5)) //Set lifetime to five minutes
.AddPolicyHandler(GetRetryPolicy());
services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
services.AddAutoMapper(assemblies);
return services;
}

View File

@ -1,20 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="12.0.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.13" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -17,8 +17,10 @@ public static class ServiceRegistrationExtensions
{
var configSection = configuration.GetSection(WallabagSettings.Position);
services.Configure<WallabagSettings>(configSection);
services.AddScoped<IAccessTokenProvider, OAuthTokenProvider>();
services.AddScoped<AuthenticationClient>();
// services.AddScoped<IAccessTokenProvider, OAuthTokenProvider>();
// services.AddScoped<AuthenticationClient>();
services.AddSingleton<IAccessTokenProvider, OAuthTokenProvider>();
services.AddSingleton<AuthenticationClient>();
services.AddHttpClient<WallabagService>()
.SetHandlerLifetime(TimeSpan.FromMinutes(5)) //Set lifetime to five minutes
.AddPolicyHandler(GetRetryPolicy());

View File

@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.13" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>dotnet-WallabagWorker-D5E52F5F-C642-4BF8-9FD7-8C6C417B0D3A</UserSecretsId>
@ -9,9 +9,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="YamlDotNet" Version="12.3.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="YamlDotNet" Version="15.1.2" />
</ItemGroup>
<ItemGroup>