java/code/src/com/redhat/rhn/domain/server/Server.java | 31 +++++++ java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java | 17 ++++ java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java | 1 java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 8 ++ java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/proxy-options.jspf | 40 ++++++++-- java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp | 37 +++++++++ java/code/webapp/WEB-INF/struts-config.xml | 1 java/spacewalk-java.spec | 8 +- proxy/installer/answers.txt | 3 proxy/installer/configure-proxy.sh | 24 +++++- proxy/installer/configure-proxy.sh.sgml | 16 +++- proxy/installer/spacewalk-proxy-installer.spec | 5 + rel-eng/packages/spacewalk-certs-tools | 2 rel-eng/packages/spacewalk-java | 2 rel-eng/packages/spacewalk-proxy-installer | 2 spacewalk/certs-tools/rhn-ssl-tool.sgml | 12 ++- spacewalk/certs-tools/sign.sh | 1 spacewalk/certs-tools/spacewalk-certs-tools.spec | 5 + spacewalk/certs-tools/sslToolCli.py | 6 + spacewalk/certs-tools/sslToolConfig.py | 28 ++++++- 20 files changed, 228 insertions(+), 21 deletions(-)
New commits: commit 97b719e69792799bc220b9efc674b746ed737b88 Author: Miroslav Suchý msuchy@redhat.com Date: Mon Aug 22 17:23:43 2011 +0200
Automatic commit of package [spacewalk-certs-tools] release [1.6.2-1].
diff --git a/rel-eng/packages/spacewalk-certs-tools b/rel-eng/packages/spacewalk-certs-tools index 8e217c9..6c2be85 100644 --- a/rel-eng/packages/spacewalk-certs-tools +++ b/rel-eng/packages/spacewalk-certs-tools @@ -1 +1 @@ -1.6.1-1 spacewalk/certs-tools/ +1.6.2-1 spacewalk/certs-tools/ diff --git a/spacewalk/certs-tools/spacewalk-certs-tools.spec b/spacewalk/certs-tools/spacewalk-certs-tools.spec index a88b32c..6c36443 100644 --- a/spacewalk/certs-tools/spacewalk-certs-tools.spec +++ b/spacewalk/certs-tools/spacewalk-certs-tools.spec @@ -2,7 +2,7 @@ Name: spacewalk-certs-tools Summary: Spacewalk SSL Key/Cert Tool Group: Applications/Internet License: GPLv2 and Python -Version: 1.6.1 +Version: 1.6.2 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -56,6 +56,9 @@ rm -rf $RPM_BUILD_ROOT %{_var}/www/html/pub/bootstrap/client_config_update.py*
%changelog +* Mon Aug 22 2011 Miroslav Suchý 1.6.2-1 +- ability to generate multihost ssl certificate + * Fri Aug 19 2011 Miroslav Suchý 1.6.1-1 - code cleanup
commit c5d6ab55683edf94cf62bc8e432e99abff3e9ed6 Author: Miroslav Suchý msuchy@redhat.com Date: Mon Aug 22 17:23:27 2011 +0200
Automatic commit of package [spacewalk-java] release [1.6.27-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec index 338d9da..08cdc6d 100644 --- a/java/spacewalk-java.spec +++ b/java/spacewalk-java.spec @@ -17,7 +17,7 @@ Name: spacewalk-java Summary: Spacewalk Java site packages Group: Applications/Internet License: GPLv2 -Version: 1.6.26 +Version: 1.6.27 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -547,6 +547,11 @@ fi %{jardir}/postgresql-jdbc.jar
%changelog +* Mon Aug 22 2011 Miroslav Suchý 1.6.27-1 +- read cnames from rhn.conf and polish UI +- show cnames aliases in hardware tab in webui +- Allow to specify host for kickstart in free form + * Mon Aug 22 2011 Tomas Lestach tlestach@redhat.com 1.6.26-1 - fix deleting kickstart tree distribution (tlestach@redhat.com) - do not see a reason to set these attributes (tlestach@redhat.com) diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java index 6213235..4441792 100644 --- a/rel-eng/packages/spacewalk-java +++ b/rel-eng/packages/spacewalk-java @@ -1 +1 @@ -1.6.26-1 java/ +1.6.27-1 java/
commit 44a7d7f934432d90fe3833073f1666d21bf67b2b Author: Miroslav Suchý msuchy@redhat.com Date: Mon Aug 22 17:22:57 2011 +0200
Automatic commit of package [spacewalk-proxy-installer] release [1.6.2-1].
diff --git a/proxy/installer/spacewalk-proxy-installer.spec b/proxy/installer/spacewalk-proxy-installer.spec index 981497b..1c08fc5 100644 --- a/proxy/installer/spacewalk-proxy-installer.spec +++ b/proxy/installer/spacewalk-proxy-installer.spec @@ -2,7 +2,7 @@ Name: spacewalk-proxy-installer Summary: Spacewalk Proxy Server Installer Group: Applications/Internet License: GPLv2 -Version: 1.6.1 +Version: 1.6.2 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -83,6 +83,9 @@ rm -rf $RPM_BUILD_ROOT %doc LICENSE answers.txt
%changelog +* Mon Aug 22 2011 Miroslav Suchý 1.6.2-1 +- allow proxy installer to set cname alias + * Fri Jul 22 2011 Jan Pazdziora 1.6.1-1 - We only support version 5 and newer of RHEL, removing conditions for old versions. diff --git a/rel-eng/packages/spacewalk-proxy-installer b/rel-eng/packages/spacewalk-proxy-installer index ae0bd34..1a06f3e 100644 --- a/rel-eng/packages/spacewalk-proxy-installer +++ b/rel-eng/packages/spacewalk-proxy-installer @@ -1 +1 @@ -1.6.1-1 proxy/installer/ +1.6.2-1 proxy/installer/
commit 272c68b80b795e05ce161cd5676640016e06f1c8 Author: Miroslav Suchý msuchy@redhat.com Date: Fri Aug 19 17:16:00 2011 +0200
allow proxy installer to set cname alias
diff --git a/proxy/installer/answers.txt b/proxy/installer/answers.txt index aefc5fb..0b7da3e 100644 --- a/proxy/installer/answers.txt +++ b/proxy/installer/answers.txt @@ -34,3 +34,6 @@ POPULATE_CONFIG_CHANNEL=Y # set this variable to 0 or N START_SERVICES=Y
+# cname aliases for proxy, this MUST be in parentheses and separated by space +# do not put here the original hostname +#SSL_CNAME=(cname.alias.com another.alias.com) diff --git a/proxy/installer/configure-proxy.sh b/proxy/installer/configure-proxy.sh index 75d857c..41d4f8a 100755 --- a/proxy/installer/configure-proxy.sh +++ b/proxy/installer/configure-proxy.sh @@ -62,6 +62,8 @@ options: Password to be used for SSL CA certificate. --ssl-state=SSL_STATE State to be used in SSL certificate. + --ssl-cname=CNAME_ALIAS + Cname alias of the machine. Can be specified multiple times. --start-services=1 1 or Y to start all services after configuration. This is default. 0 or N to not start services after configuration. @@ -77,12 +79,22 @@ HELP exit }
+parse_answer_file () { + local FILE="$1" + local ALIAS + . $(echo $FILE | cut -d= -f2-) + for ALIAS in ${SSL_CNAME[@]}; do + SSL_CNAME_PARSED[CNAME_INDEX++]=--set-cname=$ALIAS + done +} + INTERACTIVE=1 +CNAME_INDEX=0
while [ $# -ge 1 ]; do case $1 in --help | -h) print_help;; - --answer-file=*) . $(echo $1 | cut -d= -f2-);; + --answer-file=*) parse_answer_file $1;; --non-interactive) INTERACTIVE=0;;
--version=*) VERSION=$(echo $1 | cut -d= -f2-);; @@ -103,6 +115,7 @@ while [ $# -ge 1 ]; do --ssl-country=*) SSL_COUNTRY=$(echo $1 | cut -d= -f2-);; --ssl-email=*) SSL_EMAIL=$(echo $1 | cut -d= -f2-);; --ssl-password=*) SSL_PASSWORD=$(echo $1 | cut -d= -f2-);; + --ssl-cname=*) SSL_CNAME_PARSED[CNAME_INDEX++]=--set-cname=$(echo $1 | cut -d= -f2-);; --install-monitoring=*) INSTALL_MONITORING=$(echo $1 | cut -d= -f2-);; --enable-scout=*) ENABLE_SCOUT=$(echo $1 | cut -d= -f2-);; --monitoring-parent=*) MONITORING_PARENT_IP=$(echo $1 | cut -d= -f2-);; @@ -281,6 +294,14 @@ default_or_input "Country code" SSL_COUNTRY ''
default_or_input "Email" SSL_EMAIL "$TRACEBACK_EMAIL"
+if [ ${#SSL_CNAME_PARSED[@]} -eq 0 ]; then + default_or_input "Cname aliases (separated by space)" SSL_CNAME_ASK '' + CNAME=($SSL_CNAME_ASK) + local ALIAS + for ALIAS in ${CNAME[@]}; do + SSL_CNAME_PARSED[CNAME_INDEX++]=--set-cname=$ALIAS + done +fi
/usr/bin/rhn-proxy-activate --server="$RHN_PARENT" \ --http-proxy="$HTTP_PROXY" \ @@ -460,6 +481,7 @@ echo "Generating SSL key and public certificate:" --set-org="$SSL_ORG" \ --set-org-unit="$SSL_ORGUNIT" \ --set-email="$SSL_EMAIL" \ + ${SSL_CNAME_PARSED[@]} \ $RHN_SSL_TOOL_PASSWORD_OPTION $RHN_SSL_TOOL_PASSWORD config_error $? "SSL key generation failed!"
diff --git a/proxy/installer/configure-proxy.sh.sgml b/proxy/installer/configure-proxy.sh.sgml index b97da31..421e471 100644 --- a/proxy/installer/configure-proxy.sh.sgml +++ b/proxy/installer/configure-proxy.sh.sgml @@ -8,7 +8,7 @@
<RefMeta> <RefEntryTitle>&SCRIPTCOMMAND;</RefEntryTitle><manvolnum>8</manvolnum> -<RefMiscInfo>Version 0.5</RefMiscInfo> +<RefMiscInfo>Version 1.6</RefMiscInfo> </RefMeta>
<RefNameDiv> @@ -143,6 +143,13 @@ provide a required response, default answer is used.</para> </listitem> </varlistentry> <varlistentry> + <term>--ssl-cname=SSL_CNAME</term> + <listitem> + <para>Cname alias of machine. This will allow you to generate multihost SSL certificate. + Can be specified multiple times.</para> + </listitem> + </varlistentry> + <varlistentry> <term>--ssl-common=SSL_COMMON</term> <listitem> <para>Common name to be used in SSL certificate.</para> @@ -276,6 +283,13 @@ provide a required response, default answer is used.</para> </listitem> </varlistentry> <varlistentry> + <term>SSL_CNAME</term> + <listitem> + <para>Cname alias of machine. This will allow you to generate multihost SSL certificate. + Has to be specified in format: (cname.alias.com cname.alias2.com ...)</para> + </listitem> + </varlistentry> + <varlistentry> <term>SSL_ORG</term> <listitem> <para>Organization name to be used in SSL certificate.</para>
commit a7825bff5055725f858c66ddd094fd5dcba1ad82 Author: Miroslav Suchý msuchy@redhat.com Date: Fri Aug 19 09:16:19 2011 +0200
ability to generate multihost ssl certificate
implementing new option --set-cname to rhn-ssl-tool Followed: http://therowes.net/~greg/2008/01/08/creating-a-certificate-with-multiple-ho...
diff --git a/spacewalk/certs-tools/rhn-ssl-tool.sgml b/spacewalk/certs-tools/rhn-ssl-tool.sgml index 82e2423..d882b4e 100644 --- a/spacewalk/certs-tools/rhn-ssl-tool.sgml +++ b/spacewalk/certs-tools/rhn-ssl-tool.sgml @@ -505,6 +505,15 @@ Generate and maintain SSL keys, certificates and deployment RPMs. </listitem> </varlistentry> <varlistentry> + <term>--set-cname=<replaceable>HOSTNAME</replaceable></term> + <listitem> + <para>set the cname alias (FQDN: fully qualified domain name) + of the RHN Satellite or RHN Proxy. This will generate certificate + with multiple hostnames. Can be specified multiple times. + </para> + </listitem> + </varlistentry> + <varlistentry> <term>--set-email=<replaceable>EMAIL</replaceable></term> <listitem> <para>email address (default: admin@example.com)</para> @@ -610,7 +619,8 @@ Generate and maintain SSL keys, certificates and deployment RPMs. <member><command>rhn-ssl-tool --gen-server -pMY_CA_PASSWORD --set-state="North Carolina" --set-city=Raleigh --set-org="Example Inc." --set-org-unit="IS/IT" --email="taw@example.com" - --set-hostname="rhnbox1.example.com" --dir=/etc/sysconfig/rhn/ssl</command></member> + --set-hostname="rhnbox1.example.com" --set-cname="rhnbox1.localnet" + --dir=/etc/sysconfig/rhn/ssl</command></member> </simplelist> </RefSect1>
diff --git a/spacewalk/certs-tools/sign.sh b/spacewalk/certs-tools/sign.sh index a135cbe..ecabfc4 100755 --- a/spacewalk/certs-tools/sign.sh +++ b/spacewalk/certs-tools/sign.sh @@ -135,6 +135,7 @@ serial = serial # The current serial number database = index.txt # Commenting for now, the cert gets too big x509_extensions = usr_cert +copy_extensions = copy
# For the CA policy [ policy_match ] diff --git a/spacewalk/certs-tools/sslToolCli.py b/spacewalk/certs-tools/sslToolCli.py index 1389ea0..60763ff 100644 --- a/spacewalk/certs-tools/sslToolCli.py +++ b/spacewalk/certs-tools/sslToolCli.py @@ -76,6 +76,8 @@ def _getOptionsTree(defs):
_optSetHostname = make_option('--set-hostname', action='store', type="string", help='hostname of the web server you are installing the key set on (default: %s)' % repr(defs['--set-hostname']))
+ _optSetCname = make_option('--set-cname', action='append', type="string", help='cname alias of the web server, can be specified multiple times') + _buildRpmOptions = [_optRpmPackager, _optRpmVender, _optRpmOnly]
_genOptions = [ @@ -97,7 +99,7 @@ def _getOptionsTree(defs): make_option('--set-common-name', action='store', type="string", help='common name (default: %s)' % repr(defs['--set-common-name'])), ] + _genConfOptions
- _serverConfOptions = [ _optSetHostname ] + _genConfOptions + _serverConfOptions = [ _optSetHostname, _optSetCname ] + _genConfOptions
# CA generation options _caOptions = [ @@ -167,7 +169,7 @@ def _getOptionsTree(defs): + _genOptions + [_optServerCertReqOnly] _serverCertOnlySet = [_optGenServer] + _serverCertOptions \ + _genOptions + [_optServerCertOnly] - _serverRpmOnlySet = [_optGenServer, _optServerKey, _optServerCertReq, _optServerCert, _optSetHostname ] \ + _serverRpmOnlySet = [_optGenServer, _optServerKey, _optServerCertReq, _optServerCert, _optSetHostname, _optSetCname ] \ + _buildRpmOptions + [_optServerRpm, _optServerTar] + _genOptions
optionsTree = { diff --git a/spacewalk/certs-tools/sslToolConfig.py b/spacewalk/certs-tools/sslToolConfig.py index 1d3f806..15aa963 100644 --- a/spacewalk/certs-tools/sslToolConfig.py +++ b/spacewalk/certs-tools/sslToolConfig.py @@ -330,6 +330,7 @@ def figureDEFS_distinguishing(options): # NOTE: --set-hostname set in figureDEFS_dirs() if getOption(options, 'set_email') is not None: DEFS['--set-email'] = getOption(options, 'set_email') + DEFS['--set-cname'] = getOption(options, 'set_cname') # this is list
# remap to options object setOption(options, 'set_country', DEFS['--set-country']) @@ -340,6 +341,7 @@ def figureDEFS_distinguishing(options): setOption(options, 'set_common_name', DEFS['--set-common-name']) #setOption(options, 'set_hostname', DEFS['--set-hostname']) setOption(options, 'set_email', DEFS['--set-email']) + setOption(options, 'set_cname', DEFS['--set-cname'])
CONF_TEMPLATE_CA = """\ @@ -360,6 +362,7 @@ serial = $dir/serial
# how closely we follow policy policy = policy_optional +copy_extensions = copy
[ policy_optional ] countryName = optional @@ -412,6 +415,7 @@ default_bits = 2048 distinguished_name = req_distinguished_name prompt = no x509_extensions = req_server_x509_extensions +req_extensions = v3_req
[ req_distinguished_name ] %s @@ -425,10 +429,32 @@ nsCertType = server nsComment = "RHN SSL Tool Generated Certificate" subjectKeyIdentifier = hash authorityKeyIdentifier = keyid, issuer:always + +[ v3_req ] +# Extensions to add to a certificate request +basicConstraints = CA:FALSE +keyUsage = nonRepudiation, digitalSignature, keyEncipherment + +# Some CAs do not yet support subjectAltName in CSRs. +# Instead the additional names are form entries on web +# pages where one requests the certificate... +subjectAltName = @alt_names + +[alt_names] +%s #=========================================================================== """
+def gen_req_alt_names(d): + """ generates the alt_names section of the *-openssl.cnf file """ + i = 0 + result = '' + for name in d['--set-cname']: + i += 1 + result += "DNS.%d = %s\n" % (i, name) + return result + def gen_req_distinguished_name(d): """ generates the rhn_distinguished section of the *-openssl.cnf file """
@@ -702,7 +728,7 @@ serial = $dir/serial ) else: openssl_cnf = CONF_TEMPLATE_SERVER \ - % gen_req_distinguished_name(rdn) + % (gen_req_distinguished_name(rdn), gen_req_alt_names(d))
try: rotated = rotateFile(filepath=self.filename,verbosity=verbosity)
commit f66fe85a7f1f87b8a91c5d464f246b30db5c5ea2 Author: Miroslav Suchý msuchy@redhat.com Date: Tue Aug 16 13:52:40 2011 +0200
read cnames from rhn.conf and polish UI
diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java index 6c3574a..4d4bd04 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java @@ -14,6 +14,7 @@ */ package com.redhat.rhn.frontend.action.kickstart;
+import com.redhat.rhn.common.conf.Config; import com.redhat.rhn.common.conf.ConfigDefaults; import com.redhat.rhn.common.db.datasource.DataResult; import com.redhat.rhn.common.localization.LocalizationService; @@ -84,6 +85,8 @@ public class ScheduleKickstartWizardAction extends RhnWizardAction { public static final String SYNC_PACKAGE_DISABED = "syncPackageDisabled"; public static final String SYNC_SYSTEM_DISABLED = "syncSystemDisabled"; public static final String PROXIES = "proxies"; + public static final String CNAMES = "cnames"; + public static final String VALID_CNAMES = "valid_cnames_"; public static final String KERNEL_PARAMS = "kernelParams"; public static final String KERNEL_PARAMS_TYPE = "kernelParamsType"; public static final String KERNEL_PARAMS_DISTRO = "distro"; @@ -93,7 +96,7 @@ public class ScheduleKickstartWizardAction extends RhnWizardAction { public static final String POST_KERNEL_PARAMS = "postKernelParams"; public static final String POST_KERNEL_PARAMS_TYPE = "postKernelParamsType"; public static final String PROXY_HOST = "proxyHost"; - public static final String PROXY_HOST_FREE_FORM = "proxyHostFreeForm"; + public static final String PROXY_HOST_CNAME = "proxyHostCname"; public static final String IS_VIRTUAL_GUEST = "isVirtualGuest"; public static final String HOST_SID = "hostSid"; public static final String VIRT_HOST_IS_REGISTERED = "virtHostIsRegistered"; @@ -170,12 +173,19 @@ public class ScheduleKickstartWizardAction extends RhnWizardAction { List<LabelValueBean> formatted = new LinkedList<LabelValueBean>();
formatted.add(lvl10n("kickstart.schedule.default.proxy.jsp", "")); + Map cnames = new HashMap(); for (OrgProxyServer serv : proxies) { formatted.add(lv(serv.getName() + " (" + serv.getCheckin() + ")", serv.getId().toString())); + List proxyCnames = Config.get().getList(VALID_CNAMES + + serv.getId().toString()); + if (!proxyCnames.isEmpty()) { + cnames.put(serv.getId().toString(), proxyCnames); + } } ctx.getRequest().setAttribute(HAS_PROXIES, Boolean.TRUE.toString()); ctx.getRequest().setAttribute(PROXIES, formatted); + ctx.getRequest().setAttribute(CNAMES, cnames); } else { ctx.getRequest().setAttribute(HAS_PROXIES, Boolean.FALSE.toString()); @@ -587,10 +597,10 @@ public class ScheduleKickstartWizardAction extends RhnWizardAction { KickstartScheduleCommand cmd) { // if we need to go through a proxy, do it here. String phost = form.getString(PROXY_HOST); - String phostFreeForm = form.getString(PROXY_HOST_FREE_FORM); + String phostCname = form.getString(PROXY_HOST_CNAME);
- if (!StringUtils.isEmpty(phostFreeForm)) { - cmd.setProxyHost(phostFreeForm); + if (!StringUtils.isEmpty(phostCname)) { + cmd.setProxyHost(phostCname); } else if (!StringUtils.isEmpty(phost)) { cmd.setProxy(SystemManager.lookupByIdAndOrg(new Long(phost), ctx diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/proxy-options.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/proxy-options.jspf index a10e1e1..f9dae14 100644 --- a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/proxy-options.jspf +++ b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/proxy-options.jspf @@ -2,6 +2,17 @@ <%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> + +<script type="text/javascript"> +// clear all input fields in given radio group +function clearChecked(radioGroup) { + var i = radioGroup.length; + while (i--) radioGroup[i].checked = false; +} + +//--> +</script> + <c:if test="${not empty proxies}"> <h2> <img src="/img/rhn-icon-proxy.gif" @@ -14,13 +25,25 @@
</c:choose> <p> - <input type="text" name="proxyHostFreeForm" /><br /> <c:forEach var="proxy" items="${proxies}"> - <input type="radio" name="proxyHost" id="${proxy.value}" + <input type="radio" name="proxyHost" id="x${proxy.value}" <c:choose> <c:when test="${proxy.value == param.proxyHost}">checked</c:when> </c:choose> - value='${proxy.value}'/> ${proxy.label}<br /> + onclick="clearChecked(this.form.proxyHostCname)" + value='${proxy.value}'/> <label for="x${proxy.value}">${proxy.label}</label><br /> + <c:choose> + <c:when test="${not empty proxy.value}"> + <c:set var="property" value="${proxy.value}" /> + <c:forEach var="cname" items="${cnames[property]}"> + <img src="/img/channel_child_node.gif" /> + <input type="radio" name="proxyHostCname" id="${cname}" + value='${cname}' + onclick="clearChecked(this.form.proxyHost)" + /><label for="${cname}">${cname}</label><br /> + </c:forEach> + </c:when> + </c:choose> </c:forEach> <br /> <bean:message key="kickstart.schedule.tip.proxy.jsp"/> diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml index 16c2544..be05813 100644 --- a/java/code/webapp/WEB-INF/struts-config.xml +++ b/java/code/webapp/WEB-INF/struts-config.xml @@ -791,7 +791,7 @@ <form-property name="scheduleDate" type="java.util.Date" /> <form-property name="nextAction" type="java.lang.String" /> <form-property name="proxyHost" type="java.lang.String" /> - <form-property name="proxyHostFreeForm" type="java.lang.String" /> + <form-property name="proxyHostCname" type="java.lang.String" /> <!-- Advanced Options Page --> <form-property name="networkType" type="java.lang.String" /> <form-property name="networkInterface" type="java.lang.String" />
commit 1944d012b8943b41cb46e8aed97d9ef56d10b73f Author: Miroslav Suchý msuchy@redhat.com Date: Wed Jul 20 16:02:40 2011 +0200
show cnames aliases in hardware tab in webui
diff --git a/java/code/src/com/redhat/rhn/domain/server/Server.java b/java/code/src/com/redhat/rhn/domain/server/Server.java index ea7d7ed..dd2f696 100644 --- a/java/code/src/com/redhat/rhn/domain/server/Server.java +++ b/java/code/src/com/redhat/rhn/domain/server/Server.java @@ -46,6 +46,7 @@ import org.cobbler.SystemRecord;
import java.net.IDN; import java.sql.Timestamp; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Date; @@ -944,6 +945,23 @@ public class Server extends BaseDomainHelper implements Identifiable { }
/** + * Get the hostname aliases for this server + * @return Returns the hostname aliases for this server + */ + public List<String> getCnames() { + List<String> result = new ArrayList(); + Iterator nets = networks.iterator(); + if (nets.hasNext()) { + nets.next(); // skip primary interface + } + while (nets.hasNext()) { + Network net = (Network) nets.next(); + result.add(net.getHostname()); + } + return result; + } + + /** * Get the primary hostname for this server * If hostname is IDN, it is decoded from Pune encoding * @return Returns the primary hostname for this server @@ -953,6 +971,19 @@ public class Server extends BaseDomainHelper implements Identifiable { return (hostname == null) ? null : IDN.toUnicode(hostname); }
+ /** + * Get the hostname aliases (cname records) for this server + * If hostname is IDN, it is decoded from Pune encoding + * @return Returns the primary hostname for this server + */ + public List<String> getDecodedCnames() { + List<String> result = new ArrayList(); + for (String hostname : getCnames()) { + result.add(IDN.toUnicode(hostname)); + } + return result; + } + /** * @return Returns the networkInterfaces. */ diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java index 9cefeb2..9b893ee 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java @@ -131,6 +131,7 @@ public class SystemHardwareAction extends RhnAction {
request.setAttribute("network_hostname", server.getDecodedHostname()); request.setAttribute("network_ip_addr", server.getIpAddress()); + request.setAttribute("network_cnames", server.getDecodedCnames());
List<String> nicList = new ArrayList(); for (NetworkInterface n : server.getNetworkInterfaces()) { diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml index df5889f..e3c1daa 100644 --- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml +++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml @@ -19620,6 +19620,14 @@ performing a kickstart or creating a new kickstart distribution.</strong> </context-group> </trans-unit>
+ <trans-unit id="sdc.details.hardware.network_cname"> + <source>CName alias:</source> + <context-group name="ctx"> + <context context-type="sourcefile">/systems/details/SystemHardware.do</context> + </context-group> + </trans-unit> + + <trans-unit id="sdc.details.hardware.storage"> <source>Storage</source> <context-group name="ctx"> diff --git a/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp b/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp index b6f84cb..1fa7ca4 100644 --- a/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp +++ b/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp @@ -5,8 +5,18 @@ <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<html:html xhtml="true"> + <head> + <script src="/dojo/dojo/dojo.js" djConfig="parseOnLoad: true"> + <script type="text/javascript"> + dojo.require("dijit.form.DropDownButton"); + dojo.require("dijit.TooltipDialog"); + dojo.require("dijit.form.TextBox"); + dojo.require("dijit.form.Button"); + </script> + </head> <body> <%@ include file="/WEB-INF/pages/common/fragments/systems/system-header.jspf" %> + <h2><bean:message key="sdc.details.hardware.header"/></h2>
<bean:message key="sdc.details.hardware.refresh"/> @@ -154,7 +164,34 @@ </c:otherwise> </c:choose> </td> + <td> + <div dojoType="dijit.form.DropDownButton"> + <span> + + Add CName alias + </span> + <div dojoType="dijit.TooltipDialog"> + <label for="cname_alias"> + CName alias: + </label> + <input dojoType="dijit.form.TextBox" id="cname_alias" name="cname_alias"> + <br> + <button dojoType="dijit.form.Button" type="submit"> + Save + </button> + </div> + </div> + </td> + </tr> + <c:forEach items="${network_cnames}" var="cname_alias" varStatus="loop"> + <tr> + <th> + <bean:message key="sdc.details.hardware.network_cname"/> + </th> + <td> + ${cname_alias} + </td> </tr> + </c:forEach> <tr> <th> <bean:message key="sdc.details.hardware.network_ip_addr"/> diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec index bced6b7..338d9da 100644 --- a/java/spacewalk-java.spec +++ b/java/spacewalk-java.spec @@ -84,6 +84,7 @@ Requires: spacewalk-java-jdbc Requires: spacewalk-branding Requires: jpackage-utils >= 0:1.5 Requires: cobbler >= 2.0.0 +Requires: dojo %if 0%{?fedora} Requires: apache-commons-logging %else
commit 927a000b1ce617e85d95a146aff76092b696841b Author: Miroslav Suchý msuchy@redhat.com Date: Fri Jul 8 14:21:05 2011 +0200
Allow to specify host for kickstart in free form.
diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java index 3b20513..6c3574a 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java @@ -93,6 +93,7 @@ public class ScheduleKickstartWizardAction extends RhnWizardAction { public static final String POST_KERNEL_PARAMS = "postKernelParams"; public static final String POST_KERNEL_PARAMS_TYPE = "postKernelParamsType"; public static final String PROXY_HOST = "proxyHost"; + public static final String PROXY_HOST_FREE_FORM = "proxyHostFreeForm"; public static final String IS_VIRTUAL_GUEST = "isVirtualGuest"; public static final String HOST_SID = "hostSid"; public static final String VIRT_HOST_IS_REGISTERED = "virtHostIsRegistered"; @@ -586,8 +587,12 @@ public class ScheduleKickstartWizardAction extends RhnWizardAction { KickstartScheduleCommand cmd) { // if we need to go through a proxy, do it here. String phost = form.getString(PROXY_HOST); + String phostFreeForm = form.getString(PROXY_HOST_FREE_FORM);
- if (!StringUtils.isEmpty(phost)) { + if (!StringUtils.isEmpty(phostFreeForm)) { + cmd.setProxyHost(phostFreeForm); + } + else if (!StringUtils.isEmpty(phost)) { cmd.setProxy(SystemManager.lookupByIdAndOrg(new Long(phost), ctx .getCurrentUser().getOrg())); } diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/proxy-options.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/proxy-options.jspf index bfa5f3e..a10e1e1 100644 --- a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/proxy-options.jspf +++ b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/proxy-options.jspf @@ -14,14 +14,15 @@
</c:choose> <p> - <select name="proxyHost"> - <c:forEach var="proxy" items="${proxies}"> - <option - <c:if test="${proxy.value == param.proxyHost}">selected="selected"</c:if> - value='${proxy.value}'>${proxy.label}</option> - </c:forEach> - </select> + <input type="text" name="proxyHostFreeForm" /><br /> + <c:forEach var="proxy" items="${proxies}"> + <input type="radio" name="proxyHost" id="${proxy.value}" + <c:choose> + <c:when test="${proxy.value == param.proxyHost}">checked</c:when> + </c:choose> + value='${proxy.value}'/> ${proxy.label}<br /> + </c:forEach> <br /> <bean:message key="kickstart.schedule.tip.proxy.jsp"/> </p> - </c:if> \ No newline at end of file + </c:if> diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml index e8e5853..16c2544 100644 --- a/java/code/webapp/WEB-INF/struts-config.xml +++ b/java/code/webapp/WEB-INF/struts-config.xml @@ -791,6 +791,7 @@ <form-property name="scheduleDate" type="java.util.Date" /> <form-property name="nextAction" type="java.lang.String" /> <form-property name="proxyHost" type="java.lang.String" /> + <form-property name="proxyHostFreeForm" type="java.lang.String" /> <!-- Advanced Options Page --> <form-property name="networkType" type="java.lang.String" /> <form-property name="networkInterface" type="java.lang.String" />
spacewalk-commits@lists.fedorahosted.org