All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit bc81c383 authored by Leigh B Stoller's avatar Leigh B Stoller

The bulk of Emulab Portal Support! See this wiki page for a high level

view of what Portal support does:

https://users.emulab.net/trac/emulab/wiki/Portal

Notes:

* New DB tables to store the list of peer emulabs, and exports info
  for users and projects.

* Backend script to manage user and projects exports.

* Cross site login from the portal; users do not login into the peer
  sites directly.

* New portal_daemon to run on the portal, to handle exports and
  updates.
parent 7b62628f
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group. # Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -13,9 +13,10 @@ UNIFIED = @UNIFIED_BOSS_AND_OPS@ ...@@ -13,9 +13,10 @@ UNIFIED = @UNIFIED_BOSS_AND_OPS@
include $(OBJDIR)/Makeconf include $(OBJDIR)/Makeconf
SBIN_STUFF = tbacct addsfskey addpubkey mkusercert quotamail genpubkeys \ SBIN_STUFF = tbacct addsfskey addpubkey mkusercert quotamail genpubkeys \
newuser newproj mksyscert spewcert newuser newproj mksyscert spewcert dumpuser dumpproject \
manageremote
LIBEXEC_STUFF = webtbacct webaddsfskey webaddpubkey webmkusercert \ LIBEXEC_STUFF = webtbacct webaddsfskey webaddpubkey webmkusercert \
webnewuser webnewproj webspewcert webnewuser webnewproj webspewcert webmanageremote
CTRLSBIN_STUFF = adduserhook CTRLSBIN_STUFF = adduserhook
# These scripts installed setuid, with sudo. # These scripts installed setuid, with sudo.
...@@ -23,6 +24,11 @@ SETUID_BIN_SCRIPTS = ...@@ -23,6 +24,11 @@ SETUID_BIN_SCRIPTS =
SETUID_SBIN_SCRIPTS = tbacct addpubkey mkusercert mksyscert SETUID_SBIN_SCRIPTS = tbacct addpubkey mkusercert mksyscert
SETUID_LIBX_SCRIPTS = SETUID_LIBX_SCRIPTS =
ifeq ($(PROTOGENI_SUPPORT),1)
SBIN_STUFF += manageremote
SETUID_SBIN_SCRIPTS += manageremote
endif
# #
# Targets # Targets
# #
......
This diff is collapsed.
...@@ -817,7 +817,9 @@ DYNAMICROOTPASSWORDS ...@@ -817,7 +817,9 @@ DYNAMICROOTPASSWORDS
TPM TPM
REMOTEWIKIDOCS REMOTEWIKIDOCS
PROTOGENI_SUPPORT PROTOGENI_SUPPORT
PROTOGENI_CLEARINGHOUSE PROTOGENI_WEBSITE
PROTOGENI_ISCLEARINGHOUSE
PROTOGENI_EMAIL
PROTOGENI_DOMAIN PROTOGENI_DOMAIN
PROTOGENI_RPCPORT PROTOGENI_RPCPORT
PROTOGENI_RPCNAME PROTOGENI_RPCNAME
...@@ -833,6 +835,8 @@ TBUSEDBI ...@@ -833,6 +835,8 @@ TBUSEDBI
NEEDMROUTED NEEDMROUTED
OPSVM_ENABLE OPSVM_ENABLE
OPSVM_MOUNTPOINT OPSVM_MOUNTPOINT
PORTAL_ENABLE
PORTAL_ISPRIMARY
TBOPSEMAIL TBOPSEMAIL
TBOPSEMAIL_NOSLASH TBOPSEMAIL_NOSLASH
TBROBOCOPSEMAIL TBROBOCOPSEMAIL
...@@ -4959,6 +4963,10 @@ done ...@@ -4959,6 +4963,10 @@ done
...@@ -5048,7 +5056,9 @@ DYNAMICROOTPASSWORDS=1 ...@@ -5048,7 +5056,9 @@ DYNAMICROOTPASSWORDS=1
TPM=0 TPM=0
REMOTEWIKIDOCS=1 REMOTEWIKIDOCS=1
PROTOGENI_SUPPORT=0 PROTOGENI_SUPPORT=0
PROTOGENI_CLEARINGHOUSE=0 PROTOGENI_ISCLEARINGHOUSE=0
PROTOGENI_EMAIL="geni-dev-utah@flux.utah.edu"
PROTOGENI_WEBSITE="www.emulab.net"
PROTOGENI_DOMAIN="unknown" PROTOGENI_DOMAIN="unknown"
PROTOGENI_RPCPORT=12369 PROTOGENI_RPCPORT=12369
PROTOGENI_RPCNAME="" PROTOGENI_RPCNAME=""
...@@ -5063,6 +5073,8 @@ NEEDMROUTED=0 ...@@ -5063,6 +5073,8 @@ NEEDMROUTED=0
OPSVM_ENABLE=0 OPSVM_ENABLE=0
OPSVM_MOUNTPOINT="/ops" OPSVM_MOUNTPOINT="/ops"
OURTIMEZONE="America/Denver" OURTIMEZONE="America/Denver"
PORTAL_ENABLE=0
PORTAL_ISPRIMARY=0
# #
# XXX You really don't want to change these! # XXX You really don't want to change these!
...@@ -5414,6 +5426,9 @@ else ...@@ -5414,6 +5426,9 @@ else
TBERRORSEMAIL_NOSLASH="$TBOPSEMAIL_NOSLASH" TBERRORSEMAIL_NOSLASH="$TBOPSEMAIL_NOSLASH"
TBERRORSEMAIL="$TBOPSEMAIL" TBERRORSEMAIL="$TBOPSEMAIL"
fi fi
if test -n "$PROTOGENI_EMAIL"; then
PROTOGENI_EMAIL="`echo $PROTOGENI_EMAIL | sed -e 's/@/\\\@/'`"
fi
# Default OURDOMAIN to the domain name of the boss node # Default OURDOMAIN to the domain name of the boss node
# This is gross beyond all description - autoconf changes m4's quote characters # This is gross beyond all description - autoconf changes m4's quote characters
......
...@@ -215,7 +215,9 @@ AC_SUBST(DYNAMICROOTPASSWORDS) ...@@ -215,7 +215,9 @@ AC_SUBST(DYNAMICROOTPASSWORDS)
AC_SUBST(TPM) AC_SUBST(TPM)
AC_SUBST(REMOTEWIKIDOCS) AC_SUBST(REMOTEWIKIDOCS)
AC_SUBST(PROTOGENI_SUPPORT) AC_SUBST(PROTOGENI_SUPPORT)
AC_SUBST(PROTOGENI_CLEARINGHOUSE) AC_SUBST(PROTOGENI_WEBSITE)
AC_SUBST(PROTOGENI_ISCLEARINGHOUSE)
AC_SUBST(PROTOGENI_EMAIL)
AC_SUBST(PROTOGENI_DOMAIN) AC_SUBST(PROTOGENI_DOMAIN)
AC_SUBST(PROTOGENI_RPCPORT) AC_SUBST(PROTOGENI_RPCPORT)
AC_SUBST(PROTOGENI_RPCNAME) AC_SUBST(PROTOGENI_RPCNAME)
...@@ -231,6 +233,8 @@ AC_SUBST(TBUSEDBI) ...@@ -231,6 +233,8 @@ AC_SUBST(TBUSEDBI)
AC_SUBST(NEEDMROUTED) AC_SUBST(NEEDMROUTED)
AC_SUBST(OPSVM_ENABLE) AC_SUBST(OPSVM_ENABLE)
AC_SUBST(OPSVM_MOUNTPOINT) AC_SUBST(OPSVM_MOUNTPOINT)
AC_SUBST(PORTAL_ENABLE)
AC_SUBST(PORTAL_ISPRIMARY)
# #
# Offer both versions of the email addresses that have the @ escaped # Offer both versions of the email addresses that have the @ escaped
...@@ -316,7 +320,9 @@ DYNAMICROOTPASSWORDS=1 ...@@ -316,7 +320,9 @@ DYNAMICROOTPASSWORDS=1
TPM=0 TPM=0
REMOTEWIKIDOCS=1 REMOTEWIKIDOCS=1
PROTOGENI_SUPPORT=0 PROTOGENI_SUPPORT=0
PROTOGENI_CLEARINGHOUSE=0 PROTOGENI_ISCLEARINGHOUSE=0
PROTOGENI_EMAIL="geni-dev-utah@flux.utah.edu"
PROTOGENI_WEBSITE="www.emulab.net"
PROTOGENI_DOMAIN="unknown" PROTOGENI_DOMAIN="unknown"
PROTOGENI_RPCPORT=12369 PROTOGENI_RPCPORT=12369
PROTOGENI_RPCNAME="" PROTOGENI_RPCNAME=""
...@@ -331,6 +337,8 @@ NEEDMROUTED=0 ...@@ -331,6 +337,8 @@ NEEDMROUTED=0
OPSVM_ENABLE=0 OPSVM_ENABLE=0
OPSVM_MOUNTPOINT="/ops" OPSVM_MOUNTPOINT="/ops"
OURTIMEZONE="America/Denver" OURTIMEZONE="America/Denver"
PORTAL_ENABLE=0
PORTAL_ISPRIMARY=0
# #
# XXX You really don't want to change these! # XXX You really don't want to change these!
...@@ -531,6 +539,9 @@ else ...@@ -531,6 +539,9 @@ else
TBERRORSEMAIL_NOSLASH="$TBOPSEMAIL_NOSLASH" TBERRORSEMAIL_NOSLASH="$TBOPSEMAIL_NOSLASH"
TBERRORSEMAIL="$TBOPSEMAIL" TBERRORSEMAIL="$TBOPSEMAIL"
fi fi
if test -n "$PROTOGENI_EMAIL"; then
PROTOGENI_EMAIL="`echo $PROTOGENI_EMAIL | sed -e 's/@/\\\@/'`"
fi
# Default OURDOMAIN to the domain name of the boss node # Default OURDOMAIN to the domain name of the boss node
# This is gross beyond all description - autoconf changes m4's quote characters # This is gross beyond all description - autoconf changes m4's quote characters
......
...@@ -88,7 +88,11 @@ PROTOGENI_SUPPORT=1 ...@@ -88,7 +88,11 @@ PROTOGENI_SUPPORT=1
# If you are not the main Emulab site in Utah, change this! # If you are not the main Emulab site in Utah, change this!
PROTOGENI_DOMAIN="utahemulab" PROTOGENI_DOMAIN="utahemulab"
# If you are not the main Emulab site in Utah, DO NOT SET THIS! # If you are not the main Emulab site in Utah, DO NOT SET THIS!
PROTOGENI_CLEARINGHOUSE=1 PROTOGENI_ISCLEARINGHOUSE=1
# Set this to the email address for ClearingHouse.
PROTOGENI_EMAIL="geni-dev-utah@flux.utah.edu"
# Set this to the hostname of the clearinghouse web site.
PROTOGENI_WEBSITE="www.emulab.net"
# #
# SSL Certificate stuff. Used to customize config files in ssl directory. # SSL Certificate stuff. Used to customize config files in ssl directory.
......
...@@ -12,3 +12,6 @@ TBSTATEDEMAIL=stoller@fast.cs.utah.edu ...@@ -12,3 +12,6 @@ TBSTATEDEMAIL=stoller@fast.cs.utah.edu
TBTESTSUITEEMAIL=stoller@fast.cs.utah.edu TBTESTSUITEEMAIL=stoller@fast.cs.utah.edu
WWW=www.emulab.net/dev/stoller WWW=www.emulab.net/dev/stoller
THISHOMEBASE=Stoller.Emulab.Net THISHOMEBASE=Stoller.Emulab.Net
PORTAL_ENABLE=1
PORTAL_ISPRIMARY=1
#
# Another change to the testbed startup script.
#
use strict;
use libinstall;
my $TESTBED_STARTUP = "/usr/local/etc/rc.d/3.testbed.sh";
sub InstallUpdate($$)
{
my ($version, $phase) = @_;
#
# If something should run in the pre-install phase.
#
if ($phase eq "pre") {
Phase "startupfile", "Updating testbed startup file", sub {
DoneIfIdentical("$TOP_OBJDIR/rc.d/3.testbed.sh", $TESTBED_STARTUP);
DiffFiles("$TOP_OBJDIR/rc.d/3.testbed.sh", $TESTBED_STARTUP);
ExecQuietFatal("$GMAKE -C $TOP_OBJDIR/rc.d install");
};
}
#
# If something should run in the post-install phase.
#
if ($phase eq "post") {
}
return 0;
}
1;
# #
# GENIPUBLIC-COPYRIGHT # GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group. # Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -17,7 +17,7 @@ LIB_SCRIPTS = GeniDB.pm GeniUser.pm \ ...@@ -17,7 +17,7 @@ LIB_SCRIPTS = GeniDB.pm GeniUser.pm \
GeniComponent.pm GeniCH.pm GeniEmulabUtil.pm \ GeniComponent.pm GeniCH.pm GeniEmulabUtil.pm \
GeniAuthority.pm GeniCertificate.pm GeniAggregate.pm \ GeniAuthority.pm GeniCertificate.pm GeniAggregate.pm \
GeniUtil.pm GeniRegistry.pm GeniUsage.pm GeniHRN.pm \ GeniUtil.pm GeniRegistry.pm GeniUsage.pm GeniHRN.pm \
GeniSES.pm GeniResource.pm GeniXML.pm GeniAM.pm GeniSES.pm GeniResource.pm GeniXML.pm GeniAM.pm GeniEmulab.pm
SBIN_SCRIPTS = plabnodewrapper plabslicewrapper SBIN_SCRIPTS = plabnodewrapper plabslicewrapper
SCRIPTS = genischemacheck.pl SCRIPTS = genischemacheck.pl
......
This diff is collapsed.
# #
# GENIPUBLIC-COPYRIGHT # GENIPUBLIC-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group. # Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -21,7 +21,7 @@ SETUID_LIBX_SCRIPTS = ...@@ -21,7 +21,7 @@ SETUID_LIBX_SCRIPTS =
# configure if the .in file is changed. # configure if the .in file is changed.
# #
all: Genixmlrpc.pm GeniResponse.pm \ all: Genixmlrpc.pm GeniResponse.pm \
protogeni-ch.pm protogeni-sa.pm protogeni-cm.pm \ protogeni-ch.pm protogeni-sa.pm protogeni-cm.pm protogeni-emulab.pm \
protogeni-ses.pm geni-am.pm \ protogeni-ses.pm geni-am.pm \
protogeni-wrapper.pl protogeni-wrapper.pl
...@@ -33,6 +33,7 @@ install-libs: $(INSTALL_LIBDIR)/Genixmlrpc.pm \ ...@@ -33,6 +33,7 @@ install-libs: $(INSTALL_LIBDIR)/Genixmlrpc.pm \
$(INSTALL_LIBDIR)/protogeni-sa.pm \ $(INSTALL_LIBDIR)/protogeni-sa.pm \
$(INSTALL_LIBDIR)/protogeni-cm.pm \ $(INSTALL_LIBDIR)/protogeni-cm.pm \
$(INSTALL_LIBDIR)/protogeni-ses.pm \ $(INSTALL_LIBDIR)/protogeni-ses.pm \
$(INSTALL_LIBDIR)/protogeni-emulab.pm \
$(INSTALL_LIBDIR)/geni-am.pm \ $(INSTALL_LIBDIR)/geni-am.pm \
$(INSTALL_DIR)/opsdir/lib/Genixmlrpc.pm \ $(INSTALL_DIR)/opsdir/lib/Genixmlrpc.pm \
$(INSTALL_DIR)/opsdir/lib/GeniResponse.pm $(INSTALL_DIR)/opsdir/lib/GeniResponse.pm
...@@ -41,7 +42,7 @@ install-scripts: $(INSTALL_DIR)/protogeni/xmlrpc/protogeni-wrapper.pl ...@@ -41,7 +42,7 @@ install-scripts: $(INSTALL_DIR)/protogeni/xmlrpc/protogeni-wrapper.pl
$(SUDO) chown root $(INSTALL_DIR)/protogeni/xmlrpc/protogeni-wrapper.pl $(SUDO) chown root $(INSTALL_DIR)/protogeni/xmlrpc/protogeni-wrapper.pl
$(SUDO) chmod u+s $(INSTALL_DIR)/protogeni/xmlrpc/protogeni-wrapper.pl $(SUDO) chmod u+s $(INSTALL_DIR)/protogeni/xmlrpc/protogeni-wrapper.pl
install: install-libs install-scripts install: all install-libs install-scripts
control-install: control-install:
......
#!/usr/bin/perl -w
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
use English;
# Do this early so that we talk to the right DB.
use vars qw($GENI_DBNAME $GENI_METHODS $EMULAB_PEMFILE);
BEGIN { $GENI_DBNAME = "geni"; }
# Configure variables
my $ETCDIR = "@prefix@/etc";
$EMULAB_PEMFILE = "$ETCDIR/genisa.pem";
# Testbed libraries.
use lib '@prefix@/lib';
use GeniEmulab;
$GENI_METHODS = {
"GetVersion" => \&GeniEmulab::GetVersion,
"AddUser" => \&GeniEmulab::AddUser,
"DeleteUser" => \&GeniEmulab::DeleteUser,
"ModifyUser" => \&GeniEmulab::ModifyUser,
"AddProject" => \&GeniEmulab::AddProject,
"AddGroup" => \&GeniEmulab::AddGroup,
"SetGroups" => \&GeniEmulab::SetGroups,
"CrossLogin" => \&GeniEmulab::CrossLogin,
};
1;
...@@ -30,8 +30,10 @@ BEGIN { ...@@ -30,8 +30,10 @@ BEGIN {
} }
# Configure variables # Configure variables
my $MAINSITE = @TBMAINSITE@; my $MAINSITE = @TBMAINSITE@;
my $TBOPS = "@TBOPSEMAIL@"; my $TBOPS = "@TBOPSEMAIL@";
my $PORTAL_ENABLE = @PORTAL_ENABLE@;
my $PORTAL_ISPRIMARY = @PORTAL_ISPRIMARY@;
my $MODULE; my $MODULE;
my $GENIURN; my $GENIURN;
...@@ -45,7 +47,10 @@ my %GENI_MODULES = ( "cm" => "@prefix@/lib/protogeni-cm.pm", ...@@ -45,7 +47,10 @@ my %GENI_MODULES = ( "cm" => "@prefix@/lib/protogeni-cm.pm",
"ses" => "@prefix@/lib/protogeni-ses.pm", "ses" => "@prefix@/lib/protogeni-ses.pm",
# XXX This is temporary! # XXX This is temporary!
"instools" => "@prefix@/lib/protogeni-instools.pm", "instools" => "@prefix@/lib/protogeni-instools.pm",
); );
if ($PORTAL_ENABLE && !$PORTAL_ISPRIMARY) {
$GENI_MODULES{"emulab"} = "@prefix@/lib/protogeni-emulab.pm";
}
# These variables are shared with the loaded module. # These variables are shared with the loaded module.
use vars qw($EMULAB_PEMFILE $GENI_METHODS $GENI_VERSION use vars qw($EMULAB_PEMFILE $GENI_METHODS $GENI_VERSION
...@@ -62,10 +67,6 @@ use libEmulab; ...@@ -62,10 +67,6 @@ use libEmulab;
use libtestbed; use libtestbed;
use User; use User;
# Geniuser.
my $user = "geniuser";
my $group = "GeniSlices";
# Need a command line option. # Need a command line option.
my $debug = 0; my $debug = 0;
my $mailerrors = 1; my $mailerrors = 1;
...@@ -138,19 +139,7 @@ if (! (exists($ENV{'SSL_CLIENT_VERIFY'}) && ...@@ -138,19 +139,7 @@ if (! (exists($ENV{'SSL_CLIENT_VERIFY'}) &&
# so that there is an emulab user context, or many of the scripts we # so that there is an emulab user context, or many of the scripts we
# invoke will complain and croak. # invoke will complain and croak.
# #
my $unix_uid = getpwnam("$user") or GeniUtil::FlipToGeniUser();
die("*** $0:\n".
" No such user $user\n");
my $unix_gid = getgrnam("$group") or
die("*** $0:\n".
" No such group $group\n");
# Flip to user and never go back
$GID = $unix_gid;
$EGID = "$unix_gid $unix_gid";
$EUID = $UID = $unix_uid;
$ENV{'USER'} = $user;
$ENV{'LOGNAME'} = $user;
if (exists($ENV{'PATH_INFO'}) && $ENV{'PATH_INFO'} ne "") { if (exists($ENV{'PATH_INFO'}) && $ENV{'PATH_INFO'} ne "") {
my $pathinfo = $ENV{'PATH_INFO'}; my $pathinfo = $ENV{'PATH_INFO'};
...@@ -261,6 +250,10 @@ if (!(defined($GENI_METHODS) && defined($EMULAB_PEMFILE))) { ...@@ -261,6 +250,10 @@ if (!(defined($GENI_METHODS) && defined($EMULAB_PEMFILE))) {
# #
# So we know who/what we are acting as. # So we know who/what we are acting as.
# #
# Must be a require cause of the DB name that is set in the module file
# which is not loaded until just above.
require GeniCertificate;
my $certificate = GeniCertificate->LoadFromFile($EMULAB_PEMFILE); my $certificate = GeniCertificate->LoadFromFile($EMULAB_PEMFILE);
if (!defined($certificate)) { if (!defined($certificate)) {
...@@ -374,6 +367,9 @@ if ($MODULE eq "cm" || $MODULE eq $AM_MODULE) { ...@@ -374,6 +367,9 @@ if ($MODULE eq "cm" || $MODULE eq $AM_MODULE) {
$debug = 2; $debug = 2;
} }
} }
elsif ($MODULE eq "emulab") {
$debug = 2;
}
my $starttime = [gettimeofday()]; my $starttime = [gettimeofday()];
eval { $result = &{ $GENI_METHODS->{$method} }(@{ $call->{'value'} }) }; eval { $result = &{ $GENI_METHODS->{$method} }(@{ $call->{'value'} }) };
......
...@@ -590,6 +590,20 @@ CREATE TABLE `emulab_locks` ( ...@@ -590,6 +590,20 @@ CREATE TABLE `emulab_locks` (
PRIMARY KEY (`name`) PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `emulab_peers`
--
DROP TABLE IF EXISTS `emulab_peers`;
CREATE TABLE `emulab_peers` (
`name` varchar(64) NOT NULL default '',
`urn` varchar(128) NOT NULL default '',
`is_primary` tinyint(1) NOT NULL default '0',
`weburl` tinytext,
PRIMARY KEY (`name`),
UNIQUE KEY `urn` (`urn`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `emulab_pubs` -- Table structure for table `emulab_pubs`
-- --
...@@ -1482,6 +1496,23 @@ CREATE TABLE `global_vtypes` ( ...@@ -1482,6 +1496,23 @@ CREATE TABLE `global_vtypes` (
PRIMARY KEY (`vtype`) PRIMARY KEY (`vtype`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `group_exports`
--
DROP TABLE IF EXISTS `group_exports`;
CREATE TABLE `group_exports` (
`pid_idx` mediumint(8) unsigned NOT NULL default '0',
`gid_idx` mediumint(8) unsigned NOT NULL default '0',
`pid` varchar(48) NOT NULL default '',
`gid` varchar(32) NOT NULL default '',
`peer` varchar(64) NOT NULL default '',
`exported` datetime default NULL,
`updated` datetime default NULL,
PRIMARY KEY (`pid_idx`,`gid_idx`,`peer`),
UNIQUE KEY pidpeer (`pid`,`gid`,`peer`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `group_features` -- Table structure for table `group_features`
-- --
...@@ -3332,6 +3363,7 @@ CREATE TABLE `projects` ( ...@@ -3332,6 +3363,7 @@ CREATE TABLE `projects` (
`allow_workbench` tinyint(1) NOT NULL default '0', `allow_workbench` tinyint(1) NOT NULL default '0',
`nonlocal_id` varchar(128) default NULL, `nonlocal_id` varchar(128) default NULL,
`nonlocal_type` tinytext, `nonlocal_type` tinytext,
`manager_urn` varchar(128) default NULL,
PRIMARY KEY (`pid_idx`), PRIMARY KEY (`pid_idx`),
UNIQUE KEY `pid` (`pid`), UNIQUE KEY `pid` (`pid`),
KEY `unix_gid` (`unix_gid`), KEY `unix_gid` (`unix_gid`),
...@@ -3813,6 +3845,21 @@ CREATE TABLE `unixgroup_membership` ( ...@@ -3813,6 +3845,21 @@ CREATE TABLE `unixgroup_membership` (
PRIMARY KEY (`uid`,`gid`) PRIMARY KEY (`uid`,`gid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `user_exports`
--
DROP TABLE IF EXISTS `user_exports`;
CREATE TABLE `user_exports` (
`uid` varchar(8) NOT NULL default '',
`uid_idx` mediumint(8) unsigned NOT NULL default '0',
`peer` varchar(64) NOT NULL default '',
`exported` datetime default NULL,
`updated` datetime default NULL,
PRIMARY KEY (`uid_idx`,`peer`),
UNIQUE KEY uidpeer (`uid`,`peer`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `user_features` -- Table structure for table `user_features`
-- --
...@@ -3981,6 +4028,7 @@ CREATE TABLE `users` ( ...@@ -3981,6 +4028,7 @@ CREATE TABLE `users` (
`mailman_password` tinytext, `mailman_password` tinytext,
`nonlocal_id` varchar(128) default NULL, `nonlocal_id` varchar(128) default NULL,
`nonlocal_type` tinytext, `nonlocal_type` tinytext,
`manager_urn` varchar(128) default NULL,
`default_project` mediumint(8) unsigned default NULL, `default_project` mediumint(8) unsigned default NULL,
`nocollabtools` tinyint(1) default '0', `nocollabtools` tinyint(1) default '0',
PRIMARY KEY (`uid_idx`), PRIMARY KEY (`uid_idx`),
......
...@@ -757,9 +757,13 @@ REPLACE INTO table_regex VALUES ('projects','default_user_interface','text','reg ...@@ -757,9 +757,13 @@ REPLACE INTO table_regex VALUES ('projects','default_user_interface','text','reg
REPLACE INTO table_regex VALUES ('projects','pid','text','regex','^[-\\w]+$',2,48,NULL); REPLACE INTO table_regex VALUES ('projects','pid','text','regex','^[-\\w]+$',2,48,NULL);
REPLACE INTO table_regex VALUES ('projects','pid_idx','text','regex','^[\\d]+$',1,12,NULL); REPLACE INTO table_regex VALUES ('projects','pid_idx','text','regex','^[\\d]+$',1,12,NULL);
REPLACE INTO table_regex VALUES ('projects','URL','text','redirect','default:tinytext',0,0,NULL); REPLACE INTO table_regex VALUES ('projects','URL','text','redirect','default:tinytext',0,0,NULL);
REPLACE INTO table_regex VALUES ('projects','manager_urn','text','regex','^[-_\\w\\.\\/:+]*$',10,128,NULL);
REPLACE INTO table_regex VALUES ('projects','nonlocal_id','text','regex','^[-_\\w\\.\\/:+]*$',10,128,NULL); REPLACE INTO table_regex VALUES ('projects','nonlocal_id','text','regex','^[-_\\w\\.\\/:+]*$',10,128,NULL);
REPLACE INTO table_regex VALUES ('projects','nonlocal_type','text','regex','^[-\\w]*$',1,64,NULL); REPLACE INTO table_regex VALUES ('projects','nonlocal_type','text','regex','^[-\\w]*$',1,64,NULL);
REPLACE INTO table_regex VALUES ('reserved','vname','text','redirect','virt_nodes:vname',1,32,NULL); REPLACE INTO table_regex VALUES ('reserved','vname','text','redirect','virt_nodes:vname',1,32,NULL);
REPLACE INTO table_regex VALUES ('users','manager_urn','text','regex','^[-_\\w\\.\\/:+]*$',10,128,NULL);
REPLACE INTO table_regex VALUES ('users','nonlocal_id','text','regex','^[-_\\w\\.\\/:+]*$',10,128,NULL);
REPLACE INTO table_regex VALUES ('users','nonlocal_type','text','regex','^[-\\w]*$',1,64,NULL);
REPLACE INTO table_regex VALUES ('users','uid','text','regex','^[a-zA-Z][\\w]+$',2,8,NULL); REPLACE INTO table_regex VALUES ('users','uid','text','regex','^[a-zA-Z][\\w]+$',2,8,NULL);
REPLACE INTO table_regex VALUES ('users','uid_idx','text','regex','^[\\d]+$',1,12,NULL); REPLACE INTO table_regex VALUES ('users','uid_idx','text','regex','^[\\d]+$',1,12,NULL);
REPLACE INTO table_regex VALUES ('users','usr_phone','text','regex','^[-\\d\\(\\)\\+\\.x ]+$',7,64,NULL); REPLACE INTO table_regex VALUES ('users','usr_phone','text','regex','^[-\\d\\(\\)\\+\\.x ]+$',7,64,NULL);
......
#
#
#
use strict;
use libdb;
my $impotent = 0;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (! DBTableExists("emulab_peers")) {
DBQueryFatal("CREATE TABLE `emulab_peers` ( ".
" `name` varchar(64) NOT NULL default '', ".
" `urn` varchar(128) NOT NULL default '', ".
" `is_primary` tinyint(1) NOT NULL default '0', ".
" `weburl` tinytext, ".
" PRIMARY KEY (`name`), ".
" UNIQUE KEY `urn` (`urn`) ".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
if (! DBTableExists("group_exports")) {
DBQueryFatal("CREATE TABLE `group_exports` ( ".
" `pid_idx` mediumint(8) unsigned NOT NULL default '0', ".
" `gid_idx` mediumint(8) unsigned NOT NULL default '0', ".
" `pid` varchar(48) NOT NULL default '', ".
" `gid` varchar(32) NOT NULL default '', ".
" `peer` varchar(64) NOT NULL default '', ".
" `exported` datetime default NULL, ".
" `updated` datetime default NULL, ".
" PRIMARY KEY (`pid_idx`,`gid_idx`,`peer`), ".
" UNIQUE KEY pidpeer (`pid`,`gid`,`peer`) ".
") ENGINE=MyISAM DEFAULT CHARSET=latin1");
}
if (! DBTableExists("user_exports")) {
DBQueryFatal("CREATE TABLE `user_exports` ( ".
" `uid` varchar(8) NOT NULL default '', ".
" `uid_idx` mediumint(8) unsigned NOT NULL default '0', ".
" `peer` varchar(64) NOT NULL default '', ".
" `exported` datetime default NULL, ".
" `updated` datetime default NULL, ".