Up to date letsencrypt files and fix up validate template in custom

This commit is contained in:
Brian Read 2024-11-29 16:15:55 +00:00
parent 171bd5a141
commit ce91fbab45
10 changed files with 63 additions and 62 deletions

View File

@ -52,7 +52,7 @@ our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
my $c = shift; my $c = shift;
my $prefix_data = shift; #Data hash as parameter my $prefix_data = shift; #Data hash as parameter
# Validation for each field # Validation for each field
my $ret = "Error from params"; my $ret = "";
if (! TRUE) #validate $c->param('status') if (! TRUE) #validate $c->param('status')
{$ret .= 'Validation for status failed';} {$ret .= 'Validation for status failed';}
if (! TRUE) #validate $c->param('hookScript') if (! TRUE) #validate $c->param('hookScript')

View File

@ -1,6 +1,6 @@
package SrvMngr::Controller::Letsencrypt; package SrvMngr::Controller::Letsencrypt;
# #
# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 13:00:55 # Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 15:59:19
# #
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# heading : Network # heading : Network
@ -137,8 +137,8 @@ sub do_update {
# the value of trt will tell you which panel has returned # the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'LIST'; #hidden control on every form. my $trt = $c->param('trt') || 'LIST'; #hidden control on every form.
my $ret = 'ok'; my $ret = 'ok';
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
my $thispanel; my $thispanel;
if ($trt eq 'LIST'){ if ($trt eq 'LIST'){
@ -171,12 +171,12 @@ sub do_update {
$thispanel = 'CHECKONEDOMAIN'; $thispanel = 'CHECKONEDOMAIN';
} }
if ($ret ne "ok"){ if ($ret ne "ok"){
$c->do_display($thispanel); $c->do_display($thispanel);
} else { } else {
#Do whatever is needed, including writing values to the DB #Do whatever is needed, including writing values to the DB
if ($trt eq 'LIST'){ if ($trt eq 'LIST'){
#do whatever is required ... #do whatever is required ...
$ret = $c->perform_LIST(\%lets_data); $ret = $c->perform_LIST(\%lets_data);
@ -271,7 +271,6 @@ sub do_update {
$lets_data{'trt'} = 'none'; $lets_data{'trt'} = 'none';
} }
$c->do_display($lets_data{'trt'}); $c->do_display($lets_data{'trt'});
} }
} }

View File

@ -1,5 +1,5 @@
%# %#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 13:00:55 %# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 15:59:19
%# %#
<div id="Letsencrypt-CHECKALLDOMAINS" class="partial Letsencrypt-CHECKALLDOMAINS"> <div id="Letsencrypt-CHECKALLDOMAINS" class="partial Letsencrypt-CHECKALLDOMAINS">
<script> <script>

View File

@ -1,5 +1,5 @@
%# %#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 13:00:55 %# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 15:59:19
%# %#
<div id="Letsencrypt-CHECKALLENABLEDDOMAINS" class="partial Letsencrypt-CHECKALLENABLEDDOMAINS"> <div id="Letsencrypt-CHECKALLENABLEDDOMAINS" class="partial Letsencrypt-CHECKALLENABLEDDOMAINS">
<script> <script>

View File

@ -1,5 +1,5 @@
%# %#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 13:00:55 %# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 15:59:19
%# %#
<div id="Letsencrypt-CHECKONEDOMAIN" class="partial Letsencrypt-CHECKONEDOMAIN"> <div id="Letsencrypt-CHECKONEDOMAIN" class="partial Letsencrypt-CHECKONEDOMAIN">
<script> <script>

View File

@ -1,5 +1,5 @@
%# %#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 13:00:55 %# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 15:59:19
%# %#
<div id="Letsencrypt-LIST" class="partial Letsencrypt-LIST"> <div id="Letsencrypt-LIST" class="partial Letsencrypt-LIST">
<script> <script>

View File

@ -1,5 +1,5 @@
%# %#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 13:00:55 %# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 15:59:19
%# %#
<div id="Letsencrypt-PARAMS" class="partial Letsencrypt-PARAMS"> <div id="Letsencrypt-PARAMS" class="partial Letsencrypt-PARAMS">
<script> <script>

View File

@ -1,5 +1,5 @@
%# %#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 13:00:55 %# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 15:59:19
%# %#
% layout 'default', title => "Sme server 2 - Letsencrypt certificate", share_dir => './'; % layout 'default', title => "Sme server 2 - Letsencrypt certificate", share_dir => './';
%# css specific to this panel: %# css specific to this panel:
@ -26,7 +26,7 @@
</p> </p>
%} elsif ($c->stash('success')) { %} elsif ($c->stash('success')) {
<div class='sme-border'> <div class='success '>
<h2><%=$c->l('lets_Status_Report') %></h2><p> <h2><%=$c->l('lets_Status_Report') %></h2><p>
%= $c->l($c->stash('success')); %= $c->l($c->stash('success'));
</p> </p>

View File

@ -1,52 +1,54 @@
# #
# Generated by SM2Gen version: SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-17 14:48:52 # Generated by SM2Gen version: SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-29 15:59:19
# #
'lets_Loop_through_checking_the_letsencrypt' => 'Loop through checking the letsencrypt status for a specific domain', 'lets_CONFIG_LETSENCRYPT' => 'confirm Letsencrypt',
'lets_Brief_description' => 'Brief description', 'lets_SERVICE_STATUS' => 'Service Status',
'lets_Expiry' => 'Expiry', 'lets_Expiry' => 'Expiry',
'lets_EMAIL' => 'Email', 'lets_CONFIG' => 'Config',
'lets_One_domain_check_result' => 'One domain check result', 'lets_CONFIGUREMODE_STATUS' => 'Configuremode Status',
'lets_Current_certificate_details' => 'Current certificate details',
'lets_LABEL_POINT' => 'Label Point',
'lets_IS_IN_CERT' => 'Is In cart',
'lets_LABEL_LECERT' => 'Label secret',
'lets_Enabled_domains_check_result' => 'Enabled domains check result',
'lets_Letsencrypt_certificate' => 'Letsencrypt certificate',
'lets_Check_all_domains' => 'Check all domains',
'lets_Domain_name_/_HOSTNAME' => 'Domain name / HOSTNAME', 'lets_Domain_name_/_HOSTNAME' => 'Domain name / HOSTNAME',
'lets_Loop_through_checking_the_letsencrypt' => 'Loop through checking the letsencrypt status for each configured domain which is enabled', 'lets_LABEL_POINT' => 'Label Point',
'lets_CHECK_ALL_ENABLED_DOMAINS' => 'Check All Enabled Domains', 'lets_Brief_description' => 'Brief description',
'lets_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful', 'lets_Manage_letsencrypt-config_settings:' => 'Manage letsencrypt-config settings',
'lets_CHECKALLENABLEDDOMAINS_panel_action_was_successful' => 'CHECKALLENABLEDDOMAINS panel action was successful', 'lets_Loop_through_checking_the_letsencrypt' => 'Loop through checking the letsencrypt status for a specific domain',
'lets_HOOKSCRIPT_STATUS' => 'Hookscript Status', 'lets_Check_just_one_domain' => 'Check just one domain',
'lets_List_of_Domains_and_Hosts' => 'List of Domains and Hosts', 'lets_List_of_Domains_and_Hosts' => 'List of Domains and Hosts',
'lets_Save' => 'Save', 'lets_Save' => 'Save',
'lets_Internal_IP' => 'Internal IP', 'lets_Status_Report' => 'Status Report',
'lets_Loop_through_checking_the_letsencrypt' => 'Loop through checking the letsencrypt status for each configured domain', 'lets_One_domain_check_result' => 'One domain check result',
'lets_Internet_IP' => 'Internet IP',
'lets_SERVICE_STATUS' => 'Service Status',
'lets_ACCEPT_TERMS_STATUS' => 'Accept Terms Status',
'lets_CHECK' => 'Check', 'lets_CHECK' => 'Check',
'lets_Check_just_one_domain' => 'Check just one domain',
'lets_External_Interface_IP' => 'External Interface IP', 'lets_External_Interface_IP' => 'External Interface IP',
'lets_Not_Before' => 'Not Before', 'lets_APPLY' => 'Apply',
'lets_Content' => 'Content', 'lets_CHECKALLDOMAINS_panel_action_was_successful' => 'CHECKALLDOMAINS panel action was successful',
'lets_All_domains_check_result' => 'All domains check result', 'lets_CHECK_ALL_ENABLED_DOMAINS' => 'Check All Enabled Domains',
'lets_LIST_panel_action_was_successful' => 'LIST panel action was successful', 'lets_Issuer' => 'Issuer',
'lets_CONFIGUREMODE_STATUS' => 'Configuremode Status', 'lets_Check_all_domains' => 'Check all domains',
'lets_CONFIG_LETSENCRYPT' => 'confirm Letsencrypt', 'lets_Current_certificate_details' => 'Current certificate details',
'lets_CHECKONEDOMAIN_panel_action_was_successful' => 'CHECKONEDOMAIN panel action was successful', 'lets_CHECKALLENABLEDDOMAINS_panel_action_was_successful' => 'CHECKALLENABLEDDOMAINS panel action was successful',
'lets_LABEL_NAMESERVERS' => 'Label timeservers', 'lets_Internet_IP' => 'Internet IP',
'lets_CHECK_ALL_DOMAINS' => 'Check All Domains', 'lets_CHECK_ALL_DOMAINS' => 'Check All Domains',
'lets_HOSTOVERRIDE_STATUS' => 'Hostoverride Status', 'lets_HOSTOVERRIDE_STATUS' => 'Hostoverride Status',
'lets_API_STATUS' => 'ape Status', 'lets_EMAIL' => 'Email',
'lets_APPLY' => 'Apply', 'lets_HOOKSCRIPT_STATUS' => 'Hookscript Status',
'lets_Check_all_enabled_domains' => 'Check all enabled domains', 'lets_Check_all_enabled_domains' => 'Check all enabled domains',
'lets_KEYSIZE_STATUS' => 'Keysize Status', 'lets_Content' => 'Content',
'lets_Issuer' => 'Issuer',
'lets_Domains_name' => 'Domains name',
'lets_CONFIG' => 'Config',
'lets_CHECKALLDOMAINS_panel_action_was_successful' => 'CHECKALLDOMAINS panel action was successful',
'lets_Back' => 'Back', 'lets_Back' => 'Back',
'lets_Domains_name' => 'Domains name',
'lets_Internal_IP' => 'Internal IP',
'lets_For_this_Server' => 'For this Server', 'lets_For_this_Server' => 'For this Server',
'lets_Manage_letsencrypt-config_settings:' => 'Manage letsencrypt-config settings', 'lets_LIST_panel_action_was_successful' => 'LIST panel action was successful',
'lets_LABEL_LECERT' => 'Label secret',
'lets_CHECKONEDOMAIN_panel_action_was_successful' => 'CHECKONEDOMAIN panel action was successful',
'lets_ACCEPT_TERMS_STATUS' => 'Accept Terms Status',
'lets_Loop_through_checking_the_letsencrypt' => 'Loop through checking the letsencrypt status for each configured domain',
'lets_IS_IN_CERT' => 'Is In cart',
'lets_Not_Before' => 'Not Before',
'lets_All_domains_check_result' => 'All domains check result',
'lets_API_STATUS' => 'ape Status',
'lets_Error_Status_Report' => 'Error Status Report',
'lets_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful',
'lets_Letsencrypt_certificate' => 'Letsencrypt certificate',
'lets_LABEL_NAMESERVERS' => 'Label timeservers',
'lets_KEYSIZE_STATUS' => 'Keysize Status',
'lets_Loop_through_checking_the_letsencrypt' => 'Loop through checking the letsencrypt status for each configured domain which is enabled',
'lets_Enabled_domains_check_result' => 'Enabled domains check result',

View File

@ -114,7 +114,7 @@ sub get_${tablecontrol[0]} {
my $prefix_data = shift; #Data hash as parameter my $prefix_data = shift; #Data hash as parameter
my $ret = ""; my $ret = "";
<tal:block tal:repeat="field fields[panel]"> <tal:block tal:repeat="field fields[panel]">
if (! TRUE) #copy or perform with value: ${field} e.g. $c->setprop(dbentry,dbkey,$c->param('${field}') if (! TRUE) #copy or perform with value: ${field} e.g. $c->setprop(dbentry,dbkey,$c->param('${field}')))
{$ret .= 'Perform failed for ${field} failed';}</tal:block> {$ret .= 'Perform failed for ${field} failed';}</tal:block>
if ($ret eq "") {$ret = 'ok';} if ($ret eq "") {$ret = 'ok';}
return $ret; return $ret;