提交 8208d1da 编写于 作者: K kzantow

Re-run offline check & metadata download if needed, proxy configuration

didn't survive refactoring, fix misc. comments by @jglick, updated some
text based on changes to the process
上级 ff4294ca
......@@ -302,6 +302,27 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
}
}
if (checkJob != null) {
boolean isOffline = false;
for (ConnectionStatus status : checkJob.connectionStates.values()) {
if(ConnectionStatus.FAILED.equals(status)) {
isOffline = true;
break;
}
}
if (isOffline) {
// retry connection states if determined to be offline
checkJob.run();
isOffline = false;
for (ConnectionStatus status : checkJob.connectionStates.values()) {
if(ConnectionStatus.FAILED.equals(status)) {
isOffline = true;
break;
}
}
if(!isOffline) { // also need to download the metadata
updateAllSites();
}
}
return HttpResponses.okJSON(checkJob.connectionStates);
} else {
return HttpResponses.errorJSON(String.format("Unknown site '%s'.", siteId));
......
......@@ -43,10 +43,10 @@ import java.util.List;
*/
public class FullControlOnceLoggedInAuthorizationStrategy extends AuthorizationStrategy {
/**
* Whether to allow anonymouos read access, default behavior
* previously was to do so
* Whether to allow anonymous read access, for backward compatibility
* default is to allow it
*/
private boolean authenticatedReadOnly = false;
private boolean denyAnonymousReadAccess = false;
@DataBoundConstructor
public FullControlOnceLoggedInAuthorizationStrategy() {
......@@ -54,7 +54,7 @@ public class FullControlOnceLoggedInAuthorizationStrategy extends AuthorizationS
@Override
public ACL getRootACL() {
return !authenticatedReadOnly ? ANONYMOUS_READ : AUTHENTICATED_READ;
return denyAnonymousReadAccess ? AUTHENTICATED_READ : ANONYMOUS_READ;
}
public List<String> getGroups() {
......@@ -65,12 +65,12 @@ public class FullControlOnceLoggedInAuthorizationStrategy extends AuthorizationS
* If true, anonymous read access will be allowed
*/
public boolean isAllowAnonymousRead() {
return !authenticatedReadOnly;
return !denyAnonymousReadAccess;
}
@DataBoundSetter
public void setAllowAnonymousRead(boolean allowAnonymousRead) {
this.authenticatedReadOnly = !allowAnonymousRead;
this.denyAnonymousReadAccess = !allowAnonymousRead;
}
private static final SparseACL AUTHENTICATED_READ = new SparseACL(null);
......
......@@ -62,11 +62,6 @@ public class SetupWizard {
authStrategy.setAllowAnonymousRead(false);
j.setAuthorizationStrategy(authStrategy);
// there probably aren't any implementors yet, but just in case
for (PermissionAdder adder : ExtensionList.lookup(PermissionAdder.class)) {
adder.add(authStrategy, admin, Jenkins.ADMINISTER);
}
// Shut down all the ports we can by default:
j.setSlaveAgentPort(-1); // -1 to disable
......
......@@ -2,10 +2,10 @@
<l:html norefresh="true" title="${it.displayName}" xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:main-panel>
<h1>${%HTTP Proxy Configuration}</h1>
<f:form method="post" action="proxyConfigure" name="proxyConfigure">
<f:form method="post" action="/pluginManager/proxyConfigure" name="proxyConfigure">
<j:scope>
<j:set var="instance" value="${app.proxy}"/>
<j:set var="descriptor" value="${it.pluginManager.proxyDescriptor}"/>
<j:set var="descriptor" value="${app.pluginManager.proxyDescriptor}"/>
<st:include from="${descriptor}" page="${descriptor.configPage}" />
</j:scope>
</f:form>
......
......@@ -10,7 +10,7 @@ installWizard_offline_message=This Jenkins instance appears to be offline. \
<p style="font-size:18px; margin-top: 6%"> \
For information about installing Jenkins without an internet connection, see the \
<a href="https://wiki.jenkins-ci.org/display/JENKINS/Offline+Jenkins+Installation" target="_blank">Offline Jenkins Installation Documentation</a>. <br/><br/> \
If you need to configure a proxy, you may close this wizard and use the Plugin Manager. \
You may choose to continue by configuring a proxy or skipping plugin installation. \
</p>
installWizard_error_header=An error occurred
installWizard_error_message=An error occurred during installation:
......
......@@ -24,7 +24,7 @@ exports.saveFirstUser = function($form, success, error) {
*/
exports.saveProxy = function($form, success, error) {
jenkins.staplerPost(
'/proxyConfigure',
'/pluginManager/proxyConfigure',
$form,
success, {
dataType: 'html',
......
......@@ -719,7 +719,7 @@ var createPluginSetupWizard = function(appendTarget) {
// Save the proxy config
var saveProxyConfig = function() {
securityConfig.saveProxy($('iframe[src]').contents().find('form:not(.no-json)'), function() {
setPanel(welcomePanel);
jenkins.goTo('/'); // this will re-run connectivity test
});
};
......
......@@ -6,7 +6,7 @@
<h1>{{translations.installWizard_offline_title}}</h1>
<p>{{{translations.installWizard_offline_message}}}</p>
<p>
<button type="button" class="btn btn-primary configure-proxy">{{translations.installWizard_configureProxy_label}}</button>
<button type="button" class="btn btn-primary show-proxy-config">{{translations.installWizard_configureProxy_label}}</button>
<button type="button" class="btn btn-primary skip-plugin-installs">{{translations.installWizard_skipPluginInstallations}}</button>
</p>
</div>
......
<div class="modal-header">
<h4 class="modal-title">{{translations.installWizard_configureProxy_label}} PROXY</h4>
<h4 class="modal-title">{{translations.installWizard_configureProxy_label}}</h4>
</div>
<div class="modal-body">
<div class="jumbotron welcome-panel security-panel">
<iframe src="{{baseUrl}}/proxy-configuration"></iframe>
<iframe src="{{baseUrl}}/setupWizard/proxy-configuration"></iframe>
</div>
</div>
<div class="modal-footer">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册