Skip to content

Commit

Permalink
cmd/puppeth: upstream alpine images, disallow anon gists
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe committed Apr 10, 2017
1 parent ed4262f commit cdc35e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 4 additions & 0 deletions cmd/puppeth/faucet/faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ func (f *faucet) apiHandler(conn *websocket.Conn) {
websocket.JSON.Send(conn, map[string]string{"error": err.Error()})
continue
}
if gist.Owner.Login == "" {
websocket.JSON.Send(conn, map[string]string{"error": "Nice try ;)"})
continue
}
// Iterate over all the files and look for Ethereum addresses
var address common.Address
for _, file := range gist.Files {
Expand Down
12 changes: 2 additions & 10 deletions cmd/puppeth/module_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,7 @@ import (

// nodeDockerfile is the Dockerfile required to run an Ethereum node.
var nodeDockerfile = `
FROM alpine:latest
RUN \
apk add --update git go make gcc musl-dev ca-certificates linux-headers && \
git clone --depth=1 https://github.com/ethereum/go-ethereum && \
(cd go-ethereum && make geth) && \
cp go-ethereum/build/bin/geth /geth && \
apk del git go make gcc musl-dev linux-headers && \
rm -rf /go-ethereum && rm -rf /var/cache/apk/*
FROM ethereum/client-go:alpine-develop
ADD genesis.json /genesis.json
{{if .Unlock}}
Expand All @@ -50,7 +42,7 @@ RUN \
echo 'mkdir -p /root/.ethereum/keystore/ && cp /signer.json /root/.ethereum/keystore/' >> geth.sh && \{{end}}
echo $'/geth --networkid {{.NetworkID}} --cache 512 --port {{.Port}} --maxpeers {{.Peers}} {{.LightFlag}} --ethstats \'{{.Ethstats}}\' {{if .Bootnodes}}--bootnodes {{.Bootnodes}}{{end}} {{if .Etherbase}}--etherbase {{.Etherbase}} --mine{{end}}{{if .Unlock}}--unlock 0 --password /signer.pass --mine{{end}}' >> geth.sh
CMD ["/bin/sh", "geth.sh"]
ENTRYPOINT ["/bin/sh", "geth.sh"]
`

// nodeComposefile is the docker-compose.yml file required to deploy and maintain
Expand Down

0 comments on commit cdc35e1

Please sign in to comment.