OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # Script to setup a GCE instance to run the webtry server. | 3 # Script to setup a GCE instance to run the webtry server. |
4 # For full instructions see the README file. | 4 # For full instructions see the README file. |
5 | 5 |
6 function banner { | 6 function banner { |
7 echo "" | 7 echo "" |
8 echo "******************************************" | 8 echo "******************************************" |
9 echo "*" | 9 echo "*" |
10 echo "* $1" | 10 echo "* $1" |
(...skipping 13 matching lines...) Expand all Loading... |
24 banner "Setting up the webtry user account" | 24 banner "Setting up the webtry user account" |
25 sudo adduser webtry | 25 sudo adduser webtry |
26 | 26 |
27 sudo mkdir /home/webtry/cache | 27 sudo mkdir /home/webtry/cache |
28 sudo mkdir /home/webtry/cache/src | 28 sudo mkdir /home/webtry/cache/src |
29 sudo mkdir /home/webtry/inout | 29 sudo mkdir /home/webtry/inout |
30 sudo chmod 777 /home/webtry/inout | 30 sudo chmod 777 /home/webtry/inout |
31 sudo chmod 777 /home/webtry/cache | 31 sudo chmod 777 /home/webtry/cache |
32 sudo chmod 777 /home/webtry/cache/src | 32 sudo chmod 777 /home/webtry/cache/src |
33 | 33 |
34 sudo cp ../sys/webtry_schroot /etc/schroot/chroot.d/webtry | 34 sudo cp sys/webtry_schroot /etc/schroot/chroot.d/webtry |
35 | 35 |
36 CHROOT_JAIL=/srv/chroot/webtry_gyp | 36 CHROOT_JAIL=/srv/chroot/webtry_gyp |
37 # Build the chroot environment. | 37 # Build the chroot environment. |
38 if [ ! -d ${CHROOT_JAIL} ]; then | 38 if [ ! -d ${CHROOT_JAIL} ]; then |
39 banner "Building the chroot jail" | 39 banner "Building the chroot jail" |
40 sudo mkdir -p ${CHROOT_JAIL} | 40 sudo mkdir -p ${CHROOT_JAIL} |
41 | 41 |
42 sudo debootstrap --variant=minbase wheezy ${CHROOT_JAIL} | 42 sudo debootstrap --variant=minbase wheezy ${CHROOT_JAIL} |
43 sudo cp setup_jail.sh ${CHROOT_JAIL}/bin | 43 sudo cp setup_jail.sh ${CHROOT_JAIL}/bin |
44 sudo chmod 755 ${CHROOT_JAIL}/bin/setup_jail.sh | 44 sudo chmod 755 ${CHROOT_JAIL}/bin/setup_jail.sh |
(...skipping 16 matching lines...) Expand all Loading... |
61 # be run independently of this one to fetch and build the latest skia. | 61 # be run independently of this one to fetch and build the latest skia. |
62 | 62 |
63 banner "Building the webtry server outside the jail" | 63 banner "Building the webtry server outside the jail" |
64 | 64 |
65 sudo cp continue_install.sh /home/webtry | 65 sudo cp continue_install.sh /home/webtry |
66 sudo chown webtry:webtry /home/webtry/continue_install.sh | 66 sudo chown webtry:webtry /home/webtry/continue_install.sh |
67 sudo su - webtry -c /home/webtry/continue_install.sh | 67 sudo su - webtry -c /home/webtry/continue_install.sh |
68 | 68 |
69 banner "Setting up system initialization scripts" | 69 banner "Setting up system initialization scripts" |
70 | 70 |
71 sudo cp ../sys/webtry_init /etc/init.d/webtry | 71 sudo cp sys/webtry_init /etc/init.d/webtry |
72 sudo cp ../sys/webtry_monit /etc/monit/conf.d/webtry | 72 sudo cp sys/webtry_monit /etc/monit/conf.d/webtry |
73 sudo cp ../sys/webtry_squid /etc/squid3/squid.conf | 73 sudo cp sys/webtry_squid /etc/squid3/squid.conf |
74 sudo chmod 744 /etc/init.d/webtry | 74 sudo chmod 744 /etc/init.d/webtry |
75 | 75 |
76 # Confirm that monit is happy. | 76 # Confirm that monit is happy. |
77 sudo monit -t | 77 sudo monit -t |
78 sudo monit reload | 78 sudo monit reload |
79 | 79 |
80 banner "Restarting webtry server" | 80 banner "Restarting webtry server" |
81 | 81 |
82 sudo /etc/init.d/webtry restart | 82 sudo /etc/init.d/webtry restart |
83 | 83 |
84 banner "All done!" | 84 banner "All done!" |
OLD | NEW |