* Updated System->host_name to work locally and on remote targets.
* Renamed all 'hostname' instances to 'host_name' to standardize on a spelling throughout the program.
* Removed use of and dependency on 'hostname'.
Signed-off-by: Digimer <digimer@alteeve.ca>
ThisistheDRBDtargetnode's (connection) ID that we'reenablingdual-primarywith.Ifthisisnotpassed,butC<<drbd::status::<local_short_hostname>::resource::<resource>::connection::<peer_name>::peer-node-id>>isset,itwillbeused.Otherwisethisargumentisrequired.
ThisistheDRBDtargetnode's (connection) ID that we'reenablingdual-primarywith.Ifthisisnotpassed,butC<<drbd::status::<local_short_host_name>::resource::<resource>::connection::<peer_name>::peer-node-id>>isset,itwillbeused.Otherwisethisargumentisrequired.
# $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { say_dg_iface => $say_dg_iface }});
# $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { say_dg_iface => $say_dg_iface }});
# Hostname
# Hostname
my $say_default_hostname = $anvil->data->{cgi}{prefix}{value}."-striker0".$anvil->data->{cgi}{sequence}{value}.".".$anvil->data->{cgi}{domain}{value};
my $say_default_host_name = $anvil->data->{cgi}{prefix}{value}."-striker0".$anvil->data->{cgi}{sequence}{value}.".".$anvil->data->{cgi}{domain}{value};
my $hostname_class = $anvil->data->{cgi}{hostname}{alert} ? "input_alert" : "input_clear";
my $host_name_class = $anvil->data->{cgi}{host_name}{alert} ? "input_alert" : "input_clear";
my $say_hostname = $anvil->Template->get({file => "main.html", name => "input_text_form", variables => {
my $say_host_name = $anvil->Template->get({file => "main.html", name => "input_text_form", variables => {
name => "hostname",
name => "host_name",
id => "hostname",
id => "host_name",
field => "#!string!striker_0016!#",
field => "#!string!striker_0016!#",
description => "#!string!striker_0017!#",
description => "#!string!striker_0017!#",
value => defined $anvil->data->{cgi}{hostname}{value} ? $anvil->data->{cgi}{hostname}{value} : $say_default_hostname,
value => defined $anvil->data->{cgi}{host_name}{value} ? $anvil->data->{cgi}{host_name}{value} : $say_default_host_name,
default_value => "",
default_value => "",
class => $hostname_class,
class => $host_name_class,
extra => "",
extra => "",
}});
}});
@ -2327,7 +2327,7 @@ ORDER BY
striker_password_form => $say_striker_password,
striker_password_form => $say_striker_password,
gateway_form => $say_gateway,
gateway_form => $say_gateway,
dns_form => $say_dns,
dns_form => $say_dns,
hostname_form => $say_hostname,
host_name_form => $say_host_name,
}});
}});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { step2_body => $step2_body }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { step2_body => $step2_body }});
@ -2343,10 +2343,10 @@ sub sanity_check_step2
my $sane = 1;
my $sane = 1;
# Do we have a host name, striker user and password?
# Do we have a host name, striker user and password?
if (not $anvil->Validate->form_field({name => "hostname", type => "domain_name"}))
if (not $anvil->Validate->form_field({name => "host_name", type => "domain_name"}))
@ -40,8 +40,8 @@ Author: Madison Kelly <mkelly@alteeve.ca>
<keyname="message_0013">#!free!#</key>
<keyname="message_0013">#!free!#</key>
<keyname="message_0014">One or more files on disk have changed. Exiting to reload.</key>
<keyname="message_0014">One or more files on disk have changed. Exiting to reload.</key>
<keyname="message_0015">The reconfigure of the network has begun.</key>
<keyname="message_0015">The reconfigure of the network has begun.</key>
<keyname="message_0016">The hostname: [#!variable!hostname!#] has been set.</key>
<keyname="message_0016">The hostname: [#!variable!host_name!#] has been set.</key>
<keyname="message_0017">Failed to set the hostname: [#!variable!hostname!#]! The hostname is currently [#!variable!bad_hostname!#]. This is probably a program error.</key>
<keyname="message_0017">Failed to set the hostname: [#!variable!host_name!#]! The hostname is currently [#!variable!bad_host_name!#]. This is probably a program error.</key>
<keyname="message_0018">What would you like the new password to be?</key>
<keyname="message_0018">What would you like the new password to be?</key>
<keyname="message_0019">Please enter the password again to confirm.</key>
<keyname="message_0019">Please enter the password again to confirm.</key>
<keyname="message_0020">About to update the local passwords (shell users, database and web interface).</key>
<keyname="message_0020">About to update the local passwords (shell users, database and web interface).</key>
@ -823,7 +823,7 @@ Here we will inject 't_0006', which injects 't_0001' which has a variable: [#!st
<keyname="striker_0014">Step 1</key>
<keyname="striker_0014">Step 1</key>
<keyname="striker_0015">IFN Count</key>
<keyname="striker_0015">IFN Count</key>
<keyname="striker_0016">Host name</key>
<keyname="striker_0016">Host name</key>
<keyname="striker_0017">This is the hostname for this Striker dashboard. Generally it is a good idea to stick with the default.</key>
<keyname="striker_0017">This is the hostname for this Striker dashboard. Generally it is a good idea to stick with the default.</key>
<keyname="striker_0018">Back-Channel Network link #!variable!number!#</key>
<keyname="striker_0018">Back-Channel Network link #!variable!number!#</key>
<keyname="striker_0019">This is where you configure the network to enable access this Back-Channel Network.</key>
<keyname="striker_0019">This is where you configure the network to enable access this Back-Channel Network.</key>
<keyname="striker_0020">Storage Network link #!variable!number!#</key>
<keyname="striker_0020">Storage Network link #!variable!number!#</key>
@ -882,7 +882,7 @@ Here we will inject 't_0006', which injects 't_0001' which has a variable: [#!st
<keyname="striker_0073">When checked, the Anvil! will ping the peer before trying to connect to the database. This speeds up skipping a database that is offline, but won't help if the databsae is behind a router. When unchecked, connections will be a touch faster when the database is available.</key>
<keyname="striker_0073">When checked, the Anvil! will ping the peer before trying to connect to the database. This speeds up skipping a database that is offline, but won't help if the databsae is behind a router. When unchecked, connections will be a touch faster when the database is available.</key>
<keyname="striker_0074">When checked, the peer will be configured to add the local database as a peer at the same time that we add it to this system.</key>
<keyname="striker_0074">When checked, the peer will be configured to add the local database as a peer at the same time that we add it to this system.</key>
<keyname="striker_0075">Access</key>
<keyname="striker_0075">Access</key>
<keyname="striker_0076"><![CDATA[This tells Striker how to connect to the peer. The default username is '<span class="fixed_width">admin</span>', and the default port is '<span class="fixed_width">5432</span>'. If the peer uses these, then you only need to specify the IP address or hostname of the peer. If the user name is not '<span class="fixed_width">admin</span>', then you need to use the format '<span class="fixed_width">user@host</span>. If the TCP port is not '<span class="fixed_width">5432</span>', then you need to use '<span class="fixed_width">host:port</span>. If both user and port are different, use the format '<span class="fixed_width">user@host:port</span>'.]]></key>
<keyname="striker_0076"><![CDATA[This tells Striker how to connect to the peer. The default username is '<span class="fixed_width">admin</span>', and the default port is '<span class="fixed_width">5432</span>'. If the peer uses these, then you only need to specify the IP address or hostname of the peer. If the user name is not '<span class="fixed_width">admin</span>', then you need to use the format '<span class="fixed_width">user@host</span>. If the TCP port is not '<span class="fixed_width">5432</span>', then you need to use '<span class="fixed_width">host:port</span>. If both user and port are different, use the format '<span class="fixed_width">user@host:port</span>'.]]></key>
<keyname="striker_0077"><![CDATA[If '#!string!striker_0072!#' is set, we will need to update the peer's configuration. If the peer's SSH port is not '<span class="fixed_width">22</span>', you can append: '<span class="fixed_width">,ssh=X</span>' where 'X' is the SSH TCP port.]]></key>
<keyname="striker_0077"><![CDATA[If '#!string!striker_0072!#' is set, we will need to update the peer's configuration. If the peer's SSH port is not '<span class="fixed_width">22</span>', you can append: '<span class="fixed_width">,ssh=X</span>' where 'X' is the SSH TCP port.]]></key>
<keyname="striker_0078">Please verify</key>
<keyname="striker_0078">Please verify</key>
<keyname="striker_0079">Peer</key>
<keyname="striker_0079">Peer</key>
@ -1060,7 +1060,7 @@ Failure! The return code: [#!variable!return_code!#] was received ('0' was expec
<keyname="error_0009">Failed to add the target: [#!variable!target!#]:[#!variable!port!#]'s RSA fingerprint to: [#!variable!user!#]'s list of known hosts.</key>
<keyname="error_0009">Failed to add the target: [#!variable!target!#]:[#!variable!port!#]'s RSA fingerprint to: [#!variable!user!#]'s list of known hosts.</key>
<keyname="error_0010">There was a problem adding the local machine to the: [#!data!path::configs::anvil.conf!#] file. Please see the log for details.</key>
<keyname="error_0010">There was a problem adding the local machine to the: [#!data!path::configs::anvil.conf!#] file. Please see the log for details.</key>
<keyname="error_0011">Something went wrong while trying to update the password. The return code was: [#!variable!return_code!#], but '0' was expected.</key>
<keyname="error_0011">Something went wrong while trying to update the password. The return code was: [#!variable!return_code!#], but '0' was expected.</key>
<keyname="error_0012"><![CDATA[The <a href="https://en.wikipedia.org/wiki/Hostname" target="_new">hostname</a> has to be set to a valid value.]]></key>
<keyname="error_0012"><![CDATA[The <a href="https://en.wikipedia.org/wiki/Hostname" target="_new">hostname</a> has to be set to a valid value.]]></key>
<keyname="error_0013">A user name must be set. This is usually 'admin'.</key>
<keyname="error_0013">A user name must be set. This is usually 'admin'.</key>
<keyname="error_0014">You must set a password. There are no complexity rules, but a long password is strongly recommended.</key>
<keyname="error_0014">You must set a password. There are no complexity rules, but a long password is strongly recommended.</key>
<keyname="error_0015">A DNS entry is bad. One or more IPv4 addresses can be specified, with a comma separating multiple IPs.</key>
<keyname="error_0015">A DNS entry is bad. One or more IPv4 addresses can be specified, with a comma separating multiple IPs.</key>
my $bcn_count = 1; # TODO: This should be coming from the form, even though it's only '1' for now.
my $bcn_count = 1; # TODO: This should be coming from the form, even though it's only '1' for now.
my $sn_count = 0; # TODO: This should be coming from the form, even though it's always '0' for Strikers.
my $sn_count = 0; # TODO: This should be coming from the form, even though it's always '0' for Strikers.
my $ifn_count = $anvil->data->{variables}{form}{config_step1}{ifn_count}{value};
my $ifn_count = $anvil->data->{variables}{form}{config_step1}{ifn_count}{value};
my $new_hostname = defined $anvil->data->{variables}{form}{config_step2}{hostname}{value} ? $anvil->data->{variables}{form}{config_step2}{hostname}{value} : $prefix."-striker".sprintf("%02d", $sequence).".".$domain;
my $new_host_name = defined $anvil->data->{variables}{form}{config_step2}{host_name}{value} ? $anvil->data->{variables}{form}{config_step2}{host_name}{value} : $prefix."-striker".sprintf("%02d", $sequence).".".$domain;
my $pretty_hostname = $organization." - Striker ".sprintf("%02d", $sequence);
my $pretty_host_name = $organization." - Striker ".sprintf("%02d", $sequence);
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, secure => 0, list => {