diff --git a/extra/admin-api/Spacebar.UApi/Controllers/Applications/ApplicationRpcController.cs b/extra/admin-api/Spacebar.UApi/Controllers/Applications/ApplicationRpcController.cs new file mode 100644 index 000000000..fdb020f41 --- /dev/null +++ b/extra/admin-api/Spacebar.UApi/Controllers/Applications/ApplicationRpcController.cs @@ -0,0 +1,84 @@ +using System.Text.Json.Serialization; +using ArcaneLibs.Collections; +using Microsoft.AspNetCore.Mvc; + +namespace Spacebar.UApi.Controllers.Applications; + +[ApiController] +[Route("/api/v{_}/applications/{applicationId}/")] +public class ApplicationRpcController : ControllerBase { + private static LruCache _rpcInfoCache = new(10000); + // [HttpGet] + // public async Task GetApplicationRpcInfo(string applicationId) { + // + // } + + [HttpGet("disclosures")] + public ApplicationDisclosures GetApplicationDisclosures(string applicationId) { + return new ApplicationDisclosures { + Disclosures = [], + AckedDisclosures = [], + AllAcked = true + }; + } + + [HttpPost("disclosures")] + public ApplicationDisclosures AckApplicationDisclosures(string applicationId) { + // TODO: type is wrong, normally only `disclosures` is returned + return new ApplicationDisclosures { + Disclosures = [], + AckedDisclosures = [], + AllAcked = true + }; + } +} + +public class ApplicationDisclosures { + [JsonPropertyName("disclosures")] + public List Disclosures { get; set; } + + [JsonPropertyName("acked_disclosures")] + public List AckedDisclosures { get; set; } + + [JsonPropertyName("all_acked")] + public bool AllAcked { get; set; } + + public enum Type { + UnspecifiedDisclosure = 0, + IpLocation = 1, + DisplaysAdvertisements = 2, + PartnerSdkDataSharingMessage = 3 + } +} + +public class RpcApplicationInfo { + [JsonPropertyName("id")] + public string Id { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } + + [JsonPropertyName("icon")] + public string Icon { get; set; } + + [JsonPropertyName("description")] + public string Description { get; set; } + + [JsonPropertyName("summary")] + public string Summary { get; set; } + + [JsonPropertyName("type")] + public ApplicationType? Type { get; set; } // what is this? + + [JsonPropertyName("verify_key")] + public string VerifyKey { get; set; } +} + +[Flags] +public enum ApplicationType { + DeprecatedGame, + Music, + TicketedEvents, + CreatorMonetization, + Game +} \ No newline at end of file diff --git a/extra/admin-api/Spacebar.UApi/Controllers/GuildMembersController.cs b/extra/admin-api/Spacebar.UApi/Controllers/GuildMembersController.cs index ac8c1d40c..9f18624ee 100644 --- a/extra/admin-api/Spacebar.UApi/Controllers/GuildMembersController.cs +++ b/extra/admin-api/Spacebar.UApi/Controllers/GuildMembersController.cs @@ -8,6 +8,7 @@ using Spacebar.Models.Generic; namespace Spacebar.UApi.Controllers; [Route("/api/v{_}/guilds/{guildId}/members/")] +[ApiController] public class GuildMembersController(ILogger logger, SpacebarDbContext db, SpacebarAspNetAuthenticationService authService) : ControllerBase { /// /// Get a guild member by ID diff --git a/extra/admin-api/Spacebar.UApi/Program.cs b/extra/admin-api/Spacebar.UApi/Program.cs index 326d0a9c8..f6ce98299 100644 --- a/extra/admin-api/Spacebar.UApi/Program.cs +++ b/extra/admin-api/Spacebar.UApi/Program.cs @@ -112,6 +112,7 @@ app.Map("/", async context => { foreach (var header in responseMessage.Headers) context.Response.Headers[header.Key] = header.Value.ToArray(); foreach (var header in responseMessage.Content.Headers) context.Response.Headers[header.Key] = header.Value.ToArray(); + context.Response.Headers["X-SB-UApi-Status"] = "MISSING"; // await responseMessage.Content.CopyToAsync(context.Response.Body); var txt = await responseMessage.Content.ReadAsStringAsync(); diff --git a/flake.lock b/flake.lock index abb78335e..7e174fe28 100644 Binary files a/flake.lock and b/flake.lock differ diff --git a/flake.nix b/flake.nix index 59bae2440..d5a4aa42b 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,11 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/master"; # temp hack because unstable is frozen flake-utils.url = "github:numtide/flake-utils"; + pion-webrtc = { + url = "github:spacebarchat/pion-webrtc"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; }; outputs = @@ -11,6 +16,7 @@ self, nixpkgs, flake-utils, + pion-webrtc }: nixpkgs.lib.recursiveUpdate ( @@ -35,6 +41,7 @@ packages = { default = (pkgs.callPackage (import ./default.nix { inherit self rVersion; })) { }; nodeModules = (pkgs.callPackage ./node-modules.nix) { }; + pion-sfu = pion-webrtc.packages.${system}.default; }; containers = { diff --git a/nix/testVm/perlless.nix b/nix/testVm/perlless.nix index 6d391569f..669be83c5 100644 --- a/nix/testVm/perlless.nix +++ b/nix/testVm/perlless.nix @@ -1,7 +1,7 @@ -{ pkgs, lib, ... }: +{ lib, ... }: { #perlless profile -# system.switch.enable = lib.mkForce false; + #system.switch.enable = lib.mkForce false; # Remove perl from activation #system.etc.overlay.enable = lib.mkForce true; diff --git a/nix/testVm/postgres.nix b/nix/testVm/postgres.nix index 015f6d96b..0190c2756 100644 --- a/nix/testVm/postgres.nix +++ b/nix/testVm/postgres.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ pkgs, ... }: { services.postgresql = { diff --git a/nix/testVm/vm.nix b/nix/testVm/vm.nix index 8a2821354..1c9d7add3 100644 --- a/nix/testVm/vm.nix +++ b/nix/testVm/vm.nix @@ -1,6 +1,4 @@ { - nixpkgs, - modulesPath, pkgs, lib, ... @@ -55,14 +53,4 @@ font = "${pkgs.cozette}/share/consolefonts/cozette6x13.psfu"; packages = with pkgs; [ cozette ]; }; - - system = { - #activatable = false; - copySystemConfiguration = false; - includeBuildDependencies = false; - disableInstallerTools = lib.mkForce true; - build = { - separateActivationScript = true; - }; - }; }