* Continued work on the sync page.

* Updated rpm spec to bring in gnome when installing anvil-string.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 7 years ago
parent ee649ff2dd
commit 2d88502f6a
  1. 34
      cgi-bin/home
  2. 38
      html/skins/alteeve/striker.html
  3. 153
      rpm/SPECS/anvil.spec
  4. 5
      share/words.xml

@ -270,10 +270,11 @@ sub process_sync_page
#remove_sync_peer($anvil); #remove_sync_peer($anvil);
} }
my $host_uuid = $anvil->Get->host_uuid;
$anvil->System->get_ips(); $anvil->System->get_ips();
# We'll want to show the user way to access the local machine. For that, we'll loop through our own IPs. # We'll want to show the user way to access the local machine. For that, we'll loop through our own IPs.
my $table = ""; my $inbound_table = "";
foreach my $interface (sort {$a cmp $b} keys %{$anvil->data->{sys}{network}{interface}}) foreach my $interface (sort {$a cmp $b} keys %{$anvil->data->{sys}{network}{interface}})
{ {
next if (($interface !~ /^bcn/) && ($interface !~ /^ifn/)); next if (($interface !~ /^bcn/) && ($interface !~ /^ifn/));
@ -281,19 +282,42 @@ sub process_sync_page
next if not $anvil->Validate->is_subnet({subnet => $anvil->data->{sys}{network}{interface}{$interface}{subnet}}); next if not $anvil->Validate->is_subnet({subnet => $anvil->data->{sys}{network}{interface}{$interface}{subnet}});
my ($network_type, $network_number) = ($interface =~ /^(.*?)(\d+)_/); my ($network_type, $network_number) = ($interface =~ /^(.*?)(\d+)_/);
my $host_uuid = $anvil->Get->host_uuid;
my $database_user = $anvil->data->{database}{$host_uuid}{name}; my $database_user = $anvil->data->{database}{$host_uuid}{name};
my $database_port = $anvil->data->{database}{$host_uuid}{port}; my $database_port = $anvil->data->{database}{$host_uuid}{port};
my $network_key = $network_type eq "bcn" ? "striker_0018" : "striker_0022"; my $network_key = $network_type eq "bcn" ? "striker_0018" : "striker_0022";
my $say_network = $anvil->Words->string({key => $network_key, variables => { number => $network_number }}); my $say_network = $anvil->Words->string({key => $network_key, variables => { number => $network_number }});
$table .= $anvil->Template->get({file => "striker.html", name => "striker-sync-inbound", variables => { $inbound_table .= $anvil->Template->get({file => "striker.html", name => "striker-sync-inbound", variables => {
access => $database_user."\@".$anvil->data->{sys}{network}{interface}{$interface}{ip}.":".$database_port, access => $database_user."\@".$anvil->data->{sys}{network}{interface}{$interface}{ip}.":".$database_port,
note => $anvil->Words->string({key => "striker_0066", variables => { network => $say_network }}), note => $say_network,
}});
}
# This needs to be loaded into a hash by target, the sorted. We'll build the table on sort.
my $peer_table = "";
foreach my $uuid (keys %{$anvil->data->{database}})
{
next if $uuid eq $host_uuid;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { uuid => $uuid }});
my $host = $anvil->data->{database}{$uuid}{host} ? $anvil->data->{database}{$uuid}{host} : ""; # This should fail
my $port = $anvil->data->{database}{$uuid}{port} ? $anvil->data->{database}{$uuid}{port} : 5432;
my $name = $anvil->data->{database}{$uuid}{name} ? $anvil->data->{database}{$uuid}{name} : $anvil->data->{sys}{database}{name};
my $user = $anvil->data->{database}{$uuid}{user} ? $anvil->data->{database}{$uuid}{user} : $anvil->data->{sys}{database}{user};
my $password = $anvil->data->{database}{$uuid}{password} ? $anvil->data->{database}{$uuid}{password} : "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
host => $host,
port => $port,
name => $name,
user => $user,
password => $anvil->Log->secure ? $password : "#!string!log_0186!#",
}}); }});
} }
# Build the menu. # Build the menu.
$anvil->data->{form}{body} = $anvil->Template->get({file => "striker.html", name => "striker-sync", variables => { table => $table }}); $anvil->data->{form}{body} = $anvil->Template->get({file => "striker.html", name => "striker-sync", variables => {
inbound_table => $inbound_table,
peer_table => $peer_table,
}});
return(0); return(0);
} }

