From 32956e259177ab39ac632ae6ece325ee134633bf Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sat, 8 Jul 2017 20:52:18 +0000 Subject: [PATCH] Removed/changed secrets, no more secrets in git --- chumby-photo.cgi | 23 ----- dirlist | 13 --- g.cgi.go | 35 +++++--- geneweb.c | 9 -- images/haderp.svg | 208 +++++++++++++++++++++++++++++++++++++++++++ images/images.mk | 1 - images/mqdefault.jpg | Bin 0 -> 8494 bytes install | 4 +- misc/misc.mk | 5 -- mp.cgi.go | 87 ------------------ papers/papers.mk | 1 - portal.cgi | 114 ------------------------ portal.png | Bin 929 -> 0 bytes slack.cgi.c | 99 -------------------- src/src.mk | 17 ---- toys/toys.mk | 4 - trigger.cgi.go | 18 ++-- 17 files changed, 242 insertions(+), 396 deletions(-) delete mode 100755 chumby-photo.cgi delete mode 100755 dirlist delete mode 100644 geneweb.c create mode 100644 images/haderp.svg delete mode 100644 images/images.mk create mode 100644 images/mqdefault.jpg delete mode 100644 misc/misc.mk delete mode 100644 mp.cgi.go delete mode 100644 papers/papers.mk delete mode 100755 portal.cgi delete mode 100644 portal.png delete mode 100644 slack.cgi.c delete mode 100644 src/src.mk delete mode 100644 toys/toys.mk diff --git a/chumby-photo.cgi b/chumby-photo.cgi deleted file mode 100755 index fe16dda..0000000 --- a/chumby-photo.cgi +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/sh - -cd /home/neale/lib/images/chumby - -echo Content-type: image/jpeg -echo - -fn=$(ls *.jpg | shuf | head -n1) - -# Guess at scale based on file size -s=$(du "$fn" | cut -d' ' -f1) -if [ $s -lt 100 ]; then - scale=1/1 -elif [ $s -lt 1000 ]; then - scale=1/2 -elif [ $s -lt 10000 ]; then - scale=1/4 -else - scale=1/8 -fi - -djpeg -scale $scale "$fn" | pnmscale -xysize 320 240 | cjpeg - diff --git a/dirlist b/dirlist deleted file mode 100755 index 4b0163a..0000000 --- a/dirlist +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/sh - -cat $1; shift - -echo '
' -for i in "$@"; do - size=$(du --si $i | cut -f1) - desc=$(sed -n '1,3 s/.*\(Description: \|Title: \|-- \)//p' $i) - fn=$(basename $i) - echo "
$fn ($size)
" - echo "
$desc
" -done -echo '
' diff --git a/g.cgi.go b/g.cgi.go index ee1f027..e35b835 100644 --- a/g.cgi.go +++ b/g.cgi.go @@ -1,6 +1,7 @@ package main import ( + "bufio" "crypto/md5" "fmt" "log" @@ -9,12 +10,9 @@ import ( "strings" ) -const GitProjectRoot = "/home/neale/projects" - // printf "USER:PASS" | base64 | while read a; do printf "%s" "$a" | md5sum; done -var allowed = []string{ - "2c64993e88c06e297d4f01cf3b5aebdf", // neale -} +const AuthFilename = "/home/neale/.config/g.cgi/authorization" +const GitProjectRoot = "/home/neale/projects" func execv(name string, arg ...string) { c := exec.Command(name, arg...) @@ -32,6 +30,7 @@ func Authenticated() bool { return false } + // Build up a string to match parts := strings.Split(auth, " ") switch { case len(parts) != 2: @@ -43,13 +42,24 @@ func Authenticated() bool { hash := md5.Sum([]byte(parts[1])) hashhex := fmt.Sprintf("%x", hash) - for _, a := range allowed { - if a == hashhex { + authfile, err := os.Open(AuthFilename) + if err != nil { + log.Fatal(err) + } + defer authfile.Close() + + scanner := bufio.NewScanner(authfile) + for scanner.Scan() { + line := scanner.Text() + if line == "" || strings.HasPrefix(line, "#") { + continue; + } + if line == hashhex { os.Setenv("AUTH_TYPE", parts[0]) os.Setenv("REMOTE_USER", "XXX-neale") return true - } - } + } + } return false } @@ -79,12 +89,11 @@ func main() { //log.SetOutput(os.Stdout) //log.SetPrefix("Status: 500 CGI Go Boom\nContent-type: text/plain\n\nERROR: ") - os.Setenv("GIT_PROJECT_ROOT", GitProjectRoot) - uri := os.Getenv("REQUEST_URI") switch { - case strings.HasSuffix(uri, "git-receive-pack"): + case strings.HasSuffix(uri, "git-upload-pack") || strings.HasSuffix(uri, "git-receive-pack"): if Authenticated() { + os.Setenv("GIT_PROJECT_ROOT", GitProjectRoot) execv("git", "http-backend") } else { fmt.Println("Status: 401 Not Authorized") @@ -93,8 +102,6 @@ func main() { fmt.Println() fmt.Println("Nope", os.Getenv("HTTP_AUTHORIZATION")) } - case strings.HasSuffix(uri, "git-upload-pack"): - execv("git", "http-backend") default: notice() } diff --git a/geneweb.c b/geneweb.c deleted file mode 100644 index 8f4c9bf..0000000 --- a/geneweb.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -int -main(int argc, char *argv[]) -{ - chdir("/home/neale/lib/geneweb"); - execl("/usr/bin/gwd", "gwd", "-cgi", NULL); - return 0; -} \ No newline at end of file diff --git a/images/haderp.svg b/images/haderp.svg new file mode 100644 index 0000000..15808d7 --- /dev/null +++ b/images/haderp.svg @@ -0,0 +1,208 @@ + + + +Hadoop logoimage/svg+xmlHadoop logo \ No newline at end of file diff --git a/images/images.mk b/images/images.mk deleted file mode 100644 index 1bad756..0000000 --- a/images/images.mk +++ /dev/null @@ -1 +0,0 @@ -COPY += $(wildcard images/*.png images/*.gif images/*.jpg) diff --git a/images/mqdefault.jpg b/images/mqdefault.jpg new file mode 100644 index 0000000000000000000000000000000000000000..72177e3149edd5071766b5c69e666292f5b621ac GIT binary patch literal 8494 zcmeHsc|4Tu-}W^I6JjF!Hf2i`*|M9F>=hEqT2V+y$XLgceHl`e%1|VUNrbG~mCBYS zWgScQ83tp_@=kT%&wc-%`+45qyZrP1@m`>;srUU@#Lin1zLznXx;Z z@g892X5l%gq|dtF>Jmi4k5@S=BY%(NiSlN?vwe6emCHAy+1U971cij9We&+6mQz(b zuCAe}WpL8a$k@cx%=(;-t=;(x_O5PMuDW}8Uh@wKycL8D4vD!P8yBCDm~(f>!x{)5+b&LUOLbt zNC(z3jKAj7fm|gzFd-4Cr@cP0TeSZ4*WSjqT~+u-2Yh$toE@jDJ6q1ow`QKr;NvgQ zZM~2#aR)jOKsy)gOC8v;>n$NTv~n+PSJ|DlPnONFA74G-Xl5~f7MM&Lsw5>&hQ6y) z^E!Ft2LHJclobM|{Oea%vrXF;vo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Of!aZ?@)u4Oj>YGF6gZ3?K72iFjrXUSmSO0ClMEf`OGSva zUqX&aWi|_cIKk$BMFC*kC=9I}H|ak=s>!RYA@^<@!l>c`@7NCPvR3T-HosF|5pu89 zb@Nk*Z^9AmrWn`az^R7gb~m3%K7!WxJBvQso`SR)T}_=CaPML$#jIDEofI~U^=)iG z-)4ihbGiB0@m1{vM|Zhkm&@A1K-X)0n1Hir)j+*vx|e{`VW^)(SZD6BF{Gf-TGGs> z;_ai)%zW!5%N#xZ(=y&490{-HLg@?_+i?=?PqR^!W|o8th90`{7>m_Gm2Ck^U1(Y; zaS0)=j$0#{77|!W(FrLk*OX3_KW&b7JKO2w_x;h9nAbv0>z*%4-Jtha5Xm>+g*4n@ zioJGe=1sZmCrM%uf=RLQ7#kyWd;c-k{L7eQ7Zc_Qu_VP5Ei48fC**A%S#jQQ=D;bE z9)tx|R)h5z#Rrx*+DTLet+6LP7Z3#{6$a)nsK2ydI#u~Nq1p3*E&KsrL=wPA^4suM z6p?9w4&a60Ed|Lf10IS1p7PSZdf)b3)) zI((>s>yPOJ#BvmgqA0Ey(;{srwy8}mXp##VO$ADu);3VFKxi!A6a!V$CX5VnKuyds zz`&u8-5VB^r_(J3_j-d^iE z9;ui3q#jNapfOk=D9j-IS*zA3#rs<+ zovvXu9U;9CKV}y}H4YRp{Df&fD*Iy^(qwxl*29Aiu&9abPE;YWcFOB)CIy~iw6ZaI z`O~CfnGCnAkf69DrKJPXu4%S_JNDWeM)jZrR*dq&iKWtf@p;fI1FCgL#arY>I0B-_ z4>HO#9gryFuJx2X@68N`i zAa7HwlR$ryiS+*M$zbV!b7AoB NE)@Rrdl>!e{{T`3czyr? literal 0 HcmV?d00001 diff --git a/install b/install index 7eabaa9..8a41dd5 100755 --- a/install +++ b/install @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh DESTDIR=${1:-/home/neale/public_html} GOPATH=$HOME/go export GOPATH @@ -74,7 +74,7 @@ git ls-files | while read fn; do */install) install $fn ;; - trigger.cgi.go) + trigger.cgi.go|g.cgi.go) gc $fn setuid $fn ;; diff --git a/misc/misc.mk b/misc/misc.mk deleted file mode 100644 index c7b08d9..0000000 --- a/misc/misc.mk +++ /dev/null @@ -1,5 +0,0 @@ -COPY += $(wildcard misc/*.png) -COPY += $(wildcard misc/*.jpg) -COPY += misc/chupas.svg -COPY += misc/cherry-bombs.svg - diff --git a/mp.cgi.go b/mp.cgi.go deleted file mode 100644 index 6a34f4d..0000000 --- a/mp.cgi.go +++ /dev/null @@ -1,87 +0,0 @@ -package main - -import ( - "net" - "fmt" - "time" - "sync" -) - -// Internal port: 19132 -var hosts = []HostEntry{ - {"h.woozle.org:26548", "Ginnie"}, - {"h.dirtbags.net:29837", "Neale"}, -} - -const MAGIC = "\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78" - -func isAlive(host string) bool { - conn, err := net.Dial("udp", host) - if err != nil { - return false - } - - conn.SetReadDeadline(time.Now().Add(5 * time.Second)) - - pkt := "\x01" + "\x00\x00\x00\x00MERF" + MAGIC - conn.Write([]byte(pkt)) - - resp := make([]byte, 40) - rlen, err := conn.Read(resp) - if (err != nil) || (rlen == 0) { - return false - } - - return true -} - -var wg sync.WaitGroup - -func waitClose(c chan<- string) { - wg.Wait() - close(c) -} - -type HostEntry struct { - host string - owner string -} - -func ping(results chan<- string, e HostEntry) { - defer wg.Done() - if isAlive(e.host) { - results <- e.owner - } -} - -func main() { - results := make(chan string, 5) - - for _, host := range hosts { - wg.Add(1) - go ping(results, host) - } - go waitClose(results) - - fmt.Println("Content-type: text/html") - fmt.Println("") - fmt.Println("") - fmt.Println("") - fmt.Println("") - fmt.Println("") - fmt.Println("") - fmt.Println("Minecraft PE ping") - fmt.Println("") - fmt.Println("

