Browse Source

mroe crap

Signed-off-by: Erik Hollensbe <github@hollensbe.org>
master
Erik Hollensbe 7 months ago
parent
commit
e111a402e4
3 changed files with 20 additions and 6 deletions
  1. +12
    -3
      Makefile
  2. +7
    -0
      do_mkcert.sh
  3. +1
    -3
      entrypoint.sh

+ 12
- 3
Makefile View File

@ -70,9 +70,11 @@ bench: generate
lint:
golangci-lint run -v
ci-protobuf:
ci-get-pkgs:
apt-get update -qq && apt-get install unzip curl -y
curl -sSL -o /protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.11.4/protoc-3.11.4-linux-x86_64.zip
ci-protobuf: ci-get-pkgs
unzip /protoc.zip -d /usr
chmod -R 755 /usr/bin/protoc /usr/include/google
@ -81,10 +83,17 @@ ci-generate: ci-protobuf
go get -v github.com/golang/protobuf/protoc-gen-go
go generate -v ./...
ci-test: ci-generate
ci-test: ci-generate mkcert
go test -v -race -count 1 ./...
ci-bench: ci-generate
ci-bench: ci-generate mkcert
go test -v -bench ./... -benchtime 1m
get-mkcert: ci-get-pkgs
curl -sSL -o /usr/local/bin/mkcert https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-linux-amd64
chmod 755 /usr/local/bin/mkcert
mkcert: get-mkcert
bash do_mkcert.sh
.PHONY: test

+ 7
- 0
do_mkcert.sh View File

@ -0,0 +1,7 @@
#!/bin/sh
set -e
mkcert -install && \
mkcert -ecdsa -cert-file /etc/ldnsd/server.pem -key-file /etc/ldnsd/server.key localhost 127.0.0.1 && \
mkcert -ecdsa -client -cert-file /etc/ldnsd/client.pem -key-file /etc/ldnsd/client.key localhost 127.0.0.1

+ 1
- 3
entrypoint.sh View File

@ -1,7 +1,5 @@
groupadd -g "$SETGID" groupname
useradd -d "$PWD" -u "$SETUID" -g "$SETGID" -G sudo username
echo '===> Installing cert store *inside the container*'
sudo -EH -u username mkcert -install && \
sudo -EH -u username mkcert -ecdsa -cert-file /etc/ldnsd/server.pem -key-file /etc/ldnsd/server.key localhost 127.0.0.1 && \
sudo -EH -u username mkcert -ecdsa -client -cert-file /etc/ldnsd/client.pem -key-file /etc/ldnsd/client.key localhost 127.0.0.1
sudo -EH -u username bash do_mkcert.sh
exec sudo -EH -u username "$@"

Loading…
Cancel
Save