* Decided to move development to Fedora 28 to prepare for the leap to RHEL 8. So this commit is the first where the Anvil! Striker can be installed.

* Updated Get->users_home() to default to return the hore directory for the user running the program.
* Updated Remote->call() to start working on handling timeouts.
* Updated Storage->change_owner(), ->make_directory() and ->write_file() to default the the user and group running the program.
* Fixed a bug in home reporting the MAC address of NICs when confirming configuration of Striker. Also changed showing the domain to the hostname.
* Got more work done on sync peers.
* Updated the RPM spec file to install on Fedora 28.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 7 years ago
parent b24b20ec89
commit 9ab242a117
  1. 4
      Anvil/Tools/Get.pm
  2. 77
      Anvil/Tools/Remote.pm
  3. 24
      Anvil/Tools/Storage.pm
  4. 156
      cgi-bin/home
  5. 6
      html/skins/alteeve/config.html
  6. 37
      html/skins/alteeve/striker.html
  7. 266
      rpm/SPECS/anvil.spec
  8. 17
      share/words.xml
  9. 2
      tools/anvil-update-states

@ -727,7 +727,7 @@ This method takes a user's name and returns the user's home directory. If the ho
Parameters;
=head3 user (required)
=head3 user (optional, default is the user name of the real UID (as stored in '$<'))
This is the user whose home directory you are looking for.
@ -741,7 +741,7 @@ sub users_home
my $home_directory = 0;
my $user = defined $parameter->{user} ? $parameter->{user} : "";
my $user = defined $parameter->{user} ? $parameter->{user} : getpwuid($<);
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { user => $user }});
# Make sure the user is only one digit. Sometimes $< (and others) will return multiple IDs.

