-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathconst.go
More file actions
202 lines (174 loc) · 6.67 KB
/
const.go
File metadata and controls
202 lines (174 loc) · 6.67 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
package conf
const (
TypeString = "string"
TypeSelect = "select"
TypeBool = "bool"
TypeText = "text"
TypeNumber = "number"
)
const (
// site
VERSION = "version"
SiteTitle = "site_title"
Announcement = "announcement"
AllowIndexed = "allow_indexed"
AllowMounted = "allow_mounted"
RobotsTxt = "robots_txt"
Logo = "logo" // multi-lines text, L1: light, EOL: dark
Favicon = "favicon"
MainColor = "main_color"
HideStorageDetails = "hide_storage_details"
HideStorageDetailsInManagePage = "hide_storage_details_in_manage_page"
// preview
TextTypes = "text_types"
AudioTypes = "audio_types"
VideoTypes = "video_types"
ImageTypes = "image_types"
ProxyTypes = "proxy_types"
ProxyIgnoreHeaders = "proxy_ignore_headers"
AudioAutoplay = "audio_autoplay"
VideoAutoplay = "video_autoplay"
PreviewDownloadByDefault = "preview_download_by_default"
PreviewArchivesByDefault = "preview_archives_by_default"
SharePreviewDownloadByDefault = "share_preview_download_by_default"
SharePreviewArchivesByDefault = "share_preview_archives_by_default"
ReadMeAutoRender = "readme_autorender"
FilterReadMeScripts = "filter_readme_scripts"
NonEFSZipEncoding = "non_efs_zip_encoding"
// global
HideFiles = "hide_files"
CustomizeHead = "customize_head"
CustomizeBody = "customize_body"
LinkExpiration = "link_expiration"
SignAll = "sign_all"
PrivacyRegs = "privacy_regs"
OcrApi = "ocr_api"
FilenameCharMapping = "filename_char_mapping"
ForwardDirectLinkParams = "forward_direct_link_params"
IgnoreDirectLinkParams = "ignore_direct_link_params"
WebauthnLoginEnabled = "webauthn_login_enabled"
SharePreview = "share_preview"
ShareArchivePreview = "share_archive_preview"
ShareForceProxy = "share_force_proxy"
ShareSummaryContent = "share_summary_content"
HandleHookAfterWriting = "handle_hook_after_writing"
HandleHookRateLimit = "handle_hook_rate_limit"
IgnoreSystemFiles = "ignore_system_files"
// index
SearchIndex = "search_index"
AutoUpdateIndex = "auto_update_index"
IgnorePaths = "ignore_paths"
MaxIndexDepth = "max_index_depth"
// aria2
Aria2Uri = "aria2_uri"
Aria2Secret = "aria2_secret"
// transmission
TransmissionUri = "transmission_uri"
TransmissionSeedtime = "transmission_seedtime"
// 115
Pan115TempDir = "115_temp_dir"
// 115_open
Pan115OpenTempDir = "115_open_temp_dir"
// pikpak
PikPakTempDir = "pikpak_temp_dir"
// thunder
ThunderTempDir = "thunder_temp_dir"
// thunderx
ThunderXTempDir = "thunderx_temp_dir"
// thunder_browser
ThunderBrowserTempDir = "thunder_browser_temp_dir"
// single
Token = "token"
IndexProgress = "index_progress"
// SSO
SSOClientId = "sso_client_id"
SSOClientSecret = "sso_client_secret"
SSOLoginEnabled = "sso_login_enabled"
SSOLoginPlatform = "sso_login_platform"
SSOOIDCUsernameKey = "sso_oidc_username_key"
SSOOrganizationName = "sso_organization_name"
SSOApplicationName = "sso_application_name"
SSOEndpointName = "sso_endpoint_name"
SSOJwtPublicKey = "sso_jwt_public_key"
SSOExtraScopes = "sso_extra_scopes"
SSOAutoRegister = "sso_auto_register"
SSODefaultDir = "sso_default_dir"
SSODefaultPermission = "sso_default_permission"
SSOCompatibilityMode = "sso_compatibility_mode"
// ldap
LdapLoginEnabled = "ldap_login_enabled"
LdapServer = "ldap_server"
LdapSkipTlsVerify = "ldap_skip_tls_verify"
LdapManagerDN = "ldap_manager_dn"
LdapManagerPassword = "ldap_manager_password"
LdapUserSearchBase = "ldap_user_search_base"
LdapUserSearchFilter = "ldap_user_search_filter"
LdapDefaultPermission = "ldap_default_permission"
LdapDefaultDir = "ldap_default_dir"
LdapLoginTips = "ldap_login_tips"
// s3
S3Buckets = "s3_buckets"
S3AccessKeyId = "s3_access_key_id"
S3SecretAccessKey = "s3_secret_access_key"
// qbittorrent
QbittorrentUrl = "qbittorrent_url"
QbittorrentSeedtime = "qbittorrent_seedtime"
// 123 open offline download
Pan123OpenOfflineDownloadCallbackUrl = "123_open_callback_url"
Pan123OpenTempDir = "123_open_temp_dir"
Pan123TempDir = "123_temp_dir"
// ftp
FTPPublicHost = "ftp_public_host"
FTPPasvPortMap = "ftp_pasv_port_map"
FTPMandatoryTLS = "ftp_mandatory_tls"
FTPImplicitTLS = "ftp_implicit_tls"
FTPTLSPrivateKeyPath = "ftp_tls_private_key_path"
FTPTLSPublicCertPath = "ftp_tls_public_cert_path"
SFTPDisablePasswordLogin = "sftp_disable_password_login"
// traffic
TaskOfflineDownloadThreadsNum = "offline_download_task_threads_num"
TaskOfflineDownloadTransferThreadsNum = "offline_download_transfer_task_threads_num"
TaskUploadThreadsNum = "upload_task_threads_num"
TaskCopyThreadsNum = "copy_task_threads_num"
TaskMoveThreadsNum = "move_task_threads_num"
TaskDecompressDownloadThreadsNum = "decompress_download_task_threads_num"
TaskDecompressUploadThreadsNum = "decompress_upload_task_threads_num"
StreamMaxClientDownloadSpeed = "max_client_download_speed"
StreamMaxClientUploadSpeed = "max_client_upload_speed"
StreamMaxServerDownloadSpeed = "max_server_download_speed"
StreamMaxServerUploadSpeed = "max_server_upload_speed"
// HTTP Server Timeouts (传输超时配置)
HTTPServerReadTimeout = "http_server_read_timeout" // 读取请求超时(秒),0表示无限制
HTTPServerWriteTimeout = "http_server_write_timeout" // 写入响应超时(秒),0表示无限制
HTTPServerIdleTimeout = "http_server_idle_timeout" // 空闲连接超时(秒)
HTTPServerReadHeaderTimeout = "http_server_read_header_timeout" // 读取Header超时(秒)
HTTPServerMaxHeaderBytes = "http_server_max_header_bytes" // Header最大字节数
// Chunked Upload (分片上传配置)
ChunkedUploadChunkSize = "chunked_upload_chunk_size" // 分片大小(MB),超过此大小的文件将自动分片上传
)
const (
UNKNOWN = iota
FOLDER
// OFFICE
VIDEO
AUDIO
TEXT
IMAGE
)
// ContextKey is the type of context keys.
type ContextKey int8
const (
_ ContextKey = iota
NoTaskKey
ApiUrlKey
UserKey
MetaKey
MetaPassKey
ClientIPKey
ProxyHeaderKey
RequestHeaderKey
UserAgentKey
PathKey
SharingIDKey
SkipHookKey
)