workspace_setting.proto 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. syntax = "proto3";
  2. package memos.store;
  3. option go_package = "gen/store";
  4. enum WorkspaceSettingKey {
  5. WORKSPACE_SETTING_KEY_UNSPECIFIED = 0;
  6. // BASIC is the key for basic settings.
  7. BASIC = 1;
  8. // GENERAL is the key for general settings.
  9. GENERAL = 2;
  10. // STORAGE is the key for storage settings.
  11. STORAGE = 3;
  12. // MEMO_RELATED is the key for memo related settings.
  13. MEMO_RELATED = 4;
  14. }
  15. message WorkspaceSetting {
  16. WorkspaceSettingKey key = 1;
  17. oneof value {
  18. WorkspaceBasicSetting basic_setting = 2;
  19. WorkspaceGeneralSetting general_setting = 3;
  20. WorkspaceStorageSetting storage_setting = 4;
  21. WorkspaceMemoRelatedSetting memo_related_setting = 5;
  22. }
  23. }
  24. message WorkspaceBasicSetting {
  25. string secret_key = 1;
  26. }
  27. message WorkspaceGeneralSetting {
  28. // disallow_signup is the flag to disallow signup.
  29. bool disallow_signup = 1;
  30. // disallow_password_login is the flag to disallow password login.
  31. bool disallow_password_login = 2;
  32. // additional_script is the additional script.
  33. string additional_script = 3;
  34. // additional_style is the additional style.
  35. string additional_style = 4;
  36. // custom_profile is the custom profile.
  37. WorkspaceCustomProfile custom_profile = 5;
  38. }
  39. message WorkspaceCustomProfile {
  40. string title = 1;
  41. string description = 2;
  42. string logo_url = 3;
  43. string locale = 4;
  44. string appearance = 5;
  45. }
  46. message WorkspaceStorageSetting {
  47. enum StorageType {
  48. STORAGE_TYPE_UNSPECIFIED = 0;
  49. // STORAGE_TYPE_DATABASE is the database storage type.
  50. DATABASE = 1;
  51. // STORAGE_TYPE_LOCAL is the local storage type.
  52. LOCAL = 2;
  53. // STORAGE_TYPE_S3 is the S3 storage type.
  54. S3 = 3;
  55. }
  56. // storage_type is the storage type.
  57. StorageType storage_type = 1;
  58. // The template of file path.
  59. // e.g. assets/{timestamp}_{filename}
  60. string filepath_template = 2;
  61. // The max upload size in megabytes.
  62. int64 upload_size_limit_mb = 3;
  63. // The S3 config.
  64. StorageS3Config s3_config = 4;
  65. }
  66. // Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/
  67. message StorageS3Config {
  68. string access_key_id = 1;
  69. string access_key_secret = 2;
  70. string endpoint = 3;
  71. string region = 4;
  72. string bucket = 5;
  73. }
  74. message WorkspaceMemoRelatedSetting {
  75. // disallow_public_share disallows set memo as public visible.
  76. bool disallow_public_visible = 1;
  77. // display_with_update_time orders and displays memo with update time.
  78. bool display_with_update_time = 2;
  79. // content_length_limit is the limit of content length. Unit is byte.
  80. int32 content_length_limit = 3;
  81. // enable_auto_compact enables auto compact for large content.
  82. bool enable_auto_compact = 4;
  83. // enable_double_click_edit enables editing on double click.
  84. bool enable_double_click_edit = 5;
  85. }