Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Display flow

vmlintu edited this page Dec 2, 2010 · 3 revisions

Overview

  1. When display powers on, it start chromium that startpage set as https://iivari.example.org/conductor?resolution=800×600&hostname=testi1.example.org
  2. /conductor (defined in screen_controller) checks authentication and the following parameters:
    • resolution – pixel resolution of the browser screen – used to scale text and images to proper size
    • hostname – fqdn of the client – used to distinguish between displays, needed for authentication
    • cache – use html5 local cache or not – true by default
    • preview – to be deprecated
    • channel_id – id of the channel for channel preview
    • slide_id – used by admin interface for channel preview to show single static slides
  3. screen_controller#auth_require checks that session exists and if it doesn’t, the hostname parameter is used to create a session
    • hostname parameter is used to find the display from database – if the hostname is not known, a new entry is created
    • If display is found in database and it is active, the configured channel is returned – if no channel is configured, an error is returned with configuration instructions
    • Channel is configured using the admin interface
  4. /screen.manifest?resolution=800×600

Notes

  • Display authentication is done outside Puavo
  • Plan is to use SSL client certificates to authenticate displays when needed

Detailed steps

wget -O – “https://iivari.example.org/conductor?resolution=800×600&hostname=testi1”

<!DOCTYPE html>
<html manifest="/screen.manifest?resolution=800x600">
<head>
  <meta charset=utf-8 />
  <title>Iivari</title>

  <script src="/javascripts/jquery.min.js?1291034340" type="text/javascript"></script>
<script src="/javascripts/rails.js?1291034342" type="text/javascript"></script>
  <meta name="csrf-param" content="authenticity_token"/>
<meta name="csrf-token" content="bSizoGgQqOjhs/RnLhpd7HASOzmslFHAg8YI5rMoSlA="/>
</head>
<body>

  <link href="/stylesheets/jqs5.opinsys.css?1289562198" media="screen" rel="stylesheet" type="text/css" />
<script src="/javascripts/jquery.offline.js?1289562198" type="text/javascript"></script>
<script src="/javascripts/jqs5.opinsys.js?1289562198" type="text/javascript"></script>
<script src="/javascripts/slideshow.js?1291017259" type="text/javascript"></script>

<script type="text/javascript">
//<![CDATA[

    var slideNumber = 0;
    $(document).ready(jqs5_init);

    slideData = new Object();
    updateSlideData('slides.json?resolution=800x600', true);
    $(document).ready(function() { showNextSlide(true); });
    setInterval( "updateSlideData('slides.json?resolution=800x600', true)", 7000);

//]]>
</script>

</body>
</html>
  def auth_require
    if params[:preview]
      if require_user != false
        @preview = true
        @channel = Channel.find(params[:channel_id]) if params[:channel_id]
      end
    else
      if session[:display_authentication]
        @display = Display.find_or_create_by_hostname(session[:hostname])
        @channel = @display.active ? @display.channel : nil
      else
        render :json => "Unauthorized", :status => :unauthorized
      end
    end
  end
Clone this wiki locally