This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.MapGet("/ai-config", (TelemetryConfiguration telemetryConfiguration) => | |
| { | |
| var sb = new System.Text.StringBuilder(); | |
| sb.AppendLine("===== TelemetryConfiguration ====="); | |
| sb.AppendLine($"Connection String: {telemetryConfiguration.ConnectionString}"); | |
| sb.AppendLine($"Instrumentation Key: {telemetryConfiguration.InstrumentationKey}"); | |
| sb.AppendLine($"EnableAdaptiveSampling: {telemetryConfiguration.DefaultTelemetrySink.TelemetryProcessorChainBuilder.IsBuilt}"); | |
| sb.AppendLine("\n--- TelemetryInitializers ---"); | |
| foreach (var initializer in telemetryConfiguration.TelemetryInitializers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| peer.on("signal", (data) => { | |
| console.log("🔹 Peer generated signal data:", data); | |
| if (isInitiator) { | |
| console.log("🔹 [Initiator] Generating OFFER:", JSON.stringify(data)); | |
| hubConnection.invoke("SendOffer", streamId, JSON.stringify(data)) | |
| .then(() => console.log("✅ [Initiator] Offer sent successfully.")) | |
| .catch((err) => console.error("❌ [Initiator] Error sending Offer:", err)); | |
| } else { | |
| console.log("🔹 [Receiver] Generating ANSWER:", JSON.stringify(data)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public async Task<IActionResult> Syslog(string param = "-r -u eevatest.service --since \"2 days ago\"") | |
| { | |
| var p = new Process | |
| { | |
| StartInfo = { | |
| FileName = "/usr/bin/journalctl", | |
| Arguments = param, | |
| RedirectStandardOutput = true, | |
| RedirectStandardError = true, | |
| UseShellExecute = false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { "arguments": ["just a test"], "target": "HubMethod", "type": 1 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected override async Task ExecuteAsync(CancellationToken stoppingToken) | |
| { | |
| Console.WriteLine("Poller task started."); | |
| try | |
| { | |
| await InitializePrices(); | |
| } | |
| catch (Exception ex) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:9.0 AS base | |
| WORKDIR /app | |
| FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS publish | |
| WORKDIR /src | |
| COPY . . | |
| ARG TARGETARCH | |
| ARG VERSION | |
| RUN dotnet publish MyProject.csproj -c Release --self-contained true \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| options.Events = new OpenIdConnectEvents | |
| { | |
| OnAuthenticationFailed = context => | |
| { | |
| Console.WriteLine(context.Exception); | |
| return Task.CompletedTask; | |
| }, | |
| OnTokenResponseReceived = context => | |
| { | |
| Console.WriteLine(context.TokenEndpointResponse?.Content); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, | |
| AppRolesAuthorizeAttribute requirement) | |
| { | |
| string rolesString = requirement.Roles; | |
| string[] roles = rolesString.Split(","); | |
| foreach (string entry in roles) | |
| { | |
| string role = entry.Trim(); | |
| if (!context.User.IsInRole(role)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MefServiceProvider : IServiceProvider | |
| { | |
| private readonly IDependencyResolver m_resolver; | |
| private readonly ServiceProvider m_defaultServiceProvider; | |
| public MefServiceProvider(IDependencyResolver resolver, ServiceProvider defaultServiceProvider) | |
| { | |
| m_resolver = resolver ?? throw new ArgumentNullException(nameof(resolver)); | |
| m_defaultServiceProvider = defaultServiceProvider ?? throw new ArgumentNullException(nameof(defaultServiceProvider)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.AspNetCore.Routing; | |
| public class FolderRouteConstraint : IRouteConstraint | |
| { | |
| private readonly string[] _folders; | |
| public FolderRouteConstraint(params string[] folders) | |
| { | |
| _folders = folders; | |
| } |