@ -263,24 +263,17 @@ sub call
my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3;
# Get the target and port so that we can create the ssh_fh key
my $log_level = defined $parameter->{log_level} ? $parameter->{log_level} : 3;
if (($log_level !~ /^\d$/) or ($log_level < 0) or ($log_level > 4))
{
# Invalid log level, set 2.
$log_level = 3;
}
my $port = defined $parameter->{port} ? $parameter->{port} : 22;
my $target = defined $parameter->{target} ? $parameter->{target} : "";
my $ssh_fh_key = $target.":".$port;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
port => $port,
target => $target,
}});
# This will store the SSH file handle for the given target after the initial connection.
$anvil->data->{cache}{ssh_fh}{$ssh_fh_key} = defined $anvil->data->{cache}{ssh_fh}{$ssh_fh_key} ? $anvil->data->{cache}{ssh_fh}{$ssh_fh_key} : "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { "cache::ssh_fh::${ssh_fh_key}" => $anvil->data->{cache}{ssh_fh}{$ssh_fh_key} }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "cache::ssh_fh::${ssh_fh_key}" => $anvil->data->{cache}{ssh_fh}{$ssh_fh_key} }});
# Now pick up the rest of the variables.
my $close = defined $parameter->{'close'} ? $parameter->{'close'} : 0;
@ -292,7 +285,7 @@ sub call
my $start_time = time;
my $ssh_fh = $anvil->data->{cache}{ssh_fh}{$ssh_fh_key};
# NOTE: The shell call might contain sensitive data, so we show '--' if 'secure' is set and $anvil->Log->secure is not.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
'close' => $close,
password => $anvil->Log->secure ? $password : $anvil->Words->string({key => "log_0186"}),
secure => $secure,
@ -327,13 +320,13 @@ sub call
}
# Break out the port, if needed.
my $state;
my $error;
my $state = "";
my $error = "";
if ($target =~ /^(.*):(\d+)$/)
{
$target = $1;
$port = $2;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
port => $port,
target => $target,
}});
@ -342,7 +335,7 @@ sub call
if ($parameter->{port} =~ /^\d+$/)
{
$port = $parameter->{port};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { port => $port }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { port => $port }});
}
}
else
@ -351,11 +344,11 @@ sub call
$anvil->System->read_ssh_config();
$anvil->data->{hosts}{$target}{port} = "" if not defined $anvil->data->{hosts}{$target}{port};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { "hosts::${target}::port" => $anvil->data->{hosts}{$target}{port} }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "hosts::${target}::port" => $anvil->data->{hosts}{$target}{port} }});
if ($anvil->data->{hosts}{$target}{port} =~ /^\d+$/)
{
$port = $anvil->data->{hosts}{$target}{port};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { port => $port }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { port => $port }});
}
}
@ -363,12 +356,12 @@ sub call
if ($port eq "")
{
$port = 22;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { port => $port }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { port => $port }});
}
elsif ($port !~ /^\d+$/)
{
$port = getservbyname($port, 'tcp');
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { port => $port }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { port => $port }});
}
if ((not defined $port) or (($port !~ /^\d+$/) or ($port < 0) or ($port > 65536)))
{
@ -380,11 +373,11 @@ sub call
if (not $anvil->Validate->is_ipv4({ip => $target}))
{
my $new_target = $anvil->Convert->hostname_to_ip({host_name => $target});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { new_target => $new_target }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { new_target => $new_target }});
if ($new_target)
{
$target = $new_target;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { target => $target }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { target => $target }});
}
}
@ -393,7 +386,7 @@ sub call
{
# Close the connection.
$ssh_fh->disconnect();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $log_level, key => "message_0010", variables => { target => $target }});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "message_0010", variables => { target => $target }});
# For good measure, blank both variables.
$anvil->data->{cache}{ssh_fh}{$ssh_fh_key} = "";
@ -405,7 +398,7 @@ sub call
my $stderr_output = [];
# If I don't already have an active SSH file handle, connect now.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { ssh_fh => $ssh_fh }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { ssh_fh => $ssh_fh }});
if ($ssh_fh !~ /^Net::SSH2/)
{
@ -416,7 +409,8 @@ sub call
### TODO: Make the timeout user-configurable to handle slow connections. Make it
### 'sys::timeout::{all|host} = x'
my $start_time = [gettimeofday];
$ssh_fh = Net::SSH2->new(timeout => 1000);
$ssh_fh = Net::SSH2->new();
$ssh_fh->timeout(1000);
if (not $ssh_fh->connect($target, $port))
{
@ -462,10 +456,10 @@ sub call
my $connect_time = tv_interval ($start_time, [gettimeofday]);
#print "[".$connect_time."] - Connect time to: [$target:$port]\n";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { error => $error, ssh_fh => $ssh_fh }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { error => $error, ssh_fh => $ssh_fh }});
if (not $error)
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
remote_user => $remote_user,
password => $anvil->Log->secure ? $password : $anvil->Words->string({key => "log_0186"}),
}});
@ -476,7 +470,7 @@ sub call
my $home_directory = $anvil->Get->users_home({debug => $debug, user => $user});
my $public_key = $home_directory."/.ssh/id_rsa.pub";
my $private_key = $home_directory."/.ssh/id_rsa";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
user => $user,
home_directory => $home_directory,
public_key => $public_key,
@ -487,10 +481,10 @@ sub call
{
# We're in! Record the file handle for this target.
$anvil->data->{cache}{ssh_fh}{$ssh_fh_key} = $ssh_fh;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { "cache::ssh_fh::${ssh_fh_key}" => $anvil->data->{cache}{ssh_fh}{$ssh_fh_key} }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "cache::ssh_fh::${ssh_fh_key}" => $anvil->data->{cache}{ssh_fh}{$ssh_fh_key} }});
# Log that we got in without a password.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $log_level, key => "log_0062", variables => { target => $target }});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0062", variables => { target => $target }});
}
else
{
@ -503,10 +497,10 @@ sub call
{
# We're in! Record the file handle for this target.
$anvil->data->{cache}{ssh_fh}{$ssh_fh_key} = $ssh_fh;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { "cache::ssh_fh::${ssh_fh_key}" => $anvil->data->{cache}{ssh_fh}{$ssh_fh_key} }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "cache::ssh_fh::${ssh_fh_key}" => $anvil->data->{cache}{ssh_fh}{$ssh_fh_key} }});
# Record our success
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $log_level, key => "message_0007", variables => { target => $target }});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "message_0007", variables => { target => $target }});
}
}
}
@ -515,7 +509,7 @@ sub call
### sort out the polling and data collection in this section.
#
# Open a channel and make the call.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
error => $error,
ssh_fh => $ssh_fh,
}});
@ -524,10 +518,11 @@ sub call
# We need to open a channel every time for 'exec' calls. We want to keep blocking off, but we
# need to enable it for the channel() call.
$ssh_fh->blocking(1);
my $channel = $ssh_fh->channel();
my $channel = $ssh_fh->channel() or $ssh_fh->die_with_error;
$ssh_fh->blocking(0);
# Make the shell call
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { channel => $channel }});
if (not $channel)
{
# ... or not.
@ -538,7 +533,7 @@ sub call
else
{
### TODO: Timeout if the call doesn't respond in X seconds, closing the filehandle if hit.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, secure => $secure, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => $secure, list => {
channel => $channel,
shell_call => $shell_call,
}});
@ -569,7 +564,7 @@ sub call
{
my $line = $1;
$line =~ s/\r//g; # Remove \r from things like output of daemon start/stops.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, secure => $secure, list => { "STDOUT:line" => $line }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => $secure, list => { "STDOUT:line" => $line }});
push @{$stdout_output}, $line;
}
@ -581,7 +576,7 @@ sub call
while ($stderr =~ s/^(.*)\n//)
{
my $line = $1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, secure => $secure, list => { "STDERR:line" => $line }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => $secure, list => { "STDERR:line" => $line }});
push @{$stderr_output}, $line;
}
@ -590,12 +585,12 @@ sub call
}
if ($stdout)
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, secure => $secure, list => { stdout => $stdout }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => $secure, list => { stdout => $stdout }});
push @{$stdout_output}, $stdout;
}
if ($stderr)
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, secure => $secure, list => { stderr => $stderr }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => $secure, list => { stderr => $stderr }});
push @{$stderr_output}, $stderr;
}
}
@ -606,7 +601,7 @@ sub call
foreach my $line (@{$stderr_output}, @{$stdout_output})
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, secure => $secure, list => { line => $line }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => $secure, list => { line => $line }});
push @{$output}, $line;
}
@ -617,17 +612,17 @@ sub call
{
# Close it.
$ssh_fh->disconnect();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $log_level, key => "message_0009", variables => { target => $target }});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "message_0009", variables => { target => $target }});
}
# For good measure, blank both variables.
$anvil->data->{cache}{ssh_fh}{$ssh_fh_key} = "";
$ssh_fh = "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, list => { "cache::ssh_fh::${ssh_fh_key}" => $anvil->data->{cache}{ssh_fh}{$ssh_fh_key} }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "cache::ssh_fh::${ssh_fh_key}" => $anvil->data->{cache}{ssh_fh}{$ssh_fh_key} }});
}
$error = "" if not defined $error;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $log_level, secure => $secure, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => $secure, list => {
error => $error,
ssh_fh => $ssh_fh,
output => $output,

@ -389,11 +389,11 @@ Parameters;
This is the file or directory to change the mode on.
=head3 group (optional)
=head3 group (optional, default is the main group of the user running the program)
This is the group name or UID to set the target to.
=head3 user (optional)
=head3 user (optional, default is the user running the program)
This is the user name or UID to set the target to.
@ -406,8 +406,8 @@ sub change_owner
my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3;
my $target = defined $parameter->{target} ? $parameter->{target} : "";
my $group = defined $parameter->{group} ? $parameter->{group} : "";
my $user = defined $parameter->{user} ? $parameter->{user} : "";
my $group = defined $parameter->{group} ? $parameter->{group} : getgrgid($();
my $user = defined $parameter->{user} ? $parameter->{user} : getpwuid($<);
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
target => $target,
group => $group,
@ -854,7 +854,7 @@ Parameters;
This is the name of the directory to create.
=head3 group (optional)
=head3 group (optional, default is the main group of the user running the program)
This is the group name or group ID to set the ownership of the directory to.
@ -878,7 +878,7 @@ If set, the directory will be created on this machine. This must be an IP addres
If C<< target >> is set, this is the user account that will be used when connecting to the remote system.
=head3 user (optional)
=head3 user (optional, default is the user running the program)
This is the user name or user ID to set the ownership of the directory to.
@ -891,13 +891,13 @@ sub make_directory
my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3;
my $directory = defined $parameter->{directory} ? $parameter->{directory} : "";
my $group = defined $parameter->{group} ? $parameter->{group} : "";
my $group = defined $parameter->{group} ? $parameter->{group} : getgrgid($();
my $mode = defined $parameter->{mode} ? $parameter->{mode} : "";
my $password = defined $parameter->{password} ? $parameter->{password} : "";
my $port = defined $parameter->{port} ? $parameter->{port} : 22;
my $remote_user = defined $parameter->{remote_user} ? $parameter->{remote_user} : "root";
my $target = defined $parameter->{target} ? $parameter->{target} : "";
my $user = defined $parameter->{user} ? $parameter->{user} : "";
my $user = defined $parameter->{user} ? $parameter->{user} : getpwuid($<);
my $failed = 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
directory => $directory,
@ -1995,7 +1995,7 @@ This is the name of the file to write.
NOTE: The file must include the full directory it will be written into.
=head3 group (optional)
=head3 group (optional, default is the main group of the user running the program)
This is the group name or group ID to set the ownership of the file to.
@ -2025,7 +2025,7 @@ If set, the file will be written on the target machine. This must be either an I
The file will be written locally in C<< /tmp/<file_name> >>, C<< $anvil->Storage->rsync() >> will be used to copy the file, and finally the local temprary copy will be removed.
=head3 user (optional)
=head3 user (optional, default is the user running the program)
This is the user name or user ID to set the ownership of the file to.
@ -2043,14 +2043,14 @@ sub write_file
my $body = defined $parameter->{body} ? $parameter->{body} : "";
my $file = defined $parameter->{file} ? $parameter->{file} : "";
my $group = defined $parameter->{group} ? $parameter->{group} : "";
my $group = defined $parameter->{group} ? $parameter->{group} : getgrgid($();
my $mode = defined $parameter->{mode} ? $parameter->{mode} : "";
my $overwrite = defined $parameter->{overwrite} ? $parameter->{overwrite} : 0;
my $port = defined $parameter->{port} ? $parameter->{port} : 22;
my $password = defined $parameter->{password} ? $parameter->{password} : "";
my $secure = defined $parameter->{secure} ? $parameter->{secure} : 0;
my $target = defined $parameter->{target} ? $parameter->{target} : "";
my $user = defined $parameter->{user} ? $parameter->{user} : "root";
my $user = defined $parameter->{user} ? $parameter->{user} : getpwuid($<);
my $remote_user = defined $parameter->{remote_user} ? $parameter->{remote_user} : "root";
my $error = 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => 0, list => {

@ -30,7 +30,7 @@ my $anvil = Anvil::Tools->new();
# Set the log level to 2. Setting 3 slows he program down a LOT.
$anvil->Log->level({set => 2});
$anvil->Log->secure({set => 0});
$anvil->Log->secure({set => 1});
# Read the config and then connect to the database.
$anvil->Storage->read_config();
@ -206,7 +206,7 @@ sub process_task
}
# Show the login screen, if the user isn't logged in.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { logged_in => $logged_in }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { logged_in => $logged_in }});
if (not $logged_in)
{
$anvil->data->{form}{body} = $anvil->Template->get({file => "striker.html", name => "striker-login", variables => {
@ -271,24 +271,22 @@ sub process_sync_page
# This handles checkboxes
if (defined $anvil->data->{cgi}{new_peer_ping}{value})
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { ">> cgi::new_peer_ping::value" => $anvil->data->{cgi}{new_peer_ping}{value} }});
$anvil->data->{cgi}{new_peer_ping}{value} = $anvil->data->{cgi}{new_peer_ping}{value} eq "off" ? 0 : 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "<< cgi::new_peer_ping::value" => $anvil->data->{cgi}{new_peer_ping}{value} }});
$anvil->data->{cgi}{new_peer_ping}{value} = "" if $anvil->data->{cgi}{new_peer_ping}{value} ne "on";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::new_peer_ping::value" => $anvil->data->{cgi}{new_peer_ping}{value} }});
}
else
{
$anvil->data->{cgi}{new_peer_ping}{value} = 0;
$anvil->data->{cgi}{new_peer_ping}{value} = "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::new_peer_ping::value" => $anvil->data->{cgi}{new_peer_ping}{value} }});
}
if (defined $anvil->data->{cgi}{new_peer_bidirection}{value})
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { ">> cgi::new_peer_bidirection::value" => $anvil->data->{cgi}{new_peer_bidirection}{value} }});
$anvil->data->{cgi}{new_peer_bidirection}{value} = $anvil->data->{cgi}{new_peer_bidirection}{value} eq "off" ? 0 : 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "<< cgi::new_peer_bidirection::value" => $anvil->data->{cgi}{new_peer_bidirection}{value} }});
$anvil->data->{cgi}{new_peer_bidirection}{value} = "" if $anvil->data->{cgi}{new_peer_bidirection}{value} ne "on";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::new_peer_bidirection::value" => $anvil->data->{cgi}{new_peer_bidirection}{value} }});
}
else
{
$anvil->data->{cgi}{new_peer_bidirection}{value} = 0;
$anvil->data->{cgi}{new_peer_bidirection}{value} = "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::new_peer_bidirection::value" => $anvil->data->{cgi}{new_peer_bidirection}{value} }});
}
@ -296,6 +294,12 @@ sub process_sync_page
if (($anvil->data->{cgi}{new_peer_access}{value}) && ($anvil->data->{cgi}{new_peer_password}{value} ne ""))
{
add_sync_peer($anvil);
if ($anvil->data->{form}{body})
{
# We're done
return(0);
}
}
elsif ($anvil->data->{cgi}{action}{value} eq "remove")
{
@ -425,16 +429,16 @@ sub add_sync_peer
my $ssh_tcp = 22;
my $peer_uuid = "";
my $peer_host = "";
if ($anvil->data->{cgi}{new_peer_access}{value} =~ /,ssh=(\d+)$/)
if ($host =~ /,ssh=(\d+)$/)
{
$ssh_tcp = $1;
$anvil->data->{cgi}{new_peer_access}{value} =~ s/,ssh=\d+$//;
$ssh_tcp = $1;
$host =~ s/,ssh=\d+$//;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
ssh_tcp => $ssh_tcp,
"cgi::new_peer_access::value" => $anvil->data->{cgi}{new_peer_access}{value},
ssh_tcp => $ssh_tcp,
host => $host,
}});
}
if ($anvil->data->{cgi}{new_peer_access}{value} =~ /^(.*?)\@(.*?):(\d+)$/)
if ($host =~ /^(.*?)\@(.*?):(\d+)$/)
{
$user = $1;
$host = $2;
@ -445,7 +449,7 @@ sub add_sync_peer
user => $user,
}});
}
elsif ($anvil->data->{cgi}{new_peer_access}{value} =~ /^(.*?)\@(.*?)$/)
elsif ($host =~ /^(.*?)\@(.*?)$/)
{
$user = $1;
$host = $2;
@ -454,7 +458,7 @@ sub add_sync_peer
user => $user,
}});
}
elsif ($anvil->data->{cgi}{new_peer_access}{value} =~ /^(.*?):(\d+)$/)
elsif ($host =~ /^(.*?):(\d+)$/)
{
$host = $1;
$port = $2;
@ -466,10 +470,14 @@ sub add_sync_peer
# Is the host a domain or IP?
# If so, and 'bi-directional' is set, verify we can ssh into the peer.
if ((not $anvil->Validate->is_domain_name({name => $host})) or
(not $anvil->Validate->is_ipv4({ip => $host})) or
($port < 1) or
($port > 65536))
my $is_domain = $anvil->Validate->is_domain_name({name => $host});
my $is_ipv4 = $anvil->Validate->is_ipv4({ip => $host});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
is_domain => $is_domain,
is_ipv4 => $is_ipv4,
port => $port,
}});
if (((not $is_domain) && (not $is_ipv4)) or ($port < 1) or ($port > 65536))
{
# Bad host.
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "striker_warning_0002"}) }});
@ -477,11 +485,16 @@ sub add_sync_peer
else
{
# Can we connect to the peer?
(my $error, $peer_uuid) = $anvil->Remote->call({
my $shell_call = $anvil->data->{path}{exe}{dmidecode}." --string system-uuid";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }});
my ($error, $output) = $anvil->Remote->call({
debug => 2,
password => $anvil->data->{cgi}{new_peer_password}{value},
target => $ssh_tcp != 22 ? $host.":".$ssh_tcp : $host,
shell_call => $anvil->data->{path}{exe}{dmidecode}." --string system-uuid",
shell_call => $shell_call,
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { error => $error }});
if ($error)
{
# No access
@ -490,38 +503,83 @@ sub add_sync_peer
else
{
# We got the peer's UUID. Get the hostname as well.
$peer_uuid = lc($peer_uuid);
$peer_uuid = lc($output->[0]);
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { peer_uuid => $peer_uuid }});
(my $error, $peer_host) = $anvil->Remote->call({
password => $anvil->data->{cgi}{new_peer_password}{value},
target => $ssh_tcp != 22 ? $host.":".$ssh_tcp : $host,
shell_call => $anvil->data->{path}{exe}{hostnamectl}." --static",
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { peer_host => $peer_host }});
if (not $anvil->Validate->is_uuid({uuid => $peer_uuid}))
{
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "striker_warning_0005", variables => { uuid => $peer_uuid }}) }});
}
else
{
my ($error, $output) = $anvil->Remote->call({
debug => 2,
password => $anvil->data->{cgi}{new_peer_password}{value},
target => $ssh_tcp != 22 ? $host.":".$ssh_tcp : $host,
shell_call => $anvil->data->{path}{exe}{hostnamectl}." --static",
});
$peer_host = $output->[0];
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { peer_host => $peer_host }});
}
}
}
# Lastly, verify we can access the peer database. This will involve writting out a .pgpass file, then making a local system call.
my $password = $anvil->data->{cgi}{new_peer_password}{value};
$password =~ s/:/\:/g;
my $pgpass = $host.":".$port.":".$name.":".$user.":".$password;
# Write out the .pgpass file.
# TODO: Left off here, write out .pgpass, set the mode to 0600, then call 'psql --host 10.1.4.1 --port 5432 --dbname anvil --username admin --no-password --command "SELECT 1" '
my $db_access = $anvil->System->call({uuid => $peer_uuid});
# Now, verify we can access the peer database. This will involve writting out a .pgpass file, then making a local system call.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "form::error_massage" => $anvil->data->{form}{error_massage} }});
if (not $anvil->data->{form}{error_massage})
{
my $pgpass_file = "/tmp/.pgpass";
my $password = $anvil->data->{cgi}{new_peer_password}{value};
$password =~ s/:/\:/g;
my $body = $host.":".$port.":".$name.":".$user.":".$password;
$anvil->Storage->write_file({
file => $pgpass_file,
body => $body,
mode => "0600",
secure => 1,
});
# This will return '1' only, if it works.
my $db_access = $anvil->System->call({shell_call => "PGPASSFILE=\"".$pgpass_file."\" ".$anvil->data->{path}{exe}{psql}." --host ".$host." --port ".$port." --dbname ".$name." --username ".$user." --no-password --tuples-only --no-align --command \"SELECT 1\""});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { db_access => $db_access }});
if ($db_access ne "1")
{
# Failed to connect.
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "striker_warning_0004"}) }});
}
# Delete the pgpass file.
#unlink $pgpass_file;
}
# Is it confirmed?
if (not $anvil->data->{cgi}{confirm}{value})
# If an error was set, clear the 'save' and 'confirm' values.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "form::error_massage" => $anvil->data->{form}{error_massage} }});
if ($anvil->data->{form}{error_massage})
{
# Show the screen the confirm the addition.
$anvil->data->{form}{body} = $anvil->Template->get({file => "striker.html", name => "confirm-new-peer", variables => {
user
$anvil->data->{cgi}{save}{value} = "";
$anvil->data->{cgi}{confirm}{value} = "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
"cgi::save::value" => $anvil->data->{cgi}{save}{value},
"cgi::confirm::value" => $anvil->data->{cgi}{confirm}{value},
}});
}
else
{
# Things look good. Is the save confirmed?
if ($anvil->data->{cgi}{confirm}{value})
{
# OK, save!
}
else
{
# Show the screen the confirm the addition.
$anvil->data->{form}{body} = $anvil->Template->get({file => "striker.html", name => "confirm-new-peer", variables => {
access => $user."@".$host.":".$port,
ping => $anvil->data->{cgi}{new_peer_ping}{value} ? "#!string!unit_0001!#" : "#!string!unit_0002!#",
bidirectional => $anvil->data->{cgi}{new_peer_bidirection}{value} ? "#!string!unit_0001!#" : "#!string!unit_0002!#",
}});
}
}
return(0);
@ -772,8 +830,8 @@ ORDER BY
{
my $ip_key = $this_net."_ip";
my $subnet_key = $this_net."_subnet";
my $iface1_key = $this_net."_iface1_mac";
my $iface2_key = $this_net."_iface2_mac";
my $iface1_key = $this_net."_link1_mac_to_set";
my $iface2_key = $this_net."_link2_mac_to_set";
my $ip = $anvil->data->{cgi}{$ip_key}{value};
my $subnet = $anvil->data->{cgi}{$subnet_key}{value};
my $iface1_mac = $anvil->data->{cgi}{$iface1_key}{value};
@ -800,6 +858,7 @@ ORDER BY
$template .= "_with_gateway";
$anvil->data->{cgi}{dns}{value} = "--" if not $anvil->data->{cgi}{dns}{value};
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { template => $template }});
$networks .= $anvil->Template->get({file => "config.html", name => $template, variables => {
column => $anvil->Words->string({key => $column, variables => { number => $link_number }}),
ip_address => $say_ip,
@ -819,6 +878,7 @@ ORDER BY
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { matched_ip => $matched_ip }});
}
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { networks => $networks }});
# If the IP is going to change, warn the user.
if (not $matched_ip)
@ -832,7 +892,7 @@ ORDER BY
step1_welcome_message_id => "",
organization => $anvil->data->{cgi}{organization}{value},
prefix => $anvil->data->{cgi}{prefix}{value},
domain => $anvil->data->{cgi}{domain}{value},
hostname => $anvil->data->{cgi}{hostname}{value},
striker_user => $anvil->data->{cgi}{striker_user}{value},
striker_password => $anvil->data->{cgi}{striker_password}{value},
networks => $networks,

