Hello community,
here is the log from the commit of package yast2-http-server
checked in at Tue Oct 31 15:37:23 CET 2006.
--------
--- yast2-http-server/yast2-http-server.changes 2006-09-13 20:31:46.000000000 +0200
+++ /mounts/work_src_done/NOARCH/yast2-http-server/yast2-http-server.changes 2006-10-31 14:22:02.000000000 +0100
@@ -1,0 +2,6 @@
+Tue Oct 31 14:19:56 CET 2006 - mzugec@suse.cz
+
+- #180776 - missing option for SSL vhosts
+- 2.14.2
+
+-------------------------------------------------------------------
Old:
----
yast2-http-server-2.14.1.tar.bz2
New:
----
yast2-http-server-2.14.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-http-server.spec ++++++
--- /var/tmp/diff_new_pack.LrkeSD/_old 2006-10-31 15:37:18.000000000 +0100
+++ /var/tmp/diff_new_pack.LrkeSD/_new 2006-10-31 15:37:18.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-http-server (Version 2.14.1)
+# spec file for package yast2-http-server (Version 2.14.2)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,14 +11,14 @@
# norootforbuild
Name: yast2-http-server
-Version: 2.14.1
+Version: 2.14.2
Release: 1
-License: GPL
+License: GNU General Public License (GPL) - all versions
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-http-server-2.14.1.tar.bz2
+Source0: yast2-http-server-2.14.2.tar.bz2
prefix: /usr
-BuildRequires: docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2 yast2-devtools yast2-dns-server yast2-network yast2-packagemanager-devel yast2-perl-bindings yast2-testsuite
+BuildRequires: docbook-xsl-stylesheets doxygen libxslt libzio perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2 yast2-devtools yast2-dns-server yast2-network yast2-packagemanager-devel yast2-perl-bindings yast2-testsuite
Requires: yast2 yast2-network yast2-firewall yast2-perl-bindings libzio
BuildArchitectures: noarch
Summary: YaST2 - HTTP Server Configuration
@@ -34,7 +34,7 @@
Stanislav Visnovsky
%prep
-%setup -n yast2-http-server-2.14.1
+%setup -n yast2-http-server-2.14.2
%build
%{prefix}/bin/y2tool y2autoconf
@@ -70,6 +70,9 @@
%doc %{prefix}/share/doc/packages/yast2-http-server
%changelog -n yast2-http-server
+* Tue Oct 31 2006 - mzugec@suse.cz
+- #180776 - missing option for SSL vhosts
+- 2.14.2
* Wed Sep 13 2006 - mzugec@suse.cz
- 2.14.1 - #180776 - change work with virtual hosts for better ssl support for future
* Mon Jul 17 2006 - mzugec@suse.cz
++++++ yast2-http-server-2.14.1.tar.bz2 -> yast2-http-server-2.14.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-http-server-2.14.1/VERSION new/yast2-http-server-2.14.2/VERSION
--- old/yast2-http-server-2.14.1/VERSION 2006-09-13 14:54:40.000000000 +0200
+++ new/yast2-http-server-2.14.2/VERSION 2006-10-31 14:19:53.000000000 +0100
@@ -1 +1 @@
-2.14.1
+2.14.2
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-http-server-2.14.1/agents/ag_http_server new/yast2-http-server-2.14.2/agents/ag_http_server
--- old/yast2-http-server-2.14.1/agents/ag_http_server 2006-09-13 14:27:46.000000000 +0200
+++ new/yast2-http-server-2.14.2/agents/ag_http_server 2006-10-31 12:44:25.000000000 +0100
@@ -114,15 +114,16 @@
$entry->{VirtualByName} = 0;
$vhost_files{'default-server.conf'} = [ $entry ];
+
#new hash - map sorted by virtual hosts
foreach my $file (keys (%vhost_files)) {
foreach my $conf ($vhost_files{$file}){
foreach my $vhost ( @$conf ) {
if ($file eq 'default-server.conf'){
$hash_table{'main'} = $vhost;
- foreach my $data ( @{$vhost->{'DATA'}} )
- { if ($data->{'KEY'} eq 'NameVirtualHost'){ $hash_table{ $data->{'VALUE'} } = []; }
- }
+# foreach my $data ( @{$vhost->{'DATA'}} )
+# { if ($data->{'KEY'} eq 'NameVirtualHost'){ $hash_table{ $data->{'VALUE'} } = []; }
+# }
} else {
if (exists $vhost->{'HostIP'}){
if ( exists $hash_table{ $vhost->{'HostIP'}} ){ push(@{$hash_table{ $vhost->{'HostIP'}}}, $vhost); }
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-http-server-2.14.1/src/HttpServer.ycp new/yast2-http-server-2.14.2/src/HttpServer.ycp
--- old/yast2-http-server-2.14.1/src/HttpServer.ycp 2006-09-13 19:55:21.000000000 +0200
+++ new/yast2-http-server-2.14.2/src/HttpServer.ycp 2006-10-31 14:20:55.000000000 +0100
@@ -4,7 +4,7 @@
* Summary: Data for configuration of http-server, input and output functions.
* Authors: Stanislav Visnovsky
*
- * $Id: HttpServer.ycp 32565 2006-08-25 08:10:40Z mzugec $
+ * $Id: HttpServer.ycp 33935 2006-10-31 13:20:53Z mzugec $
*
* Representation of the configuration of http-server.
* Input and output routines.
@@ -319,7 +319,7 @@
/* HttpServer read dialog caption */
string caption = _("Saving HTTP Server Configuration");
- integer steps = 3;
+ integer steps = 2;
// We do not set help text here, because it was set outside
Progress::New(caption, " ", steps, [
@@ -359,7 +359,7 @@
// write hosts
YaST::HTTPDData::WriteHosts();
-
+ Progress::NextStage();
import "SuSEFirewall";
Progress::set(false);// Progress::off ();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-http-server-2.14.1/src/HttpServerWidgets.ycp new/yast2-http-server-2.14.2/src/HttpServerWidgets.ycp
--- old/yast2-http-server-2.14.1/src/HttpServerWidgets.ycp 2006-09-11 19:24:40.000000000 +0200
+++ new/yast2-http-server-2.14.2/src/HttpServerWidgets.ycp 2006-10-31 14:20:55.000000000 +0100
@@ -5,7 +5,7 @@
* Authors: Jiri Srain
* Stanislav Visnovsky
*
- * $Id: HttpServerWidgets.ycp 32814 2006-09-11 17:26:17Z mzugec $
+ * $Id: HttpServerWidgets.ycp 33935 2006-10-31 13:20:53Z mzugec $
*/
{
@@ -219,11 +219,9 @@
res = false;
break;
}
-//y2internal("ip1 - %1\nip2 - %2\n%3", ip, vhost["id"]:"", vhost);
if (vhost["id"]:"" == ip)
{
// this is valid only if both of them are name-based, not ip-based
-//y2internal("%1\n%2", YaST::HTTPDData::GetVhostType(host)["type"]:"", namebased);
if ( YaST::HTTPDData::GetVhostType(host)["type"]:""=="name-based" && namebased )
{
// error message - the entered ip address is already
@@ -1071,10 +1069,10 @@
string dns_zone = "";
global void initVhostDetails(string key){
-map servername = find(map row, vhost_descr,``(row["KEY"]:"" == "ServerName"));
-dns_zone="";
+ map servername = find(map row, vhost_descr,``(row["KEY"]:"" == "ServerName"));
+ dns_zone="";
-if (Package::Installed("bind"))
+ if (Package::Installed("bind"))
{
if ( Service::Status("named") == 0 ){
foreach(string key, map value, (map >) DnsServerAPI::GetZones(), {
@@ -1130,6 +1128,12 @@
}
} else y2milestone(_("There is no DNS server running on this machine."));
}
+
+ // disable using SSL for name-based virtual host
+ foreach(map row, vhost_descr, {
+ if (row["KEY"]:"" == "VirtualByName" && row["VALUE"]:"0" =="1") UI::ChangeWidget(`ssl_support, `Enabled, false);
+ });
+
}
global define symbol handleVhostDetails (string key, map event){
@@ -1149,9 +1153,13 @@
{
UI::ChangeWidget(`certfile, `Enabled, true);
UI::ChangeWidget(`browse_cert, `Enabled, true);
+ UI::ChangeWidget(`keyfile, `Enabled, true);
+ UI::ChangeWidget(`browse_key, `Enabled, true);
} else {
UI::ChangeWidget(`certfile, `Enabled, false);
UI::ChangeWidget(`browse_cert, `Enabled, false);
+ UI::ChangeWidget(`keyfile, `Enabled, false);
+ UI::ChangeWidget(`browse_key, `Enabled, false);
}
@@ -1185,17 +1193,30 @@
case `browse_cert :
{
- string ssl_dir = UI::AskForExistingFile("/etc/apache2/ssl.crt", "*.crt *.pem", _("Choose Certificate File") );
- if (ssl_dir != nil) UI::ChangeWidget (`certfile, `Value, ssl_dir );
- //TODO - validate certificate
- if (size((string) UI::QueryWidget(`certfile, `Value)) == 0)
- {
+ string cert_file = UI::AskForExistingFile("/etc/apache2/ssl.crt", "*.crt *.pem", _("Choose Certificate File") );
+ if (cert_file != nil && SCR::Execute(.target.bash, sformat("openssl x509 -in %1", cert_file))==0) UI::ChangeWidget (`certfile, `Value, cert_file );
+ else
+ {
+ UI::ChangeWidget (`certfile, `Value, "");
// translators: error popup
Popup::Error ( _("Enter the certificate file.") );
- }
+ }
break;
}
+ case `browse_key :
+ {
+ string key_file = UI::AskForExistingFile("/etc/apache2/ssl.key", "*.key *.pem", _("Choose Certificate Key File") );
+// boolean keyfile = (SCR::Execute(.target.bash, sformat("openssl rsa -in %1", cert_file))==0)?true:false;
+ if (key_file != nil && SCR::Execute(.target.bash, sformat("openssl rsa -in %1", key_file))==0) UI::ChangeWidget (`keyfile, `Value, key_file );
+ else
+ {
+ UI::ChangeWidget (`keyfile, `Value, "");
+ // translators: error popup
+ Popup::Error ( _("Enter the key file.") );
+ }
+ break;
+ }
}
return nil;
@@ -1228,23 +1249,27 @@
map ssl_values = $[];
if (UI::QueryWidget(`ssl_support, `Value) == true)
{
- YaST::HTTPDData::ModifyModuleList ([ "ssl" ], true);
- ssl_values = $[
- "KEY":"_SECTION",
- "SECTIONNAME":"IfDefine",
- "SECTIONPARAM":"SSL",
- "VALUE":[ $["KEY":"SSLCertificateFile", "VALUE":UI::QueryWidget(`certfile, `Value)],
- $["KEY":"SSLEngine", "VALUE":"on"] ]
- ];
- }
+ string cert_file = tostring(UI::QueryWidget(`certfile, `Value));
+ string key_file = tostring(UI::QueryWidget(`keyfile, `Value));
+
+ if (size(cert_file)>0 && size(key_file)>0){
+ YaST::HTTPDData::ModifyModuleList ([ "ssl" ], true);
+ ssl_values = $[
+ "KEY":"_SECTION",
+ "SECTIONNAME":"IfDefine",
+ "SECTIONPARAM":"SSL",
+ "VALUE":[ $["KEY":"SSLCertificateFile", "VALUE":cert_file],
+ $["KEY":"SSLCertificateKeyFile", "VALUE":key_file],
+ $["KEY":"SSLEngine", "VALUE":"on"] ]
+ ];
+ } else y2error("%1 is not valid Certificate File!", cert_file);
+ }
if (size(ssl_values)>0) vhost_descr = add(vhost_descr, ssl_values);
-y2internal("%1", vhost_descr);
any result = YaST::HTTPDData::CreateHost ( ip["VALUE"]:""+"/"+servername["VALUE"]:"", vhost_descr );
- y2milestone ("%1", result);
if ( result == nil)
{
map error = (map) YaST::HTTPDData::Error ();
@@ -1268,9 +1293,7 @@
});
if (UI::QueryWidget(`pub_html, `Value)==true) tmp_descr=add(tmp_descr, $["KEY":"UserDir", "VALUE":"public_html"]);
-// YaST::HTTPDData::ModifyHost(ip["VALUE"]:""+"/"+servername["VALUE"]:"", tmp_descr);
}
-y2internal("host values %1", YaST::HTTPDData::GetHost(ip["VALUE"]:""+"/"+servername["VALUE"]:""));
HttpServer::modified = true;
vhost_descr = [];
}
@@ -1540,13 +1563,19 @@
`VBox(
`Left(
`CheckBox(`id(`ssl_support), `opt(`notify), _("Enable &SSL Support for This Virtual Host"))),
- `HBox(
+ `VBox(
// translators: textentry, certificate file path
+ `HBox(
+ `Label(""),
`TextEntry( `id( `certfile ), _("&Certificate File Path") ),
- `VBox(
- `Label(""),
`PushButton(`id(`browse_cert ), Label::BrowseButton () )
- ))
+ ),
+ `HBox(
+ `Label(""),
+ `TextEntry( `id( `keyfile ), _("&Certificate Key File Path") ),
+ `PushButton(`id(`browse_key ), Label::BrowseButton () )
+ )
+ )
)),
`VSpacing (1),
@@ -1687,6 +1716,12 @@
});
list< map > options = [];
+
+ map vhost = YaST::HTTPDData::GetVhostType(currenthost);
+ if (vhost["type"]:""=="ip-based") options = add(options, $["KEY":"VirtualByName", "VALUE":"0"]);
+ else options = add(options, $["KEY":"VirtualByName", "VALUE":"1"]);
+ options = add(options, $["KEY":"HostIP", "VALUE": vhost["id"]:""]);
+
foreach (map option, YaST::HTTPDData::GetHost(currenthost), ``{
if ( option["KEY"]:"unknown" == "_SECTION" && option["SECTIONPARAM"]:"unknown" == "SSL")
{
@@ -1716,7 +1751,6 @@
} else options = add(options, option);
});
if (found == false) { options = add(options, $["KEY":"_SECTION", "SECTIONNAME":"IfDefine", "SECTIONPARAM":"SSL", "VALUE":forssl]); }
- YaST::HTTPDData::ModifyHost (currenthost, options );
setHostOptions(nil);
HttpServer::modified = true;
}
@@ -1877,7 +1911,6 @@
*/
global void HostStore (string key, map event)
{
-
list< map > options = [];
foreach (integer key, map values, host_options,
``{
@@ -1885,7 +1918,6 @@
{
//In main host SSL can't be used
-/*
if (values["KEY"]:"" == "SSL")
{
options = add(options, $[
@@ -1896,7 +1928,6 @@
"OVERHEAD" : values["OVERHEAD"]:""]);
y2milestone("SSL section - %1", options);
}
-*/
if (values["KEY"]:"" == "Directory")
{
@@ -1945,7 +1976,6 @@
* @return list of items for the table
*/
global define list HostTableContents (map descr) ``{
-
if (host_options == nil)
{
// fill the data
@@ -1960,7 +1990,6 @@
boolean documentroot = false;
list< map > host = YaST::HTTPDData::GetHost(currenthost);
-
foreach (map option, host, ``{
string key = option["KEY"]: "unknown";
@@ -1987,7 +2016,7 @@
"VALUE" : "",
"DATA": option["VALUE"]:[],
"OVERHEAD" : option["OVERHEAD"]:""
- ];
+ ];
res = add (res, option_counter);
option_counter = option_counter + 1;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-http-server-2.14.1/src/YaPI/HTTPD.pm new/yast2-http-server-2.14.2/src/YaPI/HTTPD.pm
--- old/yast2-http-server-2.14.1/src/YaPI/HTTPD.pm 2006-09-13 14:12:32.000000000 +0200
+++ new/yast2-http-server-2.14.2/src/YaPI/HTTPD.pm 2006-10-31 12:44:15.000000000 +0100
@@ -554,6 +554,14 @@
}
}
+
+sub modifyMain {
+ my $self = shift;
+ my $data = shift;
+
+ $vhost_files->{'main'}{'DATA'} = $data;
+}
+
sub modifyVH {
my $self = shift;
my $hostid = shift;
@@ -580,7 +588,6 @@
}
sub validateNVH (){
-
my @nb = ();
foreach my $key ( keys( %{$vhost_files} ) ){
if(($key ne 'ip-based') && ($key ne 'main')){
@@ -594,9 +601,9 @@
$vhost_files->{main}{DATA} = \@tmp_data;
-foreach my $ip (@nb){
- push(@{$vhost_files->{main}{DATA}}, {KEY=>'NameVirtualHost', VALUE=>$ip} );
-}
+ foreach my $ip (@nb){
+ push(@{$vhost_files->{main}{DATA}}, {KEY=>'NameVirtualHost', VALUE=>$ip} );
+ }
}
@@ -882,9 +889,26 @@
sub writeHosts (){
my $self = shift;
my @vhosts = @{$vhost_files->{'ip-based'}};
+
+ foreach my $key ( keys(%{$vhost_files}) ) {
+ switch($key)
+ {
+ case "ip-based" {
+ }
+ case "main" {}
+ else {
+ foreach my $hostList ( $vhost_files->{$key} ) {
+ foreach my $hostentryHash ( @$hostList ) {
+ push( @vhosts, $hostentryHash ) ;
+ }
+ }
+ }
+ }
+ }
+
my %data = ( 'default-server.conf' =>$vhost_files->{'main'},
'yast2_vhosts.conf'=>\@vhosts );
-# SCR->Write(".http_server.vhosts", \%data);
+ SCR->Write(".http_server.vhosts", \%data);
}
#######################################################
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-http-server-2.14.1/src/YaST/HTTPDData.pm new/yast2-http-server-2.14.2/src/YaST/HTTPDData.pm
--- old/yast2-http-server-2.14.1/src/YaST/HTTPDData.pm 2006-09-12 10:52:43.000000000 +0200
+++ new/yast2-http-server-2.14.2/src/YaST/HTTPDData.pm 2006-10-31 12:44:31.000000000 +0100
@@ -255,7 +255,9 @@
# }
$dirty{MODIFIED}->{$hostid} = 1 unless( exists($dirty{NEW}->{$hostid}) );
- }
+ } else {
+ YaPI::HTTPD->modifyMain($hostdata);
+ }
return 1;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org