<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Transition Technology: Ticket #487: robots.txt files for development sites</title>
    <link>http://localhost:8080/trac/ticket/487</link>
    <description>&lt;p&gt;
All the sites other than www.transitionnetwork.org on &lt;a class="wiki" href="http://localhost:8080/trac/wiki/PuffinServer"&gt;wiki:PuffinServer&lt;/a&gt; should have a robots.txt file to exclude them from being crawled and indexed to prevent the development versions of sites being included in search results.
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>Transition Technology</title>
      <url>/trac/chrome/site/TransitionNetwork-Logo-Web-Small.jpg</url>
      <link>http://localhost:8080/trac/ticket/487</link>
    </image>
    <generator>Trac 0.12.5</generator>
    <item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 29 Jan 2013 17:46:11 GMT</pubDate>
      <title>hours, owner, status, totalhours changed</title>
      <link>http://localhost:8080/trac/ticket/487#comment:1</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.1&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;chris&lt;/em&gt; to &lt;em&gt;jim&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;assigned&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.1&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
On the old dev sites we had things in place to ensure that the sites didn't sent out emails etc -- is this in hand for the new dev sites on puffin?
&lt;/p&gt;
&lt;p&gt;
I'm assigning this ticket to Jim, in the hope that this can be sorted at a Drupal level rather than at a Nginx / Postfix level.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jim</dc:creator>

      <pubDate>Tue, 29 Jan 2013 19:02:51 GMT</pubDate>
      <title></title>
      <link>http://localhost:8080/trac/ticket/487#comment:2</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:2</guid>
      <description>
        &lt;p&gt;
The Robotstxt module is auto-installed and enabled on all platforms.
&lt;/p&gt;
&lt;p&gt;
On any (D6) site an admin can go to: &lt;a class="ext-link" href="https://example.com/admin/settings/robotstxt"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://example.com/admin/settings/robotstxt&lt;/a&gt; and put
&lt;/p&gt;
&lt;pre class="wiki"&gt;User-agent: *
Disallow: /
&lt;/pre&gt;&lt;p&gt;
This is done on newlive, and the copy of the site on my server. I also ran &lt;tt&gt;drush newlive.puffin.webarch.net dis googleanalytics piwik&lt;/tt&gt; to stop any further reporting -- sorry I did this before but missed it on my 3rd platform/site.
&lt;/p&gt;
&lt;p&gt;
---
&lt;/p&gt;
&lt;p&gt;
As for config that would prevent emails going out, on the old Kiwi DEV we had 'reroute_email' running, which had a settings.php switch for each environment to allow/reroute emails. That section looked like this:
&lt;/p&gt;
&lt;pre class="wiki"&gt;/**
 * Reroute Email 6.x-1.x-dev variable to send emails to a different address for LIVE
 *
 * JK - this is LIVE so NOT rerouting emails!
 */
$conf['reroute_email_enable'] = 0;
&lt;/pre&gt;&lt;p&gt;
Based on &lt;a class="ext-link" href="http://groups.drupal.org/node/101274"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://groups.drupal.org/node/101274&lt;/a&gt;, I looked in our site settings.php on the new platform and saw:
&lt;/p&gt;
&lt;pre class="wiki"&gt;  # Additional host wide configuration settings. Useful for safely specifying configuration settings.
  if (file_exists('/data/disk/tn/config/includes/global.inc')) {
    include_once('/data/disk/tn/config/includes/global.inc');
  }
  # Additional site configuration settings.
  if (file_exists('/data/disk/tn/static/transition-network-d6-002/sites/transitionnetwork.org/local.settings.php')) {
    include_once('/data/disk/tn/static/transition-network-d6-002/sites/transitionnetwork.org/local.settings.php');
  }
