This file is indexed.

/usr/share/chef-server-api/app/controllers/main.rb is in chef-server-api 10.12.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
class Main < Application

  provides :html, :json

  def index
    case content_type
    when :json
      display absolute_url(:nodes) => "Manage Nodes",
              absolute_url(:roles) => "Manage Roles",
              absolute_url(:cookbooks) => "Manage Cookbooks",
              absolute_url(:data) => "Manage Data Bags",
              absolute_url(:search) => "Search"
    else
      @webui_url = if Chef::Config[:chef_webui_url]
        Chef::Config[:chef_webui_url]
      elsif request.host =~ /(.*):4000/
        absolute_url(:top, :host => "#{$1}:4040")
      else
        nil
      end
      render
    end
  end
  
end