提交 96294049 编写于 作者: J Jesse Glick

Merge branch 'master' of github.com:jenkinsci/jenkins

......@@ -24,32 +24,35 @@
package hudson;
import com.google.common.collect.Lists;
import com.thoughtworks.xstream.XStream;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import hudson.util.FormValidation;
import jenkins.model.Jenkins;
import hudson.model.Saveable;
import hudson.model.listeners.SaveableListener;
import hudson.util.FormValidation;
import hudson.util.Scrambler;
import hudson.util.Secret;
import hudson.util.XStream2;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.net.Authenticator;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
import com.thoughtworks.xstream.XStream;
import java.io.InputStream;
import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
import jenkins.model.Jenkins;
import org.apache.commons.httpclient.Credentials;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.GetMethod;
import org.jvnet.robust_http_client.RetryableHttpStream;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
......@@ -65,7 +68,7 @@ import org.kohsuke.stapler.QueryParameter;
* (as described in the Java 6 tech note
* <a href="http://java.sun.com/javase/6/docs/technotes/guides/net/http-auth.html">
* Http Authentication</a>).
*
*
* @see jenkins.model.Jenkins#proxy
*/
public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfiguration> implements Saveable, Serializable {
......@@ -80,7 +83,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
/**
* List of host names that shouldn't use proxy, as typed by users.
*
* @see #getNoProxyHostPatterns()
* @see #getNoProxyHostPatterns()
*/
public final String noProxyHost;
......@@ -91,6 +94,8 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
* encrypted password
*/
private Secret secretPassword;
private String testUrl;
public ProxyConfiguration(String name, int port) {
this(name,port,null,null);
......@@ -100,13 +105,18 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
this(name,port,userName,password,null);
}
@DataBoundConstructor
public ProxyConfiguration(String name, int port, String userName, String password, String noProxyHost) {
this(name,port,userName,password,noProxyHost,null);
}
@DataBoundConstructor
public ProxyConfiguration(String name, int port, String userName, String password, String noProxyHost, String testUrl) {
this.name = Util.fixEmptyAndTrim(name);
this.port = port;
this.userName = Util.fixEmptyAndTrim(userName);
this.secretPassword = Secret.fromString(password);
this.noProxyHost = Util.fixEmptyAndTrim(noProxyHost);
this.testUrl =Util.fixEmptyAndTrim(testUrl);
}
public String getUserName() {
......@@ -126,6 +136,10 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
return (secretPassword == null) ? null : secretPassword.getEncryptedValue();
}
public String getTestUrl() {
return testUrl;
}
/**
* Returns the list of properly formatted no proxy host names.
*/
......@@ -207,7 +221,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
URLConnection con = url.openConnection(p.createProxy(url.getHost()));
if(p.getUserName()!=null) {
// Add an authenticator which provides the credentials for proxy authentication
// Add an authenticator which provides the credentials for proxy authentication
Authenticator.setDefault(new Authenticator() {
@Override
public PasswordAuthentication getPasswordAuthentication() {
......@@ -245,7 +259,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
}
});
}
return is;
}
......@@ -280,5 +294,43 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
}
return FormValidation.ok();
}
public FormValidation doValidateProxy(
@QueryParameter("testUrl") String testUrl, @QueryParameter("name") String name, @QueryParameter("port") int port,
@QueryParameter("userName") String userName, @QueryParameter("password") String password,
@QueryParameter("noProxyHost") String noProxyHost) {
if (Util.fixEmptyAndTrim(testUrl) == null) {
return FormValidation.error(Messages.ProxyConfiguration_TestUrlRequired());
}
GetMethod method = null;
try {
method = new GetMethod(testUrl);
method.getParams().setParameter("http.socket.timeout", new Integer(30 * 1000));
HttpClient client = new HttpClient();
if (Util.fixEmptyAndTrim(name) != null) {
client.getHostConfiguration().setProxy(name, port);
Credentials credentials =
new UsernamePasswordCredentials(userName, Secret.fromString(password).getPlainText());
AuthScope scope = new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT);
client.getState().setProxyCredentials(scope, credentials);
}
int code = client.executeMethod(method);
if (code != HttpURLConnection.HTTP_OK) {
return FormValidation.error(Messages.ProxyConfiguration_FailedToConnect(testUrl, code));
}
} catch (IOException e) {
return FormValidation.error(e, Messages.ProxyConfiguration_FailedToConnectViaProxy(testUrl));
} finally {
if (method != null) {
method.releaseConnection();
}
}
return FormValidation.ok(Messages.ProxyConfiguration_Success());
}
}
}
......@@ -63,3 +63,8 @@ PluginManager.ConfigureUpdateCenterPermission.Description=\
AboutJenkins.DisplayName=About Jenkins
AboutJenkins.Description=See the version and license information.
ProxyConfiguration.TestUrlRequired=Test URL is required.
ProxyConfiguration.FailedToConnectViaProxy=Failed to connect to {0}.
ProxyConfiguration.FailedToConnect=Failed to connect to {0} (code {1}).
ProxyConfiguration.Success=Success
\ No newline at end of file
......@@ -62,4 +62,9 @@ PluginManager.UploadPluginsPermission.Description=\
PluginManager.ConfigureUpdateCenterPermission.Description=\
\u6a29\u9650"\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u30bb\u30f3\u30bf\u30fc\u306e\u66f4\u65b0"\u304c\u3001\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u30b5\u30a4\u30c8\u3084\u30d7\u30ed\u30ad\u30b7\u30fc\u306e\u8a2d\u5b9a\u3092\u8a31\u53ef\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002
AboutJenkins.DisplayName=Jenkins\u306b\u3064\u3044\u3066
AboutJenkins.Description=\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u30e9\u30a4\u30bb\u30f3\u30b9\u60c5\u5831\u3092\u8868\u793a\u3057\u307e\u3059\u3002
\ No newline at end of file
AboutJenkins.Description=\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u30e9\u30a4\u30bb\u30f3\u30b9\u60c5\u5831\u3092\u8868\u793a\u3057\u307e\u3059\u3002
ProxyConfiguration.TestUrlRequired=\u30c6\u30b9\u30c8URL\u306f\u5fc5\u9808\u3067\u3059\u3002
ProxyConfiguration.FailedToConnectViaProxy={0} \u306b\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002
ProxyConfiguration.FailedToConnect={0} \u306b\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002(\u30b3\u30fc\u30c9 {1}).
ProxyConfiguration.Success=\u6210\u529f
\ No newline at end of file
......@@ -17,3 +17,10 @@ f.entry(title:_("Password"),field:"password") {
f.entry(title:_("No Proxy Host"),field:"noProxyHost") {
f.textarea()
}
f.advanced(){
f.entry(title:_("Test URL"),field:"testUrl") {
f.textbox()
}
f.validateButton(title:_("Validate Proxy"),
method:"validateProxy", with:"testUrl,name,port,userName,password,noProxyHost")
}
# The MIT License
#
# Copyright (c) 2004-2012, Sun Microsystems, Inc., Kohsuke Kawaguchi, Seiji Sogabe
# Copyright (c) 2004-2013, Sun Microsystems, Inc., Kohsuke Kawaguchi, Seiji Sogabe
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -24,4 +24,6 @@ Server=\u30b5\u30fc\u30d0\u30fc
Port=\u30dd\u30fc\u30c8\u756a\u53f7
User\ name=\u30e6\u30fc\u30b6\u30fc\u540d
Password=\u30d1\u30b9\u30ef\u30fc\u30c9
No\ Proxy\ Host=\u5bfe\u8c61\u5916\u30db\u30b9\u30c8
\ No newline at end of file
No\ Proxy\ Host=\u5bfe\u8c61\u5916\u30db\u30b9\u30c8
Test\ URL=\u30c6\u30b9\u30c8URL
Validate\ Proxy=Proxy\u306e\u63a5\u7d9a\u78ba\u8a8d
\ No newline at end of file
......@@ -19,4 +19,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# note for translators: this message is referenced from st:structuredMessageFormat
description=Upstream project {0} is already building.
\ No newline at end of file
# The MIT License
#
# Copyright (c) 2004-2013, Sun Microsystems, Inc., Harald Albers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
description=Vorgelagertes Projekt {0} ist bereits in Arbeit.
......@@ -19,3 +19,5 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
description=El proyecto padre {0} est\u00E1 ejecutandose actualmente.
......@@ -20,7 +20,8 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
Back\ to\ Dashboard= Zur\u00fcck zur \u00dcbersicht
Back\ to\ Dashboard=Zur\u00fcck zur \u00dcbersicht
Up=Zur\u00FCck
Status=Status
Changes=\u00c4nderungen
Workspace=Arbeitsbereich
......
......@@ -9,6 +9,6 @@ step.1=Melden Sie sich am Rechner an, auf dem Jenkins l
step.2=Führen Sie manuell <tt>svn co ...</tt> aus.
step.3=Subversion fragt Sie interaktiv nach dem Passwort. Geben Sie dieses ein.
step.4=Subversion speichert das Passwort in seinem eigenen Authentifizierungscache. Bei allen \
weiteren Aufrufen von <tt>svn co ...</tt> wird das Passwort aus dem Cache verwendet.
final.words=Dieses Vorgehen schützt Ihr Passwort nicht wirklich - es ist aber immerhin \
ein bißchen schwerer auszuspähen.
weiteren Aufrufen von <tt>svn co ...</tt> wird das Passwort aus dem Cache verwendet.
final.words=Dieses Vorgehen sch\u00FCtzt Ihr Passwort nicht wirklich - es ist aber immerhin \
ein bisschen schwerer auszusp\u00E4hen.
Trigger\ builds\ remotely=Auslser, um entfernte Builds zu starten
Trigger\ builds\ remotely=Builds von au\u00DFerhalb starten
e.g.,\ from\ scripts=z.B. skriptgesteuert
Authentication\ Token=Authentifizierungstoken
Use\ the\ following\ URL\ to\ trigger\ build\ remotely\:=Folgende URL verwenden, um einen entfernte Build auszulsen:
......
......@@ -20,4 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# note for translators: this message is referenced from st:structuredMessageFormat
description=Waiting for next available executor on {0}
\ No newline at end of file
# The MIT License
#
# Copyright (c) 2013, Sun Microsystems, Harald Albers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
description=Alle Knoten des Labels ''{0}'' sind besch\u00E4ftigt
......@@ -20,3 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
description=Esperando por un ejecutor disponible en {0}
......@@ -20,4 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# note for translators: this message is referenced from st:structuredMessageFormat
description=All nodes of label \u2018{0}\u2019 are offline
\ No newline at end of file
# The MIT License
#
# Copyright (c) 2013, Sun Microsystems, Harald Albers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
description=Alle Knoten des Labels ''{0}'' sind offline
......@@ -20,3 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
description=Todos los nodos etiquetados como ''{0}'' estan fuera de l\u00EDnea
......@@ -20,4 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# note for translators: this message is referenced from st:structuredMessageFormat
description=Waiting for next available executor on {0}
\ No newline at end of file
# The MIT License
#
# Copyright (c) 2013, Sun Microsystems, Harald Albers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
description=Warte auf den n\u00E4chsten freien Build-Prozessor auf {0}
......@@ -20,3 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
description=Esperando por un ejecutor libre en {0}
......@@ -20,4 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# note for translators: this message is referenced from st:structuredMessageFormat
description={0} is offline
\ No newline at end of file
# The MIT License
#
# Copyright (c) 2013, Sun Microsystems, Harald Albers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
description={0} ist offline
......@@ -20,3 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
description={0} est\u00E1 fuera de l\u00EDnea
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册