@ -283,13 +283,13 @@
#!variable!organization!#
</td>
</tr>
<!-- Domain name -->
<!-- Host-name name -->
<tr>
<td class="column_row_name">
#!string!striker_0007!#:
#!string!striker_0016!#:
</td>
<td class="column_row_value_fixed">
#!variable!domain!#
#!variable!hostname!#
</td>
</tr>
<!-- User -->

@ -4,36 +4,20 @@
<div id="confirm-new-peer">
<tr>
<td colspan="2">
About to add a new peer
#!string!striker_0078!#
</td>
</tr>
<tr>
<td>
Striker User:
#!string!striker_0079!#:
</td>
<td class="fixed_width">
#!variable!user!#
#!variable!access!#
</td>
</tr>
<tr>
<td>
Host:
</td>
<td class="fixed_width">
#!variable!host!#
</td>
</tr>
<tr>
<td>
Port:
</td>
<td class="fixed_width">
#!variable!port!#
</td>
</tr>
<tr>
<td>
Ping before Connect:
#!string!striker_0080!#:
</td>
<td class="fixed_width">
#!variable!ping!#
@ -41,7 +25,7 @@
</tr>
<tr>
<td>
Bi-directional:
#!string!striker_0072!#:
</td>
<td class="fixed_width">
#!variable!bidirectional!#
@ -49,11 +33,18 @@
</tr>
<tr>
<td colspan="5" class="subtle_text" style="text-align: center;">
When the peer is added, all data from this host will be copied to the peer's database. Depending on how much data this is, how fast the connection is, and how fast the local machine is, this sync process could take a little time.
#!string!striker_0081!#
</td>
</tr>
</div>
<input type="hidden" name="cgi_list" id="cgi_list" value="username,password,login">
<input type="hidden" name="new_peer_access" id="new_peer_access" value="#!data!cgi::new_peer_access::value!#">
<input type="hidden" name="new_peer_password" id="new_peer_password" value="#!data!cgi::new_peer_password::value!#">
<input type="hidden" name="new_peer_bidirection" id="new_peer_bidirection" value="#!data!cgi::new_peer_bidirection::value!#">
<input type="hidden" name="new_peer_ping" id="new_peer_ping" value="#!data!cgi::new_peer_ping::value!#">
<input type="hidden" name="striker" id="striker" value="#!data!cgi::striker::value!#">
<input type="hidden" name="task" id="task" value="#!data!cgi::task::value!#">
<input type="hidden" name="save" id="save" value="#!data!cgi::save::value!#">
<input type="hidden" name="confirm" id="confirm" value="true">
</form>
</table>
<!-- end confirm-new-peer -->

