Skip to content

InstallProjectConfigFile

Jason Fesler edited this page Apr 5, 2014 · 3 revisions

Introduction

In the early days of the project (from April 2010 through April 2013) , the "local" configuration was baked into a perl include file; and the site was custom-compiled. All of your special options, like site name, IP address, etc was baked into the delivered javascript files.

In May 2013, this was rewritten. The content was made generic; and the use of new site specific config files were made that are loaded by the client. Any changes required (or indicated in the config) will dynamically update the javascript client.

Files

Two new files are required for your site, at a minimum; and placed into your /site/ directory of where your content will be served from.

/site/config.js

Used by: the main javascript client.

You'll see an example in the content bundle, called config.js.example.

Note, while this looks like JavaScript, this is really JSON - with a variable name of MirrorConfig in front. Don't do fancy JavaScript tricks with this; as the various scripts (written in php, perl) won't handle it.

MirrorConfig = 
{

  "site": {
    "name": "test-ipv6.example.com",
    "contact": "Jason Fesler",
    "mailto": "jfesler@test-ipv6.com"
  },
  
  "load": {
    "domain": "test-ipv6.example.com",
    "ipv4": "192.0.2.1",
    "ipv6": "2001:db8::1"
  },
  
  "footer": {
    "#logo": "/site/logo.png",         
    "#operator": "Jason Fesler",       
    "#link": "http://test-ipv6.com", 
    "#html": "/site/footer.html"
  },
  
  "options": {
    "show_stats": "/stats.html",
    "survey": "/survey.php",
    "comment": "/comment.php",
    "ip": "/ip/"
  },
  
  "facebook": {
    "enable": 0
  },
  "twitter": {
    "enable": 0,
    "name": "testipv6com"
  }
}

site:

  • "name" : the name to show on the web page.
  • "contact": name of the contact point (such as the ACME Company NOC)
  • "mailto": email address for the above contact. used by the comment form; and remote audits.

load: This defines where the URLs will test.

  • "domain": this is the base DNS name that should be used for [InstallDNS]. Often the same as the site name.
  • "ipv4": your IPv4 address for this mirror site (if using load balancers, then the VIP)
  • "ipv6": same as above, but IPv6

footer:

  • "logo" - if set, shows a logo at the bottom of the test.
  • "operator" - if set, gives a note about the operator at the bottom of the test.
  • "link" - if set, hyperlinks the operator name.
  • "html" - if set to a url such as "/site/footer.html", attempts to load that instead. Note this must be on the same virtualhost.

Please keep things classy.

options:

  • "show_stats* - comment out to hide the stats tab. Alternately, set it to a differnt link.
  • "survey" - comment out if you don't plan on keeping stats.
  • "comment" - set to the comment form where you want feedback sent.
  • "ip" - where mod_ip answers.

/site/private.js

Used by: PHP scripts, charting scripts.

Note, while this looks like JavaScript, this is really JSON - with a variable name of MirrorConfig in front. Don't do fancy JavaScript tricks with this; as the various scripts (written in php, perl) won't handle it.

PrivateConfig = 
{
  "db": {
    "host": "localhost",
    "db": "testipv6",
    "username": "sampleusername",
    "password": "samplepassword"
  },
  "paths": {
    "rrd": "/usr/local/var/testipv6/rrd",
    "png": "/usr/local/www/data/virt/beta.test-ipv6.com/site/charts"
  },
  "google_translate": { // Google translate for comments.php
     "enable": 0,
     "language": "en",
     "key": "get_your_own_key"
  }
}

db - Used by survey.php, and charting. If you don't plan on doing survey.php (And showing charts of your testers), then you can (in config.js, comment out the survey line). See also: InstallCharts

  • "host": where the mysql instance is
  • "db": the name of the database
  • "username": the username that has been granted r/w access
  • "password": the password for the above username

paths - Used by charting. Ignore if you're not charting.

  • "rrd': Location to store RRD files.
  • "png": Location to write image files; should map to /site/charts/ in the browser.

google_translate - if enabled and set with a key, then comment.php will do automatic translation. Note that Google charges for the service. This is particularly handy where a large number of comments come in each day, from all parts of the world. Translation: really for test-ipv6.com

  • "enable" - set to 1 to enable translation
  • "language" - target language. must be a valid-to-google target name.
  • "key" - the key used (get this from google).

Optional Files

If, in your config files, you refer to either a logo or a footer, you can put those in /site/ as well. All files in /site/ will be considered "site local"; and any instructions we have for updating the site will avoid overwriting or deleting that subdirectory.

Clone this wiki locally