Skip to content

Commit 6b6bdd3

Browse files
authored
Merge pull request #5 from antoniomika/am/updates
Update versions of dependencies and tools
2 parents 094aa0b + ef2a1b4 commit 6b6bdd3

File tree

9 files changed

+538
-275
lines changed

9 files changed

+538
-275
lines changed

.dockerignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/.dockerignore
22
/Dockerfile
3-
/Dockerfile.buildkit
43
/.git/
54
/.github/
65
/.gitignore

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: antoniomika

.github/workflows/docker.yml

+30-8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
runs-on: ubuntu-20.04
1616
steps:
1717
- uses: actions/checkout@v2
18+
- name: Set up Go
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: 1.18
1822
- name: Lint the codebase
1923
uses: golangci/golangci-lint-action@v2
2024
with:
@@ -49,6 +53,7 @@ jobs:
4953
5054
DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
5155
REF="${BRANCH_NAME:-main}"
56+
OTHER_TAGS=()
5257
OTHER_ARGS=""
5358
OTHER_PUSH_ARGS=""
5459
@@ -61,9 +66,9 @@ jobs:
6166
6267
if [[ "${GITHUB_REF}" =~ ^refs\/tags\/v.*$ ]]; then
6368
REF="${GITHUB_REF//refs\/tags\/v}"
64-
OTHER_ARGS="${OTHER_ARGS} -t ${GITHUB_REPOSITORY}:${GITHUB_REF//refs\/tags\/}"
69+
OTHER_TAGS+=("${GITHUB_REF//refs\/tags\/}")
6570
if ! [[ ${GITHUB_REF} =~ ^refs\/tags\/v.*-.*$ ]]; then
66-
OTHER_ARGS="${OTHER_ARGS} -t ${GITHUB_REPOSITORY}:latest"
71+
OTHER_TAGS+=("latest")
6772
fi
6873
fi
6974
@@ -76,16 +81,24 @@ jobs:
7681
fi
7782
fi
7883
84+
OTHER_TAGS+=("${GITHUB_SHA}" "${REF}")
85+
86+
MAIN_IMAGE_TAGS=""
87+
BUILD_IMAGE_TAGS=""
88+
89+
for TAG in ${OTHER_TAGS[@]}; do
90+
MAIN_IMAGE_TAGS="${MAIN_IMAGE_TAGS} -t ${GITHUB_REPOSITORY}:${TAG}"
91+
BUILD_IMAGE_TAGS="${BUILD_IMAGE_TAGS} -t ${GITHUB_REPOSITORY}-build-image:${TAG}"
92+
done
93+
7994
docker buildx build \
8095
--target release \
8196
--cache-from ${GITHUB_REPOSITORY}-cache \
8297
--build-arg VERSION=${REF} \
8398
--build-arg COMMIT=${GITHUB_SHA} \
8499
--build-arg DATE=${DATE} \
85100
--build-arg REPOSITORY=${GITHUB_REPOSITORY} \
86-
-t ${GITHUB_REPOSITORY}:${GITHUB_SHA} \
87-
-t ${GITHUB_REPOSITORY}:${REF} \
88-
${OTHER_ARGS} ${OTHER_PUSH_ARGS} .
101+
${MAIN_IMAGE_TAGS} ${OTHER_ARGS} ${OTHER_PUSH_ARGS} .
89102
90103
if [[ "${OTHER_ARGS}" != *"--load"* ]]; then
91104
docker buildx build \
@@ -95,9 +108,18 @@ jobs:
95108
--build-arg COMMIT=${GITHUB_SHA} \
96109
--build-arg DATE=${DATE} \
97110
--build-arg REPOSITORY=${GITHUB_REPOSITORY} \
98-
-t ${GITHUB_REPOSITORY}:${GITHUB_SHA} \
99-
-t ${GITHUB_REPOSITORY}:${REF} \
100-
--load .
111+
${MAIN_IMAGE_TAGS} --load .
112+
fi
113+
114+
if [[ "${GITHUB_ACTOR}" == "${GITHUB_REPOSITORY%/*}" ]]; then
115+
docker buildx build \
116+
--target build-image \
117+
--cache-from ${GITHUB_REPOSITORY}-cache \
118+
--build-arg VERSION=${REF} \
119+
--build-arg COMMIT=${GITHUB_SHA} \
120+
--build-arg DATE=${DATE} \
121+
--build-arg REPOSITORY=${GITHUB_REPOSITORY} \
122+
${BUILD_IMAGE_TAGS} ${OTHER_ARGS} ${OTHER_PUSH_ARGS} .
101123
fi
102124
103125
if [[ "${GITHUB_ACTOR}" == "${GITHUB_REPOSITORY%/*}" ]]; then

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Go
1515
uses: actions/setup-go@v2
1616
with:
17-
go-version: 1.15
17+
go-version: 1.18
1818
- name: Run GoReleaser
1919
uses: goreleaser/goreleaser-action@v2
2020
with:

