Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/webui/www/api/methods.conf
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,13 @@ CCU.setSecurityLevel {
ARGUMENTS {_session_id_ level}
}

RecoveryMode.enter {
LEVEL ADMIN
SCRIPT_FILE recoverymode/enter.tcl
INFO {Startet die HomeMatic Zentrale im Recovery Modus}
ARGUMENTS {_session_id_}
}

CCU.getSerial {
LEVEL ADMIN
SCRIPT_FILE ccu/getserial.tcl
Expand Down
50 changes: 50 additions & 0 deletions src/webui/www/api/methods/recoverymode/enter.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
##
# RecoveryMode.enter
# Startet die HomeMatic Zentrale im Recovery Modus
#
# Parameter: kein
#
# R�ckgabewert: [bool]
# true
##

set FLAG_FILE "/usr/local/.recoveryMode"
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Plattform ermitteln: oci und lxc haben kein Recovery-System
set platform ""
catch {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
set fd [open /VERSION r]
while { [gets $fd line] >= 0 } {
if { [regexp {^ *PLATFORM *= *(.*)$} $line dummy platform] } { break }
}
close $fd
}
if { $platform == "" } {
jsonrpc_error 500 "could not determine the platform from /VERSION"
}
if { $platform == "oci" || $platform == "lxc" } {
jsonrpc_error 501 "recovery mode is not supported on platform $platform"
}

# Einstellungen speichern, bevor die Flag-Datei erzeugt wird
if { [catch {rega system.Save()} err] } {
jsonrpc_error 500 "could not save the settings: $err"
}

# Flag-Datei erzeugen
if { [catch {
set fd [open $FLAG_FILE w]
puts $fd 1
close $fd
} err] } {
file delete -force $FLAG_FILE
Comment thread
jens-maus marked this conversation as resolved.
jsonrpc_error 500 "could not create the recovery mode flag: $err"
}

# Neustart, bei einem Fehler die Flag-Datei wieder entfernen
if { [catch {exec /sbin/reboot -d 2 2>/dev/null >/dev/null &} err] } {
file delete -force $FLAG_FILE
jsonrpc_error 500 "could not restart: $err"
}

jsonrpc_response true
33 changes: 33 additions & 0 deletions src/webui/www/config/cp_maintenance.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,27 @@ proc action_put_page {} {
}
}

# Recovery Modus
if {[get_platform] != "oci" && [get_platform] != "lxc"} {
table_row {class="CLASS20902 j_noForcedUpdate j_fwUpdateOnly"} {
table_data {class="CLASS20903"} $styleMaxWidth {
#puts "Recovery<br>"
#puts "Modus"
puts "\${dialogSettingsCMTDCCURecoveryMode}"
}
table_data {class="CLASS20904"} {
division {class="popupControls CLASS20905"} {
division {class="CLASS20910 colorGradient50px"} {onClick="OnEnterRecoveryMode();"} {
puts "\${dialogSettingsCMBtnCCURestartRecovery}"
}
}
}
table_data {align="left"} {class="CLASS20904"} {
puts "\${dialogSettingsCMHintRestartRecoveryMode}"
}
}
}

table_row {class="CLASS20902 j_noForcedUpdate j_fwUpdateOnly"} {
table_data {class="CLASS20903"} $styleMaxWidth {
#puts "Fehler-<br>"
Expand Down Expand Up @@ -717,6 +738,18 @@ proc action_put_page {} {
}
});
}

OnEnterRecoveryMode = function() {
new YesNoDialog(translateKey("dialogRecoveryCheck"), translateKey("dialogQuestionRestartRecoveryMode"), function(result) {
if (result == YesNoDialog.RESULT_YES)
{
MessageBox.show(translateKey("dialogRestartRecoveryModeTitle"), translateKey("dialogRestartRecoveryModeContent"), function() {
window.location.href = "/";
});
homematic("RecoveryMode.enter");
}
});
}
}


Expand Down
4 changes: 4 additions & 0 deletions src/webui/www/tcl/eq3_old/common.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ proc get_version { } {
return [read_var /VERSION VERSION]
}

proc get_platform { } {
return [read_var /VERSION PLATFORM]
}

