This file is indexed.

/usr/share/koji-web/scripts/taskinfo.chtml is in koji-servers 1.10.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
#import koji
#from kojiweb import util
#import urllib
#import cgi

#def printValue($key, $value, $sep=', ')
  #if $key in ('brootid', 'buildroot_id')
<a href="buildrootinfo?buildrootID=$value">$value</a>
  #elif $isinstance($value, list) 
$sep.join([$str($val) for $val in $value]) 
  #elif $isinstance($value, dict)
$sep.join(['%s=%s' % (($n == '' and "''" or $n), $v) for $n, $v in $value.items()])
  #else 
$value
  #end if
#end def

#def printProperties($props)
  #echo ', '.join([$v is not None and '%s=%s' % ($n, $v) or $str($n) for $n, $v in $props.items()])
#end def

#def printMap($vals, $prefix='')
  #for $key, $value in $vals.items()
  #if $key == 'properties'
  ${prefix}properties&nbsp;=&nbsp;$printProperties($value)<br/>
  #elif $key != '__starstar'
  $prefix$key&nbsp;=&nbsp;$printValue($key, $value)<br/>
  #end if
  #end for  
#end def

#def printOpts($opts)
  #if $opts
  <strong>Options:</strong><br/>
  $printMap($opts, '&nbsp;&nbsp;')
  #end if
#end def

#def printChildren($taskID, $childMap)
  #set $iter = 0
  #set $children = $childMap[$str($taskID)]
  #if $children
  <ul>
    #for $child in $children
    #set $iter += 1
    #if $iter < $len($children)
    <li class="sibling">
    #else
    <li>
    #end if
      #set $childState = $util.taskState($child.state)
      <span class="treeBranch">
        <span class="treeLabel">
          <a href="taskinfo?taskID=$child.id" class="task$childState" title="$childState">$koji.taskLabel($child)</a>
        </span>
      </span>
    $printChildren($child.id, $childMap)
    </li>
    #end for
  </ul>
  #end if
#end def