Dockerfile

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
# syntax = docker/dockerfile:experimental
2-
FROM --platform=$BUILDPLATFORM golang:1.15-alpine as builder
2+
FROM --platform=$BUILDPLATFORM golang:1.18-alpine as builder
33
LABEL maintainer="Antonio Mika <[email protected]>"
44

55
ENV CGO_ENABLED 0
66

7-
ARG VERSION=dev
8-
ARG COMMIT=none
9-
ARG DATE=unknown
10-
ARG REPOSITORY=unknown
11-
127
WORKDIR /app
138

149
RUN --mount=type=bind,target=/cache,from=antoniomika/pcompose-build-cache \
@@ -28,6 +23,11 @@ COPY --from=builder /root/.cache/go-build /go-build
2823

2924
FROM builder as build-image
3025

26+
ARG VERSION=dev
27+
ARG COMMIT=none
28+
ARG DATE=unknown
29+
ARG REPOSITORY=unknown
30+
3131
ARG TARGETOS
3232
ARG TARGETARCH
3333

cmd/pcompose.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"path"
1010
"strings"
11+
"time"
1112

1213
"github.com/antoniomika/pcompose/hook"
1314
"github.com/antoniomika/pcompose/sshserver"
@@ -57,8 +58,8 @@ func init() {
5758
rootCmd.PersistentFlags().StringP("whitelisted-ips", "w", "", "A comma separated list of whitelisted ips. Applies to SSH connections")
5859
rootCmd.PersistentFlags().StringP("whitelisted-countries", "y", "", "A comma separated list of whitelisted countries. Applies to SSH connections")
5960
rootCmd.PersistentFlags().StringP("private-key-passphrase", "p", "S3Cr3tP4$$phrAsE", "Passphrase to use to encrypt the server private key")
60-
rootCmd.PersistentFlags().StringP("private-key-location", "l", "deploy/keys/ssh_key", "The location of the SSH server private key. pcompose will create a private key here if\nit doesn't exist using the --private-key-passphrase to encrypt it if supplied")
61-
rootCmd.PersistentFlags().StringP("authentication-password", "u", "S3Cr3tP4$$W0rD", "Password to use for ssh server password authentication")
61+
rootCmd.PersistentFlags().StringP("private-keys-directory", "l", "deploy/keys", "The location of other SSH server private keys. sish will add these as valid auth methods for SSH. Note, these need to be unencrypted OR use the private-key-passphrase")
62+
rootCmd.PersistentFlags().StringP("authentication-password", "u", "", "Password to use for ssh server password authentication")
6263
rootCmd.PersistentFlags().StringP("authentication-keys-directory", "k", "deploy/pubkeys/", "Directory where public keys for public key authentication are stored.\npcompose will watch this directory and automatically load new keys and remove keys\nfrom the authentication list")
6364
rootCmd.PersistentFlags().StringP("time-format", "", "2006/01/02 - 15:04:05", "The time format to use for general log messages")
6465
rootCmd.PersistentFlags().StringP("log-to-file-path", "", "/tmp/pcompose.log", "The file to write log output to")
@@ -77,6 +78,8 @@ func init() {
7778
rootCmd.PersistentFlags().IntP("log-to-file-max-size", "", 500, "The maximum size of outputed log files in megabytes")
7879
rootCmd.PersistentFlags().IntP("log-to-file-max-backups", "", 3, "The maxium number of rotated logs files to keep")
7980
rootCmd.PersistentFlags().IntP("log-to-file-max-age", "", 28, "The maxium number of days to store log output in a file")
81+
82+
rootCmd.PersistentFlags().DurationP("authentication-keys-directory-watch-interval", "", 200*time.Millisecond, "The interval to poll for filesystem changes for SSH keys")
8083
}
8184

8285
// initConfig initializes the configuration and loads needed

go.mod

+65-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,74 @@
11
module github.com/antoniomika/pcompose
22

3-
go 1.15
3+
go 1.18
44

55
require (
6-
github.com/antoniomika/sish v1.1.5
7-
github.com/creack/pty v1.1.11
8-
github.com/fsnotify/fsnotify v1.4.9
9-
github.com/sirupsen/logrus v1.7.0
10-
github.com/spf13/cobra v1.1.3
11-
github.com/spf13/viper v1.7.1
12-
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
6+
github.com/antoniomika/sish v1.1.8-0.20220629213805-9ad6cdc6b02a
7+
github.com/creack/pty v1.1.18
8+
github.com/fsnotify/fsnotify v1.5.4
9+
github.com/sirupsen/logrus v1.8.1
10+
github.com/spf13/cobra v1.5.0
11+
github.com/spf13/viper v1.12.0
12+
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
1313
gopkg.in/natefinch/lumberjack.v2 v2.0.0
1414
)
1515

16-
replace github.com/pires/go-proxyproto => github.com/antoniomika/go-proxyproto v0.1.4-0.20210215223815-7210fcdac442
16+
require (
17+
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
18+
github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5 // indirect
19+
github.com/antoniomika/syncmap v1.0.0 // indirect
20+
github.com/caddyserver/certmagic v0.16.1 // indirect
21+
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a // indirect
22+
github.com/gin-contrib/sse v0.1.0 // indirect
23+
github.com/gin-gonic/gin v1.8.1 // indirect
24+
github.com/go-playground/locales v0.14.0 // indirect
25+
github.com/go-playground/universal-translator v0.18.0 // indirect
26+
github.com/go-playground/validator/v10 v10.11.0 // indirect
27+
github.com/goccy/go-json v0.9.8 // indirect
28+
github.com/gorilla/websocket v1.5.0 // indirect
29+
github.com/hashicorp/hcl v1.0.0 // indirect
30+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
31+
github.com/jpillora/ipfilter v1.2.6 // indirect
32+
github.com/json-iterator/go v1.1.12 // indirect
33+
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
34+
github.com/leodido/go-urn v1.2.1 // indirect
35+
github.com/libdns/libdns v0.2.1 // indirect
36+
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
37+
github.com/magiconair/properties v1.8.6 // indirect
38+
github.com/mailgun/timetools v0.0.0-20170619190023-f3a7b8ffff47 // indirect
39+
github.com/mattn/go-isatty v0.0.14 // indirect
40+
github.com/mholt/acmez v1.0.3 // indirect
41+
github.com/miekg/dns v1.1.50 // indirect
42+
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a // indirect
43+
github.com/mitchellh/mapstructure v1.5.0 // indirect
44+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
45+
github.com/modern-go/reflect2 v1.0.2 // indirect
46+
github.com/pelletier/go-toml v1.9.5 // indirect
47+
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
48+
github.com/phuslu/iploc v1.0.20220630 // indirect
49+
github.com/pires/go-proxyproto v0.6.2 // indirect
50+
github.com/radovskyb/watcher v1.0.7 // indirect
51+
github.com/spf13/afero v1.8.2 // indirect
52+
github.com/spf13/cast v1.5.0 // indirect
53+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
54+
github.com/spf13/pflag v1.0.5 // indirect
55+
github.com/subosito/gotenv v1.4.0 // indirect
56+
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect
57+
github.com/ugorji/go/codec v1.2.7 // indirect
58+
github.com/vulcand/oxy v1.4.1 // indirect
59+
go.uber.org/atomic v1.9.0 // indirect
60+
go.uber.org/multierr v1.8.0 // indirect
61+
go.uber.org/zap v1.21.0 // indirect
62+
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
63+
golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect
64+
golang.org/x/sys v0.0.0-20220712014510-0a85c31ab51e // indirect
65+
golang.org/x/text v0.3.7 // indirect
66+
golang.org/x/tools v0.1.11 // indirect
67+
google.golang.org/protobuf v1.28.0 // indirect
68+
gopkg.in/ini.v1 v1.66.6 // indirect
69+
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
70+
gopkg.in/yaml.v2 v2.4.0 // indirect
71+
gopkg.in/yaml.v3 v3.0.1 // indirect
72+
)
1773

1874
replace github.com/vulcand/oxy => github.com/antoniomika/oxy v1.1.1-0.20210215225031-0afb828604bb

0 commit comments

Comments
 (0)