From 19dad4bba1d60b686db54fb612fe04aaad7acd24 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 15 Jan 2023 18:30:32 -0600 Subject: inject http port into html --- src/slskd/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index af5d7420..f1f6bc03 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -815,7 +815,7 @@ namespace slskd // prepend the url base. app.UsePathBase(urlBase); app.UseHTMLRewrite("((\\.)?\\/static)", $"{(urlBase == "/" ? string.Empty : urlBase)}/static"); - app.UseHTMLInjection($"", excludedRoutes: new[] { "/api", "/swagger" }); + app.UseHTMLInjection($"", excludedRoutes: new[] { "/api", "/swagger" }); Log.Information("Using base url {UrlBase}", urlBase); // serve static content from the configured path -- cgit v1.2.3 From 10559e97fbe2edb35459586d3dea43075855d3cd Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 28 Jan 2023 16:16:28 -0600 Subject: fix version check (again) --- bin/build | 2 +- bin/publish | 4 ++-- src/slskd/Program.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/bin/build b/bin/build index 04fd0805..a5ca4f29 100755 --- a/bin/build +++ b/bin/build @@ -13,7 +13,7 @@ while test $# -gt 0; do echo '--web-only skip dotnet build' echo '--dotnet-only skip web build' echo '--skip-tests skip execution of npm and dotnet tests' - echo '--version version for the binary. defaults to current git tag-SHA' + echo '--version version for the binary. defaults to current git tag+SHA' exit 0 ;; --web-only) diff --git a/bin/publish b/bin/publish index 3461c470..512fb9f6 100755 --- a/bin/publish +++ b/bin/publish @@ -11,7 +11,7 @@ while test $# -gt 0; do echo '--no-prebuild skip build and test' echo '--runtime a valid RID (https://docs.microsoft.com/en-us/dotnet/core/rid-catalog)' echo '--platform one of: linux/amd64, linux/arm64, linux/arm/v7. overrides runtime.' - echo '--version version for the binary. defaults to current git tag-SHA' + echo '--version version for the binary. defaults to current git tag+SHA' echo '--output the output directory. defaults to ../../dist/' exit 0 ;; @@ -69,7 +69,7 @@ fi if [ -z "$version" ]; then tag=$(git describe --tags --abbrev=0) sha=$(git rev-parse --short HEAD) - version=$tag-$sha + version=$tag+$sha fi if [ -z "$runtime" ]; then diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index af5d7420..c13cfdf1 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -135,7 +135,7 @@ namespace slskd /// /// Gets the semantic application version. /// - public static string SemanticVersion { get; } = InformationalVersion.Split('-').First(); + public static string SemanticVersion { get; } = InformationalVersion.Split('+').First(); /// /// Gets the full application version, including both assembly and informational versions. @@ -246,7 +246,7 @@ namespace slskd try { - Arguments.Populate(clearExistingValues: false); + Arguments.Populate(clearExistingValues: false); } catch (Exception ex) { -- cgit v1.2.3 From 3010a89000fd08e0e5688d232c3cf70a98e6f8f2 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 28 Jan 2023 16:52:28 -0600 Subject: suppress ASP0014 --- src/slskd/Program.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index c13cfdf1..5d7c37e1 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -841,6 +841,11 @@ namespace slskd app.UseAuthentication(); app.UseRouting(); app.UseAuthorization(); + + // starting with .NET 7 the framework *really* wants you to use top level endpoint mapping + // for whatever reason this breaks everything, and i just can't bring myself to care unless + // UseEndpoints is going to be deprecated or if there's some material benefit +#pragma warning disable ASP0014 // Suggest using top level route registrations app.UseEndpoints(endpoints => { endpoints.MapHub("/hub/application"); @@ -885,6 +890,7 @@ namespace slskd }); } }); +#pragma warning restore ASP0014 // Suggest using top level route registrations // if this is an /api route and no API controller was matched, give up and return a 404. app.Use(async (context, next) => -- cgit v1.2.3