&lt;/pre&gt;&lt;p&gt;
Meaning we can either add our config to each site's local.settings.php file, or better still add some logic to &lt;tt&gt;/data/disk/tn/config/includes/global.inc&lt;/tt&gt; that just knows when a site is DEV or TEST and does stuff accordingly.
&lt;/p&gt;
&lt;p&gt;
I have some ideas and will throw some PHP together to do this shortly.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jim</dc:creator>

      <pubDate>Tue, 29 Jan 2013 20:34:47 GMT</pubDate>
      <title></title>
      <link>http://localhost:8080/trac/ticket/487#comment:3</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:3</guid>
      <description>
        &lt;p&gt;
I've added Reroute Email, and Environment Indicator to the makefile, and to the platform.
&lt;/p&gt;
&lt;p&gt;
And based on &lt;a class="closed ticket" href="http://localhost:8080/trac/ticket/136" title="defect: dev server sending messages to users (closed: fixed)"&gt;#136&lt;/a&gt; I've created a new /data/conf/override.global.inc with some goodies in. It's checked into Github at &lt;a class="ext-link" href="https://github.com/transitionnetwork/transitionnetwork.org-d6.profile/blob/master/override.global.php"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://github.com/transitionnetwork/transitionnetwork.org-d6.profile/blob/master/override.global.php&lt;/a&gt; and currently looks like:
&lt;/p&gt;
&lt;pre class="wiki"&gt;&amp;lt;?php // OVERRIDE global settings.php
/**
 * @file override.settings.php
 *
 * Sets up some key Dev/Stage/Test/Prod behaviours
 *
 * Works with
 * -- Session 443
 * -- Environment Indicator
 * -- Reroute Email
 */
/* ------------ DEFAULTS ------------ */
&lt;/pre&gt;&lt;p&gt;
...These enforce some things we want, like HTTPS cookies and certain module settings...
&lt;/p&gt;
&lt;pre class="wiki"&gt;/**
 * Enforce secure cookies handling
 *
 * @see: http://drupal.org/project/session443
 */
ini_set('session.cookie_secure', 1);
/**
 * Reroute Email 6.x-1.x-dev switch means we'll always reroute (if module enabled).
 *
 * @see: http://drupal.org/project/reroute_email
 */
$conf['reroute_email_enable'] = 1;
$conf['reroute_email_address'] = "transition-dev@email-lists.org";
/**
 * Environment Indicator to remind users what site they're looking at (if module enabled).
 *
 * @see: http://drupal.org/project/environment_indicator
 */
$conf['environment_indicator_text'] = 'UNKNOWN SERVER!';
$conf['environment_indicator_color'] = 'red';
$conf['environment_indicator_enabled'] = TRUE;
&lt;/pre&gt;&lt;p&gt;
...And the following function allows us to add to each site's own &lt;tt&gt;local.settings.php&lt;/tt&gt; to set their environment type, and associated overrides of the settings above...
&lt;/p&gt;
&lt;pre class="wiki"&gt;/**
 * Allows server environment settings to be changed on a per site basis
 * from defaults above based on environment type.
 *
 * $environment_name must start with 'Production', 'Testing' or
 * 'Development' (default) else no changes will be made. Any other names
 * can be added after a space.
 *
 * e.g. 'Testing - TN.org commerce'
 */