Who is playing Minecraft PE?

") - fmt.Println("
    ") - count := 0 - for msg := range results { - fmt.Printf("
  • %s
  • \n", msg) - count += 1 - } - fmt.Println("
") - if count == 0 { - fmt.Println("

Sorry, looks like nobody's playing right now.

") - } - fmt.Println("") -} diff --git a/papers/papers.mk b/papers/papers.mk deleted file mode 100644 index e892a7c..0000000 --- a/papers/papers.mk +++ /dev/null @@ -1 +0,0 @@ -COPY += $(wildcard papers/clovis-*.png) diff --git a/portal.cgi b/portal.cgi deleted file mode 100755 index c58ceaf..0000000 --- a/portal.cgi +++ /dev/null @@ -1,114 +0,0 @@ -#! /bin/sh - -case "$HTTP_USER_AGENT" in - *MIDP*) - TINY=1 - NOCAL=1 - ;; - *Mobile*) - NOCAL=1 - ;; -esac - -weather () { - curl -s 'http://rss.wunderground.com/auto/rss_full/NM/Los_Alamos.xml?units=metric' | \ - awk -F ' [-:] ' ' -(/Current Conditions/) { - print "

" $2 "

"; -} - -(c == 2) { - print "

" $0 "

"; - exit; -} - -(/CDATA/) { - c++; -}' - -} - -section () { - echo "

