Skip to content

Commit

Permalink
chore: update ci and dev images to go 1.16 and ubuntu 20.01 (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
derektamsen authored Feb 22, 2021
1 parent e1dcdbe commit faf0efa
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2.1
executors:
golang:
docker:
- image: circleci/golang:1.14-buster
- image: cimg/go:1.16

commands:
setup-image:
Expand Down
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
FROM ubuntu:bionic
FROM ubuntu:focal

# luks2crypt variables
ARG LUKS2CRYPT_VER='7213ec6894a6f368375a290de81c17f56190c20e'

# golang variables
ARG GO111MODULE='on'
ARG GOLANGVER='1.14.1'
ARG GOLANGVER='1.16'
ARG GOLANGSHA="013a489ebb3e24ef3d915abe5b94c3286c070dfe0818d5bca8108f1d6e8440d2"
ARG GOPATH='/go'
ENV PATH=${PATH}:/usr/local/go/bin:/go/bin

# disable apt interactive prompts
ENV DEBIAN_FRONTEND='noninteractive'

# create golang user
RUN adduser --shell /bin/sh --system --group \
--gecos 'golang build user' --disabled-password golang
Expand All @@ -18,6 +22,8 @@ RUN apt-get update && apt-get install -y \
wget \
ca-certificates \
&& wget --no-verbose "https://dl.google.com/go/go${GOLANGVER}.linux-amd64.tar.gz" \
&& echo "${GOLANGSHA} *go${GOLANGVER}.linux-amd64.tar.gz" > go${GOLANGVER}.linux-amd64.tar.gz.shasum \
&& sha256sum -c go${GOLANGVER}.linux-amd64.tar.gz.shasum \
&& tar -C /usr/local -xzf go${GOLANGVER}.linux-amd64.tar.gz \
&& mkdir -p /go \
&& chown -R golang:golang /go \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Luks2Crypt

- https://golang.org/cmd/cgo/

- https://gitlab.com/cryptsetup/cryptsetup/blob/v1_6_6/lib/libcryptsetup.h
- https://gitlab.com/cryptsetup/cryptsetup/-/blob/v2.2.2/lib/libcryptsetup.h

Luks2crypt is used to manage luks client devices and allow escrowing to a
[crypt-server](https://github.com/grahamgilbert/Crypt-Server). Currently, it
Expand Down Expand Up @@ -97,7 +97,7 @@ through cgo to manage the encrypted devices. On debian/ubuntu you can run:
sudo /vagrant/bin/luks2crypt postimaging \
-l ./luks-dev-disk.img \
-p devpassword \
-s ubuntu-bionic:8443
-s ubuntu-focal:8443

You should then see the form post data printed to stdout from
`cryptservermock`.
Expand Down
10 changes: 7 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$golang_install = <<-SCRIPT
set -ux
GOLANGVER=1.14.1
GOLANGVER=1.16
GOLANGTAR=https://dl.google.com/go/go${GOLANGVER}.linux-amd64.tar.gz
pushd /tmp
Expand All @@ -22,7 +22,7 @@ sudo cryptsetup close luks-dev-disk
rm -f luks-dev-disk.img
fallocate -l 1G luks-dev-disk.img
parted luks-dev-disk.img mklabel msdos --script
echo "devpassword" | cryptsetup --batch-mode luksFormat luks-dev-disk.img
echo "devpassword" | sudo cryptsetup --batch-mode luksFormat --type luks2 luks-dev-disk.img
echo "devpassword" | sudo cryptsetup open luks-dev-disk.img luks-dev-disk
sudo mkfs.ext4 /dev/mapper/luks-dev-disk
sudo mount /dev/mapper/luks-dev-disk /mnt
Expand Down Expand Up @@ -56,10 +56,14 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell", privileged: true,
inline: $cryptservermock_install

config.vm.define "bionic", primary: true do |bionic|
config.vm.define "bionic", autostart: false do |bionic|
bionic.vm.box = "ubuntu/bionic64"
end

config.vm.define "focal", primary: true do |focal|
focal.vm.box = "ubuntu/focal64"
end

config.vm.define "xenial", autostart: false do |xenial|
xenial.vm.box = "ubuntu/xenial64"
end
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ require (
github.com/kr/pretty v0.1.0 // indirect
github.com/satori/go.uuid v1.2.0 // indirect
github.com/sethvargo/go-diceware v0.2.0
golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c
golang.org/x/sys v0.0.0-20201204225414-ed752295db88 // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43 // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/urfave/cli.v1 v1.20.0
)
13 changes: 6 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh
github.com/sethvargo/go-diceware v0.2.0 h1:3QzXGqUe0UR9y1XYSz1dxGS+fKtXOxRqqKjy+cG1yTI=
github.com/sethvargo/go-diceware v0.2.0/go.mod h1:II+37A5sTGAtg3zd/JqyVQ8qqAjSm/2r2X6qkVZDjyg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c h1:9HhBz5L/UjnK9XLtiZhYAdue5BVKep3PMmS2LuPDt8k=
golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g=
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201204225414-ed752295db88 h1:KmZPnMocC93w341XZp26yTJg8Za7lhb2KhkYmixoeso=
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43 h1:SgQ6LNaYJU0JIuEHv9+s6EbhSCwYeAf5Yvj6lpYlqAE=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down

0 comments on commit faf0efa

Please sign in to comment.