1 |
diff -urN smeserver-geneweb-2.3.0.old/createlinks smeserver-geneweb-2.3.0/createlinks |
2 |
--- smeserver-geneweb-2.3.0.old/createlinks 2022-07-12 21:03:41.000000000 +0400 |
3 |
+++ smeserver-geneweb-2.3.0/createlinks 2022-07-14 14:24:33.187000000 +0400 |
4 |
@@ -36,4 +36,23 @@ |
5 |
templates2events("/etc/systemd/system-preset/49-koozali.preset", $event); |
6 |
event_link("systemd-default", $event, "06"); |
7 |
event_link("restart-smanager","smeserver-geneweb-update","10"); |
8 |
+ |
9 |
#-------------------------------------------------- |
10 |
+# for smeserver-manager |
11 |
+#-------------------------------------------------- |
12 |
+my $event= "smeserver-geneweb-update"; |
13 |
+safe_symlink('restart', "root/etc/e-smith/events/$event/services2adjust/smanager"); |
14 |
+event_link('navigation2-conf', "$event", '80'); |
15 |
+event_link('routes2-conf', "$event", '80'); |
16 |
+event_link('locales2-conf', "$event", '80'); |
17 |
+ |
18 |
+#-------------------------------------------------- |
19 |
+# for backup |
20 |
+#-------------------------------------------------- |
21 |
+use esmith::Build::Backup qw(:all); |
22 |
+backup_includes("smeserver-geneweb", qw( |
23 |
+/opt/geneweb/bases/ |
24 |
+)); |
25 |
+backup_excludes("smeserver-geneweb", qw( |
26 |
+/opt/geneweb/bases/README.txt |
27 |
+)); |
28 |
diff -urN smeserver-geneweb-2.3.0.old/root/etc/e-smith/db/configuration/migrate/20geneweb smeserver-geneweb-2.3.0/root/etc/e-smith/db/configuration/migrate/20geneweb |
29 |
--- smeserver-geneweb-2.3.0.old/root/etc/e-smith/db/configuration/migrate/20geneweb 2022-07-12 21:03:41.000000000 +0400 |
30 |
+++ smeserver-geneweb-2.3.0/root/etc/e-smith/db/configuration/migrate/20geneweb 2022-07-12 22:07:37.217000000 +0400 |
31 |
@@ -1,35 +1,27 @@ |
32 |
-# create status and access for geneweb and gwsetup if not existing |
33 |
-# set domain if empty |
34 |
+{ |
35 |
|
36 |
-my $rec; |
37 |
+# migrate of geneweb, gwsetup configuration |
38 |
+my ($rec, $ip, $ip2); |
39 |
|
40 |
for my $service ( qw( geneweb gwsetup ) ) { |
41 |
if ( $rec = $DB->get($service) ) { |
42 |
- if ( ! $rec->prop('status') ) { |
43 |
- $rec->set_prop('status', 'disabled'); |
44 |
- } |
45 |
- if ( ! $rec->prop('access') ) { |
46 |
- $rec->set_prop('access', 'private'); |
47 |
- } |
48 |
- if ( ! $rec->prop('domain') ) { |
49 |
- $rec->set_prop('domain', $service . '.' . |
50 |
- ($DB->get('DomainName')->value() || '')); |
51 |
- } |
52 |
# change TCPPort attributes to TcpPort |
53 |
if ( $rec->prop('TCPPort') ) { |
54 |
- $rec->set_prop('TcpPort', ($DB->get('TCPPort')->value() || '')); |
55 |
- $DB->delete_prop($service,'TCPPort'); |
56 |
+ $rec->set_prop('TcpPort', $rec->prop('TCPPort')); |
57 |
+ $rec->delete_prop('TCPPort'); |
58 |
} |
59 |
+ $ip = ($rec->prop('only') || '') if ($service eq 'geneweb'); |
60 |
+ $ip2 = ($rec->prop('only') || '') if ($service eq 'gwsetup'); |
61 |
} |
62 |
} |
63 |
|
64 |
-# move only IP from geneweb to gwsetup if existing |
65 |
+# move 'only' from geneweb to gwsetup if existing |
66 |
|
67 |
-my $ip = $DB->get_prop('geneweb', 'only'); |
68 |
-my $ip2 = $DB->get_prop('gwsetup', 'only'); |
69 |
+return unless $ip; |
70 |
|
71 |
-if ( $ip and ! $ip2 ) { |
72 |
- $DB->delete_prop('geneweb','only'); |
73 |
- ($DB->get('gwsetup'))->set_prop('only', $ip); |
74 |
-} |
75 |
+$rec = $DB->get('geneweb'); |
76 |
+rec->delete_prop('only') if $ip; |
77 |
+ |
78 |
+$DB->set_prop('gwsetup', 'only', "$ip") unless $ip2; |
79 |
|
80 |
+} |
81 |
diff -urN smeserver-geneweb-2.3.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86GwsetupAlias smeserver-geneweb-2.3.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86GwsetupAlias |
82 |
--- smeserver-geneweb-2.3.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86GwsetupAlias 2020-11-05 20:15:06.000000000 +0400 |
83 |
+++ smeserver-geneweb-2.3.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86GwsetupAlias 2022-07-14 13:53:17.889000000 +0400 |
84 |
@@ -1,36 +1,38 @@ |
85 |
{ |
86 |
-# gwsetup ( verify settings!) |
87 |
+# gwsetup (geneweb) |
88 |
my $status = $gwsetup{'status'} || 'disabled'; |
89 |
|
90 |
if ($status eq 'enabled') |
91 |
{ |
92 |
$OUT .="#-------------------------------------------------\n"; |
93 |
- $OUT .="# gwsetup settings from smeserver-gwsetup\n"; |
94 |
+ $OUT .="# gwsetup settings from smeserver-geneweb\n"; |
95 |
$OUT .="#-------------------------------------------------\n"; |
96 |
$OUT .="\n"; |
97 |
|
98 |
$OUT .= qq( |
99 |
<LocationMatch ^/(gwsetup|gwd)> |
100 |
SSLRequireSSL |
101 |
- order deny,allow |
102 |
- deny from all |
103 |
+ AuthName "Gwsetup (geneweb)" |
104 |
+ AuthType Basic |
105 |
+ AuthBasicProvider external |
106 |
+ AuthExternal pwauth |
107 |
+ <RequireAll> |
108 |
); |
109 |
- |
110 |
- my $access = ($gwsetup{'access'} || 'private'); |
111 |
+ my $access = ($gwsetup{'access'} || 'private'); |
112 |
if ("$access" eq "private") |
113 |
{ |
114 |
- $OUT .= " allow from $localAccess $externalSSLAccess"; |
115 |
+ $OUT .= " Require ip $localAccess $externalSSLAccess\n"; |
116 |
} |
117 |
elsif ("$access" eq "public") |
118 |
{ |
119 |
- $OUT .= " allow from all"; |
120 |
+ $OUT .= " Require all granted\n"; |
121 |
+ } |
122 |
+ else { |
123 |
+ $OUT .= " Require ip 127.0.0.1\n"; |
124 |
} |
125 |
$OUT .= qq( |
126 |
- AuthName "gwsetup" |
127 |
- AuthType Basic |
128 |
- AuthBasicProvider external |
129 |
- AuthExternal pwauth |
130 |
- require user admin |
131 |
+ Require user admin |
132 |
+ </RequireAll> |
133 |
</LocationMatch> |
134 |
); |
135 |
} |
136 |
diff -urN smeserver-geneweb-2.3.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28gwd_gwsProxyPass smeserver-geneweb-2.3.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28gwd_gwsProxyPass |
137 |
--- smeserver-geneweb-2.3.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28gwd_gwsProxyPass 2022-07-12 21:03:41.000000000 +0400 |
138 |
+++ smeserver-geneweb-2.3.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28gwd_gwsProxyPass 2022-07-14 12:55:55.336000000 +0400 |
139 |
@@ -23,14 +23,12 @@ |
140 |
$OUT .= " RequestHeader set X-Forwarded-Proto 'http'\n"; |
141 |
|
142 |
$OUT .= " <Proxy '/$place'>\n"; |
143 |
- $OUT .= " order deny,allow\n"; |
144 |
- $OUT .= " deny from all\n"; |
145 |
if ($port eq $plainPort) { |
146 |
- $OUT .= ' allow from 127.0.0.1' . "\n"; |
147 |
+ $OUT .= ' Require ip 127.0.0.1' . "\n"; |
148 |
} elsif (($haveSSL eq 'yes') && ($port eq $sslPort)) { |
149 |
- $OUT .= " allow from $localAccess $externalSSLAccess\n"; |
150 |
+ $OUT .= " Require ip $localAccess $externalSSLAccess\n"; |
151 |
} else { |
152 |
- $OUT .= " allow from $localAccess\n"; |
153 |
+ $OUT .= " Require ip $localAccess\n"; |
154 |
} |
155 |
|
156 |
$OUT .= " </Proxy>\n\n"; |
157 |
diff -urN smeserver-geneweb-2.3.0.old/root/usr/lib/systemd/systemd-geneweb smeserver-geneweb-2.3.0/root/usr/lib/systemd/systemd-geneweb |
158 |
--- smeserver-geneweb-2.3.0.old/root/usr/lib/systemd/systemd-geneweb 2022-07-12 21:03:41.000000000 +0400 |
159 |
+++ smeserver-geneweb-2.3.0/root/usr/lib/systemd/systemd-geneweb 2022-06-30 22:50:50.000000000 +0400 |
160 |
@@ -8,10 +8,12 @@ |
161 |
BD=$(/sbin/e-smith/db configuration getprop geneweb DBDir || echo "/opt/geneweb/bases") |
162 |
HD="/opt/geneweb/gw/gw" |
163 |
BIN=$HD/gwd |
164 |
+LOGF="/var/log/gwd.log" |
165 |
|
166 |
start() { |
167 |
echo -n "Starting GeneWeb Services (geneweb):" |
168 |
$BIN -daemon -hd $HD -bd $BD -lang $GWLANG |
169 |
+ /bin/su -s /bin/bash geneweb -c "$BIN -daemon -hd $HD -bd $BD -lang $GWLANG >>$LOGF 2>>\&1" |
170 |
} |
171 |
|
172 |
cd $BD |
173 |
diff -urN smeserver-geneweb-2.3.0.old/root/usr/lib/systemd/systemd-gwsetup smeserver-geneweb-2.3.0/root/usr/lib/systemd/systemd-gwsetup |
174 |
--- smeserver-geneweb-2.3.0.old/root/usr/lib/systemd/systemd-gwsetup 2022-07-12 21:03:41.000000000 +0400 |
175 |
+++ smeserver-geneweb-2.3.0/root/usr/lib/systemd/systemd-gwsetup 2022-06-30 22:50:50.000000000 +0400 |
176 |
@@ -10,10 +10,12 @@ |
177 |
|
178 |
HD="/opt/geneweb/gw/gw" |
179 |
BIN=$HD/gwsetup |
180 |
+LOGF="/var/log/gwsetup.log" |
181 |
|
182 |
start() { |
183 |
echo -n "Starting gwsetup Services (gwsetup):" |
184 |
$BIN -daemon -gd $HD -bindir $HD -p $TcpPort -lang $GWLANG |
185 |
+ /bin/su -s /bin/bash geneweb -c "$BIN -daemon -gd $HD -bindir $HD -p $TcpPort -lang $GWLANG >>$LOGF 2>>\&1" |
186 |
} |
187 |
|
188 |
cd $BD |