<commit_before>#!/bin/bash
# This script will setup your server from scratch
set -e

# Setup Docker
curl -sL http://get.docker.io/ | bash
docker pull flynn/slugbuilder
docker pull flynn/slugrunner

# Setup gitreceived
curl -sL https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz | tar xzC /usr/local

export PATH=/usr/local/go/bin:$PATH
export GOROOT=/usr/local/go
export GOPATH=/go

apt-get install -yq git
go get -v github.com/flynn/gitreceive-next/gitreceived
go get -v github.com/rochacon/cargo

useradd -G docker -m -s /bin/bash git || true
su -c "mkdir -p /home/git/.ssh && ssh-keygen -t rsa -f /home/git/.ssh/id_rsa -N ''" git
su -c "mkdir -p /home/git/{keys,hosts,repositories}" git

cat >/etc/init/gitreceived.conf <<EOF
start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]

setuid git
setgid docker

respawn

console log
chdir /home/git

exec /go/bin/gitreceived -p 2222 -k /home/git/keys -r /home/git/repositories /home/git/.ssh/id_rsa /go/bin/cargo
EOF

start gitreceived

apt-get install -y nginx
cat >/etc/nginx/nginx.conf <<EOF
daemon on;
error_log error.log;
pid /var/run/nginx/nginx.pid;

events {
    use epoll;
    worker_connections 4096;
}

http {
    include /home/git/hosts/*.conf;
}
EOF
nginx -s reload<commit_msg>bootstrap: Added cargo configs<commit_after>#!/bin/bash
# This script will setup your server from scratch
set -e

# FIXME configure these variables
BASE_DOMAIN="localhost"
BUCKET="my-slug-bucket-container" # XXX right now slugs will be public, remember, pre-alpha software

# Setup Docker
curl -sL http://get.docker.io/ | bash
docker pull flynn/slugbuilder
docker pull flynn/slugrunner

# Setup gitreceived
curl -sL https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz | tar xzC /usr/local

export PATH=/usr/local/go/bin:$PATH
export GOROOT=/usr/local/go
export GOPATH=/go

apt-get install -yq git
go get -v github.com/flynn/gitreceive-next/gitreceived
go get -v github.com/rochacon/cargo

useradd -G docker -m -s /bin/bash git || true
su -c "mkdir -p /home/git/.ssh && ssh-keygen -t rsa -f /home/git/.ssh/id_rsa -N ''" git
su -c "mkdir -p /home/git/{keys,hosts,repositories}" git

cat >/etc/init/gitreceived.conf <<EOF
start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]

setuid git
setgid docker

respawn

console log
chdir /home/git

exec /go/bin/gitreceived -p 2222 -k /home/git/keys -r /home/git/repositories /home/git/.ssh/id_rsa "/go/bin/cargo -bucket $BUCKET -d $BASE_DOMAIN"
EOF

start gitreceived

apt-get install -y nginx
cat >/etc/nginx/nginx.conf <<EOF
daemon on;
error_log error.log;
pid /var/run/nginx/nginx.pid;

events {
    use epoll;
    worker_connections 4096;
}

http {
    include /home/git/hosts/*.conf;
}
EOF
nginx -s reload
{'fraction_non_alphanumeric': 0.13094798967170787, 'fraction_numerical': 0.014016967908520842, 'mean_word_length': 3.4975124378109452, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7605598', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1027, 'n_words': 290}