Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3515951
D5641.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5641.diff
View Options
diff --git a/services/tunnelbroker/src/notifications/config.rs b/services/tunnelbroker/src/notifications/config.rs
new file mode 100644
--- /dev/null
+++ b/services/tunnelbroker/src/notifications/config.rs
@@ -0,0 +1,8 @@
+#[derive(Default, Clone)]
+pub struct Config {
+ pub fcm_api_key: String,
+ pub apns_certificate_path: String,
+ pub apns_certificate_password: String,
+ pub apns_topic: String,
+ pub is_sandbox: bool,
+}
diff --git a/services/tunnelbroker/src/notifications/mod.rs b/services/tunnelbroker/src/notifications/mod.rs
--- a/services/tunnelbroker/src/notifications/mod.rs
+++ b/services/tunnelbroker/src/notifications/mod.rs
@@ -1,2 +1,23 @@
pub mod apns;
+pub mod config;
pub mod fcm;
+use super::cxx_bridge::ffi::{getConfigParameter, isSandbox};
+use lazy_static::lazy_static;
+
+lazy_static! {
+ static ref CONFIG: config::Config = config::Config {
+ fcm_api_key: getConfigParameter("notifications.fcm_server_key")
+ .expect("Error getting `notifications.fcm_server_key` config parameter"),
+ apns_certificate_path: getConfigParameter("notifications.apns_cert_path")
+ .expect("Error getting `notifications.apns_cert_path` config parameter"),
+ apns_certificate_password: getConfigParameter(
+ "notifications.apns_cert_password"
+ )
+ .expect(
+ "Error getting `notifications.apns_cert_password` config parameter"
+ ),
+ apns_topic: getConfigParameter("notifications.apns_topic")
+ .expect("Error getting `apns_topic` config parameter"),
+ is_sandbox: isSandbox().expect("Error determining of sandboxing"),
+ };
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 11:16 AM (18 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694551
Default Alt Text
D5641.diff (1 KB)
Attached To
Mode
D5641: [services] Tunnelbroker - Notifications config initialization
Attached
Detach File
Event Timeline
Log In to Comment