@ -109,19 +109,44 @@
<!-- start striker-sync --> <!-- start striker-sync -->
<table align="center"> <table align="center">
<tr> <tr>
<td> <td class="menu_title">
Add or remove Striker peers. Add or remove Striker peers.
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td class="menu_details">
Peer dashboards are Striker machines whose databases this Striker will use to record data. If this machine ever needs to be replaced, or goes offline for a period of time, it will automatically pull the data back from any peers that it is missing. Peer dashboards are Striker machines whose databases this Striker will use to record data. If this machine ever needs to be replaced, or goes offline for a period of time, it will automatically pull the data back from any peers that it is missing.
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<table> &nbsp;
#!variable!table!# </td>
</tr>
<tr>
<td align="center">
<table class="data_table">
<tr>
<td class="column_header">
#!string!header_0007!#
</td>
<td colspan="3" class="column_header">
#!string!header_0008!#
</td>
</tr>
#!variable!inbound_table!#
<tr>
<td class="column_header">
#!string!header_0009!#
</td>
<td class="column_header">
#!string!header_0010!#
</td>
<td colspan="2" class="column_header">
&nbsp;
</td>
</tr>
#!variable!peer_table!#
</table> </table>
</td> </td>
</tr> </tr>
@ -137,7 +162,10 @@
#!variable!ping!# #!variable!ping!#
</td> </td>
<td> <td>
#!variable!button!# #!variable!save_button!#
</td>
<td>
#!variable!delete_button!#
</td> </td>
</tr> </tr>
<!-- end striker-sync-entry --> <!-- end striker-sync-entry -->

