Skip to content

Commit

Permalink
[JENKINS-16273] Improved instructions for passing -jnlpCredentials.
Browse files Browse the repository at this point in the history
First, display instructions when the user has CONNECT, not necessarily ADMINISTER.
Second, when anonymous users cannot CONNECT, show how to use -jnlpCredentials
(and do not bother showing javaws, since it does not work in this case).(cherry picked from commit a1e709d)

Conflicts:
	changelog.html
  • Loading branch information
jglick authored and vjuranek committed Jan 25, 2013
1 parent 4b1a73f commit 17f0161
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -64,6 +64,9 @@
<li class=bug>
Improving responsiveness of <b>People</b> page.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16397">issue 16397</a>)
<li class=bug>
JNLP slave index page failed to explain how to pass <code>-jnlpCredentials</code>.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16273">issue 16273</a>)
<li class=bug>
Slow rendering of view pages in large installations due to eager check whether the “People” link would show anything.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16244">issue 16244</a>)
Expand Down
40 changes: 26 additions & 14 deletions core/src/main/resources/hudson/slaves/JNLPLauncher/main.jelly
Expand Up @@ -32,7 +32,7 @@ THE SOFTWARE.
</div>
</j:when>
<j:when test="${it.offline and !it.temporarilyOffline}">
<l:isAdmin><!-- TODO: we need a permission to launch a slave -->
<j:if test="${h.hasPermission(it, it.CONNECT)}">
<p>
${%Connect slave to Jenkins one of these ways:}
</p>
Expand All @@ -45,18 +45,30 @@ THE SOFTWARE.
${%Launch agent from browser on slave}
</p>
</li>
<li>
<p>
${%Run from slave command line:}
</p>
<pre>javaws ${h.inferHudsonURL(request)}${it.url}slave-agent.jnlp</pre>
</li>
<li>
<p>
${%Or if the slave is headless:}
</p>
<pre>java -jar <a href="${rootURL}/jnlpJars/slave.jar">slave.jar</a> -jnlpUrl ${h.inferHudsonURL(request)}${it.url}slave-agent.jnlp</pre>
</li>
<j:choose>
<j:when test="${it.ACL.hasPermission(app.ANONYMOUS, it.CONNECT)}">
<li>
<p>
${%Run from slave command line:}
</p>
<pre>javaws ${h.inferHudsonURL(request)}${it.url}slave-agent.jnlp</pre>
</li>
<li>
<p>
${%Or if the slave is headless:}
</p>
<pre>java -jar <a href="${rootURL}/jnlpJars/slave.jar">slave.jar</a> -jnlpUrl ${h.inferHudsonURL(request)}${it.url}slave-agent.jnlp</pre>
</li>
</j:when>
<j:otherwise>
<li>
<p>
${%Run from slave command line:}
</p>
<pre>java -jar <a href="${rootURL}/jnlpJars/slave.jar">slave.jar</a> -jnlpUrl ${h.inferHudsonURL(request)}${it.url}slave-agent.jnlp -jnlpCredentials ${app.authentication.name}:<a href="${rootURL}/user/${app.authentication.name}/configure" target="_blank">your-API-token</a></pre>
</li>
</j:otherwise>
</j:choose>
</ul>
<!--
<p>
Expand All @@ -65,7 +77,7 @@ THE SOFTWARE.
</a>
</p>
-->
</l:isAdmin>
</j:if>
</j:when>
<j:otherwise>
<p>
Expand Down

0 comments on commit 17f0161

Please sign in to comment.