Commit 60f04310 authored by Leigh Stoller's avatar Leigh Stoller

A bunch of changes for a "standalone" clearinghouse. Presently this

its really a hugely stripped down Emulab boss install, using a very
short version of install/boss-install to get a few things into place.

I refactored a few things in both the protogeni code and the Emulab
code, and whacked a bunch of makefiles and configure stuff. The result
is that we only need to install about 10-12 files from the Emulab
code, plus the protogeni code. Quite manageable, if you don't mind
that it requires FreeBSD 6.X ... Still, I think it satisfies the
requirement that we have a packaged clearinghouse that can be run
standalone from a running Emulab site.
parent d3600eb2
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -23,15 +23,31 @@ SETUID_BIN_SCRIPTS =
SETUID_SBIN_SCRIPTS = tbacct addpubkey mkusercert mksyscert
SETUID_LIBX_SCRIPTS =
#
# Targets
#
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
TARGETS = $(SBIN_STUFF) $(LIBEXEC_STUFF) $(CTRLSBIN_STUFF)
else
TARGETS = mksyscert
SETUID_SBIN_SCRIPTS = mksyscert
endif
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: $(SBIN_STUFF) $(LIBEXEC_STUFF) $(CTRLSBIN_STUFF)
all: $(TARGETS)
include $(TESTBED_SRCDIR)/GNUmakerules
install: all script-install
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
install: boss-install
else
install: clrhouse-install
endif
boss-install: all script-install
@echo "Don't forget to do a post-install as root"
script-install: $(addprefix $(INSTALL_SBINDIR)/, $(SBIN_STUFF)) \
......@@ -53,6 +69,9 @@ control-install:
hook-install: $(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(CTRLSBIN_STUFF))
# Clearinghouse install.
clrhouse-install: $(INSTALL_SBINDIR)/mksyscert
# This rule says what web* script depends on which installed binary directory.
$(LIBEXEC_STUFF): $(INSTALL_SBINDIR)
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
......@@ -13,9 +13,8 @@ use Getopt::Std;
#
use lib "@prefix@/lib";
use libaudit;
use libdb;
use emutil;
use libtestbed;
use User;
#
# Create system SSL certificates.
......@@ -43,11 +42,8 @@ my $TBLOGS = "@TBLOGSEMAIL@";
my $OURDOMAIN = "@OURDOMAIN@";
my $PGENIDOMAIN = "@PROTOGENI_DOMAIN@";
my $PGENISUPPORT= @PROTOGENI_SUPPORT@;
my $CONTROL = "@USERNODE@";
my $BOSSNODE = "@BOSSNODE@";
# Locals
my $USERDIR = USERROOT();
my $SSLDIR = "$TB/lib/ssl";
my $TEMPLATE = "$SSLDIR/syscert.cnf";
my $CACONFIG = "$SSLDIR/ca.cnf";
......@@ -160,12 +156,6 @@ if (@ARGV < 1) {
my $orgunit = shift(@ARGV);
my $uuid = (@ARGV ? shift(@ARGV) : undef);
# Map invoking user to object.
my $this_user = User->LookupByUnixId($UID);
if (! defined($this_user)) {
fatal("You ($UID) do not exist!");
}
# Generate/confirm uuid
if (!defined($uuid)) {
$uuid = NewUUID();
......
......@@ -269,7 +269,8 @@ if ($WIKISUPPORT) {
# And the email address has to be unique.
#
UserError("Email address already in use; please pick another!")
if (User->LookupByEmail($newuser_args{'usr_email'}));
if ($newuser_args{'usr_email'} ne $TBOPS &&
User->LookupByEmail($newuser_args{'usr_email'}));
#
# Check the password.
......
......@@ -1454,6 +1454,8 @@ done
......@@ -1537,6 +1539,7 @@ REMOTEWIKIDOCS=1
PROTOGENI_SUPPORT=0
PROTOGENI_CLEARINGHOUSE=0
PROTOGENI_DOMAIN="unknown"
STANDALONE_CLEARINGHOUSE=0
#
# XXX You really don't want to change these!
......@@ -2139,17 +2142,17 @@ for ac_hdr in ulxmlrpcpp/ulxr_config.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2142: checking for $ac_hdr" >&5
echo "configure:2146: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2147 "configure"
#line 2151 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2156: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2188,17 +2191,17 @@ for ac_hdr in linux/videodev.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2191: checking for $ac_hdr" >&5
echo "configure:2195: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2196 "configure"
#line 2200 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2231,7 +2234,7 @@ done
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2234: checking for $ac_word" >&5
echo "configure:2238: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -2310,7 +2313,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:2313: checking for a BSD compatible install" >&5
echo "configure:2317: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
......@@ -2371,7 +2374,7 @@ esac
# Extract the first word of "rsync", so it can be a program name with args.
set dummy rsync; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2374: checking for $ac_word" >&5
echo "configure:2378: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RSYNC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
......@@ -2892,6 +2895,7 @@ s%@REMOTEWIKIDOCS@%$REMOTEWIKIDOCS%g
s%@PROTOGENI_SUPPORT@%$PROTOGENI_SUPPORT%g
s%@PROTOGENI_CLEARINGHOUSE@%$PROTOGENI_CLEARINGHOUSE%g
s%@PROTOGENI_DOMAIN@%$PROTOGENI_DOMAIN%g
s%@STANDALONE_CLEARINGHOUSE@%$STANDALONE_CLEARINGHOUSE%g
s%@TBOPSEMAIL@%$TBOPSEMAIL%g
s%@TBOPSEMAIL_NOSLASH@%$TBOPSEMAIL_NOSLASH%g
s%@TBROBOCOPSEMAIL@%$TBROBOCOPSEMAIL%g
......
......@@ -210,6 +210,7 @@ AC_SUBST(REMOTEWIKIDOCS)
AC_SUBST(PROTOGENI_SUPPORT)
AC_SUBST(PROTOGENI_CLEARINGHOUSE)
AC_SUBST(PROTOGENI_DOMAIN)
AC_SUBST(STANDALONE_CLEARINGHOUSE)
#
# Offer both versions of the email addresses that have the @ escaped
......@@ -291,6 +292,7 @@ REMOTEWIKIDOCS=1
PROTOGENI_SUPPORT=0
PROTOGENI_CLEARINGHOUSE=0
PROTOGENI_DOMAIN="unknown"
STANDALONE_CLEARINGHOUSE=0
#
# XXX You really don't want to change these!
......
......@@ -37,26 +37,40 @@ USERLIBS = libtbdb.pm libdb.py
SETUID_BIN_SCRIPTS =
SETUID_SBIN_SCRIPTS = genelists dhcpd_makeconf elabinelab_bossinit \
changecreator
SETUID_LIBX_SCRIPTS =
SETUID_LIBX_SCRIPTS =
#
# Targets
#
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
TARGETS = $(BIN_SCRIPTS) $(SBIN_SCRIPTS) $(LIBEXEC_SCRIPTS) $(LIB_SCRIPTS) \
$(USERSBINS) $(USERLIBS) schemacheck dbfillcheck
else
TARGETS = emdb.pm emutil.pm emdbi.pm
SETUID_SBIN_SCRIPTS =
endif
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: $(BIN_SCRIPTS) $(SBIN_SCRIPTS) $(LIBEXEC_SCRIPTS) $(LIB_SCRIPTS) \
$(USERSBINS) $(USERLIBS) schemacheck dbfillcheck
all: $(TARGETS)
include $(TESTBED_SRCDIR)/GNUmakerules
install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
install: boss-install
else
install: clrhouse-install
endif
boss-install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \
$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \
$(addprefix $(INSTALL_LIBDIR)/, $(LIB_SCRIPTS)) \
$(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_SCRIPTS)) \
$(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(USERSBINS)) \
$(addprefix $(INSTALL_DIR)/opsdir/lib/, $(USERLIBS))
boss-install: install
post-install:
chown root $(INSTALL_SBINDIR)/genelists
chmod u+s $(INSTALL_SBINDIR)/genelists
......@@ -71,6 +85,9 @@ post-install:
control-install: $(addprefix $(INSTALL_SBINDIR)/, $(USERSBINS)) \
$(addprefix $(INSTALL_LIBDIR)/, $(USERLIBS))
# Clearinghouse install.
clrhouse-install: $(addprefix $(INSTALL_LIBDIR)/, $(TARGETS))
# This rule says what web* script depends on which installed binary directory.
$(WEB_SBIN_SCRIPTS): $(INSTALL_SBINDIR)
$(WEB_BIN_SCRIPTS): $(INSTALL_BINDIR)
......
......@@ -127,8 +127,8 @@ SSLCERT_ORGNAME="Utah Network Testbed"
# For boss this is an address on the private segment of the control net.
# For users this is an address on the public segment of the control net.
#
BOSSNODE_IP=155.98.32.70
USERNODE_IP=155.98.33.74
BOSSNODE_IP=10.1.32.70
USERNODE_IP=10.1.33.74
FSNODE_IP=$USERNODE_IP
#
......@@ -150,8 +150,8 @@ EXTERNAL_FSNODE_IP=$EXTERNAL_USERNODE_IP
# The overall control network range - this subnet should cover the
# CONTROL, PRIVATE, and PUBLIC networks below.
#
TESTBED_NETWORK=155.98.32.0
TESTBED_NETMASK=255.255.240.0
TESTBED_NETWORK=10.1.32.0
TESTBED_NETMASK=255.255.255.0
#
# As above, if you have internal and external networks, define the
......@@ -163,22 +163,22 @@ EXTERNAL_TESTBED_NETMASK=$TESTBED_NETMASK
#
# The node control network segment.
#
CONTROL_ROUTER_IP=155.98.36.1
CONTROL_NETWORK=155.98.36.0
CONTROL_NETMASK=255.255.252.0
CONTROL_ROUTER_IP=10.1.36.1
CONTROL_NETWORK=10.1.36.0
CONTROL_NETMASK=255.255.255.0
#
# The private network segment.
#
PRIVATE_NETWORK=155.98.32.0
PRIVATE_ROUTER=155.98.32.1
PRIVATE_NETWORK=10.1.32.0
PRIVATE_ROUTER=10.1.32.1
PRIVATE_NETMASK=255.255.255.0
#
# The public network segment.
#
PUBLIC_NETWORK=155.98.33.0
PUBLIC_ROUTER=155.98.33.1
PUBLIC_NETWORK=10.1.33.0
PUBLIC_ROUTER=10.1.33.1
PUBLIC_NETMASK=255.255.255.0
#
......@@ -186,7 +186,7 @@ PUBLIC_NETMASK=255.255.255.0
# to use for new nodes being added to the testbed.
# You need at least one.
#
DHCPD_DYNRANGE="155.98.36.200 155.98.36.249"
DHCPD_DYNRANGE="10.1.36.200 10.1.36.249"
#
# Fill in the nameservers for your campus network here - the nameserver on boss
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -11,15 +11,21 @@ SUBDIR = install
include $(OBJDIR)/Makeconf
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
TARGETS = boss-install ops-install fs-install dump-descriptors load-descriptors
else
TARGETS = clrhouse-install
endif
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: boss-install ops-install fs-install dump-descriptors load-descriptors
all: $(TARGETS)
include $(TESTBED_SRCDIR)/GNUmakerules
install:
install: $(INSTALL_LIBDIR)/libinstall.pm
clean:
rm -f boss-install ops-install fs-install
This diff is collapsed.
# New ports collection makefile for: emulab-clrhouse
# Date created: 28 February 2009
# Whom: stoller@flux.utah.edu
# Need the major version number to figure out to do.
OSMAJOR!= /usr/bin/uname -r | /usr/bin/sed -e 's/\..*//'
OSMINOR!= /usr/bin/uname -r | /usr/bin/sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/'
PORTNAME= emulab-clrhouse
.if ${OSMAJOR} >= 6
.if ${OSMINOR} >= 3
PORTVERSION= 1.1
.else
PORTVERSION= 1.0
.endif
.endif
CATEGORIES= misc
MASTER_SITES= #none
DISTFILES= #none
EXTRACT_ONLY= #none
COMMENT= "Meta-port for a protogeni clearinghouse"
MAINTAINER= stoller@cs.utah.edu
#
# We set this so that the mysql server port doesn't do name resolution
#
.MAKEFLAGS+= -DSKIP_DNS_CHECK
#
# We must make sure PERL is built with this.
#
.MAKEFLAGS+= ENABLE_SUIDPERL=yes
#
# For SWIG, so that it doesn't feel the need to suck in php and apache
# XXX Something is broken on FreeBSD 6.X and SWIG_LANGUAGES='x y z' breaks.
#
.MAKEFLAGS+= SWIG_LANGUAGES=
.MAKEFLAGS+= WANT_SWIG_PERL=yes WANT_SWIG_PYTHON=yes WANT_SWIG_TCL=yes
#
# Have not taken the plunge to PHP5
#
.MAKEFLAGS+= PHP_VER=4
#
# Various ports need to agree on what version of apache. Make sure this
# agrees with what is in the emulab-ops and emulab-php4 metaports.
#
.MAKEFLAGS+= APACHE_PORT=www/apache13-modssl WITH_OPENSSL_PORT=yes
#
# This prevents any ports from trying to run interactively - some, like the
# net-snmp port, ask silly questions without this option.
#
.MAKEFLAGS+= -DBATCH
BUILD_DEPENDS= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql50 \
${LOCALBASE}/libexec/apache/libphp4.so:${PORTSDIR}/misc/emulab-php4 \
LIB_DEPENDS= mhash.2:${PORTSDIR}/security/mhash \
mysqlclient.15:${PORTSDIR}/databases/mysql50-client \
pubsub.1:${PORTSDIR}/misc/emulab-pubsub
RUN_DEPENDS= \
${LOCALBASE}/etc/apache/ssl.crl:${PORTSDIR}/www/apache13-modssl \
${LOCALBASE}/libexec/apache/libauth_mysql.so:${PORTSDIR}/www/mod_auth_mysql \
${LOCALBASE}/libexec/apache/libphp4.so:${PORTSDIR}/misc/emulab-php4 \
rsync:${PORTSDIR}/net/rsync \
${LOCALBASE}/libexec/mysqld:${PORTSDIR}/databases/mysql50-server \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/BSD/Resource.pm:${PORTSDIR}/devel/p5-BSD-Resource \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/MD5.pm:${PORTSDIR}/security/p5-MD5 \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/IO/Pty.pm:${PORTSDIR}/devel/p5-IO-Tty \
sudo:${PORTSDIR}/security/sudo \
wget:${PORTSDIR}/ftp/wget \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/XML/Parser:${PORTSDIR}/textproc/p5-XML-Parser \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/RPC/XML.pm:${PORTSDIR}/net/p5-RPC-XML \
${PYTHON_SITELIBDIR}/M2Crypto/ASN1.py:${PORTSDIR}/security/py-m2crypto \
gmake:${PORTSDIR}/devel/gmake \
${PYTHON_SITELIBDIR}/MySQLdb/times.py:${PORTSDIR}/databases/py-MySQLdb \
mysqlhotcopy:${PORTSDIR}/databases/mysql50-scripts
RUN_DEPENDS+= \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/DBI.pm:${PORTSDIR}/databases/p5-DBI \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/XML/Simple.pm:${PORTSDIR}/textproc/p5-XML-Simple \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Date/Parse.pm:${PORTSDIR}/devel/p5-TimeDate
RUN_DEPENDS+= \
${LOCALBASE}/lib/libxml2.so:${PORTSDIR}/textproc/libxml2 \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Frontier/Client.pm:${PORTSDIR}/net/p5-Frontier-RPC \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}${PERL_ARCH}/XML/LibXML.pm:${PORTSDIR}/textproc/p5-XML-LibXML \
xmlsec1:${PORTSDIR}/security/xmlsec1 \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}${PERL_ARCH}/Crypt/SSLeay.pm:${PORTSDIR}/security/p5-Crypt-SSLeay
USE_PERL5= yes
USE_PYTHON= yes
NO_BUILD= yes
do-install: # empty
.include <bsd.port.mk>
Meta-port for an emulab Clearinghouse node.
@comment This packing list left intentionally empty
......@@ -7,7 +7,7 @@
PORTSDIR=/usr/ports
PORTSUBDIR=misc
SRCDIR=`dirname $0`
PORTS="elvind emulab-boss emulab-fs emulab-ops libelvin emulab-tftp-hpa p5-GD-old p5-DBD-mysql50-old ulsshxmlrpcpp emulab-iperf emulab-php4 emulab-mailman emulab-pubsub emulab-pubsub-elvincompat"
PORTS="elvind emulab-boss emulab-fs emulab-ops libelvin emulab-tftp-hpa p5-GD-old p5-DBD-mysql50-old ulsshxmlrpcpp emulab-iperf emulab-php4 emulab-mailman emulab-pubsub emulab-pubsub-elvincompat emulab-clrhouse"
echo "Copying ports ..."
for PORT in $PORTS
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -11,7 +11,7 @@ SUBDIR = protogeni
include $(OBJDIR)/Makeconf
SUBDIRS = security xmlrpc lib scripts etc
SUBDIRS = security xmlrpc lib scripts etc
all: all-subdirs
......@@ -26,6 +26,9 @@ install:
control-install:
# Clearinghouse install.
clrhouse-install: install
clean: clean-subdirs
distclean: subdir-distclean
......@@ -38,5 +41,4 @@ subdir-distclean:
@$(MAKE) -C $(dir $@) $(basename $(notdir $@))
%-subdirs: $(addsuffix /%.MAKE,$(SUBDIRS)) ;
.PHONY: $(SUBDIRS)
.PHONY: $(SUBDIRS) install
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# All rights reserved.
#
......
This diff is collapsed.
This diff is collapsed.
#
# For the standalone clearinghouse, change only these.
#
. defs-example
# The name of this installation
THISHOMEBASE=ClearingHouse.Emulab.Net
# Hostname
WWWHOST=mynode.example.net
BOSSNODE=mynode.example.net
# Email for errors.
TBOPSEMAIL=someone@mynode.example.net
TBLOGSEMAIL=someone@mynode.example.net
TBWWWEMAIL=someone@mynode.example.net
TBAUDITEMAIL=someone@mynode.example.net
# Make sure you change this!
PROTOGENI_DOMAIN="mynode"
PROTOGENI_SUPPORT=1
PROTOGENI_CLEARINGHOUSE=1
......@@ -17,14 +17,13 @@ use vars qw(@ISA @EXPORT);
@EXPORT = qw ( );
# Must come after package declaration!
use lib '@prefix@/lib';
use GeniDB;
use GeniCredential;
use GeniCertificate;
use GeniSliver;
use GeniSlice;
use GeniRegistry;
use libdb qw(TBGetUniqueIndex);
use emutil;
use English;
use overload ('""' => 'Stringify');
use XML::Simple;
......@@ -42,6 +41,7 @@ my $VERIFYCRED = "$TB/sbin/verifygenicred";
# Cache of instances to avoid regenerating them.
my %aggregates = ();
BEGIN { use GeniUtil; GeniUtil::AddCache(\%aggregates); }
#
# Lookup by idx, or uuid.
......
......@@ -17,11 +17,9 @@ use vars qw(@ISA @EXPORT);
@EXPORT = qw ( );
# Must come after package declaration!
use lib '@prefix@/lib';
use GeniDB;
use GeniRegistry;
use libtestbed;
use libdb qw(TBGetUniqueIndex);
use emutil qw(TBGetUniqueIndex);
use English;
use overload ('""' => 'Stringify');
use XML::Simple;
......@@ -38,6 +36,7 @@ my $VERIFYCRED = "$TB/sbin/verifygenicred";
# Cache of instances to avoid regenerating them.
my %authorities = ();
BEGIN { use GeniUtil; GeniUtil::AddCache(\%authorities); }
#
# Lookup by uuid.
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
......@@ -16,18 +15,16 @@ use vars qw(@ISA @EXPORT);
@ISA = "Exporter";
@EXPORT = qw ( );
# Must come after package declaration!
use lib '@prefix@/lib';
#use Devel::TraceUse;
use GeniDB;
use Genixmlrpc;
use GeniRegistry;
use GeniResponse;
use User;
use GeniUser;
use GeniSlice;
use GeniComponent;
use GeniAuthority;
use libtestbed;
use emutil;
use libtestbed qw(SENDMAIL);
use English;
use Data::Dumper;
......@@ -278,7 +275,7 @@ sub Resolve($)
return GeniResponse->Create(GENIRESPONSE_SUCCESS, $blob);
}
if ($type eq "slice") {
my $slice = GeniSlice->Lookup($lookup_token);
my $slice = GeniRegistry::GeniSlice->Lookup($lookup_token);
if (!defined($slice)) {
return GeniResponse->Create(GENIRESPONSE_SEARCHFAILED, undef,
"No such slice $lookup_token");
......@@ -442,7 +439,6 @@ sub Register($)
}
if ($type eq "slice") {
my $creator_uuid = $info->{'creator_uuid'};
my $userbindings = $info->{'userbindings'};
if (! ($creator_uuid =~ /^[-\w]*$/)) {
return GeniResponse->Create(GENIRESPONSE_ERROR, undef,
......@@ -473,7 +469,7 @@ sub Register($)
#
# Reregistration of existing slice is okay.
#
my $existing = GeniSlice->Lookup($certificate->uuid());
my $existing = GeniRegistry::GeniSlice->Lookup($certificate->uuid());
if (defined($existing)) {
if (! ($existing->cert() eq $certificate->cert())) {
return GeniResponse->Create(GENIRESPONSE_ERROR, undef,
......@@ -490,14 +486,15 @@ sub Register($)
#
# Make sure slice hrn and uuid are unique.
#
if (GeniSlice->CheckExisting($certificate->hrn(),
$certificate->uuid())) {
if (GeniRegistry::GeniSlice->CheckExisting($certificate->hrn(),
$certificate->uuid())) {
return GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Slice already registered");
}
my $newslice = GeniSlice->Create($certificate, $creator_uuid,
$slice_authority);
my $newslice = GeniRegistry::GeniSlice->Create($certificate,
$creator_uuid,
$slice_authority);
if (!defined($newslice)) {
return GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"Could not be registered");
......@@ -614,7 +611,7 @@ sub Remove($)
"$uuid has been unregistered");
}
if ($type eq "Slice") {
my $slice = GeniSlice->Lookup($uuid);
my $slice = GeniRegistry::GeniSlice->Lookup($uuid);
if (!defined($slice)) {
return GeniResponse->Create(GENIRESPONSE_SUCCESS, undef,
"No such slice $uuid");
......@@ -673,13 +670,12 @@ sub Shutdown($)
return GeniResponse->Create(GENIRESPONSE_FORBIDDEN,
undef, "This is not your registry!");
}
$credential->HasPrivilege( "authority" ) or
$credential->HasPrivilege( "operator" ) or
return GeniResponse->Create( GENIRESPONSE_FORBIDDEN, undef,
"Insufficient privilege" );
my $slice = GeniSlice->Lookup($uuid);
my $slice = GeniRegistry::GeniSlice->Lookup($uuid);
if (!defined($slice)) {
print STDERR "No slice record $uuid for shutdown!\n";
return GeniResponse->Create(GENIRESPONSE_ERROR, undef,
......
......@@ -32,9 +32,9 @@ use GeniSliver;
use GeniUser;
use GeniRegistry;
use libtestbed;
use emutil;
# Hate to import all this crap; need a utility library.
use libdb qw(TBGetUniqueIndex TBcheck_dbslot TBGetSiteVar
TBDB_CHECKDBSLOT_ERROR);
use libdb qw(TBGetSiteVar);
use User;
use Node;
use libadminctrl;
......
......@@ -17,10 +17,8 @@ use vars qw(@ISA @EXPORT);
@EXPORT = qw ( );
# Must come after package declaration!
use lib '@prefix@/lib';
use GeniDB;
use libtestbed;
use libdb qw(TBGetUniqueIndex);
use emutil qw(TBGetUniqueIndex);
use English;
use XML::Simple;
use XML::LibXML;
......@@ -43,6 +41,7 @@ my $MKCERT = "$TB/sbin/mksyscert";
# Cache of instances to avoid regenerating them.
my %certificates = ();
BEGIN { use GeniUtil; GeniUtil::AddCache(\%certificates); }
#
# Lookup by uuid only.
......@@ -458,7 +457,7 @@ sub StoreCRL($$$)
#
package GeniCertificate::LocalUser;
use English;
use libdb;
use emdb;
#
# Create a wrapper, with the same access names.
......
......@@ -16,8 +16,6 @@ use vars qw(@ISA @EXPORT);
@ISA = "Exporter";
@EXPORT = qw ( );
# Must come after package declaration!
use lib '@prefix@/lib';
use GeniDB;
use Genixmlrpc;
use GeniResponse;
......@@ -25,7 +23,7 @@ use GeniRegistry;
use GeniTicket;
use GeniCredential;
use GeniAuthority;
use libdb qw(TBGetUniqueIndex);
use emutil qw(TBGetUniqueIndex);