proc get_CoProVersion {} {
set cfgFile "/var/hm_mode"
set unknownVersion "0.0.0"
Expand Down
9 changes: 8 additions & 1 deletion src/webui/www/webui/js/lang/de/translate.lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,10 @@ jQuery.extend(true,langJSON, {
"dialogNo" : "Nein",
"dialogBack" : "Zur%FCck",
"dialogSafetyCheck" : "Sicherheitsabfrage",
"dialogRecoveryCheck" : "Sicherheitsabfrage",
"dialogInfo" : "Info",
"dialogHint" : "Hinweis",
"dialogQuestionRemoveProgram" : "M%F6chten Sie das Programm wirklich l%F6schen?",
"dialogQuestionRemoveProgram" : "M%F6chten Sie das Programm '%s' wirklich l%F6schen?",
"dialogQuestionRemoveLink" : "M%F6chten Sie die Verkn%FCpfung wirklich l%F6schen?",
"dialogQuestionRemoveUser" : "M%F6chten Sie den Benutzer wirklich l%F6schen?",
"dialogQuestionRemoveSysVar" : "M%F6chten Sie die Systemvariable wirklich l%F6schen?",
Expand All @@ -412,6 +413,7 @@ jQuery.extend(true,langJSON, {
"dialogQuestionRestart" : "Best%E4tigen Sie hier, um den Neustart durchzuf%FChren.",
"dialogQuestionShutdown" : "Best%E4tigen Sie hier, um das Herunterfahren durchzuf%FChren.",
"dialogQuestionRestartSafeMode" : "M%F6chten Sie die " + HMIdentifier.de.CCUFullNameText + " wirklich im abgesicherten Modus starten?",
"dialogQuestionRestartRecoveryMode" : "M%F6chten Sie die " + HMIdentifier.de.CCUFullNameText + " wirklich im Recovery Modus starten?",
"dialogUserAccountTitle" : "Benutzerkonto - Konfiguration",
"dialogProgChoseSysVar" : "Programme - Systemvariablenauswahl",
"dialogEditRoom" : "Raum bearbeiten",
Expand All @@ -434,7 +436,9 @@ jQuery.extend(true,langJSON, {
"dialogChooseBidCosInterface" : "Auswahl BidCos-Interface",
"dialogChooseChannel" : "Kanalauswahl",
"dialogRestartSafeModeTitle" : "Neustart",
"dialogRestartRecoveryModeTitle" : "Neustart",
"dialogRestartSafeModeContent" : "Die Zentrale startet nun im abgesicherten Modus. Klicken Sie auf \"OK\", um sich neu anzumelden.",
"dialogRestartRecoveryModeContent" : "Die Zentrale startet nun im Recovery Modus. Klicken Sie auf \"OK\", um sich neu anzumelden.",
"dialogBtnPerformRestart" : "Neustart ",
"dialogBtnPerformShutdown" : "Herunterfahren",
"dialogEditRoomBtnClose" : "Schlie%DFen",
Expand Down Expand Up @@ -469,6 +473,7 @@ jQuery.extend(true,langJSON, {
"dialogSettingsCMTDCCURestart" : HMIdentifier.de.CCUShortName + "<br/>Neustart",
"dialogSettingsCMTDCCUShutdown" : "Herunterfahren",
"dialogSettingsCMTDCCUSafeMode" : "Abgesicherter<br/>Modus",
"dialogSettingsCMTDCCURecoveryMode" : "Recovery<br/>Modus",
"dialogSettingsCMTDErrorProtocol" : "Fehler-<br/>protokoll",
"dialogSettingsCMLblActualSoftwareVersion" : "Aktuelle Software-Version:",
"dialogSettingsCMLblAvailableSoftwareVersion" : "Verf%FCgbare Software-Version:",
Expand All @@ -487,6 +492,7 @@ jQuery.extend(true,langJSON, {
"dialogSettingsCMBtnCCURestart" : "Neustart",
"dialogSettingsCMBtnCCUShutdown" : "Herunterfahren",
"dialogSettingsCMBtnCCURestartSafe" : "Neustart im abgesicherten Modus",
"dialogSettingsCMBtnCCURestartRecovery" : "Neustart im Recovery Modus",
"dialogSettingsCMBtnLogSysLogServerAddress" : "Einstellungen %FCbernehmen",
"dialogSettingsCMBtnLogLoadLogFile" : "Logdatei herunterladen",
"dialogSettingsCMErrorTitle" : "Softwareupdate - Fehler",
Expand All @@ -499,6 +505,7 @@ jQuery.extend(true,langJSON, {
"dialogSettingsCMHintRestart" : "Zentrale neu starten. Ver%E4nderte Einstellungen werden vorher gespeichert.",
"dialogSettingsCMHintShutdown" : "Zentrale herunterfahren. Ver%E4nderte Einstellungen werden vorher gespeichert.",
"dialogSettingsCMHintRestartSafeMode" : "Homematic Zentrale einmalig im abgesicherten Modus starten. Im abgesicherten Modus wird die installierte Zusatzsoftware nicht gestartet. Ver%E4nderte Einstellungen werden vorher gespeichert.",
"dialogSettingsCMHintRestartRecoveryMode" : "HomeMatic Zentrale einmalig im Recovery Modus starten. Im Recovery Modus werden administrative Werkzeuge zur Verf%FCgung gestellt. Ver%E4nderte Einstellungen werden vorher gespeichert.",
"dialogSettingsCMHintErrorLog" : "Stellen Sie die Anzahl der Logmeldungen ein, die von der Zentrale generiert werden sollen.<br>Sie k%F6nnen zus%E4tzlich einen Rechner angeben, dem die Zentrale ihre Logmeldungen per Syslog schickt. Auf diesem Rechner mu%DF entsprechende Software installiert sein, die die Meldungen entgegennimmt.<br>Zu Diagnosezwecken k%F6nnen die aktuellen Logmeldungen der Zentrale in einer Textdatei heruntergeladen werden.",
"dialogSettingsCMLogLevel0" : "Alles loggen",
"dialogSettingsCMLogLevel1" : "Information",
Expand Down
9 changes: 8 additions & 1 deletion src/webui/www/webui/js/lang/en/translate.lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,10 @@ jQuery.extend(true,langJSON, {
"dialogNo" : "No",
"dialogBack" : "Back",
"dialogSafetyCheck" : "Confirmation prompt",
"dialogRecoveryCheck" : "Confirmation prompt",
"dialogInfo" : "Info",
"dialogHint" : "Please note",
"dialogQuestionRemoveProgram" : "Do you really want to delete the program?",
"dialogQuestionRemoveProgram" : "Do you really want to delete the program '%s'?",
"dialogQuestionRemoveLink" : "Do you really want to delete the connection?",
"dialogQuestionRemoveUser" : "Do you really want to delete the user?",
"dialogQuestionRemoveSysVar" : "Do you really want to delete the system variable?",
Expand All @@ -411,6 +412,7 @@ jQuery.extend(true,langJSON, {
"dialogQuestionRestart" : "Please click here to perform the restart?",
"dialogQuestionShutdown" : "Please click here to perform the shutdown?",
"dialogQuestionRestartSafeMode" : "Do you really want to start the " + HMIdentifier.en.CCUFullNameText + " in the safe mode?",
"dialogQuestionRestartRecoveryMode" : "Do you really want to start the " + HMIdentifier.en.CCUFullNameText + " in the recovery mode?",
"dialogUserAccountTitle" : "User account configuration",
"dialogProgChoseSysVar" : "Programs - system variable selection",
"dialogEditRoom" : "Edit room",
Expand All @@ -433,7 +435,9 @@ jQuery.extend(true,langJSON, {
"dialogChooseBidCosInterface" : "Selection BidCos-Interface",
"dialogChooseChannel" : "Channel selection",
"dialogRestartSafeModeTitle" : "Restart",
"dialogRestartRecoveryModeTitle" : "Restart",
"dialogRestartSafeModeContent" : "The Central Control Unit will now start in safe mode. Please click \"OK\" to log in again.",
"dialogRestartRecoveryModeContent" : "The Central Control Unit will now start in recovery mode. Please click \"OK\" to log in again.",
"dialogBtnPerformRestart" : "Restart ",
"dialogBtnPerformShutdown" : "Shutdown",
"dialogEditRoomBtnClose" : "Close",
Expand Down Expand Up @@ -468,6 +472,7 @@ jQuery.extend(true,langJSON, {
"dialogSettingsCMTDCCURestart" : HMIdentifier.en.CCUShortName + "<br/>restart",
"dialogSettingsCMTDCCUShutdown" : "Shutdown",
"dialogSettingsCMTDCCUSafeMode" : "Safe<br/>mode",
"dialogSettingsCMTDCCURecoveryMode" : "Recovery<br/>mode",
"dialogSettingsCMTDErrorProtocol" : "Error<br/>log",
"dialogSettingsCMLblActualSoftwareVersion" : "Current software version:",
"dialogSettingsCMLblAvailableSoftwareVersion" : "Available software version:",
Expand All @@ -486,6 +491,7 @@ jQuery.extend(true,langJSON, {
"dialogSettingsCMBtnCCURestart" : "Restart",
"dialogSettingsCMBtnCCUShutdown" : "Shutdown",
"dialogSettingsCMBtnCCURestartSafe" : "Restart in safe mode",
"dialogSettingsCMBtnCCURestartRecovery" : "Restart in recovery mode",
"dialogSettingsCMBtnLogSysLogServerAddress" : "Apply settings",
"dialogSettingsCMBtnLogLoadLogFile" : "Download log file",
"dialogSettingsCMErrorTitle" : "Software update - error",
Expand All @@ -498,6 +504,7 @@ jQuery.extend(true,langJSON, {
"dialogSettingsCMHintRestart" : "Restart CCU. The changed settings will be saved before.",
"dialogSettingsCMHintShutdown" : "Shutdown CCU. The changed settings will be saved before.",
"dialogSettingsCMHintRestartSafeMode" : "Start Homematic Central Control Unit in safe mode once. In safe mode, the installed additional software will not be started. The changed settings will be saved before.",
"dialogSettingsCMHintRestartRecoveryMode" : "Start HomeMatic Central Control Unit in recovery mode once. In recovery mode, maintenance tasks can be performed. The changed settings will be saved before.",
"dialogSettingsCMHintErrorLog" : "Please set the number of log messages to be generated by the CCU.<br>You can also specify a computer that will receive the log messages from the CCU via syslog. An additional software that will be able to receive this messages has to be installed on the computer.<br>To analyse the results, the current log messages of the CCU can be downloaded in a text file.",
"dialogSettingsCMLogLevel0" : "Log all",
"dialogSettingsCMLogLevel1" : "Information",
Expand Down