#include "includes/header.chtml"

  <h4>Information for task <a href="taskinfo?taskID=$task.id">$koji.taskLabel($task)</a></h4>

  <table>
    <tr>
      <th>ID</th><td>$task.id</td>
    </tr>
    <tr>
      <th>Method</th><td>$task.method</td>
    </tr>
    <tr>
      <th>Parameters</th>
      <td>
        #if $task.method == 'buildSRPMFromSCM'
        <strong>SCM URL:</strong> $params[0]<br/>
        #if $len($params) > 1
        <strong>Build Tag:</strong>: <a href="taginfo?tagID=$buildTag.name">$buildTag.name</a><br/>
        #end if
        #if $len($params) > 2
        $printOpts($params[2])
        #end if
        #elif $task.method == 'buildSRPMFromCVS'
        <strong>CVS URL:</strong> $params[0]
        #elif $task.method == 'buildArch'
        <strong>SRPM:</strong> $params[0]<br/>
        <strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag.name">$buildTag.name</a><br/>
        <strong>Arch:</strong> $params[2]<br/>
        <strong>Keep SRPM?</strong> #if $params[3] then 'yes' else 'no'#<br/>
        #if $len($params) > 4
        $printOpts($params[4])
        #end if
        #elif $task.method == 'tagBuild'
        <strong>Destination Tag:</strong> <a href="taginfo?tagID=$destTag.id">$destTag.name</a><br/>
        <strong>Build:</strong> <a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a>
        #elif $task.method == 'buildNotification'
        #set $build = $params[1]
        #set $buildTarget = $params[2]
        <strong>Recipients:</strong>&nbsp;$printValue('', $params[0])<br/>
        <strong>Build:</strong> <a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a><br/>
        #if $buildTarget
        <strong>Build Target:</strong> <a href="buildtargetinfo?targetID=$buildTarget.id">$buildTarget.name</a><br/>
        #else
        <strong>Build Target:</strong> (no build target)<br/>
        #end if
        <strong>Web URL:</strong> <a href="$params[3]">$params[3]</a>
        #elif $task.method == 'tagNotification'
        <strong>Recipients:</strong>&nbsp;$printValue('', $params[0])<br/>
        <strong>Successful?:</strong> #if $params[1] then 'yes' else 'no'#<br/>
        #if $destTag
        <strong>Tagged Into:</strong> <a href="taginfo?tagID=$destTag.id">$destTag.name</a><br/>
        #end if
        #if $srcTag
        <strong>#if $destTag then 'Moved From:' else 'Untagged From:'#</strong> <a href="taginfo?tagID=$srcTag.id">$srcTag.name</a><br/>
        #end if
        <strong>Build:</strong> <a href="buildinfo?buildID=$build.id">$koji.buildLabel($build)</a><br/>
        <strong>#if $destTag then 'Tagged By:' else 'Untagged By:'#</strong> <a href="userinfo?userID=$user.id">$user.name</a><br/>
        <strong>Ignore Success?:</strong> #if $params[6] then 'yes' else 'no'#<br/>
        #if $params[7]
        <strong>Failure Message:</strong> $params[7]
        #end if
        #elif $task.method == 'build'
        <strong>Source:</strong> $params[0]<br/>
        <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>
        $printOpts($params[2])
        #elif $task.method == 'maven'
        <strong>SCM URL:</strong> $params[0]<br/>
        <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>
        $printOpts($params[2])
	#elif $task.method == 'buildMaven'
	<strong>SCM URL:</strong> $params[0]<br/>
	<strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag.id">$buildTag.name</a><br/>
	#if $len($params) > 2
        $printOpts($params[2])
        #end if
	#elif $task.method == 'wrapperRPM'
	<strong>Spec File URL:</strong> $params[0]<br/>
	#if 'locked' in $buildTarget
	#set $buildTag = $buildTarget
	<strong>Build Tag:</strong> <a href="taginfo?tagID=$buildTag.id">$buildTag.name</a><br/>
	#else
	<strong>Build Target:</strong> <a href="buildtargetinfo?targetID=$buildTarget.id">$buildTarget.name</a><br/>
	#end if
	#if $params[2]
	<strong>Build:</strong> <a href="buildinfo?buildID=$params[2].id">$koji.buildLabel($params[2])</a><br/>
	#end if
	#if $params[3]
	<strong>Task:</strong> <a href="taskinfo?taskID=$wrapTask.id">$koji.taskLabel($wrapTask)</a><br/>
	#end if
        #if $len($params) > 4
        $printOpts($params[4])
        #end if
        #elif $task.method == 'chainmaven'
        <strong>Builds:</strong><br/>
        <table>
        #for $key, $val in $params[0].items()
        <tr><td><strong>$key:</strong></td><td>$printMap($val)</td></tr>
        #end for
        </table>
        <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>
        #if $len($params) > 2
        $printOpts($params[2])
        #end if
        #elif $task.method == 'livecd' or $task.method == 'appliance'
        <strong>Arch:</strong> $params[2]<br/>
        <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[3]">$params[3]</a><br/>
        <strong>Kickstart File:</strong> $params[4]<br/>
        $printOpts($params[5])
        #elif $task.method == 'image'
        <strong>Arches:</strong> #echo ', '.join($params[2])#<br/>
        <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[3]">$params[3]</a><br/>
        <strong>Installation Tree:</strong> $params[4]<br/>
        $printOpts($params[5])
        #elif $task.method == 'createLiveCD' or $task.method == 'createAppliance'
        #if $len($params) > 4:
        ## new method signature
        <strong>Arch:</strong> $params[3]<br/>
        <strong>Kickstart File:</strong> $params[7]<br/>
        #if $len($params) > 8
        $printOpts($params[8])
        #end if
        #else
        ## old method signature
        <strong>Arch:</strong> $params[0]<br/>
        <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>
        <strong>Kickstart File:</strong> $params[2]<br/>
        #if $len($params) > 3
        $printOpts($params[3])
        #end if
        #end if
        #elif $task.method == 'createImage'
        #set $target = $params[4]
        <strong>Build Target:</strong> <a href="buildtargetinfo?name=$target.name">$target.name</a><br/>
        <strong>Install Tree:</strong> $params[7]<br/>
        $printOpts($params[8])
        #elif $task.method == 'winbuild'
        <strong>VM:</strong> $params[0]<br/>
        <strong>SCM URL:</strong> $params[1]<br/>
        <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[2]">$params[2]</a><br/>
        #if $len($params) > 3
        $printOpts($params[3])
        #end if
        #elif $task.method == 'vmExec'
        <strong>VM:</strong> $params[0]<br/>
        <strong>Exec Params:</strong><br/>
        #for $info in $params[1]
        #if $isinstance($info, dict)
        $printMap($info, '&nbsp;&nbsp;&nbsp;&nbsp;')
        #else
        &nbsp;&nbsp;$info<br/>
        #end if
        #end for
        #if $len($params) > 2
        $printOpts($params[2])
        #end if
        #elif $task.method == 'newRepo'
        <strong>Tag:</strong> <a href="taginfo?tagID=$tag.id">$tag.name</a><br/>
        #if $len($params) > 1
        $printOpts($params[1])
        #end if
        #elif $task.method == 'prepRepo'
        <strong>Tag:</strong> <a href="taginfo?tagID=$params[0].id">$params[0].name</a>
        #elif $task.method == 'createrepo'
        <strong>Repo ID:</strong> $params[0]<br/>
        <strong>Arch:</strong> $params[1]<br/>
        #set $oldrepo = $params[2]
        #if $oldrepo
        <strong>Old Repo ID:</strong> $oldrepo.id<br/>
        <strong>Old Repo Creation:</strong> $koji.formatTimeLong($oldrepo.creation_time)<br/>
        #end if
        #if $len($params) > 3
        <strong>External Repos:</strong> $printValue(None, [ext['external_repo_name'] for ext in $params[3]])<br/>
        #end if
        #elif $task.method == 'dependantTask'
        <strong>Dependant Tasks:</strong><br/>
        #for $dep in $deps
        &nbsp;&nbsp;<a href="taskinfo?taskID=$dep.id" class="task$util.taskState($dep.state)">$koji.taskLabel($dep)</a><br/>
        #end for
        <strong>Subtasks:</strong><br/>
        #for $subtask in $params[1]
        &nbsp;&nbsp;<strong>Method:</strong> $subtask[0]<br/>
        &nbsp;&nbsp;<strong>Parameters:</strong> #echo ', '.join([$str($subparam) for $subparam in $subtask[1]])#<br/>
        #if $len($subtask) > 2 and $subtask[2]
        &nbsp;&nbsp;<strong>Options:</strong><br/>
        $printMap($subtask[2], '&nbsp;&nbsp;&nbsp;&nbsp;')
        #end if
        <br/>
        #end for
        #elif $task.method == 'chainbuild'
        <strong>Build Groups:</strong><br/>
        #set $groupNum = 0
        #for $urls in $params[0]
        #set $groupNum += 1
        &nbsp;&nbsp;<strong>$groupNum</strong>: #echo ', '.join($urls)#<br/>
        #end for
        <strong>Build Target:</strong> <a href="buildtargetinfo?name=$params[1]">$params[1]</a><br/>
        $printOpts($params[2])
        #elif $task.method == 'waitrepo'
        <strong>Build Target:</strong> $params[0]<br/>
        #if $params[1]
        <strong>Newer Than:</strong> $params[1]<br/>
        #end if
        #if $params[2]
        <strong>NVRs:</strong> $printValue('', $params[2])
        #end if
        #elif $task.method == 'restart'
        <strong>Host:</strong> <a href="hostinfo?hostID=$params[0].id">$params[0].name</a><br/>
        #elif $task.method == 'restartVerify'
        <strong>Host:</strong> <a href="hostinfo?hostID=$params[1].id">$params[1].name</a><br/>
        <strong>Restart Task:</strong>
            <a href="taskinfo?taskID=$rtask.id" class="task$util.taskState($rtask.state)">$koji.taskLabel($rtask)</a><br/>
        #else
        $params
        #end if
      </td>
    </tr>
    <tr>
      #set $state = $util.taskState($task.state)
      <th>State</th>
      <td class="task$state">$state
      #if $currentUser and ('admin' in $perms or $task.owner == $currentUser.id)
      #if $task.state in ($koji.TASK_STATES.FREE, $koji.TASK_STATES.OPEN, $koji.TASK_STATES.ASSIGNED)
      <span class="adminLink">(<a href="canceltask?taskID=$task.id$util.authToken($self)">cancel</a>)</span>
      #elif $task.state in ($koji.TASK_STATES.CANCELED, $koji.TASK_STATES.FAILED) and (not $parent)
      <span class="adminLink">(<a href="resubmittask?taskID=$task.id$util.authToken($self)">resubmit</a>)</span>
      #end if
      #end if
      </td>
    </tr>
    #if $taskBuild
    <tr>
      <th>Build</th><td><a href="buildinfo?buildID=$taskBuild.build_id">$koji.buildLabel($taskBuild)</a></td>
    </tr>
    #end if
    <tr>
      <th>Created</th><td>$util.formatTimeLong($task.create_time)</td>
    </tr>
    #if $task.start_time
    <tr>
      <th>Started</th><td>$util.formatTimeLong($task.start_time)</td>
    #end if
    #if $task.state == $koji.TASK_STATES.OPEN
    #if $estCompletion
    <tr>
      <th>Est. Completion</th><td>$util.formatTimeLong($estCompletion)</td>
    </tr>
    #end if
    #elif $task.completion_time
    <tr>
      <th>Completed</th><td>$util.formatTimeLong($task.completion_time)</td>
    </tr>
    #end if
    <tr>
      <th>Owner</th>
      <td>
        #if $owner
          #if $owner.usertype == $koji.USERTYPES['HOST']
          <a href="hostinfo?userID=$owner.id">$owner.name</a>
          #else
          <a href="userinfo?userID=$owner.id">$owner.name</a>
          #end if
        #end if
      </td>
    </tr>
    <tr>
      <th>Channel</th>
      <td>
        #if $task.channel_id
        <a href="channelinfo?channelID=$task.channel_id">$channelName</a>
        #end if
      </td>
    </tr>
    <tr>
      <th>Host</th>
      <td>
        #if $task.host_id
        <a href="hostinfo?hostID=$task.host_id">$hostName</a>
        #end if
      </td>
    </tr>
    <tr>
      <th>Arch</th><td>$task.arch</td>
    </tr>
    #if $buildroots
    <tr>
      <th>Buildroot#if $len($buildroots) > 1 then 's' else ''#</th>
      <td>
        #for $buildroot in $buildroots
        <a href="buildrootinfo?buildrootID=$buildroot.id">#if $task.method == 'vmExec' then '' else '/var/lib/mock/'#$buildroot.tag_name-$buildroot.id-$buildroot.repo_id</a><br/>
        #end for
      </td>
    </tr>
    #end if
    <tr>
      <th>Parent</th>
        <td>
        #if $parent
        <a href="taskinfo?taskID=$parent.id" class="task$util.taskState($parent.state)">$koji.taskLabel($parent)</a>
        #end if
      </td>
    </tr>
    <tr>
      <th>Descendants</th>
      <td class="tree">
        #if $len($descendents[$str($task.id)]) > 0
        <span class="root">$task.method</span>
        #end if
        $printChildren($task.id, $descendents)
      </td>
    </tr>
    <tr>
      <th>Waiting?</th><td>#if $task.waiting then 'yes' else 'no'#</td>
    </tr>
    <tr>
      <th>Awaited?</th><td>#if $task.awaited then 'yes' else 'no'#</td>
    </tr>
    <tr>
      <th>Priority</th><td>$task.priority</td>
    </tr>
    <tr>
      <th>Weight</th><td>#echo '%.2f' % $task.weight#</td>
    </tr>
    <tr>
      <th>Result</th>
      <td>
        <a href="#" collapse" id="toggle-result" style="display: none;">Show results</a>
        <div id="result">
        #if $excClass
          <pre>
          #if $hasattr($result, 'faultString')