@ -1,7 +1,9 @@
%define debug_package %{nil} %define debug_package %{nil}
%define anviluser admin
%define anvilgroup admin
Name: anvil Name: anvil
Version: 3.0 Version: 3.0
Release: 3%{?dist} Release: 4%{?dist}
Summary: Alteeve Anvil! complete package. Summary: Alteeve Anvil! complete package.
License: GPLv2+ License: GPLv2+
@ -60,6 +62,133 @@ Requires: httpd
Requires: nmap Requires: nmap
Requires: perl-CGI Requires: perl-CGI
Requires: postgresql-server 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
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: gdm
Requires: gedit
Requires: glib-networking
Requires: gnome-bluetooth
# Requires: gnome-boxes
Requires: gnome-calculator
Requires: gnome-classic-session
Requires: gnome-clocks
# Requires: gnome-color-manager
# Requires: gnome-contacts
Requires: gnome-dictionary
Requires: gnome-disk-utility
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-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: mesa-dri-drivers
Requires: plymouth-system-theme
Requires: spice-vdagent
Requires: xorg-x11-drivers
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. # A Striker dashboard is not allowed to host servers or be a migration target.
# So the node and dr packages can not be installed. # So the node and dr packages can not be installed.
Conflicts: anvil-node Conflicts: anvil-node
@ -83,7 +212,7 @@ Requires: libvirt-daemon
Requires: libvirt-daemon-driver-qemu Requires: libvirt-daemon-driver-qemu
Requires: libvirt-daemon-kvm Requires: libvirt-daemon-kvm
Requires: libvirt-docs Requires: libvirt-docs
Requires: pacemaker Requires: pacemaker2
Requires: pcs Requires: pcs
Requires: qemu-kvm Requires: qemu-kvm
Requires: qemu-kvm-common Requires: qemu-kvm-common
@ -156,11 +285,18 @@ cp -R -p tools/* %{buildroot}/%{_sbindir}
cp -R -p anvil.conf %{buildroot}/%{_sysconfdir}/anvil/ cp -R -p anvil.conf %{buildroot}/%{_sysconfdir}/anvil/
cp -R -p anvil.version %{buildroot}/%{_sysconfdir}/anvil/ cp -R -p anvil.version %{buildroot}/%{_sysconfdir}/anvil/
mv %{buildroot}/%{_sbindir}/anvil.sql %{buildroot}/%{_datadir}/anvil.sql mv %{buildroot}/%{_sbindir}/anvil.sql %{buildroot}/%{_datadir}/anvil.sql
mv %{buildroot}/%{_sbindir}/snmp-models.json %{buildroot}/%{_sysconfdir}/anvil/snmp-models.json
sed -i "1s/^.*$/%{version}/" %{buildroot}/%{_sysconfdir}/anvil/anvil.version
%pre
getent group %{anvilgroup} >/dev/null || groupadd -r %{anvilgroup}
getent passwd %{anviluser} >/dev/null || useradd --create-home \
--gid %{anvilgroup} --comment "Anvil! user account" %{anviluser}
%post %post
# TODO: Remove this!! This is only for use during development, all SELinux
# issues must be resolved before final release!
sed -i.anvil 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
sed -i "1s/^.*$/%{version}/" %{buildroot}/%{_sysconfdir}/anvil/anvil.version
restorecon -rv %{buildroot}/%{_localstatedir}/www restorecon -rv %{buildroot}/%{_localstatedir}/www
%post striker %post striker
@ -180,13 +316,9 @@ firewall-cmd --zone=public --add-service=postgresql --permanent
%{_sbindir}/* %{_sbindir}/*
%{_sysconfdir}/anvil/anvil.version %{_sysconfdir}/anvil/anvil.version
%{_datadir}/perl5/* %{_datadir}/perl5/*
# TODO: Remove this!! This is only for use during development, all SELinux
# issues must be resolved before final release!
sed -i.anvil 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
%files striker %files striker
%attr(0775, apache, root) %{_localstatedir}/www/*/* %attr(0775, apache, root) %{_localstatedir}/www/*/*
%{_sysconfdir}/anvil/snmp-models.json
%ghost %{_sysconfdir}/anvil/snmp-vendors.txt %ghost %{_sysconfdir}/anvil/snmp-vendors.txt
%files node %files node
@ -197,6 +329,11 @@ sed -i.anvil 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
%changelog %changelog
* Tue Jul 10 2018 Madison Kelly <mkelly@alteeve.ca> 3.0-4
- Added a check for and creation of the 'admin' user/group.
- Updated the pacemaker dependency to 'pacemaker2'.
- Added packages for anvil-striker to pull in Gnome.
* Sun Mar 18 2018 Madison Kelly <mkelly@alteeve.ca> 3.0-3 * Sun Mar 18 2018 Madison Kelly <mkelly@alteeve.ca> 3.0-3
- Changed the 'Obsoletes' to 'Conflicts'. - Changed the 'Obsoletes' to 'Conflicts'.

@ -317,6 +317,11 @@ Here we will inject 't_0006', which injects 't_0001' which has a variable: [#!st
<key name="header_0004">State</key> <key name="header_0004">State</key>
<key name="header_0005">Speed</key> <key name="header_0005">Speed</key>
<key name="header_0006">Up Order</key> <key name="header_0006">Up Order</key>
<key name="header_0007">Inbound Connections</key>
<key name="header_0008">Network</key>
<key name="header_0009">Peer Connection (user@host:port)</key>
<key name="header_0010">Ping</key>
<key name="header_0011"></key>
<!-- General strings shown in Striker --> <!-- General strings shown in Striker -->
<key name="striker_0001">Welcome! Lets setup your #!string!brand_0003!# dashboard...</key> <key name="striker_0001">Welcome! Lets setup your #!string!brand_0003!# dashboard...</key>

Loading…
Cancel
Save