server.proto 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. syntax = "proto3";
  2. package chatto.admin.v1;
  3. import "buf/validate/validate.proto";
  4. import "chatto/api/v1/common.proto";
  5. import "chatto/api/v1/server.proto";
  6. // Runtime-editable server profile settings.
  7. message ServerConfig {
  8. // Server name for page titles. Empty means the default is used.
  9. string server_name = 1;
  10. // Short server description for OG link-preview metadata.
  11. string description = 2;
  12. // Message of the day for the authenticated header.
  13. string motd = 3;
  14. // Welcome message shown on the login page.
  15. string welcome_message = 4;
  16. }
  17. // Request server profile settings.
  18. message GetServerConfigRequest {}
  19. // Server profile settings plus effective public branding.
  20. message GetServerConfigResponse {
  21. reserved 2;
  22. reserved "profile";
  23. // Runtime-editable server profile settings.
  24. ServerConfig config = 1;
  25. // Effective public server profile and branding.
  26. chatto.api.v1.ServerPublicProfile public_profile = 3;
  27. }
  28. // Request to update runtime-editable server profile settings.
  29. message UpdateServerConfigRequest {
  30. // Optional server name for page titles. Set to empty string to use default.
  31. optional string server_name = 1 [(buf.validate.field).string.max_len = 80];
  32. // Optional short server description for OG link-preview metadata. Set to
  33. // empty string to clear.
  34. optional string description = 2 [(buf.validate.field).string.max_len = 500];
  35. // Optional message of the day for the header. Set to empty string to clear.
  36. optional string motd = 3 [(buf.validate.field).string.max_len = 1000];
  37. // Optional welcome message shown on the login page. Set to empty string to
  38. // clear.
  39. optional string welcome_message = 4 [(buf.validate.field).string.max_len = 10000];
  40. }
  41. // Result of updating runtime-editable server profile settings.
  42. message UpdateServerConfigResponse {
  43. reserved 1;
  44. reserved "profile";
  45. // Updated public server profile and branding.
  46. chatto.api.v1.ServerPublicProfile public_profile = 3;
  47. // Updated runtime-editable server profile settings.
  48. ServerConfig config = 2;
  49. }
  50. // Request to upload and set the public server logo.
  51. message UploadServerLogoRequest {
  52. reserved 1 to 3;
  53. reserved "filename", "content_type";
  54. // Image payload. The server validates, resizes, and stores a WebP logo.
  55. chatto.api.v1.ImageUpload image = 4;
  56. }
  57. // Result of uploading the public server logo.
  58. message UploadServerLogoResponse {
  59. reserved 1;
  60. reserved "profile";
  61. // Updated public server profile and branding.
  62. chatto.api.v1.ServerPublicProfile public_profile = 2;
  63. }
  64. // Request to clear the public server logo.
  65. message DeleteServerLogoRequest {}
  66. // Result of clearing the public server logo.
  67. message DeleteServerLogoResponse {
  68. reserved 1;
  69. reserved "profile";
  70. // Updated public server profile and branding.
  71. chatto.api.v1.ServerPublicProfile public_profile = 2;
  72. }
  73. // Request to upload and set the public server banner.
  74. message UploadServerBannerRequest {
  75. reserved 1 to 3;
  76. reserved "filename", "content_type";
  77. // Image payload. The server validates, resizes, and stores a WebP banner.
  78. chatto.api.v1.ImageUpload image = 4;
  79. }
  80. // Result of uploading the public server banner.
  81. message UploadServerBannerResponse {
  82. reserved 1;
  83. reserved "profile";
  84. // Updated public server profile and branding.
  85. chatto.api.v1.ServerPublicProfile public_profile = 2;
  86. }
  87. // Request to clear the public server banner.
  88. message DeleteServerBannerRequest {}
  89. // Result of clearing the public server banner.
  90. message DeleteServerBannerResponse {
  91. reserved 1;
  92. reserved "profile";
  93. // Updated public server profile and branding.
  94. chatto.api.v1.ServerPublicProfile public_profile = 2;
  95. }
  96. // Request for server security configuration.
  97. message GetServerSecurityConfigRequest {}
  98. // Security-sensitive server configuration. The caller must be allowed to
  99. // manage server configuration.
  100. message GetServerSecurityConfigResponse {
  101. // Blocked usernames. Entries are normalized by the server.
  102. repeated string blocked_usernames = 1;
  103. }
  104. // Request to update the server blocked-username list.
  105. message UpdateBlockedUsernamesRequest {
  106. // Blocked usernames. Empty entries are ignored and entries are normalized by
  107. // the server.
  108. repeated string blocked_usernames = 1 [(buf.validate.field).repeated = {max_items: 1000}];
  109. }
  110. // Result of updating the server blocked-username list.
  111. message UpdateBlockedUsernamesResponse {
  112. // Effective blocked usernames after the update.
  113. repeated string blocked_usernames = 1;
  114. }
  115. // Provides server-administration commands for profile, branding, and security
  116. // settings.
  117. service AdminServerService {
  118. // Gets runtime-editable server profile settings. This RPC requires
  119. // server.manage.
  120. rpc GetServerConfig(GetServerConfigRequest) returns (GetServerConfigResponse);
  121. // Updates runtime-editable server profile settings. This RPC requires
  122. // server.manage.
  123. rpc UpdateServerConfig(UpdateServerConfigRequest) returns (UpdateServerConfigResponse);
  124. // Uploads and sets the public server logo. This RPC requires server.manage.
  125. rpc UploadServerLogo(UploadServerLogoRequest) returns (UploadServerLogoResponse);
  126. // Clears the public server logo. This RPC requires server.manage.
  127. rpc DeleteServerLogo(DeleteServerLogoRequest) returns (DeleteServerLogoResponse);
  128. // Uploads and sets the public server banner. This RPC requires server.manage.
  129. rpc UploadServerBanner(UploadServerBannerRequest) returns (UploadServerBannerResponse);
  130. // Clears the public server banner. This RPC requires server.manage.
  131. rpc DeleteServerBanner(DeleteServerBannerRequest) returns (DeleteServerBannerResponse);
  132. // Returns security-sensitive server configuration. This RPC requires
  133. // server.manage.
  134. rpc GetServerSecurityConfig(GetServerSecurityConfigRequest) returns (GetServerSecurityConfigResponse);
  135. // Updates the blocked-username list. This RPC requires server.manage.
  136. rpc UpdateBlockedUsernames(UpdateBlockedUsernamesRequest) returns (UpdateBlockedUsernamesResponse);
  137. }