$1

" - echo "
    " - [ "$TINY" ] && pfx="http://news.google.com/gwt/x?u=" - curl -s "$3" | \ - awk -F '>' -v RS='<' -v m=${4:-5} -v pfx="$pfx" ' -(/^item[> ]/) { - a++; -} - -(/^title/) { - title=$2; -} - -(a && a" title ""; -}' - - echo "
" -} - -cat < - - - Houyhnhnm - - - - - -EOF - -if ! [ "$NOCAL" ]; then - printf '\n' \ - 'https://www.google.com/calendar/embed?title=Calendar&showTitle=0&showDate=0&showPrint=0&showTz=0&mode=AGENDA&height=350&wkst=1&bgcolor=%23FFFFFF&src=2cdrf19kah6jkonhom8evck38c%40group.calendar.google.com&color=%23333333&src=s531giqfiotabht4qrn59tjf9g%40group.calendar.google.com&color=%231B887A&src=dartcatcher%40gmail.com&color=%23125A12&src=laderbydames%40gmail.com&color=%2323164E&src=uulosalamos.org_gu7e0s8dsh1tn8iktt468tk95k%40group.calendar.google.com&color=%232F6309&src=en.usa%23holiday%40group.v.calendar.google.com&color=%238D6F47&ctz=America%2FDenver' -fi - -if [ "$TINY" ]; then - echo '
' - echo '
' -fi - -weather - -section LA \ - 'http://ladailypost.com/' \ - 'http://www.ladailypost.com/rss.xml' -section "Ars Technica" \ - 'http://m.arstechnica.com/' \ - 'http://feeds.arstechnica.com/arstechnica/index?format=xml' -section NPR \ - 'http://thin.npr.org/t.php?tid=1001' \ - 'http://www.npr.org/rss/rss.php?id=1001' -section CSM \ - 'http://www.csmonitor.com/textedition' \ - 'http://rss.csmonitor.com/feeds/csm' -section AJE \ - 'http://m.aljazeera.net' \ - 'http://www.aljazeera.com/Services/Rss/?PostingId=2007731105943979989' -cat < - -EOF diff --git a/portal.png b/portal.png deleted file mode 100644 index 2efd7a68dfee0dde20776c80cec5efee3c6e27b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 929 zcmV;S177@zP)~IfkWEdfL}j_ zflJXH#o%xEcQSmuIEUfK(~}o~1_dbRF+2o`0|XEl-RNVGzuC|5{{7j?|NsBq{C}c> z0Zb!fm>5V6NG(VYNH0JDv4Ds_e;GDN*p~_AT@vg{uX#~uxA5M$`Bxc7|*vc#PdokE>I3B0($ft!=v3x7#=?T$#7n+gyDsN zDcAss52qOnZ}l+9OS3b`xyCRsFmf^6UDL<#`RV-xfB<6o^M@fpSVx`VWOpuuvYQjb z<0s!3Zn@55;09_`X7~j0C7(LOExFkYOuLg9xGwEvxVvi~gSxK=!~2K#6958;<@X;3 z2LU;82J`HAhI0$oGW>OKWl-k(#DER_b;x6Qw6hwl76d?g0Rjl*0$?C~0}Fh8_l3d! zSPqyi%kzcdnEw`r-ita66RzmM#g@LyhpPwa1qdLJ3xGy{ftkp_@as32-Dr50;ng>G zh6(4?K{9Z$-xm?;nYlO_00IbNz@M*R0TwQH2Hh|F7%sEhG9>LVg*yB<+zb61e=tk| zs)4Eh{O&sgKmaiTopIpBt)~np7aU?xGL~RSc~b_|^9w5m$$`{>)PnSY^a2C`K>)u0 z164Bs0QdCyP&!s401guc00r*k04U+E0OSE80P6u80092}04w*z0D0_Q06rt*04FvQ z030n80MEVU0QB(tfC31Vlo?m1F`PHB6Vz8TgOMZlkdMXtgP9>und$rK|&w{00ImE6D3y814grW00000NkvXXu0mjf DWUHKz diff --git a/slack.cgi.c b/slack.cgi.c deleted file mode 100644 index e85aab6..0000000 --- a/slack.cgi.c +++ /dev/null @@ -1,99 +0,0 @@ -#include -#include -#include -#include // only for chdir -#include - -#include "cgi.h" - -char const *botdir = "/home/neale/bot"; - -void -jputchar(unsigned char c) -{ - if (c == '\n') { - printf("\\n"); - } else if (c < 0x20) { - printf("\\u%04x", c); - } else if ((c == '\\') || (c == '"')) { - putchar('\\'); - putchar(c); - } else { - putchar(c); - } -} - -int -main(int argc, char *argv[]) -{ - char key[80]; - char val[2000]; - - bool its_me = false; - - cgi_init(argv); - - for (;;) { - size_t len; - - len = cgi_item(key, sizeof(key)); - len = cgi_item(val, sizeof(val)); - - if (0 == len) { - break; - } - - if (0 == strcmp(key, "user_id")) { - if (0 == strcmp(val, "USLACKBOT")) { - its_me = true; - } - } else if (0 == strcmp(key, "channel_name")) { - char chan[40]; - - snprintf(chan, sizeof(chan), "#%s", val); - setenv("forum", chan, true); - } else if (0 == strcmp(key, "user_name")) { - setenv("sender", val, true); - } else if (0 == strcmp(key, "text")) { - setenv("text", val, true); - } else if (0 == strcmp(key, "token")) { - setenv("token", val, true); - } - } - - cgi_header("text/json"); - - if (its_me) { - printf("{}"); - return 0; - } - - setenv("command", "PRIVMSG", true); - - chdir(botdir); - { - FILE *p = popen("./handler", "r"); - int newlines = 0; - - printf("{\"text\":\""); - for (;;) { - int c = fgetc(p); - - if (EOF == c) { - break; - } else if ('\n' == c) { - newlines += 1; - } else { - for (; newlines > 0; newlines -= 1) { - jputchar('\n'); - } - jputchar(c); - } - } - printf("\",\"parse\":\"full\"}\n"); - - pclose(p); - } - - return 0; -} diff --git a/src/src.mk b/src/src.mk deleted file mode 100644 index 4b50f7f..0000000 --- a/src/src.mk +++ /dev/null @@ -1,17 +0,0 @@ -HTML += $(patsubst %.mdwn, %.html, $(wildcard src/*.mdwn src/*/*.mdwn)) - -HTML += $(patsubst %/index.head.mdwn, %/index.html, $(wildcard src/*/index.head.mdwn)) - -COPY += $(wildcard src/ipqueue/*.tar.*) src/eguile/eguile.scm - -include src/*/*.mk - -$(DESTDIR)/src/%/index.html: src/%/index.head.mdwn - @mkdir -p $(@D) - cp $(wordlist 2, $(words $^), $^) $(@D) - ./dirlist $+ | $(MDWNTOHTML) > $@ - - -$(DESTDIR)/src/misc/index.html: src/misc/* -$(DESTDIR)/src/postscript/index.html: src/postscript/*.ps -$(DESTDIR)/src/python/index.html: src/python/*.py diff --git a/toys/toys.mk b/toys/toys.mk deleted file mode 100644 index 0faad69..0000000 --- a/toys/toys.mk +++ /dev/null @@ -1,4 +0,0 @@ -PLAIN += toys - -COPY += $(wildcard toys/*.cgi toys/cards/*.png) -COPY += toys/timer.html diff --git a/trigger.cgi.go b/trigger.cgi.go index 5107bdb..cac0b29 100644 --- a/trigger.cgi.go +++ b/trigger.cgi.go @@ -11,7 +11,7 @@ import ( "os" ) -const authtok = "~!Jf5!uYFxhK" +// These are not actually secrets, and get posted around various forums const clientId = "81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384" const clientSec = "c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3" @@ -42,16 +42,18 @@ type Handler struct { cgi.Handler } -func (h Handler) TriggerHvac(w http.ResponseWriter, r *http.Request) { - os.Setenv("HOME", "/home/neale") +func getSecret(host string) netrc.Entry { n, _ := netrc.Parse() - secrets := n["gitosis.com"] // Requiring a password here is such bullshit. + return n[host] +} +func (h Handler) TriggerHvac(w http.ResponseWriter, r *http.Request) { + secret := getSecret("teslamotors.com") auth := tesla.Auth{ ClientID: clientId, ClientSecret: clientSec, - Email: secrets.Login, - Password: secrets.Password, + Email: secret.Login, + Password: secret.Password, } cli, err := tesla.NewClient(&auth) if err != nil { @@ -83,7 +85,8 @@ func (h Handler) TriggerHvac(w http.ResponseWriter, r *http.Request) { } func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - if r.FormValue("auth") != authtok { + secret := getSecret("host:trigger.cgi") + if r.FormValue("auth") != secret.Password { http.Error(w, "Invalid authtok", 401) return } @@ -101,6 +104,7 @@ func main() { log.SetOutput(os.Stdout) log.SetFlags(0) log.SetPrefix("Status: 500 CGI Go Boom\nContent-type: text/plain\n\nERROR: ") + os.Setenv("HOME", "/home/neale") // required by netrc library h := Handler{} if err := cgi.Serve(h); err != nil { log.Fatal(err)