WEB = web.cgi DATABASE = database.txt USER = collberg CGI = /cs/cgi/people/${USER} SCRIPTS = ${CGI}/public_html DATA = ${CGI}/ GROUP = `groups | gawk '{print $1}'` ######################################################################## # Installing scripts on the CGI server ######################################################################## install: database.txt cp ${WEB} ${SCRIPTS} chmod u=rwx,g=rx,o=rx ${SCRIPTS} chmod u=rwx,g=rx,o=rx ${SCRIPTS}/${WEB} chgrp ${GROUP} ${SCRIPTS}/${WEB} # wmark? cp database.txt ${DATA} chmod a+rwx ${DATA}/${DATABASE} errors: tail /cs/cgi/logs/error_log access: tail /cs/cgi/logs/access_log ######################################################################## # Test scripts ######################################################################## # welcome page test1: database.txt ruby ${WEB} -w action="" # OK login test2: database.txt ruby ${WEB} -w action=login username=nopants password=feathers # wrong user test3: database.txt ruby ${WEB} -w action=login username=scrooge password=feathers # wrong password test4: database.txt ruby ${WEB} -w action=login username=nopants password=sailor # go to create account page test5: database.txt ruby ${WEB} -w action='create\ account' # new user already exists test6: database.txt ruby ${WEB} -w action='save\ account' username=nopants password=blah sex=Male # save new user test7: database.txt ruby ${WEB} -w action='save\ account' \ username=luckyboy \ realname='gladstone\ gander' \ password=clover \ sex=Male # go to edit page test8: database.txt ruby ${WEB} -w action=edit username=bluehat # save edits test9: database.txt ruby ${WEB} -w action='save\ edits' \ username=bluehat \ name='Dewey\ Duck' \ sex=Female \ password=wood \ nopants-isfriend=yes nopants-how=family \ redhat-isfriend=yes redhat-how=family \ greenhat-isfriend=yes greenhat-how=family \ cheeseboy-isfriend=no cheeseboy-how=nohow \ lonelygirl13-isfriend=no lonelygirl13-how=nohow # view friend testA: database.txt ruby ${WEB} -w action='view\ bluehat' # new user, illegal username testB: database.txt ruby ${WEB} -w action='save\ account' username=42 password=blah sex=Male # new user, illegal password testC: database.txt ruby ${WEB} -w action='save\ account' username=goofy password=42 sex=Male # new user, illegal sex testD: database.txt ruby ${WEB} -w action='save\ account' username=goofy password=yfoog sex= # reset the database.txt file to database.orig database.txt: .FORCE /bin/cp database.orig database.txt .FORCE: ######################################################################## # Installing scripts on a mac ######################################################################## installmac: macclean database.txt -sudo /bin/rm /home/${USER}/Sites/${DATABASE} cp ${WEB} ${DATABASE} /home/${USER}/Sites chmod a+rx /home/${USER}/Sites/${WEB} macerrors: tail /var/log/httpd/error_log macaccess: tail /var/log/httpd/access_log macclean: -sudo /bin/rm /tmp/372book.* ######################################################################## # Installing calc script on a mac ######################################################################## installcalc: cp calc.cgi /cs/cgi/people/collberg/public_html chmod u=rwx,g=,o= /cs/cgi/people/collberg/public_html/calc.cgi chgrp wmark /cs/cgi/people/collberg/public_html/calc.cgi installcalcmac: cp calc.cgi /home/${USER}/Sites chmod a+rx /home/${USER}/Sites/calc.cgi testcalc1: ruby calc.cgi -w testcalc2: ruby calc.cgi -w left=6 op=mul right=7