~~~~~~~~~~~
fpc: add switch -gl (runtime errors write line#)
+Installer:
+- mo-install: reduce what gets copied to mo-eval home
+- update group permissions
+
New submitter:
- Checking of contest time (and per-contestant exceptions)
- Keeping history and pruning status files
chown root.$a $a
chmod 750 $a
cp -a `find $H/template -type f -name ".*"` $a/$a/
+
+ if [ -n "$REMOTE_SUBMIT" ] ; then
+ M=$a/$a/.mo
+ mkdir $M
+ cp $H/certs/$a-cert.pem $M/cert.pem
+ cp $H/certs/$a-key.pem $M/key.pem
+ chmod 600 $M/key.pem
+ cp $H/certs/ca-cert.pem $M/
+ fi
+
chown $a.$a $a/$a -R
chmod 700 $a/$a
done
esac
>>etcshadow >>etcpasswd >>etcgroup
+expire=$((`date +%s` / 86400 - 1))
case $mode in
eval)
- echo -n Enter password for mo-eval:
+ echo -n Enter password for evaluation users:
read passwd
passwd=`echo $passwd | bin/md5crypt`
- echo $EVAL_USER:x:$uid:$uid:MO Evaluator:$MO_ROOT/eval/$EVAL_USER:/bin/bash >> etcpasswd
- echo $EVAL_GROUP:x:$uid: >> etcgroup
- echo $EVAL_USER:$passwd:$((`date +%s` / 86400 - 1)):0:99999:7::: >> etcshadow
- tuid=$(($uid + 1))
+ gid=$uid
+ tgid=$(($gid+1))
+ rgid=$(($gid+2))
+ echo $EVAL_USER:x:$uid:$gid:MO Evaluator:$MO_ROOT/eval/eval:/bin/bash >> etcpasswd
+ echo $EVAL_USER:$passwd:$expire:0:99999:7::: >> etcshadow
+ echo $EVAL_GROUP:x:$gid: >> etcgroup
+ echo $TEST_GROUP:x:$tgid:$EVAL_USER >> etcgroup
+
+ if [ -n "$REMOTE_SUBMIT" ] ; then
+ uid=$(($uid + 1))
+ echo $REMOTE_SUBMIT_USER:x:$uid:$rgid:MO Submitter:$MO_ROOT/eval/submit:/bin/bash >> etcpasswd
+ echo $REMOTE_SUBMIT_USER:$passwd:$expire:0:99999:7::: >> etcshadow
+ echo $REMOTE_SUBMIT_GROUP:x:$rgid: >> etcgroup
+ fi
+ tuid=$(($uid + 1))
for tester in $TEST_USERS; do
- echo $tester:x:$tuid:$uid:MO Tester `expr $tuid - $uid`:$MO_ROOT/eval/$tester:/bin/bash >> etcpasswd
- echo $tester:$passwd:$((`date +%s` / 86400 - 1)):0:99999:7::: >> etcshadow
+ echo $tester:x:$tuid:$tgid:MO Tester `expr $tuid - $uid`:$MO_ROOT/eval/$tester:/bin/bash >> etcpasswd
+ echo $tester:$passwd:$expire:0:99999:7::: >> etcshadow
tuid=$(($tuid + 1))
done
;;
echo "Populating $MO_ROOT/public"
H=`pwd`
cd $MO_ROOT/public
-rm -rf bin
+rm -rf bin submit
sed 's/^TEST_USER=/#TEST_USER=/' <$H/config >config
cp -a $H/$a bin/
done
+if [ -n "$REMOTE_SUBMIT" ] ; then
+ mkdir -p submit
+ cp $H/submit/{contest,remote-submit,remote-status} submit/
+ mkdir -p submit/lib/perl5/{MO,Sherlock}
+ cp $H/submit/MO/*.pm submit/lib/perl5/MO/
+ cp $H/submit/lib/perl5/Sherlock/Object.pm submit/lib/perl5/Sherlock/
+fi
+
mkdir -p problems
if [ `id -u` == 0 ] ; then
--- /dev/null
+#!/bin/bash
+
+[ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
+set -e
+. config
+[ -n "$REMOTE_SUBMIT" ] || { echo "Remote submit not enabled." ; exit 1 ; }
+make
+
+echo "Creating submit directory"
+
+H=`pwd`
+cd $MO_ROOT/eval/submit
+mkdir -p certs
+cp $H/certs/server* certs/
+cp $H/certs/ca-cert.pem certs/
+
+rm -rf submit
+mkdir -p submit
+cp $H/submit/submitd submit/
+cp $H/submit/config submit/
+
+mkdir -p solutions
+for a in `cd $H && bin/mo-get-users` ; do
+ mkdir -p solutions/$a
+done
+
+mkdir tmp
+
+chown -R $REMOTE_SUBMIT_USER.$REMOTE_SUBMIT_GROUP $MO_ROOT/eval/submit
echo "Creating $u"
rm -rf ./$u
mkdir $u
- chown $u.$EVAL_GROUP $u
+ chown $u.$TEST_GROUP $u
chmod 770 $u
- cp $EVAL_USER/bin/box $EVAL_USER/bin/box-$u
- chown $u.$EVAL_GROUP $EVAL_USER/bin/box-$u
- chmod 4550 $EVAL_USER/bin/box-$u
- done
+ cp eval/bin/box eval/bin/box-$u
+ chown $u.$EVAL_GROUP eval/bin/box-$u
+ chmod 4550 eval/bin/box-$u
+done
H=`pwd`
-# mo-eval home
+# The eval directory
cd $MO_ROOT
rm -rf eval
mkdir eval
chgrp $EVAL_GROUP eval
-chmod 550 eval
+chmod 755 eval
cd eval
+
+# mo-eval home
echo "Creating $EVAL_USER"
-mkdir $EVAL_USER
-cd $EVAL_USER
+mkdir eval
+cd eval
cp -a $H/* .
chmod +x bin/*
+if [ -d ~/.ssh ] ; then echo "Copying SSH configuration from ~/.ssh" ; cp -a ~/.ssh . ; fi
cd ..
-chown -R $EVAL_USER.$EVAL_GROUP $EVAL_USER
-chmod 700 $EVAL_USER
+chown -R $EVAL_USER.$EVAL_GROUP eval
+chmod 750 eval
+
+# testusers
+( cd eval && bin/mo-create-testusers )
-( cd $EVAL_USER ; bin/mo-create-testusers )
+# mo-submit home
+if [ -n "$REMOTE_SUBMIT" ] ; then
+ mkdir submit
+ if [ -d ~/.ssh ] ; then echo "Copying SSH configuration from ~/.ssh" ; cp -a ~/.ssh submit/ ; fi
+ ( cd $H && bin/mo-create-submit )
+fi
# create public
cd $MO_ROOT
mkdir public
# populate public
-( cd eval/$EVAL_USER ; bin/mo-create-public )
+( cd eval/eval ; bin/mo-create-public )
# The root of the whole directory hierarchy
if [ -z "$MO_ROOT" ] ; then
- MO_ROOT=/aux/mo
+ MO_ROOT=/mo
fi
# User and group used by the evaluator itself
# with EVAL_USER privileges, but beware, this is INSECURE.
#TEST_USER=${TEST_USER:-mo-test1}
TEST_USERS="mo-test1 mo-test2"
+TEST_GROUP=mo-test
-# These values are used when creating logins for eval and contestanst.
+# These values are used when creating logins for eval and contestants
+# (group id's are from the same range)
EVAL_UID_MIN=65000
CT_UID_MIN=65100
CT_UID_MAX=65199
# or (if undefined) scans /etc/passwd for users with UID between CT_UID_MIN and CT_UID_MAX.
CT_USER_LIST=userlist
+# (optional) Use remote submitting
+REMOTE_SUBMIT=1
+REMOTE_SUBMIT_USER=mo-submit
+REMOTE_SUBMIT_GROUP=mo-submit
+
### Per-task configuration variables (default values, override in per-task config)
## Compiler settings:
-export MO_ROOT=/aux/mo/public
+export MO_ROOT=/mo/public
PATH=$PATH:$MO_ROOT/bin