@ -3,7 +3,7 @@
%define anvilgroup admin
Name: anvil
Version: 3.0
Release: 9%{?dist}
Release: 12%{?dist}
Summary: Alteeve Anvil! complete package.
License: GPLv2+
@ -38,6 +38,7 @@ Requires: perl-JSON
Requires: perl-Log-Journald
Requires: perl-Net-SSH2
Requires: perl-NetAddr-IP
Requires: perl-Sys-Syslog
Requires: perl-Time-HiRes
Requires: perl-XML-Simple
Requires: postgresql-contrib
@ -56,7 +57,7 @@ Common base libraries required for the Anvil! system.
%package striker
Summary: Alteeve's Anvil! Striker dashboard package
BuildRequires: httpd
Requires: httpd
Requires: anvil-core
Requires: httpd
Requires: nmap
@ -64,130 +65,133 @@ Requires: perl-CGI
Requires: postgresql-server
Requires: firefox
Requires: virt-manager
### Gnome Desktop group
Requires: abrt-desktop
Requires: at-spi2-atk
Requires: at-spi2-core
# Requires: avahi
# Requires: baobab
Requires: caribou
Requires: caribou-gtk2-module
Requires: caribou-gtk3-module
# Requires: cheese
# Requires: compat-cheese314
Requires: control-center
### Desktop stuff
Requires: aajohan-comfortaa-fonts
Requires: abattis-cantarell-fonts
Requires: adobe-source-han-sans-cn-fonts
Requires: adobe-source-han-sans-tw-fonts
Requires: adobe-source-han-serif-cn-fonts
Requires: adobe-source-han-serif-tw-fonts
Requires: adwaita-gtk2-theme
Requires: adwaita-icon-theme
Requires: alsa-plugins-pulseaudio
Requires: alsa-ucm
Requires: alsa-utils
Requires: awesome
Requires: dconf
# Requires: empathy
# Requires: eog
Requires: evince
Requires: evince-nautilus
Requires: file-roller
Requires: file-roller-nautilus
# Requires: firewall-config
# Requires: firstboot
# Requires: fprintd-pam
Requires: dconf-editor
Requires: dejavu-sans-fonts
Requires: dejavu-sans-mono-fonts
Requires: dejavu-serif-fonts
Requires: dwm
Requires: fedora-icon-theme
Requires: gdm
Requires: gedit
Requires: glib-networking
Requires: gnome-bluetooth
# Requires: gnome-boxes
Requires: glx-utils
Requires: gnu-free-mono-fonts
Requires: gnu-free-sans-fonts
Requires: gnu-free-serif-fonts
Requires: google-noto-emoji-color-fonts
Requires: google-noto-emoji-fonts
Requires: google-noto-sans-lisu-fonts
Requires: google-noto-sans-mandaic-fonts
Requires: google-noto-sans-meetei-mayek-fonts
Requires: google-noto-sans-sinhala-fonts
Requires: google-noto-sans-tagalog-fonts
Requires: google-noto-sans-tai-tham-fonts
Requires: google-noto-sans-tai-viet-fonts
Requires: gnome-screenshot
Requires: gnome-shell
Requires: gnome-terminal
Requires: gnome-autoar
Requires: gnome-backgrounds
Requires: gnome-calculator
Requires: gnome-characters
Requires: gnome-classic-session
Requires: gnome-clocks
# Requires: gnome-color-manager
# Requires: gnome-contacts
Requires: gnome-dictionary
Requires: gnome-color-manager
Requires: gnome-disk-utility
Requires: gnome-documents
Requires: gnome-documents-libs
Requires: gnome-font-viewer
# Requires: gnome-getting-started-docs
Requires: gnome-icon-theme
Requires: gnome-icon-theme-extras
Requires: gnome-icon-theme-symbolic
# Requires: gnome-initial-setup
Requires: gnome-packagekit
Requires: gnome-packagekit-updater
Requires: gnome-screenshot
Requires: gnome-session
Requires: gnome-session-xsession
Requires: gnome-settings-daemon
Requires: gnome-shell
Requires: gnome-logs
Requires: gnome-menus
Requires: gnome-shell-extension-alternate-tab
Requires: gnome-shell-extension-apps-menu
Requires: gnome-shell-extension-common
Requires: gnome-shell-extension-launch-new-instance
Requires: gnome-shell-extension-places-menu
Requires: gnome-shell-extension-window-list
Requires: gnome-software
Requires: gnome-system-log
Requires: gnome-system-monitor
Requires: gnome-terminal
Requires: gnome-terminal-nautilus
Requires: gnome-themes-standard
Requires: gnome-tweak-tool
Requires: gnome-user-docs
Requires: gnome-weather
Requires: gucharmap
Requires: gvfs-afc
Requires: gvfs-afp
Requires: gvfs-archive
Requires: gvfs-fuse
Requires: gvfs-goa
Requires: gvfs-gphoto2
Requires: gvfs-mtp
Requires: gvfs-smb
# Requires: initial-setup-gui
Requires: libcanberra-gtk2
Requires: libcanberra-gtk3
Requires: libproxy-mozjs
Requires: librsvg2
Requires: libsane-hpaio
Requires: metacity
Requires: mousetweaks
Requires: nautilus
# Requires: nautilus-sendto
# Requires: NetworkManager-libreswan-gnome
Requires: nm-connection-editor
Requires: orca
Requires: PackageKit-command-not-found
Requires: PackageKit-gtk3-module
# Requires: redhat-access-gui
# Requires: sane-backends-drivers-scanners
# Requires: seahorse
Requires: setroubleshoot
Requires: sushi
# Requires: totem
# Requires: totem-nautilus
Requires: vinagre
# Requires: vino
Requires: xdg-user-dirs-gtk
Requires: yelp
Requires: qgnomeplatform
Requires: xdg-desktop-portal-gtk
Requires: alacarte
Requires: dconf-editor
# Requires: dvgrab
Requires: fonts-tweak-tool
Requires: gconf-editor
Requires: gedit-plugins
Requires: gnome-shell-browser-plugin
Requires: gnote
Requires: libappindicator-gtk3
# Requires: seahorse-nautilus
# Requires: seahorse-sharing
# Requires: vim-X11
# Requires: xguest
### x11 group
Requires: glx-utils
Requires: initial-setup-gui
Requires: gnome-user-share
Requires: hyperv-daemons
Requires: i3
Requires: isdn4k-utils
Requires: jomolhari-fonts
Requires: julietaula-montserrat-fonts
Requires: khmeros-base-fonts
Requires: liberation-mono-fonts
Requires: liberation-sans-fonts
Requires: liberation-serif-fonts
Requires: lightdm-gtk
Requires: linux-atm
Requires: lohit-assamese-fonts
Requires: lohit-bengali-fonts
Requires: lohit-devanagari-fonts
Requires: lohit-gujarati-fonts
Requires: lohit-gurmukhi-fonts
Requires: lohit-kannada-fonts
Requires: lohit-odia-fonts
Requires: lohit-tamil-fonts
Requires: lohit-telugu-fonts
Requires: lrzsz
Requires: mesa-dri-drivers
Requires: metacity
Requires: minicom
Requires: naver-nanum-gothic-fonts
Requires: NetworkManager-adsl
Requires: NetworkManager-ppp
Requires: open-vm-tools-desktop
Requires: openbox
Requires: PackageKit-gstreamer-plugin
Requires: paktype-naskh-basic-fonts
Requires: paratype-pt-sans-fonts
Requires: plymouth-system-theme
Requires: ppp
Requires: qtile
Requires: ratpoison
Requires: rp-pppoe
Requires: setroubleshoot
Requires: sil-abyssinica-fonts
Requires: sil-mingzat-fonts
Requires: sil-nuosu-fonts
Requires: sil-padauk-fonts
Requires: smc-meera-fonts
Requires: spice-vdagent
Requires: xorg-x11-drivers
Requires: stix-fonts
Requires: tabish-eeyek-fonts
Requires: thai-scalable-waree-fonts
Requires: tigervnc-server
Requires: vlgothic-fonts
Requires: wvdial
Requires: xmonad-basic
Requires: xorg-x11-drv-ati
Requires: xorg-x11-drv-evdev
Requires: xorg-x11-drv-fbdev
Requires: xorg-x11-drv-intel
Requires: xorg-x11-drv-libinput
Requires: xorg-x11-drv-nouveau
Requires: xorg-x11-drv-openchrome
Requires: xorg-x11-drv-qxl
Requires: xorg-x11-drv-vesa
Requires: xorg-x11-drv-vmware
Requires: xorg-x11-drv-wacom
Requires: xorg-x11-server-Xorg
Requires: xorg-x11-utils
Requires: xorg-x11-xauth
Requires: xorg-x11-xinit
Requires: xvattr
Requires: tigervnc-server
# Requires: wayland-protocols-devel
Requires: xorg-x11-drv-keyboard
Requires: xorg-x11-drv-libinput
Requires: xorg-x11-drv-mouse
Requires: xorg-x11-drv-openchrome
# A Striker dashboard is not allowed to host servers or be a migration target.
# So the node and dr packages can not be installed.
@ -196,6 +200,7 @@ Conflicts: anvil-dr
%description striker
Web interface of the Striker dashboard for Alteeve Anvil! systems
NOTE: This installs and enables Gnome desktop.
%package node
Summary: Alteeve's Anvil! node package
@ -203,10 +208,10 @@ Requires: anvil-core
Requires: bridge-utils
Requires: drbd
Requires: drbd-bash-completion
Requires: drbd-kernel
Requires: drbd-utils
Requires: kernel-doc
Requires: kmod-drbd
### NOTE: Disabled only until we get drbd9 building on F28
#Requires: drbd-kernel
#Requires: kmod-drbd
Requires: libvirt
Requires: libvirt-daemon
Requires: libvirt-daemon-driver-qemu
@ -215,8 +220,7 @@ Requires: libvirt-docs
Requires: pacemaker
Requires: pcs
Requires: qemu-kvm
Requires: qemu-kvm-common
Requires: qemu-kvm-tools
Requires: qemu-kvm-core
Requires: virt-install
# A node is allowed to host servers and be a live migration target. It is not
# allowed to host a database or be a DR host.
@ -238,18 +242,17 @@ Requires: anvil-core
Requires: bridge-utils
Requires: drbd
Requires: drbd-bash-completion
Requires: drbd-kernel
Requires: drbd-utils
Requires: kernel-doc
Requires: kmod-drbd
### NOTE: Disabled only until we get drbd9 building on F28
#Requires: drbd-kernel
#Requires: kmod-drbd
Requires: libvirt
Requires: libvirt-daemon
Requires: libvirt-daemon-driver-qemu
Requires: libvirt-daemon-kvm
Requires: libvirt-docs
Requires: qemu-kvm
Requires: qemu-kvm-common
Requires: qemu-kvm-tools
Requires: qemu-kvm-core
Requires: virt-install
# A DR host is not allowed to be a live-migration target or host a database.
Conflicts: anvil-striker
@ -309,15 +312,25 @@ echo "Enabling and starting apache."
systemctl enable httpd.service
systemctl start httpd.service
restorecon -rv /%{_localstatedir}/www
if ! $(ls -l /etc/systemd/system/default.target | grep -q graphical);
then
echo "Seting graphical interface as default on boot."
systemctl set-default graphical.target
systemctl enable gdm.service
fi
echo "Preparing the database"
anvil-prep-database
anvil-update-states
# Open access for Striker. The database will be opened after initial setup.
echo "Opening the web and postgresql ports."
firewall-cmd --zone=public --add-service=http
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --zone=public --add-service=postgresql
firewall-cmd --zone=public --add-service=postgresql --permanent
firewall-cmd --add-service=http
firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https
firewall-cmd --add-service=https --permanent
firewall-cmd --add-service=postgresql
firewall-cmd --add-service=postgresql --permanent
### Remove stuff
%postun core
@ -364,6 +377,13 @@ systemctl stop postgresql.service
%changelog
* Tue Jul 24 2018 Madison Kelly <mkelly@alteeve.ca> 3.0-11
- Added a check to enable the graphical target on boot.
- Updated anvil-striker dependency list to pull in gnome.
* Tue Jul 24 2018 Madison Kelly <mkelly@alteeve.ca> 3.0-10
- Began switching to Fedora 28 (as an analog for EL8)
* Fri Jul 13 2018 Madison Kelly <mkelly@alteeve.ca> 3.0-9
- Updated the source tarball.

