enforce a users usage understanding by adding a startup configuration parameter that must be set;

pull/114/head
Bryan Biedenkapp 1 month ago
parent a67fe9318e
commit d853b35654

@ -5,6 +5,19 @@
# Flag indicating whether the host will run as a background or foreground task.
daemon: true
#
# This flag should be set to 'true', it simply means that you acknowledge the license and restrictions of use for this
# software, at no time should THIS SOFTWARE EVER BE USED IN PUBLIC SAFETY OR LIFE SAFETY CRITICAL APPLICATIONS. This
# software project is provided solely for personal, non-commercial, hobbyist use; any commercial, professional,
# governmental, or other non-hobbyist use is strictly discouraged, fully unsupported and expressly disclaimed by
# the authors.
#
# By using this software, you agree to indemnify, defend, and hold harmless the authors, contributors, and affiliated
# parties from and against any and all claims, liabilities, damages, losses, or expenses (including reasonable
# attorneys fees) arising out of or relating to any unlawful, unauthorized, or improper use of the software.
#
iAgreeNotToBeStupid: false
#
# Logging Configuration
#

@ -5,6 +5,19 @@
# Flag indicating whether the host will run as a background or foreground task.
daemon: true
#
# This flag should be set to 'true', it simply means that you acknowledge the license and restrictions of use for this
# software, at no time should THIS SOFTWARE EVER BE USED IN PUBLIC SAFETY OR LIFE SAFETY CRITICAL APPLICATIONS. This
# software project is provided solely for personal, non-commercial, hobbyist use; any commercial, professional,
# governmental, or other non-hobbyist use is strictly discouraged, fully unsupported and expressly disclaimed by
# the authors.
#
# By using this software, you agree to indemnify, defend, and hold harmless the authors, contributors, and affiliated
# parties from and against any and all claims, liabilities, damages, losses, or expenses (including reasonable
# attorneys fees) arising out of or relating to any unlawful, unauthorized, or improper use of the software.
#
iAgreeNotToBeStupid: false
#
# Logging Configuration
# Logging Levels:

@ -342,6 +342,13 @@ bool HostFNE::readParams()
bool sendTalkgroups = systemConf["sendTalkgroups"].as<bool>(true);
m_peerReplicaSavesACL = systemConf["peerReplicaSaveACL"].as<bool>(false);
bool iAgreeNotToBeStupid = systemConf["iAgreeNotToBeStupid"].as<bool>(false);
if (!iAgreeNotToBeStupid) {
LogError(LOG_HOST, HIGHLY_UNNECESSARY_DISCLAIMER_FOR_THE_MENTAL);
LogError(LOG_HOST, "You must agree to software license terms, and not to be stupid to use this software.");
return false;
}
if (m_pingTime == 0U) {
m_pingTime = 5U;
}

@ -59,6 +59,13 @@ bool Host::readParams()
m_duplex = systemConf["duplex"].as<bool>(true);
bool simplexSameFreq = systemConf["simplexSameFrequency"].as<bool>(false);
bool iAgreeNotToBeStupid = systemConf["iAgreeNotToBeStupid"].as<bool>(false);
if (!iAgreeNotToBeStupid) {
LogError(LOG_HOST, HIGHLY_UNNECESSARY_DISCLAIMER_FOR_THE_MENTAL);
LogError(LOG_HOST, "You must agree to software license terms, and not to be stupid to use this software.");
return false;
}
m_timeout = systemConf["timeout"].as<uint32_t>(120U);
m_rfModeHang = systemConf["rfModeHang"].as<uint32_t>(10U);
m_rfTalkgroupHang = systemConf["rfTalkgroupHang"].as<uint32_t>(10U);

@ -122,6 +122,13 @@ class ConfigWizard:
console.print()
# Step 1b: Usage Agreement (REQUIRED - not overridable with answers file)
if not self._confirm_usage_agreement():
console.print("\n[red]Usage agreement not accepted. Configuration wizard cancelled.[/red]")
return None
console.print()
# Step 2: Create base config
self.config = DVMConfig()
self.config.config = get_template(self.template_name)
@ -137,6 +144,34 @@ class ConfigWizard:
return None
def _confirm_usage_agreement(self) -> bool:
"""
Display and confirm the usage agreement.
This prompt CANNOT be overridden by answers file.
"""
console.print("[bold yellow]Usage Agreement[/bold yellow]\n")
console.print(
"[yellow]⚠ IMPORTANT NOTICE[/yellow]\n"
"This software is provided solely for personal, non-commercial, hobbyist use.\n"
"Use in public safety or life safety critical applications is STRICTLY PROHIBITED.\n\n"
"[red]DO NOT use this software for:[/red]\n"
" • Emergency services (police, fire, EMS)\n"
" • Life safety critical operations\n"
" • Commercial use without explicit permission\n"
" • Any governmental or professional application\n\n"
"[yellow]By continuing, you acknowledge:[/yellow]\n"
" • You understand the restrictions on this software\n"
" • You agree to use it only for hobbyist purposes\n"
" • You indemnify the authors against any misuse\n"
)
# This is INTENTIONALLY not using _get_answer()
# License agreement must be explicitly confirmed each time
return Confirm.ask(
"Do you agree to these terms and understand the restrictions?",
default=False
)
def _choose_template(self) -> Optional[str]:
"""Choose configuration template"""
console.print("[bold]Step 1: Choose Configuration Template[/bold]\n")
@ -1098,6 +1133,34 @@ class TrunkingWizard:
self.answers = answers or {}
self.iden_table: IdenTable = create_default_iden_table()
def _confirm_usage_agreement(self) -> bool:
"""
Display and confirm the usage agreement.
This prompt CANNOT be overridden by answers file.
"""
console.print("[bold yellow]Usage Agreement[/bold yellow]\n")
console.print(
"[yellow]⚠ IMPORTANT NOTICE[/yellow]\n"
"This software is provided solely for personal, non-commercial, hobbyist use.\n"
"Use in public safety or life safety critical applications is STRICTLY PROHIBITED.\n\n"
"[red]DO NOT use this software for:[/red]\n"
" • Emergency services (police, fire, EMS)\n"
" • Life safety critical operations\n"
" • Commercial use without explicit permission\n"
" • Any governmental or professional application\n\n"
"[yellow]By continuing, you acknowledge:[/yellow]\n"
" • You understand the restrictions on this software\n"
" • You agree to use it only for hobbyist purposes\n"
" • You indemnify the authors against any misuse\n"
)
# This is INTENTIONALLY not using _get_answer()
# Usage agreement must be explicitly confirmed each time
return Confirm.ask(
"Do you agree to these terms and understand the restrictions?",
default=False
)
def _get_answer(self, key: str, prompt_func, *args, **kwargs) -> Any:
"""
Get answer from answers file or prompt user
@ -1135,6 +1198,13 @@ class TrunkingWizard:
))
console.print()
# Usage Agreement (REQUIRED - not overridable with answers file)
if not self._confirm_usage_agreement():
console.print("\n[red]Usage agreement not accepted. Configuration wizard cancelled.[/red]")
return None
console.print()
# System basics
console.print("[bold]Step 1: System Configuration[/bold]\n")

Loading…
Cancel
Save

Powered by TurnKey Linux.