From 1349bfc471d77b8738dd55a4d0e61cf74e70cad0 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 20 Feb 2021 11:21:45 +0100 Subject: [PATCH] Add privacy policy URL in static configuration --- config.yaml | 1 + src/api_data/server_config.rs | 10 ++++++---- src/data/config.rs | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/config.yaml b/config.yaml index 35cc28d..74ec49b 100644 --- a/config.yaml +++ b/config.yaml @@ -22,6 +22,7 @@ storage-path: /home/pierre/Documents/projets_web/comunic/current/user_data/ # URL where Comunic Terms of use are available terms-url: http://devweb.local/comunic/current/about.php?cgu +privacy-policy-url: http://devweb.local/comunic/current/about.php?cgu&privacy # Android application download URL play-store-url: https://play.google.com/store/apps/details?id=org.communiquons.comunic diff --git a/src/api_data/server_config.rs b/src/api_data/server_config.rs index a2459ed..3655603 100644 --- a/src/api_data/server_config.rs +++ b/src/api_data/server_config.rs @@ -31,8 +31,9 @@ struct DataConservationPolicy { #[derive(Serialize)] pub struct ServerConfig { min_supported_mobile_version: &'static str, - terms_url: String, - play_store_url: String, + terms_url: &'static str, + privacy_policy_url: &'static str, + play_store_url: &'static str, android_direct_download_url: String, password_policy: PasswordPolicy, data_conservation_policy: DataConservationPolicy, @@ -42,8 +43,9 @@ impl ServerConfig { pub fn new() -> Self { ServerConfig { min_supported_mobile_version: MIN_SUPPORTED_MOBILE_VERSION, - terms_url: conf().terms_url.clone(), - play_store_url: conf().play_store_url.clone(), + terms_url: &conf().terms_url, + privacy_policy_url: &conf().privacy_policy_url, + play_store_url: &conf().play_store_url, android_direct_download_url: conf().android_direct_download_url.clone(), password_policy: PasswordPolicy { allow_email_in_password: password_policy::ALLOW_EMAIL_IN_PASSWORD, diff --git a/src/data/config.rs b/src/data/config.rs index f403b27..4c5f7f9 100644 --- a/src/data/config.rs +++ b/src/data/config.rs @@ -31,6 +31,7 @@ pub struct Config { pub storage_url: String, pub storage_path: String, pub terms_url: String, + pub privacy_policy_url: String, pub play_store_url: String, pub android_direct_download_url: String, pub proxy: Option, @@ -105,6 +106,7 @@ impl Config { storage_path: Config::yaml_str(parsed, "storage-path"), terms_url: Config::yaml_str(parsed, "terms-url"), + privacy_policy_url: Config::yaml_str(parsed, "privacy-policy-url"), play_store_url: Config::yaml_str(parsed, "play-store-url"), android_direct_download_url: Config::yaml_str(parsed, "android-direct-download-url"),