diff options
| author | Lassulus <lassulus@googlemail.com> | 2012-12-10 01:13:19 +0100 | 
|---|---|---|
| committer | Lassulus <lassulus@googlemail.com> | 2012-12-10 01:13:19 +0100 | 
| commit | f64da1f8c0531bb72f1917e29d365fe888e1df31 (patch) | |
| tree | 654e0d95556524c8947ff2b0b766b58435a5e03a | |
| parent | 88b6956f32ed74be82a401a7716398a622a9042f (diff) | |
| parent | 0cb539ed99e1b43f0098ebce82e8b913cc38f256 (diff) | |
Merge branch 'master' of github.com:krebscode/painload
| -rw-r--r-- | punani/db/punani | 2 | ||||
| -rwxr-xr-x | retiolum/bin/create-host-tar | 1 | ||||
| -rw-r--r-- | retiolum/doc/git_checkout_only_hosts | 11 | ||||
| -rw-r--r-- | retiolum/hosts/minikrebs | 2 | ||||
| -rw-r--r-- | retiolum/scripts/github_listener/INSTALL | 13 | ||||
| -rw-r--r-- | retiolum/scripts/github_listener/README | 4 | ||||
| -rw-r--r-- | retiolum/scripts/github_listener/github_listener.conf | 5 | ||||
| -rwxr-xr-x | retiolum/scripts/github_listener/handle_request | 16 | ||||
| -rwxr-xr-x | retiolum/scripts/github_listener/listen | 4 | 
9 files changed, 53 insertions, 5 deletions
diff --git a/punani/db/punani b/punani/db/punani index ad477dab..e5d1f383 100644 --- a/punani/db/punani +++ b/punani/db/punani @@ -43,7 +43,7 @@    },    "tinc" : {      "apt-get" : "tinc", -    "yaourt" : "tinc" +    "pacman" : "tinc"    },    "python-notify" : {      "pacman" : "python-notify", diff --git a/retiolum/bin/create-host-tar b/retiolum/bin/create-host-tar index 305f174c..9def7cec 100755 --- a/retiolum/bin/create-host-tar +++ b/retiolum/bin/create-host-tar @@ -3,6 +3,7 @@ set -xeuf  WEBDIR=${WEBDIR:-/srv/http/pub/retiolum}  HOSTFILE=$WEBDIR/hosts.tar.gz  cd $(dirname $(readlink -f $0)) +git pull origin master || logger "cannot pull painload"  #rm $HOSTFILE  tar czf  $HOSTFILE  -C ../hosts .  chmod a+rx $HOSTFILE diff --git a/retiolum/doc/git_checkout_only_hosts b/retiolum/doc/git_checkout_only_hosts new file mode 100644 index 00000000..2286169d --- /dev/null +++ b/retiolum/doc/git_checkout_only_hosts @@ -0,0 +1,11 @@ +# Reference +http://jasonkarns.com/blog/subdirectory-checkouts-with-git-sparse-checkout/ + +# Code + +  git init painload +  cd painload +  git remote add -f origin https://github.com/krebscode/painload.git +  git config core.sparsecheckout true +  echo retiolum/hosts/ >> .git/info/sparse-checkout +  git pull origin master diff --git a/retiolum/hosts/minikrebs b/retiolum/hosts/minikrebs index ad7278e2..b0d60558 100644 --- a/retiolum/hosts/minikrebs +++ b/retiolum/hosts/minikrebs @@ -1,5 +1,5 @@  Subnet = 10.243.1.1/32 -Subnet = 42:0:0:0:0:0:1:1/128 +#Subnet = 42:0:0:0:0:0:1:1/128  -----BEGIN RSA PUBLIC KEY-----  MIIBCgKCAQEA0fu8F+XJ6hHsIj8QtdSZIhE+Ae2sEIY4dHcnHbCOeHJlOQQDJrme  frmG65BX4BMcClUyhvvMwlZIerFwsJoEwa39lB3/Y58OwSS9cNCZTShQPbyVy5wo diff --git a/retiolum/scripts/github_listener/INSTALL b/retiolum/scripts/github_listener/INSTALL new file mode 100644 index 00000000..20c0845c --- /dev/null +++ b/retiolum/scripts/github_listener/INSTALL @@ -0,0 +1,13 @@ +# HowTo +   +  useradd -r tinc +  mkdir -p /opt/ +  git init github_listener +  git remote add -f origin https://github.com/krebscode/painload.git +  git config core.sparsecheckout true +  echo retiolum/hosts/ >> .git/info/sparse-checkout +  git pull origin master +  ln -s $static_painload/retiolum/{scripts,bin} retiolum/ +  cp scripts/github_listener/github_listener.conf /etc/supervisor/conf.d/ +  cd .. +  chown tinc:tinc -R github_listener diff --git a/retiolum/scripts/github_listener/README b/retiolum/scripts/github_listener/README index ad43031c..57c30896 100644 --- a/retiolum/scripts/github_listener/README +++ b/retiolum/scripts/github_listener/README @@ -16,3 +16,7 @@ with a "logger" command to signalise successful tarball generation.  github_listener.conf  ===================  the supervisor config file + +References +========== +also see //retiolum/doc/git_checkout_only_hosts diff --git a/retiolum/scripts/github_listener/github_listener.conf b/retiolum/scripts/github_listener/github_listener.conf index d1f2dae4..88c8ea60 100644 --- a/retiolum/scripts/github_listener/github_listener.conf +++ b/retiolum/scripts/github_listener/github_listener.conf @@ -1,3 +1,4 @@  [program:github_listener] -command=/krebs/retiolum/scripts/github_listener/listen 5432 -user=nobody +command=/opt/github_listener/retiolum/scripts/github_listener/listen 5432 +user=tinc +environment=HOSTFOLDER='/opt/github_listener/retiolum/hosts',WEBDIR='/srv/http/pub/retiolum/' diff --git a/retiolum/scripts/github_listener/handle_request b/retiolum/scripts/github_listener/handle_request new file mode 100755 index 00000000..2df05ae0 --- /dev/null +++ b/retiolum/scripts/github_listener/handle_request @@ -0,0 +1,16 @@ +#!/bin/sh +# Possible Shell Vars +#   WEBDIR  +#   HOSTFOLDER +set -euf +HOSTFOLDER=${HOSTFOLDER:-../../hosts} +cd $(dirname $(readlink -f $0)) +cd "$HOSTFOLDER" +git pull origin master  >&2 +cd - >&2 + +echo "sorry for keeping you waiting, please be patient" +../../bin/create-supernode-tar +echo "almost done..." +../../bin/create-host-tar +echo "Thank you for your patience!" diff --git a/retiolum/scripts/github_listener/listen b/retiolum/scripts/github_listener/listen index c701d14b..30f0c4b5 100755 --- a/retiolum/scripts/github_listener/listen +++ b/retiolum/scripts/github_listener/listen @@ -1,6 +1,8 @@  #!/bin/sh  PORT=${1:-5432}  # eloop pattern +cd $(dirname $(readlink -f $0))  while sleep 1; do -  nc -l -p $PORT -e /krebs/retiolum/bin/create-host-tar && logger "successfully built retiolum hosts tarball" +  nc -lvv -p $PORT -e ./handle_request && logger "successfully built retiolum hosts tarball" +  done   | 