@ -29,7 +29,7 @@ Author: Madison Kelly <mkelly@alteeve.ca>
<key name="message_0005">There was an unknown error while connecting to: [#!variable!target!#]. The error was: [#!variable!error!#]</key>
<key name="message_0006">We were unable to log in to: [#!variable!target!#]. Please check that the password is correct or that passwordless SSH is configured properly.</key>
<key name="message_0007">An SSH session was successfully opened to: [#!variable!target!#].</key>
<key name="message_0008">There was a problem establishing an SSH channel to the target: [#!variable!target!#] for shell call: [#!variable!shell_call!#]</key>
<key name="message_0008">There was a problem establishing an SSH channel to the target: [#!variable!target!#].</key>
<key name="message_0009">The SSH session to: [#!variable!target!#] was successfully closed.</key>
<key name="message_0010">The SSH session to: [#!variable!target!#] was closed because 'no_cache' was set and there was an open SSH connection.</key>
<key name="message_0011">Wrote the system UUID to the file: [#!variable!file!#] to enable the web based tools to read this system's UUID.</key>
@ -284,7 +284,7 @@ The database connection error was:
<key name="log_0183">The user: [#!variable!user!#] logged in successfully.</key>
<key name="log_0184">Theew was a failed login attempt from: [#!variable!user_agent!#], trying to log in as: [#!variable!user!#]. log in rejected.</key>
<key name="log_0185"><![CDATA[<unknown>]]></key> <!-- Used in some cases when a variable isn't known -->
<key name="log_0186"><![CDATA[<supressed>]]></key> <!-- Used in some cases when a variable isn't known -->
<key name="log_0186"><![CDATA[<suppressed>]]></key> <!-- Used in some cases when a variable isn't known -->
<!-- Test words. Do NOT change unless you update 't/Words.t' or tests will needlessly fail. -->
<key name="t_0000">Test</key>
@ -400,7 +400,11 @@ Here we will inject 't_0006', which injects 't_0001' which has a variable: [#!st
<key name="striker_0074">When checked, the peer will be configure to add the local database as a peer at the same time that we add it to this system.</key>
<key name="striker_0075">Access</key>
<key name="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>
<key name="striker_0077"><![CDATA[If the '#!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>
<key name="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>
<key name="striker_0078">Please verify</key>
<key name="striker_0079">Peer</key>
<key name="striker_0080">Ping before connect</key>
<key name="striker_0081">The test connection was successful. When saved, the resynchronization process might take a few minutes, and cause maintenance periods where some features are offline until complete.</key>
<!-- Strings used by jobs -->
<key name="job_0001">Configure Network</key>
@ -410,6 +414,8 @@ Here we will inject 't_0006', which injects 't_0001' which has a variable: [#!st
<key name="striker_warning_0001">The IP address will change. You will need to reconnect after applying these changes.</key>
<key name="striker_warning_0002">The access information appears to not be valid.</key>
<key name="striker_warning_0003">Test access to the peer (using SSH) failed. There may be details in the log file.</key>
<key name="striker_warning_0004">Accessing the peer over SSH worked, but a test connection to the database failed.</key>
<key name="striker_warning_0005">There was a problem reading the peer's UUID. Read: [#!variable!uuid!#], which appears to be invalid.</key>
<!-- Errors -->
<key name="error_0001">There are not enough network interfaces on this machine. You have: [#!variable!interface_count!#] interface(s), and you need at least: [#!variable!required_interfaces_for_single!#] interfaces to connect to the requested networks (one for Back-Channel and one for each Internet-Facing network).</key>
@ -443,6 +449,11 @@ Here we will inject 't_0006', which injects 't_0001' which has a variable: [#!st
<key name="error_0029"><![CDATA[Failed to find the template: [<span class="code">#!variable!template!#</span>] in the template file: [<span class="code">#!variable!file!#</span>].]]></key>
<key name="error_0030"><![CDATA[Failed to process the template: [<span class="code">#!variable!template!#</span>] in the template file: [<span class="code">#!variable!file!#</span>]. Details of the problem should be in: [<span class="code">#!data!sys::log_file!#</span>].]]></key>
<!-- These are units, words and so on used when displaying information. -->
<key name="unit_0001">Yes</key>
<key name="unit_0002">No</key>
<!-- TODO: Merge these into 'unit' -->
<!-- These are works and strings used by javascript/jqery -->
<key name="js_0001">Up</key>
<key name="js_0002">Down</key>

@ -128,7 +128,7 @@ sub update_network
{
### Set some fake values.
# Speed is "as fast as possible", so we'll record 100 Gbps, but that is really kind of arbitrary.
$speed = 100000 if not $speed;
$speed = 100000 if ((not $speed) or ($speed eq "-1"));
$duplex = "full" if not $duplex;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
speed => $speed,

Loading…
Cancel
Save