-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Expand file tree
/
Copy pathinstance_setting.proto
More file actions
169 lines (151 loc) · 4.99 KB
/
Copy pathinstance_setting.proto
File metadata and controls
169 lines (151 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
syntax = "proto3";
package memos.store;
import "google/type/color.proto";
option go_package = "gen/store";
enum InstanceSettingKey {
INSTANCE_SETTING_KEY_UNSPECIFIED = 0;
// BASIC is the key for basic settings.
BASIC = 1;
// GENERAL is the key for general settings.
GENERAL = 2;
// STORAGE is the key for storage settings.
STORAGE = 3;
// MEMO_RELATED is the key for memo related settings.
MEMO_RELATED = 4;
// TAGS is the key for tag metadata.
TAGS = 5;
// NOTIFICATION is the key for notification transport settings.
NOTIFICATION = 6;
// AI is the key for AI provider settings.
AI = 7;
}
message InstanceSetting {
InstanceSettingKey key = 1;
oneof value {
InstanceBasicSetting basic_setting = 2;
InstanceGeneralSetting general_setting = 3;
InstanceStorageSetting storage_setting = 4;
InstanceMemoRelatedSetting memo_related_setting = 5;
InstanceTagsSetting tags_setting = 6;
InstanceNotificationSetting notification_setting = 7;
InstanceAISetting ai_setting = 8;
}
}
message InstanceBasicSetting {
// The secret key for instance. Mainly used for session management.
string secret_key = 1;
// The current schema version of database.
string schema_version = 2;
}
message InstanceGeneralSetting {
// disallow_user_registration disallows user registration.
bool disallow_user_registration = 2;
// disallow_password_auth disallows password authentication.
bool disallow_password_auth = 3;
// additional_script is the additional script.
string additional_script = 4;
// additional_style is the additional style.
string additional_style = 5;
// custom_profile is the custom profile.
InstanceCustomProfile custom_profile = 6;
// week_start_day_offset is the week start day offset from Sunday.
// 0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday
// Default is Sunday.
int32 week_start_day_offset = 7;
// disallow_change_username disallows changing username.
bool disallow_change_username = 8;
// disallow_change_nickname disallows changing nickname.
bool disallow_change_nickname = 9;
}
message InstanceCustomProfile {
string title = 1;
string description = 2;
string logo_url = 3;
}
message InstanceStorageSetting {
enum StorageType {
STORAGE_TYPE_UNSPECIFIED = 0;
// STORAGE_TYPE_DATABASE is the database storage type.
DATABASE = 1;
// STORAGE_TYPE_LOCAL is the local storage type.
LOCAL = 2;
// STORAGE_TYPE_S3 is the S3 storage type.
S3 = 3;
}
// storage_type is the storage type.
StorageType storage_type = 1;
// The template of file path.
// e.g. assets/{timestamp}_{filename}
string filepath_template = 2;
// The max upload size in megabytes.
int64 upload_size_limit_mb = 3;
// The S3 config.
StorageS3Config s3_config = 4;
}
// Reference: https://developers.cloudflare.com/r2/examples/aws/aws-sdk-go/
message StorageS3Config {
string access_key_id = 1;
string access_key_secret = 2;
string endpoint = 3;
string region = 4;
string bucket = 5;
bool use_path_style = 6;
}
message InstanceMemoRelatedSetting {
// display_with_update_time orders and displays memo with update time.
bool display_with_update_time = 2;
// content_length_limit is the limit of content length. Unit is byte.
int32 content_length_limit = 3;
// enable_double_click_edit enables editing on double click.
bool enable_double_click_edit = 4;
// enable_single_click_memo_expand enables toggling compact memo content with a single click.
bool enable_single_click_memo_expand = 5;
// reactions is the list of reactions.
repeated string reactions = 7;
}
message InstanceTagMetadata {
// Optional background color for the tag label.
// When unset, the default tag color is used.
google.type.Color background_color = 1;
// Whether memos with this tag should have their content blurred.
bool blur_content = 2;
}
message InstanceTagsSetting {
// Map of tag name pattern to tag metadata.
// Each key is treated as an anchored regular expression (^pattern$),
// so a single entry like "project/.*" matches all tags under that prefix.
// Exact tag names are also valid (they are trivially valid regex patterns).
map<string, InstanceTagMetadata> tags = 1;
}
message InstanceNotificationSetting {
EmailSetting email = 1;
message EmailSetting {
bool enabled = 1;
string smtp_host = 2;
int32 smtp_port = 3;
string smtp_username = 4;
string smtp_password = 5;
string from_email = 6;
string from_name = 7;
string reply_to = 8;
bool use_tls = 9;
bool use_ssl = 10;
}
}
message InstanceAISetting {
// providers is the list of AI provider configurations available instance-wide.
repeated AIProviderConfig providers = 1;
}
message AIProviderConfig {
string id = 1;
string title = 2;
AIProviderType type = 3;
string endpoint = 4;
// api_key is write-only at the API layer and is required by the server to call providers.
string api_key = 5;
}
enum AIProviderType {
AI_PROVIDER_TYPE_UNSPECIFIED = 0;
OPENAI = 1;
GEMINI = 2;
}