mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-29 09:50:20 +00:00
UApi work, nix test vm cleanup
This commit is contained in:
@@ -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<object> _rpcInfoCache = new(10000);
|
||||
// [HttpGet]
|
||||
// public async Task<object> 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<ApplicationDisclosures.Type> Disclosures { get; set; }
|
||||
|
||||
[JsonPropertyName("acked_disclosures")]
|
||||
public List<ApplicationDisclosures.Type> 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
|
||||
}
|
||||
@@ -8,6 +8,7 @@ using Spacebar.Models.Generic;
|
||||
namespace Spacebar.UApi.Controllers;
|
||||
|
||||
[Route("/api/v{_}/guilds/{guildId}/members/")]
|
||||
[ApiController]
|
||||
public class GuildMembersController(ILogger<GuildMembersController> logger, SpacebarDbContext db, SpacebarAspNetAuthenticationService authService) : ControllerBase {
|
||||
/// <summary>
|
||||
/// Get a guild member by ID
|
||||
|
||||
@@ -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();
|
||||
|
||||
BIN
flake.lock
generated
BIN
flake.lock
generated
Binary file not shown.
@@ -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 = {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ config, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
services.postgresql = {
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user