From ee4c7e26b53f41a9abc5b1a98a235da789f5495a Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Wed, 2 Dec 2020 19:10:43 +0000 Subject: [PATCH] remove cgo disable pam by default --- Dockerfile | 7 ++----- go.mod | 1 + go.sum | 2 ++ sshpiperd/cmd.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 68eadd2d..b3a3cc74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,14 @@ -FROM golang:1.14-alpine as builder +FROM golang:1.15-alpine as builder RUN apk update \ && apk upgrade \ && apk add --no-cache \ ca-certificates \ && update-ca-certificates 2>/dev/null -RUN apk add google-authenticator git gcc libc-dev linux-pam-dev ADD . /go/src/github.com/tg123/sshpiper/ WORKDIR /go/src/github.com/tg123/sshpiper/sshpiperd -RUN go build -ldflags "$(/go/src/github.com/tg123/sshpiper/sshpiperd/ldflags.sh)" -tags pam -o /go/bin/sshpiperd +RUN CGO_ENABLED=0 go build -ldflags "$(/go/src/github.com/tg123/sshpiper/sshpiperd/ldflags.sh)" -o /go/bin/sshpiperd FROM alpine:latest @@ -21,8 +20,6 @@ RUN apk update \ ca-certificates \ && update-ca-certificates 2>/dev/null -RUN apk add google-authenticator - RUN mkdir /etc/ssh/ ADD entrypoint.sh / diff --git a/go.mod b/go.mod index 894dd176..3c2d3408 100644 --- a/go.mod +++ b/go.mod @@ -27,6 +27,7 @@ require ( github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/msteinert/pam v0.0.0-20190215180659-f29b9f28d6f9 github.com/pkg/errors v0.9.1 // indirect + github.com/tg123/sshkey v0.0.0-20201202190454-3bb356f89f1f golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 golang.org/x/sys v0.0.0-20200513112337-417ce2331b5c // indirect gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 diff --git a/go.sum b/go.sum index 515c66b4..b0ca7c8f 100644 --- a/go.sum +++ b/go.sum @@ -82,6 +82,8 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/tg123/go-flags v1.4.0-globalref h1:pfUF3Mdnw5gZ5izA7s95Yrp+AetZPlnO9x39RByCi98= github.com/tg123/go-flags v1.4.0-globalref/go.mod h1:G60U6XrJAj49cFQ8MY2Wr+SEjylerbSqj0I8FZy2tFE= +github.com/tg123/sshkey v0.0.0-20201202190454-3bb356f89f1f h1:MOxh2uC27wne9vo2OJqtL2W0Uq3qbBnaOGKgiJA+/fI= +github.com/tg123/sshkey v0.0.0-20201202190454-3bb356f89f1f/go.mod h1:0NrddipH8l+ho+Cpbs4qrpEaqbNeHUAfhxURhKC1waE= github.com/tg123/sshpiper.crypto v0.0.0-sshpiper-20201202 h1:a2r3NdQN25cm02epOv0tfimKWNfaR4apxMk0UAIRh2E= github.com/tg123/sshpiper.crypto v0.0.0-sshpiper-20201202/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/sshpiperd/cmd.go b/sshpiperd/cmd.go index e8426151..549c66be 100644 --- a/sshpiperd/cmd.go +++ b/sshpiperd/cmd.go @@ -6,7 +6,7 @@ import ( "log" "os" - "github.com/gokyle/sshkey" + "github.com/tg123/sshkey" "github.com/jessevdk/go-flags" "github.com/tg123/sshpiper/sshpiperd/auditor"