function puffin_server_override_settings_set_environment($environment_name = 'Development') {
  // use full string for Environment Indicator module label.
  $conf['environment_indicator_text'] = $environment_name;
  // use string before space so we know which environment to choose.
  $env_type = explode(' ', $environment_name);
  // set our own $_SERVER variable for other uses if needs be
  $_SERVER['_TN_ENVIRONMENT'] = $env_type;
  switch ($env_type[0]) {
    case 'Production':
      $conf['reroute_email_enable'] = 0;
      $conf['environment_indicator_color'] = '#D0E7B4';
      $conf['environment_indicator_enabled'] = TRUE;
      break;
    case 'Testing':
      $conf['reroute_email_enable'] = 1;
      $conf['environment_indicator_color'] = '#D0E7B4';
      $conf['environment_indicator_enabled'] = TRUE;
      break;
    case 'Development':
      $conf['reroute_email_enable'] = 1;
      $conf['environment_indicator_color'] = '#D0E7B4';
      $conf['environment_indicator_enabled'] = TRUE;
      break;
  }
}
&lt;/pre&gt;&lt;p&gt;
E.g. add this line to our Prod site when all done: &lt;tt&gt;puffin_server_override_settings_set_environment('Production TN.org');&lt;/tt&gt;
&lt;/p&gt;
&lt;p&gt;
So the only thing we need do now is enforce &lt;tt&gt;reroute_email&lt;/tt&gt; and &lt;tt&gt;environment_indicator&lt;/tt&gt; to be enabled on every site. There are a number of ways to do this:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;BOA does it daily for modules here: &lt;a class="ext-link" href="https://github.com/omega8cc/nginx-for-drupal/blob/master/aegir/tools/system/usage.sh"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://github.com/omega8cc/nginx-for-drupal/blob/master/aegir/tools/system/usage.sh&lt;/a&gt; (FYI lives in /var/xdrago/)
&lt;/li&gt;&lt;li&gt;Add a new 'Transition Environment Settings' feature that does some goodies (still needs force-loading for sites)
&lt;/li&gt;&lt;li&gt;Other ways, I'm sure.
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
But for now we've made a good progress and helped development in the future. Also, the &lt;tt&gt;$_SERVER['_TN_ENVIRONMENT']&lt;/tt&gt; allows us to check quickly where we are in our code and do/not do things accordingly.
&lt;/p&gt;
&lt;p&gt;
For another time, there will probably be a more efficient approach based on something here: &lt;a class="ext-link" href="http://community.aegirproject.org/content/overriding-site-specific-php-values"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://community.aegirproject.org/content/overriding-site-specific-php-values&lt;/a&gt;.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jim</dc:creator>

      <pubDate>Tue, 29 Jan 2013 20:38:27 GMT</pubDate>
      <title></title>
      <link>http://localhost:8080/trac/ticket/487#comment:4</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:4</guid>
      <description>
        &lt;p&gt;
I see there's a patch for &lt;a class="ext-link" href="http://drupal.org/project/robotstxt"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;Robots.txt module&lt;/a&gt; that would allow setting it from settings.php (or override.global.inc on our setup): &lt;a class="ext-link" href="http://drupal.org/node/619404#comment-2237812"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://drupal.org/node/619404#comment-2237812&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
We'd need our own version of robots though -- currently it comes from BOA automatically... For another day.
&lt;/p&gt;
&lt;p&gt;
Once the dev and test sites are set up, devs should only ever clone/migrate them, which minimises this risk going forward.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jim</dc:creator>

      <pubDate>Wed, 30 Jan 2013 00:12:20 GMT</pubDate>
      <title>priority changed</title>
      <link>http://localhost:8080/trac/ticket/487#comment:5</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:5</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;priority&lt;/strong&gt;
                changed from &lt;em&gt;major&lt;/em&gt; to &lt;em&gt;minor&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Patched version of Robots module added to makefile.