$cgi.escape($result.faultString.strip())
          #else
${excClass.__name__}: $cgi.escape($str($result))
          #end if
          </pre>
        #elif $isinstance($result, dict)
        $printMap($result)
        #else
        $printValue('', $result)
        #end if
        </div>
      </td>
    </tr>
    <tr>
      <th>Output</th>
      <td>
        #for $filename in $output
        <a href="$pathinfo.task($task.id)/$urllib.quote($filename)">$filename</a>
           #if $filename.endswith('.log')
           (<a href="getfile?taskID=$task.id&name=$urllib.quote($filename)&offset=-4000">tail</a>)
           #end if
        <br/>
        #end for
        #if $task.state not in ($koji.TASK_STATES.CLOSED, $koji.TASK_STATES.CANCELED, $koji.TASK_STATES.FAILED) and \
            $task.method in ('buildSRPMFromSCM', 'buildArch', 'livecd', 'appliance', 'buildMaven', 'wrapperRPM', 'vmExec', 'createrepo')
        <br/>
        <a href="watchlogs?taskID=$task.id">Watch logs</a>
        #end if
      </td>
    </tr>
  </table>

  <script type="text/javascript">
    (function() {
       var r = document.getElementById('result'),
       t = document.getElementById('toggle-result');
       r.style.display = 'none';
       t.style.display = 'block';
       t.text = 'Show result';
       t.onclick = function(e) {
         if(r.style.display == 'none') {
           r.style.display = 'block';
           t.text = 'Hide result';
           }
         else {
           r.style.display = 'none';
           t.text = 'Show result';
         }
         return false;
       };
    })();
  </script>

#include "includes/footer.chtml"