Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
26fc0c85
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
26fc0c85
编写于
6月 17, 2011
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prevent a occasional JavaScript safety warning message when running in
HTTPS
上级
da4ddde7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
59 addition
and
7 deletion
+59
-7
changelog.html
changelog.html
+2
-0
core/src/main/java/hudson/model/DownloadService.java
core/src/main/java/hudson/model/DownloadService.java
+19
-3
core/src/main/java/hudson/model/UpdateSite.java
core/src/main/java/hudson/model/UpdateSite.java
+23
-0
core/src/main/java/jenkins/model/Jenkins.java
core/src/main/java/jenkins/model/Jenkins.java
+13
-2
core/src/main/resources/hudson/model/UpdateCenter/PageDecoratorImpl/footer.jelly
.../hudson/model/UpdateCenter/PageDecoratorImpl/footer.jelly
+1
-1
core/src/main/resources/hudson/model/UsageStatistics/footer.jelly
.../main/resources/hudson/model/UsageStatistics/footer.jelly
+1
-1
未找到文件。
changelog.html
浏览文件 @
26fc0c85
...
...
@@ -61,6 +61,8 @@ Upcoming changes</a>
<li
class=
bug
>
Defined a proper way to interrupt the build and mark it as a failure.
(
<a
href=
"http://issues.jenkins-ci.org/browse/JENKINS-9203"
>
issue 9203
</a>
)
<li
class=
rfe
>
Prevent a occasional JavaScript safety warning message when running in HTTPS
<li
class=
rfe
>
About page should not autorefresh
(
<a
href=
"http://issues.jenkins-ci.org/browse/JENKINS-9967"
>
issue 9967
</a>
)
...
...
core/src/main/java/hudson/model/DownloadService.java
浏览文件 @
26fc0c85
...
...
@@ -73,7 +73,7 @@ public class DownloadService extends PageDecorator {
.
append
(
" downloadService.download("
)
.
append
(
QuotedStringTokenizer
.
quote
(
d
.
getId
()))
.
append
(
','
)
.
append
(
QuotedStringTokenizer
.
quote
(
d
.
getUrl
(
)))
.
append
(
QuotedStringTokenizer
.
quote
(
mapHttps
(
d
.
getUrl
()
)))
.
append
(
','
)
.
append
(
"{version:"
+
QuotedStringTokenizer
.
quote
(
Jenkins
.
VERSION
)+
'}'
)
.
append
(
','
)
...
...
@@ -89,6 +89,22 @@ public class DownloadService extends PageDecorator {
return
buf
.
toString
();
}
private
String
mapHttps
(
String
url
)
{
/*
HACKISH:
Loading scripts in HTTP from HTTPS pages cause browsers to issue a warning dialog.
The elegant way to solve the problem is to always load update center from HTTPS,
but our backend mirroring scheme isn't ready for that. So this hack serves regular
traffic in HTTP server, and only use HTTPS update center for Jenkins in HTTPS.
We'll monitor the traffic to see if we can sustain this added traffic.
*/
if
(
url
.
startsWith
(
"http://updates.jenkins-ci.org/"
)
&&
Jenkins
.
getInstance
().
isRootUrlSecure
())
return
"https"
+
url
.
substring
(
4
);
return
url
;
}
/**
* Gets {@link Downloadable} by its ID.
* Used to bind them to URL.
...
...
@@ -119,9 +135,9 @@ public class DownloadService extends PageDecorator {
/**
*
* @param url
* URL relative to {@link UpdateCenter#getUrl()}.
* URL relative to {@link UpdateCenter#get
DefaultBase
Url()}.
* So if this string is "foo.json", the ultimate URL will be
* something like "http
s://hudson.dev.java.net
/foo.json"
* something like "http
://updates.jenkins-ci.org/updates
/foo.json"
*
* For security and privacy reasons, we don't allow the retrieval
* from random locations.
...
...
core/src/main/java/hudson/model/UpdateSite.java
浏览文件 @
26fc0c85
...
...
@@ -37,6 +37,7 @@ import static hudson.util.TimeUnit2.DAYS;
import
jenkins.model.Jenkins
;
import
net.sf.json.JSONObject
;
import
org.kohsuke.stapler.DataBoundConstructor
;
import
org.kohsuke.stapler.Stapler
;
import
org.kohsuke.stapler.StaplerRequest
;
import
org.kohsuke.stapler.StaplerResponse
;
import
org.jvnet.hudson.crypto.CertificateUtil
;
...
...
@@ -337,6 +338,28 @@ public class UpdateSite {
return
url
;
}
/**
* Where to actually download the update center?
*
* @deprecated
* Exposed only for UI.
*/
public
String
getDownloadUrl
()
{
/*
HACKISH:
Loading scripts in HTTP from HTTPS pages cause browsers to issue a warning dialog.
The elegant way to solve the problem is to always load update center from HTTPS,
but our backend mirroring scheme isn't ready for that. So this hack serves regular
traffic in HTTP server, and only use HTTPS update center for Jenkins in HTTPS.
We'll monitor the traffic to see if we can sustain this added traffic.
*/
if
(
url
.
equals
(
"http://updates.jenkins-ci.org/update-center.json"
)
&&
Jenkins
.
getInstance
().
isRootUrlSecure
())
return
"https"
+
url
.
substring
(
4
);
return
url
;
}
/**
* Is this the legacy default update center site?
*/
...
...
core/src/main/java/jenkins/model/Jenkins.java
浏览文件 @
26fc0c85
...
...
@@ -1622,8 +1622,8 @@ public class Jenkins extends AbstractCIBase implements ModifiableItemGroup<TopLe
}
/**
* Gets the absolute URL of
Hudson
,
* such as "http://localhost/
hudson
/".
* Gets the absolute URL of
Jenkins
,
* such as "http://localhost/
jenkins
/".
*
* <p>
* This method first tries to use the manually configured value, then
...
...
@@ -1650,6 +1650,17 @@ public class Jenkins extends AbstractCIBase implements ModifiableItemGroup<TopLe
return
null
;
}
/**
* Is Jenkins running in HTTPS?
*
* Note that we can't really trust {@link StaplerRequest#isSecure()} because HTTPS might be terminated
* in the reverse proxy.
*/
public
boolean
isRootUrlSecure
()
{
String
url
=
getRootUrl
();
return
url
!=
null
&&
url
.
startsWith
(
"https"
);
}
/**
* Gets the absolute URL of Hudson top page, such as "http://localhost/hudson/".
*
...
...
core/src/main/resources/hudson/model/UpdateCenter/PageDecoratorImpl/footer.jelly
浏览文件 @
26fc0c85
...
...
@@ -37,7 +37,7 @@ THE SOFTWARE.
Behaviour.addLoadEvent(function() {
downloadService.download(
"${site.id}",
"${site.
u
rl}",
"${site.
downloadU
rl}",
{version:"${h.version}"},
"${rootURL}/updateCenter/byId/${site.id}/postBack",
null);
...
...
core/src/main/resources/hudson/model/UsageStatistics/footer.jelly
浏览文件 @
26fc0c85
...
...
@@ -34,7 +34,7 @@ THE SOFTWARE.
<j:if test="${it.due}">
<script>
Behaviour.addLoadEvent(function() {
loadScript("
http
://usage.jenkins-ci.org/usage-stats.js?${it.statData}");
loadScript("
${app.isRootUrlSecure()?'https':'http'}
://usage.jenkins-ci.org/usage-stats.js?${it.statData}");
});
</script>
</j:if>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录