&lt;/p&gt;
&lt;p&gt;
Downgrading but keeping open to automate 'deny everything' on dev and test if possible.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 05 Feb 2013 14:06:48 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost:8080/trac/ticket/487#comment:6</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:6</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;assigned&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Closing this ticket as Jim has, urm, fixed it! (is this bad taste joke day?)
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 11 Feb 2014 22:04:34 GMT</pubDate>
      <title>cc, hours, status, totalhours changed; resolution deleted</title>
      <link>http://localhost:8080/trac/ticket/487#comment:7</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:7</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;cc&lt;/strong&gt;
              &lt;em&gt;sam&lt;/em&gt; added
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.25&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;closed&lt;/em&gt; to &lt;em&gt;reopened&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                &lt;em&gt;fixed&lt;/em&gt; deleted
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.1&lt;/em&gt; to &lt;em&gt;0.35&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Reopening this as Sam noticed that &lt;a class="ext-link" href="https://stg.transitionnetwork.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://stg.transitionnetwork.org/&lt;/a&gt; is indexed by google, "About 847 results", &lt;a class="ext-link" href="https://www.google.com/search?q=transition+site%3Astg.transitionnetwork.org"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://www.google.com/search?q=transition+site%3Astg.transitionnetwork.org&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
The site had the live &lt;tt&gt;robots.txt&lt;/tt&gt;:
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="ext-link" href="https://stg.transitionnetwork.org/robots.txt"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://stg.transitionnetwork.org/robots.txt&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
I get "You are not authorized to access this page." at &lt;a class="ext-link" href="https://stg.transitionnetwork.org/admin/settings/robotstxt"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://stg.transitionnetwork.org/admin/settings/robotstxt&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Following &lt;a class="ext-link" href="https://omega8.cc/how-to-use-robotstxt-properly-243"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://omega8.cc/how-to-use-robotstxt-properly-243&lt;/a&gt; I created a &lt;tt&gt;robots.txt&lt;/tt&gt; file in &lt;tt&gt;/data/disk/tn/clients/tnusers/stg.transitionnetwork.org/files&lt;/tt&gt; and this has fixed it for this site.
&lt;/p&gt;
&lt;p&gt;
There might be a better way to do this?
&lt;/p&gt;
&lt;p&gt;
There might be other sites it needs doing for?
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jim</dc:creator>

      <pubDate>Wed, 12 Feb 2014 10:21:40 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>http://localhost:8080/trac/ticket/487#comment:8</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:8</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.1&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.35&lt;/em&gt; to &lt;em&gt;0.45&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Hi chris,
&lt;/p&gt;
&lt;p&gt;
The &lt;a class="missing wiki"&gt;RobotsTxt?&lt;/a&gt; module should be enabled in STG -- this should then have the 'Disallow everyone' settings added.
&lt;/p&gt;
&lt;p&gt;
&lt;a class="ext-link" href="https://github.com/transitionnetwork/transitionnetwork.org-d6.profile/blob/master/transitionnetwork.org-d6.make#L94"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;Robots is included in the makefile&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
So the module needs to be enabled, the robots.txt file in the docroot folder needs removing (since the module can't work without it), and it needs to be confirmed to work.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>sam</dc:creator>

      <pubDate>Wed, 12 Feb 2014 13:33:18 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost:8080/trac/ticket/487#comment:9</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:9</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;reopened&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Hi I changed robots.txt on the stg &amp;amp; stg2 servers yesterday using the Drupal frontend/ robots.txt module
&lt;/p&gt;
&lt;p&gt;
It seems to have worked: &lt;a class="ext-link" href="http://stg.transitionnetwork.org/robots.txt"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://stg.transitionnetwork.org/robots.txt&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
So I'm going to close the ticket and we just have to remember to do it when creating a new stg site.
&lt;/p&gt;
&lt;p&gt;
Thanks
&lt;/p&gt;
&lt;p&gt;
Sam
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>ed</dc:creator>

      <pubDate>Mon, 03 Mar 2014 15:07:47 GMT</pubDate>
      <title>milestone set</title>
      <link>http://localhost:8080/trac/ticket/487#comment:10</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:10</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                set to &lt;em&gt;Maintenance&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 06 May 2014 18:07:05 GMT</pubDate>
      <title></title>
      <link>http://localhost:8080/trac/ticket/487#comment:11</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:11</guid>
      <description>
        &lt;p&gt;
This issue came up again, see &lt;a class="reopened ticket" href="http://localhost:8080/trac/ticket/712#comment:27" title="maintenance: Create a new stgX.transitionnetwork.org site (reopened)"&gt;ticket:712#comment:27&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Thu, 31 Jul 2014 12:01:26 GMT</pubDate>
      <title></title>
      <link>http://localhost:8080/trac/ticket/487#comment:12</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/487#comment:12</guid>
      <description>
        &lt;p&gt;
This issue came up again, see &lt;a class="new ticket" href="http://localhost:8080/trac/ticket/767" title="defect: robots.txt on dev site (new)"&gt;ticket:767&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>