Crowdsourcing Demo

Here are the instructions for installing the crowdsourcing demo on the urd2.let.rug.nl web server.
If you don't have a web site on urd2, see /net/homepages/README.user.txt on how to create one.

Everywhere you see code like this you need to replace it with your own text.

Installing on urd2

Choose a directory name for your project, and download the software to that directory of your website:

cd /net/homepages/user/www
git clone --depth 1 https://github.com/pebbe/crowdsourcing project

From now on, assume ROOT equals /net/homepages/user/www/project

Go to the db subdirectory, and copy the example questions:

cd ROOT/db
cp questions.csv.example questions.csv

Go to the bin subdirectory:

cd ROOT/bin

Create the file Makefile.cfg with the following content:

GO = /net/aps/urd2/opt/go/bin/go
OPTS = -v
export HOME=/net/homepages/user

Copy the file config.go.example to config.go, open it with a text editor, and change the values of the four constants below. Change the values to match the bold value as shown, but replace the dark part with your own values.

cBaseUrl = "https://urd2.let.rug.nl/~user/project/"
cMailName = "My Crowdsourcing"
cMailFrom = "me@my.domain"
cSmtpServ = "smtp.rug.nl:25"

Now, to finish, run this command:

curl -s https://urd2.let.rug.nl/~user/project/bin/make.sh

If everything goes well, you will see something like this:

/net/aps/urd2/opt/go/bin/go build -o index -v .
go: downloading github.com/mattn/go-sqlite3 v1.14.6
go: downloading github.com/dchest/authcookie v0.0.0-20190824115100-f900d2294c8e
github.com/dchest/authcookie
github.com/mattn/go-sqlite3
github.com/pebbe/crowdsourcing/bin
make: Entering directory '/net/homepages/user/www/project/db'
/net/aps/urd2/opt/go/bin/go build -v makedb.go
command-line-arguments
rm -f data.sqlite
./makedb
make: Leaving directory '/net/homepages/user/www/project/db'

You can now test your installation by visiting https://urd2.let.rug.nl/~user/project/

Set up your own survey

The next step is to change the demo survey into your own survey. To do this, read the instructions at https://github.com/pebbe/crowdsourcing/blob/master/CONFIG.md.

Whenever the above documentation instructs you to run make, you can replace it with this command:

curl -s https://urd2.let.rug.nl/~user/project/bin/make.sh

Trouble shooting

The last step of the installation could show something like this:

/net/aps/urd2/opt/go/bin/go build -o index -v .
failed to initialize build cache at /net/homepages/user/.cache/go-build: mkdir /net/homepages/user/.cache: permission denied
Makefile:5: recipe for target 'index' failed
make: *** [index] Error 1
make: Entering directory '/net/homepages/user/www/project/db'
/net/aps/urd2/opt/go/bin/go build -v makedb.go
failed to initialize build cache at /net/homepages/user/.cache/go-build: mkdir /net/homepages/user/.cache: permission denied
Makefile:5: recipe for target 'makedb' failed
make: *** [makedb] Error 1
make: Leaving directory '/net/homepages/user/www/project/db'

This is because the web server is running your programs not as you, but as user www-data . To fix this, you have two options:

Other problems may occur if you forget to change texts like user.