cross module change
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 26 Mar 2008 13:14:41 +0000 (13:14 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 26 Mar 2008 13:14:41 +0000 (13:14 +0000)
taking /var/www/html/{boot,PLCAPI} out of PLCWWW and into nodeconfig
files formerly right under nodeconfig/trunk move one step down into PlanetLabConf/
removed corresponding obsolete files in PLCWWW/branches/onelab

55 files changed:
PlanetLabConf/RPM-GPG-KEY-fedora [moved from RPM-GPG-KEY-fedora with 100% similarity]
PlanetLabConf/RootResources/pl_conf.py [moved from RootResources/pl_conf.py with 100% similarity]
PlanetLabConf/RootResources/pl_netflow.py [moved from RootResources/pl_netflow.py with 100% similarity]
PlanetLabConf/RootResources/plc_slice_pool.php [moved from RootResources/plc_slice_pool.php with 100% similarity]
PlanetLabConf/blacklist.php [moved from blacklist.php with 100% similarity]
PlanetLabConf/bwlimit.php [moved from bwlimit.php with 100% similarity]
PlanetLabConf/delete-rpm-list-production [moved from delete-rpm-list-production with 100% similarity]
PlanetLabConf/get_gpg_key.php [moved from get_gpg_key.php with 100% similarity]
PlanetLabConf/get_plc_config.php [moved from get_plc_config.php with 100% similarity]
PlanetLabConf/getupdatesxml.php [moved from getupdatesxml.php with 100% similarity]
PlanetLabConf/ipod.conf.php [moved from ipod.conf.php with 100% similarity]
PlanetLabConf/iptables [moved from iptables with 100% similarity]
PlanetLabConf/issue.php [moved from issue.php with 100% similarity]
PlanetLabConf/keys.php [moved from keys.php with 100% similarity]
PlanetLabConf/logrotate.conf [moved from logrotate.conf with 100% similarity]
PlanetLabConf/ntp.conf.php [moved from ntp.conf.php with 100% similarity]
PlanetLabConf/ntp/host/ntp.conf.grouse.hpl.hp.com [moved from ntp/host/ntp.conf.grouse.hpl.hp.com with 100% similarity]
PlanetLabConf/ntp/host/ntp.conf.planet2.ecse.rpi.edu [moved from ntp/host/ntp.conf.planet2.ecse.rpi.edu with 100% similarity]
PlanetLabConf/ntp/ntp.conf.au [moved from ntp/ntp.conf.au with 100% similarity]
PlanetLabConf/ntp/ntp.conf.bbk.ac.uk [moved from ntp/ntp.conf.bbk.ac.uk with 100% similarity]
PlanetLabConf/ntp/ntp.conf.br [moved from ntp/ntp.conf.br with 100% similarity]
PlanetLabConf/ntp/ntp.conf.ch [moved from ntp/ntp.conf.ch with 100% similarity]
PlanetLabConf/ntp/ntp.conf.cn [moved from ntp/ntp.conf.cn with 100% similarity]
PlanetLabConf/ntp/ntp.conf.de [moved from ntp/ntp.conf.de with 100% similarity]
PlanetLabConf/ntp/ntp.conf.default [moved from ntp/ntp.conf.default with 100% similarity]
PlanetLabConf/ntp/ntp.conf.di.unito.it [moved from ntp/ntp.conf.di.unito.it with 100% similarity]
PlanetLabConf/ntp/ntp.conf.dk [moved from ntp/ntp.conf.dk with 100% similarity]
PlanetLabConf/ntp/ntp.conf.edu [moved from ntp/ntp.conf.edu with 100% similarity]
PlanetLabConf/ntp/ntp.conf.eurecom.fr [moved from ntp/ntp.conf.eurecom.fr with 100% similarity]
PlanetLabConf/ntp/ntp.conf.fr [moved from ntp/ntp.conf.fr with 100% similarity]
PlanetLabConf/ntp/ntp.conf.ics.forth.gr [moved from ntp/ntp.conf.ics.forth.gr with 100% similarity]
PlanetLabConf/ntp/ntp.conf.ipv6.lip6.fr [moved from ntp/ntp.conf.ipv6.lip6.fr with 100% similarity]
PlanetLabConf/ntp/ntp.conf.it [moved from ntp/ntp.conf.it with 100% similarity]
PlanetLabConf/ntp/ntp.conf.it.uu.se [moved from ntp/ntp.conf.it.uu.se with 100% similarity]
PlanetLabConf/ntp/ntp.conf.polito.it [moved from ntp/ntp.conf.polito.it with 100% similarity]
PlanetLabConf/ntp/ntp.conf.prob.default [moved from ntp/ntp.conf.prob.default with 100% similarity]
PlanetLabConf/ntp/ntp.conf.se [moved from ntp/ntp.conf.se with 100% similarity]
PlanetLabConf/ntp/ntp.conf.sics.se [moved from ntp/ntp.conf.sics.se with 100% similarity]
PlanetLabConf/ntp/ntp.conf.uk [moved from ntp/ntp.conf.uk with 100% similarity]
PlanetLabConf/ntp/ntp.conf.ukc.ac.uk [moved from ntp/ntp.conf.ukc.ac.uk with 100% similarity]
PlanetLabConf/ntp/step-tickers.php [moved from ntp/step-tickers.php with 100% similarity]
PlanetLabConf/ntptickers.php [moved from ntptickers.php with 100% similarity]
PlanetLabConf/propd.conf [moved from propd.conf with 100% similarity]
PlanetLabConf/proxies.php [moved from proxies.php with 100% similarity]
PlanetLabConf/sendmail.cf [moved from sendmail.cf with 100% similarity]
PlanetLabConf/sendmail.mc [moved from sendmail.mc with 100% similarity]
PlanetLabConf/slocate.cron [moved from slocate.cron with 100% similarity]
PlanetLabConf/sshd_config [moved from sshd_config with 100% similarity]
PlanetLabConf/sudoers [moved from sudoers with 100% similarity]
PlanetLabConf/sysctl.php [moved from sysctl.php with 100% similarity]
PlanetLabConf/yum.conf.php [moved from yum.conf.php with 100% similarity]
boot/getnodeid.php [new file with mode: 0755]
boot/index.php [new file with mode: 0755]
boot/uudecode.gz [new file with mode: 0755]
nodeconfig.spec

similarity index 100%
rename from blacklist.php
rename to PlanetLabConf/blacklist.php
similarity index 100%
rename from bwlimit.php
rename to PlanetLabConf/bwlimit.php
similarity index 100%
rename from ipod.conf.php
rename to PlanetLabConf/ipod.conf.php
similarity index 100%
rename from iptables
rename to PlanetLabConf/iptables
similarity index 100%
rename from issue.php
rename to PlanetLabConf/issue.php
similarity index 100%
rename from keys.php
rename to PlanetLabConf/keys.php
similarity index 100%
rename from logrotate.conf
rename to PlanetLabConf/logrotate.conf
similarity index 100%
rename from ntp.conf.php
rename to PlanetLabConf/ntp.conf.php
similarity index 100%
rename from ntptickers.php
rename to PlanetLabConf/ntptickers.php
similarity index 100%
rename from propd.conf
rename to PlanetLabConf/propd.conf
similarity index 100%
rename from proxies.php
rename to PlanetLabConf/proxies.php
similarity index 100%
rename from sendmail.cf
rename to PlanetLabConf/sendmail.cf
similarity index 100%
rename from sendmail.mc
rename to PlanetLabConf/sendmail.mc
similarity index 100%
rename from slocate.cron
rename to PlanetLabConf/slocate.cron
similarity index 100%
rename from sshd_config
rename to PlanetLabConf/sshd_config
similarity index 100%
rename from sudoers
rename to PlanetLabConf/sudoers
similarity index 100%
rename from sysctl.php
rename to PlanetLabConf/sysctl.php
similarity index 100%
rename from yum.conf.php
rename to PlanetLabConf/yum.conf.php
diff --git a/boot/getnodeid.php b/boot/getnodeid.php
new file mode 100755 (executable)
index 0000000..004ce23
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+//
+// Returns node ID of requestor
+//
+// Mark Huang <mlhuang@cs.princeton.edu>
+// Copyright (C) 2006 The Trustees of Princeton University
+//
+// $Id$ $
+//
+
+// Get admin API handle
+require_once 'plc_api.php';
+global $adm;
+
+if (!empty($_REQUEST['mac_addr'])) {
+  $mac_lower = strtolower(trim($_REQUEST['mac_addr']));
+  $mac_upper = strtoupper(trim($_REQUEST['mac_addr']));
+  $nodenetworks = $adm->GetNodeNetworks(array('mac' => array($mac_lower, $mac_upper)));
+} else {
+  $nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
+}
+
+if (!empty($nodenetworks)) {
+  print $nodenetworks[0]['node_id'];
+} else {
+  print "-1";
+}
+
+?>
diff --git a/boot/index.php b/boot/index.php
new file mode 100755 (executable)
index 0000000..ba7dc7b
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+//
+// Returns node boot script
+//
+// Mark Huang <mlhuang@cs.princeton.edu>
+// Copyright (C) 2006 The Trustees of Princeton University
+//
+// $Id$ $
+//
+
+// Get admin API handle
+require_once 'plc_api.php';
+global $adm;
+
+// Default bootmanager
+$bootmanager = "bootmanager.sh.sgn";
+
+// Look up the node
+$nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
+if (!empty($nodenetworks)) {
+  $nodes = $adm->GetNodes(array($nodenetworks[0]['node_id']));
+  if (!empty($nodes)) {
+    $node = $nodes[0];
+  }
+}
+
+if (isset($node)) {
+  // Allow very old nodes that do not have a node key in their
+  // configuration files to use their "boot nonce" instead. The boot
+  // nonce is a random value generated by the node itself and POSTed
+  // by the Boot CD when it requests the Boot Manager. This is
+  // obviously not very secure, so we only allow it to be used if the
+  // requestor IP is the same as the IP address we have on record for
+  // the node.
+
+  // 3.x CDs post 'version', 2.x CDs post 'id'.
+  if (!empty($_REQUEST['version'])) {
+    $version = trim($_REQUEST['version']);
+  } elseif (!empty($_REQUEST['id'])) {
+    $version = trim($_REQUEST['id']);
+  } else {
+    $version = "2.0";
+  }
+
+  if (empty($node['key']) && !empty($_REQUEST['nonce'])) {
+    // 3.x CDs post the boot nonce in ASCII hex. 2.x CDs post it in binary.
+    if (strstr($version, "2.0") === FALSE) {
+      // 3.x CDs post a trailing newline...sigh
+      $nonce = trim($_REQUEST['nonce']);
+    } else {
+      $nonce = bin2hex($_REQUEST['nonce']);
+    }
+    $adm->UpdateNode($node['node_id'], array('boot_nonce' => $nonce));
+  }
+
+  // Custom bootmanager for the node, e.g.
+  // planetlab-1.cs.princeton.edu_bootmanager.sh.sgn
+  $bootmanagers = array(strtolower($node['hostname']) . "_" . $bootmanager);
+
+  // Custom bootmanager for the node group, e.g.
+  // alpha_bootmanager.sh.sgn
+  if (!empty($node['nodegroup_ids'])) {
+    $nodegroups = $adm->GetNodeGroups($node['nodegroup_ids']);
+    foreach ($nodegroups as $nodegroup) {
+      $bootmanagers[] = strtolower($nodegroup['name']) . "_" . $bootmanager;
+    }
+  }
+}
+
+// Default bootmanager
+$bootmanagers[] = $bootmanager;
+
+foreach ($bootmanagers as $bootmanager) {
+  if (file_exists($bootmanager)) {
+    readfile($bootmanager);
+    exit();
+  }
+}
+
+?>
diff --git a/boot/uudecode.gz b/boot/uudecode.gz
new file mode 100755 (executable)
index 0000000..040c34f
Binary files /dev/null and b/boot/uudecode.gz differ
index ef5e128..c5caab0 100644 (file)
@@ -48,14 +48,18 @@ rm -rf $RPM_BUILD_ROOT
 
 echo "* nodeconfig: Installing PlanetLabConf pages"
 
-mkdir -p $RPM_BUILD_ROOT/var/www/html/PlanetLabConf
+for dir in boot PlanetLabConf PLCAPI ; do
+    mkdir -p $RPM_BUILD_ROOT/var/www/html/$dir
+done
 # let's be conservative and exclude codebase files, though there should not be any
-rsync -a --exclude \*.spec --exclude .svn --exclude CVS ./ $RPM_BUILD_ROOT/var/www/html/PlanetLabConf
+rsync -a --exclude \*.spec --exclude .svn --exclude CVS ./ $RPM_BUILD_ROOT/var/www/html/
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
+/var/www/html/boot
 /var/www/html/PlanetLabConf
+/var/www/html/PLCAPI