1#[cfg(feature = "12-62-0")]
2use crate::model::clip::Clip;
3use crate::model::{emoji::Emoji, id::Id, user::User};
4
5use serde::{Deserialize, Serialize};
6use url::Url;
7
8#[derive(Deserialize, Serialize, Debug, Clone)]
9#[serde(rename_all = "camelCase")]
10pub struct Meta {
11 #[serde(default)]
12 pub features: Option<FeaturesMeta>,
13 #[serde(default, flatten)]
14 pub admin: Option<AdminMeta>,
15 pub maintainer_name: Option<String>,
16 pub maintainer_email: Option<String>,
17 pub version: String,
18 pub name: Option<String>,
19 pub uri: String,
20 pub description: Option<String>,
21 pub langs: Vec<String>,
22 pub tos_url: Option<String>,
23 pub repository_url: Url,
24 pub feedback_url: Option<String>,
25 pub secure: bool,
26 pub disable_registration: bool,
27 pub disable_local_timeline: bool,
28 pub disable_global_timeline: bool,
29 pub drive_capacity_per_local_user_mb: u64,
30 pub drive_capacity_per_remote_user_mb: u64,
31 #[cfg(feature = "12-58-0")]
33 pub cache_remote_files: Option<bool>,
34 #[cfg(not(feature = "12-58-0"))]
35 pub cache_remote_files: bool,
36 #[cfg(feature = "12-58-0")]
38 pub proxy_remote_files: Option<bool>,
39 #[cfg(not(feature = "12-58-0"))]
40 pub proxy_remote_files: bool,
41 #[cfg(feature = "12-37-0")]
42 #[cfg_attr(docsrs, doc(cfg(feature = "12-37-0")))]
43 pub enable_hcaptcha: bool,
44 #[cfg(feature = "12-37-0")]
45 #[cfg_attr(docsrs, doc(cfg(feature = "12-37-0")))]
46 pub hcaptcha_site_key: Option<String>,
47 pub enable_recaptcha: bool,
48 pub recaptcha_site_key: Option<String>,
49 #[serde(rename = "swPublickey")]
50 pub sw_public_key: Option<String>,
51 pub mascot_image_url: Option<String>,
52 pub bannar_url: Option<String>,
53 pub error_image_url: Option<String>,
54 pub icon_url: Option<String>,
55 pub max_note_text_length: u64,
56 pub emojis: Vec<Emoji>,
57 #[cfg(feature = "12-58-0")]
59 pub require_setup: Option<bool>,
60 #[cfg(not(feature = "12-58-0"))]
61 pub require_setup: bool,
62 pub enable_email: bool,
63 pub enable_twitter_integration: bool,
64 pub enable_github_integration: bool,
65 pub enable_discord_integration: bool,
66 pub enable_service_worker: bool,
67 #[cfg(feature = "12-58-0")]
69 #[cfg_attr(docsrs, doc(cfg(feature = "12-48-0")))]
70 #[serde(default)]
71 pub proxy_account_name: Option<Option<String>>,
72 #[cfg(all(feature = "12-48-0", not(feature = "12-58-0")))]
73 pub proxy_account_name: Option<String>,
74 #[cfg(all(
75 feature = "12-58-0",
76 any(not(feature = "12-62-0"), feature = "12-62-2")
77 ))]
78 #[cfg_attr(
79 docsrs,
80 doc(cfg(all(
81 feature = "12-58-0",
82 any(not(feature = "12-62-0"), feature = "12-62-2")
83 )))
84 )]
85 pub pinned_pages: Option<Vec<String>>,
86 #[cfg(feature = "12-62-0")]
87 #[cfg_attr(docsrs, doc(cfg(feature = "12-62-0")))]
88 pub pinned_clip_id: Option<Id<Clip>>,
89}
90
91#[derive(Deserialize, Serialize, Debug, Clone)]
92#[serde(rename_all = "camelCase")]
93pub struct AdminMeta {
94 pub use_star_for_reaction_fallback: bool,
95 pub pinned_users: Vec<String>,
96 pub hidden_tags: Vec<String>,
97 pub blocked_hosts: Vec<String>,
98 #[cfg(feature = "12-37-0")]
99 #[cfg_attr(docsrs, doc(cfg(feature = "12-37-0")))]
100 pub hcaptcha_secret_key: Option<String>,
101 pub recaptcha_secret_key: Option<String>,
102 pub proxy_account_id: Option<Id<User>>,
103 pub twitter_consumer_key: Option<String>,
104 pub twitter_consumer_secret: Option<String>,
105 pub github_client_id: Option<String>,
106 pub github_client_secret: Option<String>,
107 pub discord_client_id: Option<String>,
108 pub discord_client_secret: Option<String>,
109 pub summaly_proxy: Option<Url>,
110 pub email: Option<String>,
111 pub smtp_secure: bool,
112 pub smtp_host: Option<String>,
113 pub smtp_port: Option<u16>,
114 pub smtp_user: Option<String>,
115 pub smtp_pass: Option<String>,
116 pub sw_private_key: Option<String>,
117 pub use_object_storage: bool,
118 pub object_storage_base_url: Option<Url>,
119 pub object_storage_bucket: Option<String>,
120 pub object_storage_prefix: Option<String>,
121 pub object_storage_endpoint: Option<String>,
122 pub object_storage_region: Option<String>,
123 pub object_storage_port: Option<u16>,
124 pub object_storage_access_key: Option<String>,
125 pub object_storage_secret_key: Option<String>,
126 #[serde(rename = "objectStorageUseSSL")]
127 pub object_storage_use_ssl: bool,
128 #[cfg(feature = "12-31-0")]
129 #[cfg_attr(docsrs, doc(cfg(feature = "12-31-0")))]
130 pub object_storage_use_proxy: bool,
131 #[cfg(feature = "12-47-0")]
132 #[cfg_attr(docsrs, doc(cfg(feature = "12-47-0")))]
133 pub object_storage_set_public_read: bool,
134}
135
136#[derive(Deserialize, Serialize, Debug, Clone)]
137#[serde(rename_all = "camelCase")]
138pub struct FeaturesMeta {
139 pub registration: bool,
140 pub local_time_line: bool,
141 pub global_time_line: bool,
142 pub elasticsearch: bool,
143 #[cfg(feature = "12-37-0")]
144 #[cfg_attr(docsrs, doc(cfg(feature = "12-37-0")))]
145 pub hcaptcha: bool,
146 pub recaptcha: bool,
147 pub object_storage: bool,
148 pub twitter: bool,
149 pub github: bool,
150 pub discord: bool,
151 pub service_worker: bool,
152 #[cfg(feature = "12-28-0")]
153 #[cfg_attr(docsrs, doc(cfg(feature = "12-28-0")))]
154 pub miauth: bool,
155}