workspace_setting.proto 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. // The secret key for workspace. Mainly used for session management.
  26. string secret_key = 1;
  27. // The current schema version of database.
  28. string schema_version = 2;
  29. }
  30. message WorkspaceGeneralSetting {
  31. // disallow_user_registration disallows user registration.
  32. bool disallow_user_registration = 1;
  33. // disallow_password_auth disallows password authentication.
  34. bool disallow_password_auth = 2;
  35. // additional_script is the additional script.
  36. string additional_script = 3;
  37. // additional_style is the additional style.
  38. string additional_style = 4;
  39. // custom_profile is the custom profile.
  40. WorkspaceCustomProfile custom_profile = 5;
  41. // week_start_day_offset is the week start day offset from Sunday.
  42. // 0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday
  43. // Default is Sunday.
  44. int32 week_start_day_offset = 6;
  45. // disallow_change_username disallows changing username.
  46. bool disallow_change_username = 7;
  47. // disallow_change_nickname disallows changing nickname.
  48. bool disallow_change_nickname = 8;
  49. }
  50. message WorkspaceCustomProfile {
  51. string title = 1;
  52. string description = 2;
  53. string logo_url = 3;
  54. string locale = 4;
  55. string appearance = 5;
  56. }
  57. message WorkspaceStorageSetting {
  58. enum StorageType {
  59. STORAGE_TYPE_UNSPECIFIED = 0;
  60. // STORAGE_TYPE_DATABASE is the database storage type.
  61. DATABASE = 1;
  62. // STORAGE_TYPE_LOCAL is the local storage type.
  63. LOCAL = 2;
  64. // STORAGE_TYPE_S3 is the S3 storage type.
  65. S3 = 3;
  66. }
  67. // storage_type is the storage type.
  68. StorageType storage_type = 1;
  69. // The template of file path.
  70. // e.g. assets/{timestamp}_{filename}
  71. string filepath_template = 2;
  72. // The max upload size in megabytes.
  73. int64 upload_size_limit_mb = 3;
  74. // The S3 config.
  75. StorageS3Config s3_config = 4;
  76. }
  77. // Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/
  78. message StorageS3Config {
  79. string access_key_id = 1;
  80. string access_key_secret = 2;
  81. string endpoint = 3;
  82. string region = 4;
  83. string bucket = 5;
  84. }
  85. message WorkspaceMemoRelatedSetting {
  86. // disallow_public_visibility disallows set memo as public visibility.
  87. bool disallow_public_visibility = 1;
  88. // display_with_update_time orders and displays memo with update time.
  89. bool display_with_update_time = 2;
  90. // content_length_limit is the limit of content length. Unit is byte.
  91. int32 content_length_limit = 3;
  92. // enable_auto_compact enables auto compact for large content.
  93. bool enable_auto_compact = 4;
  94. // enable_double_click_edit enables editing on double click.
  95. bool enable_double_click_edit = 5;
  96. // enable_link_preview enables links preview.
  97. bool enable_link_preview = 6;
  98. // enable_comment enables comment.
  99. bool enable_comment = 7;
  100. // enable_location enables setting location for memo.
  101. bool enable_location = 8;
  102. }