From 6763867cbe4239eb215f6ef2646ee6a7b21331b9 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Wed, 4 Aug 2021 19:24:35 +0530 Subject: [PATCH] make billing section optional --- config/default.toml | 1 + src/data.rs | 30 +++++++++++++++--------------- src/settings.rs | 31 ++++++++++++++++--------------- templates/panel/navbar/index.html | 2 ++ 4 files changed, 34 insertions(+), 30 deletions(-) diff --git a/config/default.toml b/config/default.toml index e93c0ee7..f1d95305 100644 --- a/config/default.toml +++ b/config/default.toml @@ -1,5 +1,6 @@ debug = true source_code = "https://github.com/mCaptcha/mCaptcha" +commercial = false [server] # Please set a unique value, your mCaptcha instance's security depends on this being diff --git a/src/data.rs b/src/data.rs index 8ec213fa..f8852778 100644 --- a/src/data.rs +++ b/src/data.rs @@ -1,19 +1,19 @@ /* -* Copyright (C) 2021 Aravinth Manivannan -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Affero General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with this program. If not, see . -*/ + * Copyright (C) 2021 Aravinth Manivannan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ //! App data: redis cache, database connections, etc. use std::sync::Arc; use std::thread; diff --git a/src/settings.rs b/src/settings.rs index 912bc307..dd804713 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -1,19 +1,19 @@ /* -* Copyright (C) 2021 Aravinth Manivannan -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Affero General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with this program. If not, see . -*/ + * Copyright (C) 2021 Aravinth Manivannan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ use std::env; use std::path::Path; @@ -98,6 +98,7 @@ pub struct Redis { #[derive(Debug, Clone, Deserialize)] pub struct Settings { pub debug: bool, + pub commercial: bool, pub database: Database, pub redis: Option, pub server: Server, diff --git a/templates/panel/navbar/index.html b/templates/panel/navbar/index.html index 45241fd5..038f27b4 100644 --- a/templates/panel/navbar/index.html +++ b/templates/panel/navbar/index.html @@ -38,6 +38,7 @@ + <. if crate::SETTINGS.commercial { .>
  • <.= crate::CREDIT_CARD.1 .> @@ -46,6 +47,7 @@
  • + <. } .>
  • <.= crate::HELP_CIRCLE.1 .>