diff -urN smeserver-geneweb-2.1.old/createlinks smeserver-geneweb-2.1/createlinks --- smeserver-geneweb-2.1.old/createlinks 2007-04-07 17:40:39.000000000 +0400 +++ smeserver-geneweb-2.1/createlinks 2019-04-03 00:11:38.000000000 +0400 @@ -7,20 +7,27 @@ # Panel Link panel_link('geneweb', 'manager'); -my $gwd = "/opt/geneweb/gw/gwd"; +my $gw = "/opt/geneweb/gw/gw"; for my $event (qw( geneweb-modify )) { -templates2events("/opt/geneweb/gw/gw/only.txt", +templates2events("$gw/only.txt", qw(geneweb-modify bootstrap-console-save console-save)); - safe_symlink("sigusr1", - "root/etc/e-smith/events/$event/service2adjust/httpd-e-smith"); +templates2events("/etc/rc.d/init.d/gwd", + qw(geneweb-modify bootstrap-console-save console-save)); + +} +for my $event (qw(geneweb-modify)) +{ + safe_symlink("sigusr1", + "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); safe_symlink("restart", - "root/etc/e-smith/events/$event/service2adjust/gwd"); + "root/etc/e-smith/events/$event/services2adjust/geneweb"); + } for my $event (qw(post-upgrade)) @@ -28,6 +35,3 @@ event_link("geneweb-restart", $event, "05"); } -service_link_enhanced("gwd", "S96", "7"); -service_link_enhanced("gwd", "K47", "6"); -service_link_enhanced("gwd", "K47", "0"); diff -urN smeserver-geneweb-2.1.old/root/etc/e-smith/db/configuration/defaults/geneweb/DBDir smeserver-geneweb-2.1/root/etc/e-smith/db/configuration/defaults/geneweb/DBDir --- smeserver-geneweb-2.1.old/root/etc/e-smith/db/configuration/defaults/geneweb/DBDir 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-geneweb-2.1/root/etc/e-smith/db/configuration/defaults/geneweb/DBDir 2019-04-03 00:13:09.000000000 +0400 @@ -0,0 +1,2 @@ +/opt/geneweb/bases + diff -urN smeserver-geneweb-2.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/geneweb smeserver-geneweb-2.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/geneweb --- smeserver-geneweb-2.1.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/geneweb 2007-08-05 16:48:59.000000000 +0400 +++ smeserver-geneweb-2.1/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/geneweb 2019-04-03 00:16:01.000000000 +0400 @@ -9,7 +9,7 @@ LABEL_ONLY_STATUS Current assigned Geneweb 'only' IP: - + DESC_STATE_ADMIN_BUTTON @@ -72,5 +72,31 @@ ]]> - + + + ERR_DIR_NOT_EXIST + This directory does not exist. + + + + LABEL_DBDIR_STATUS + Current assigned Geneweb Database(s) directory: + + + ERR_DIR_NOT_EXIST + Directory not found. + + + DESC_GENEWEB_BASE_DIR_DESCRIPTION + This directory must exist on server and be writeable for Geneweb. (geneweb:geneweb 770) + + + LABEL_GENEWEB_BASE_DIR + New directory for Geneweb database(s). : + + + NO_CHANGE + No change... no update ! + + diff -urN smeserver-geneweb-2.1.old/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/geneweb smeserver-geneweb-2.1/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/geneweb --- smeserver-geneweb-2.1.old/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/geneweb 2019-04-02 23:11:43.000000000 +0400 +++ smeserver-geneweb-2.1/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/geneweb 2019-04-03 00:17:21.000000000 +0400 @@ -9,11 +9,11 @@ LABEL_ONLY_STATUS IP 'unique' assignée actuellement à Geneweb: - + DESC_STATE_ADMIN_BUTTON Change IP and Administer ]]> - + ERROR_UPDATING @@ -49,5 +49,27 @@ GENEWEB_ADMINACCESS_STATUS_DESCRIPTION
  • Access to port 2316 provides the administrative interface for Geneweb @ http://YourGenewebServer:2316
  • Geneweb Administration can only be accessed by the IP assigned in /opt/geneweb/gw/gw/only.txt
  • This panel allows you to assign a valid LAN IP from which you wish to administer Geneweb on your LAN.
  • Browse to http://YourGenewebServer:2316
    -Geneweb will display the IP to set for administrative access from that client.



    ]]>
    - + + + LABEL_DBDIR_STATUS + Répertoire de base de donnée(s) assigné actuellement à Geneweb: + + + ERR_DIR_NOT_EXIST + Répertoire inexistant sur le serveur. + + + DESC_GENEWEB_BASE_DIR_DESCRIPTION + Ce répertoire doit exister sur le serveur et être accessible en écriture par Geneweb. (geneweb:geneweb 770) + + + LABEL_GENEWEB_BASE_DIR + Nouveau répertoire contenant le(s) base(s) de données de Geneweb. : + + + NO_CHANGE + Aucun changement... pas de mis à jour ! + + + diff -urN smeserver-geneweb-2.1.old/root/etc/e-smith/templates/etc/rc.d/init.d/gwd/gwd_ALL smeserver-geneweb-2.1/root/etc/e-smith/templates/etc/rc.d/init.d/gwd/gwd_ALL --- smeserver-geneweb-2.1.old/root/etc/e-smith/templates/etc/rc.d/init.d/gwd/gwd_ALL 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-geneweb-2.1/root/etc/e-smith/templates/etc/rc.d/init.d/gwd/gwd_ALL 2019-04-03 00:19:07.000000000 +0400 @@ -0,0 +1,64 @@ +#!/bin/sh +# chkconfig: 345 99 01 +# +# gwd: Starts the genealogy Server +# +# Version: @(#) /etc/rc.d/init.d/gwd 1.0 +# +# description: Starts and stops the genealogy Server at boot time and shutdown. +# +# processname: gwd +# hide: true + +# Source function library. +if [ -f /etc/rc.d/init.d/functions ]; then + . /etc/rc.d/init.d/functions +fi + +{ + my $db_dir = ${'geneweb'}{'DBDir'} || "/opt/geneweb/bases"; + $OUT .= <> /var/log/gwsetup.log + touch /var/lock/subsys/gwd +\} + +stop() \{ + echo -n "Shutting down GeneWeb Services: " + killproc $HD/gwd + killproc $HD/gwsetup + rm -f /var/lock/subsys/gwd + echo +\} + +restart() \{ + echo -n "Restarting GeneWeb Services: " + stop + sleep 1 + start +\} + +# See how we were called. +cd $BD + +case "$1" in + start|stop|restart) + $1 + ;; + status) + status gwd + ;; + *) + echo "*** Usage: gwd \{start|stop|status|restart\}" + exit 1 +esac + +exit 0 diff -urN smeserver-geneweb-2.1.old/root/etc/e-smith/templates/etc/rc.d/init.d/masq/45AllowGeneWeb smeserver-geneweb-2.1/root/etc/e-smith/templates/etc/rc.d/init.d/masq/45AllowGeneWeb --- smeserver-geneweb-2.1.old/root/etc/e-smith/templates/etc/rc.d/init.d/masq/45AllowGeneWeb 2007-03-05 00:27:09.000000000 +0400 +++ smeserver-geneweb-2.1/root/etc/e-smith/templates/etc/rc.d/init.d/masq/45AllowGeneWeb 2019-04-03 00:20:11.000000000 +0400 @@ -4,10 +4,7 @@ my $status = ${'httpd-e-smith'}{status} || "disabled"; my $access = ${'httpd-e-smith'}{access} || "public"; - #$OUT = allow_tcp_in(2316, - # ($status eq "enabled") && ($access eq "public")); - $OUT = allow_tcp_in(2317, - ($status eq "enabled") && ($access eq "public")); + ($status eq "enabled") && ($access eq "public")); } diff -urN smeserver-geneweb-2.1.old/root/etc/e-smith/templates.metadata/etc/rc.d/init.d/gwd smeserver-geneweb-2.1/root/etc/e-smith/templates.metadata/etc/rc.d/init.d/gwd --- smeserver-geneweb-2.1.old/root/etc/e-smith/templates.metadata/etc/rc.d/init.d/gwd 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-geneweb-2.1/root/etc/e-smith/templates.metadata/etc/rc.d/init.d/gwd 2019-04-03 00:21:56.000000000 +0400 @@ -0,0 +1,3 @@ +UID="root" +GID="root" +PERMS=0751 diff -urN smeserver-geneweb-2.1.old/root/etc/e-smith/templates.metadata/opt/geneweb/gw/gw/only.txt smeserver-geneweb-2.1/root/etc/e-smith/templates.metadata/opt/geneweb/gw/gw/only.txt --- smeserver-geneweb-2.1.old/root/etc/e-smith/templates.metadata/opt/geneweb/gw/gw/only.txt 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-geneweb-2.1/root/etc/e-smith/templates.metadata/opt/geneweb/gw/gw/only.txt 2019-04-03 00:23:24.000000000 +0400 @@ -0,0 +1 @@ +PERMS=0750 diff -urN smeserver-geneweb-2.1.old/root/etc/e-smith/web/functions/geneweb smeserver-geneweb-2.1/root/etc/e-smith/web/functions/geneweb --- smeserver-geneweb-2.1.old/root/etc/e-smith/web/functions/geneweb 2007-08-05 19:29:43.000000000 +0400 +++ smeserver-geneweb-2.1/root/etc/e-smith/web/functions/geneweb 2019-04-03 00:27:46.000000000 +0400 @@ -78,6 +78,13 @@ + + + + + + + + DESC_GENEWEB_BASE_DIR_DESCRIPTION + + + + + + diff -urN smeserver-geneweb-2.1.old/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/geneweb.pm smeserver-geneweb-2.1/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/geneweb.pm --- smeserver-geneweb-2.1.old/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/geneweb.pm 2019-04-02 23:11:43.000000000 +0400 +++ smeserver-geneweb-2.1/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/geneweb.pm 2019-04-03 00:35:30.000000000 +0400 @@ -22,8 +22,10 @@ get_prop get_value get_only + get_dbdir change_settings must_be_local + must_exist ); our $VERSION = sprintf '%d.%03d', q$Revision: 0.09 $ =~ /: (\d+).(\d+)/; @@ -134,6 +136,16 @@ { return $db->get_prop("geneweb", "only"); } + +=head2 get_dbdir + +method to retrieve the value of /opt/geneweb/bases or other location for the form +=cut + +sub get_dbdir +{ + return $db->get_prop("geneweb", "DBDir"); +} =head2 change_settings @@ -144,7 +156,19 @@ { my $self = shift; my $q = $self->{'cgi'}; - $db->set_prop("geneweb", "only", $q->param("geneweb_only") || ''); + my $n_gw_ip = $q->param("geneweb_only") || ''; + my $n_gw_dbdir = $q->param("geneweb_dbdir") || ''; + if (!($n_gw_ip || $n_gw_dbdir)) { + return $self->success("NO_CHANGE") + } + my $gw_ip = get_only(); + my $gw_dbdir = get_dbdir(); + if (($n_gw_ip eq $gw_ip) && ($n_gw_dbdir eq $gw_dbdir)) { + return $self->success("NO_CHANGE") + } + if ($n_gw_ip) { $db->set_prop("geneweb", "only", $n_gw_ip) } + if ($n_gw_dbdir) { $db->set_prop("geneweb", "DBDir", $n_gw_dbdir) } + unless ( system ( "/sbin/e-smith/signal-event", "geneweb-modify" ) == 0 ) { $self->error("ERROR_UPDATING"); @@ -163,24 +187,45 @@ { my $self = shift; my $q = $self->{cgi}; - my $gw_ip = $q->param("geneweb_only"); + my $gw_ip = $q->param("geneweb_only" || ''); + if (!($gw_ip)) { return 'OK'} + if (!( $gw_ip =~ /^((([01]?[0-9]{1,2}|[2][0-5]{1,2}).){3}([01]?[0-9]{1,2}|[2][0-5]{1,2}))$/ )) + { + return 'NOT_VALID_IP'; + } # Make sure that the IP is indeed local. my $ndb = esmith::NetworksDB->open_ro; my @local_list = $ndb->local_access_spec; foreach my $spec (@local_list) { - my $gw_ip = $db->get_prop("geneweb", "only", $q->param("geneweb_only") || ''); - if ($gw_ip) - { - if (Net::IPv4Addr::ipv4_in_network($spec, $gw_ip)) - { - return 'OK'; - } - } - } + if (Net::IPv4Addr::ipv4_in_network($spec, $gw_ip)) + { + return 'OK'; + } # Not OK. The IP is not on any of our local networks. return 'ERR_IP_NOT_LOCAL'; } + +=head2 valid_base_directory + +subroutine to validate base directory. +=cut + +sub must_exist +{ + my $self = shift; + my $q = $self->{cgi}; + my $gw_dbdir = $q->param("geneweb_dbdir") || ''; + if ($gw_dbdir) { + if (! -d "$gw_dbdir") { return 'ERR_DIR_NOT_EXIST' } + # system("su geneweb -c 'touch $gw_dbdir/toto'") == 0 + # or return 'DIR_NOT_WRITEABLE'; + # system("su geneweb -c 'rm -f $gw_dbdir/toto'") + # return 'DIR_EXIST_AND_WRITEABLE'; + } + return 'OK'; +} + 1;