Skip to content

Instantly share code, notes, and snippets.

@chriskuehl
Created August 7, 2014 19:51
Show Gist options
  • Save chriskuehl/d14dfa27906eb9c57d98 to your computer and use it in GitHub Desktop.
Save chriskuehl/d14dfa27906eb9c57d98 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
apt-get update
apt-get -y install sudo apache2 w3c-markup-validator git default-jdk python \
daemontools-run
adduser --system --group --shell /bin/false --disabled-login \
--home /opt/html5-validator validator
# set up html5 validator
sudo -u validator sh -e <<EOF
cd ~
git clone https://github.com/validator/build.git build
export JAVA_HOME=/usr/lib/jvm/default-java
# line duplicated on purpose; first time is expected to fail according to docs
build/build.py checkout dldeps build || true
build/build.py checkout dldeps build
EOF
# start html5 validator automatically
mkdir /etc/service/validator
cat > /etc/service/validator/run <<EOF
#!/bin/sh
cd ~validator
sudo -u validator build/build.py run
EOF
chmod +x /etc/service/validator/run
# enable html5 validator service
sed -i 's/#HTML5 = /HTML5 = /' /etc/w3c/validator.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment