Skip to content

Commit fdaa429

Browse files
committed
Merge branch 'master' into pr/squalus/488
2 parents ca1e300 + 9b8713c commit fdaa429

13 files changed

Lines changed: 173 additions & 277 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
# go: ['1.14', '1.15']
21-
go: ['1.16']
21+
go: ['1.18']
2222

2323
steps:
2424
- uses: actions/setup-go@v2

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
- docker
88

99
go:
10-
- "1.16"
10+
- "1.18"
1111

1212
env:
1313
- ISTRAVIS=true

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44

55
Coming soon! Please document any work in progress here as part of your PR. It will be moved to the next tag when released.
66

7+
## v0.39.0
8+
79
- [add support for listening on unix domain sockets](https://github.com/vouch/vouch-proxy/pull/488)
810

11+
## v0.38.0
12+
13+
- upgrade golang to `v1.18` from `v1.16`
14+
915
## v0.37.0
1016

1117
- [allow configurable Write, Read and Idle timeouts for the http server](https://github.com/vouch/vouch-proxy/pull/468)

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# Setting up a Development Environment
2+
3+
## Running Tests
4+
5+
```bash
6+
export VOUCH_ROOT=`pwd` # if not using GOPATH
7+
./do.sh test
8+
```
9+
10+
After running these tests manually once (which creates a test key pair), it is possible to run the tests with VSCode Test Explorer.
11+
12+
To get it to work, we must set some environment variables in `.vscode/settings.json` which otherwise would be set by `do.sh`:
13+
14+
```json
15+
{
16+
"go.testEnvVars": {
17+
"VOUCH_ROOT": "${workspaceFolder}",
18+
"VOUCH_CONFIG": "${workspaceFolder}/config/testing/test_config.yml",
19+
"TEST_PRIVATE_KEY_FILE": "${workspaceFolder}/config/testing/rsa.key",
20+
"TEST_PUBLIC_KEY_FILE": "${workspaceFolder}/config/testing/rsa.pub",
21+
}
22+
}
23+
```
24+
125
### Contributing to Vouch Proxy by submitting a Pull Request
226

327
**_I really love Vouch Proxy! I wish it did XXXX..._**

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# quay.io/vouch/vouch-proxy
22
# https://github.com/vouch/vouch-proxy
3-
FROM golang:1.16 AS builder
3+
FROM golang:1.18 AS builder
44

55
ARG UID=999
66
ARG GID=999

Dockerfile.alpine

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# quay.io/vouch/vouch-proxy
22
# https://github.com/vouch/vouch-proxy
3-
FROM golang:1.16 AS builder
3+
FROM golang:1.18 AS builder
44

55
ARG UID=999
66
ARG GID=999

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ VP can send the visitor's email, name and other information which the IdP provid
7575

7676
## Installation and Configuration
7777

78-
Vouch Proxy relies on the ability to share a cookie between the Vouch Proxy server and the application it's protecting. Typically this will be done by running Vouch on a subdomain such as `vouch.yourdomain.com` with apps running at `app1.yourdomain.com` and `app2.yourdomain.com`. The protected domain is `.yourdomain.com` and the Vouch Proxy cookie must be set in this domain by setting [vouch.domains](https://github.com/vouch/vouch-proxy/blob/master/config/config.yml_example#L23-L33) to include `yourdomain.com` or sometimes by setting [vouch.cookie.domain](https://github.com/vouch/vouch-proxy/blob/master/config/config.yml_example#L81-L82) to `yourdomain.com`.
78+
Vouch Proxy relies on the ability to share a cookie between the Vouch Proxy server and the application it's protecting. Typically this will be done by running Vouch on a subdomain such as `vouch.yourdomain.com` with apps running at `app1.yourdomain.com` and `app2.yourdomain.com`. The protected domain is `.yourdomain.com` and the Vouch Proxy cookie must be set in this domain by setting [vouch.domains](https://github.com/vouch/vouch-proxy/blob/master/config/config.yml_example#L38-L48) to include `yourdomain.com` or sometimes by setting [vouch.cookie.domain](https://github.com/vouch/vouch-proxy/blob/master/config/config.yml_example#L109-L114) to `yourdomain.com`.
7979

8080
- `cp ./config/config.yml_example_$OAUTH_PROVIDER ./config/config.yml`
8181
- create OAuth credentials for Vouch Proxy at [google](https://console.developers.google.com/apis/credentials) or [github](https://developer.github.com/apps/building-integrations/setting-up-and-registering-oauth-apps/about-authorization-options-for-oauth-apps/), etc
@@ -467,7 +467,6 @@ TLDR:
467467
- and follow the instructions at the end to redact your Nginx config
468468
- all of those go into a [gist](https://gist.github.com/)
469469
- then [open a new issue](https://github.com/vouch/vouch-proxy/issues/new) in this repository
470-
- or visit our IRC channel [#vouch](irc.libera.chat/#vouch) on libera.chat
471470

472471
A bug report can be generated from a docker environment using the `quay.io/vouch/vouch-proxy:alpine` image...
473472

config/config.yml_example_github

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ vouch:
3636
oauth:
3737
# create a new OAuth application at:
3838
# https://github.com/settings/applications/new
39+
#
40+
# callback_url is configured at github.com when setting up the app
41+
# Set to e.g. https://vouch.yourdomain.com/auth or https://yourdomain.com/vp_in_a_path/auth
3942
provider: github
4043
client_id: xxxxxxxxxxxxxxxxxxxx
4144
client_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

do.sh

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fi
1313

1414
IMAGE=quay.io/vouch/vouch-proxy:latest
1515
ALPINE=quay.io/vouch/vouch-proxy:alpine-latest
16-
GOIMAGE=golang:1.16
16+
GOIMAGE=golang:1.18
1717
NAME=vouch-proxy
1818
HTTPPORT=9090
1919
GODOC_PORT=5050
@@ -25,28 +25,24 @@ run () {
2525
build () {
2626
local VERSION=$(git describe --always --long)
2727
local DT=$(date -u +"%Y-%m-%dT%H:%M:%SZ") # ISO-8601
28-
local FQDN=$(_hostname)
28+
local UQDN=$(_hostname)
2929
local SEMVER=$(git tag --list --sort="v:refname" | tail -n -1)
3030
local BRANCH=$(git rev-parse --abbrev-ref HEAD)
3131
local UNAME=$(uname)
32-
go build -v -ldflags=" -X main.version=${VERSION} -X main.uname=${UNAME} -X main.builddt=${DT} -X main.host=${FQDN} -X main.semver=${SEMVER} -X main.branch=${BRANCH}" .
32+
go build -v -ldflags=" -X main.version=${VERSION} -X main.uname=${UNAME} -X main.builddt=${DT} -X main.host=${UQDN} -X main.semver=${SEMVER} -X main.branch=${BRANCH}" .
3333
}
3434

3535
_hostname() {
3636
local FQDN
37-
local HOSTNAME_CMD
37+
local UQDN
38+
FQDN=$(hostname)
39+
UQDN=${FQDN/.*/}
3840

39-
case $(uname) in
40-
FreeBSD) HOSTNAME_CMD="hostname";;
41-
*) HOSTNAME_CMD="hostname --fqdn"
42-
esac
43-
44-
FQDN=$($HOSTNAME_CMD)
45-
if [ -z "$FQDN" ]; then
46-
>&2 echo "error: Could determine the fully qualified domain name using command $HOSTNAME_CMD"
41+
if [ -z "$UQDN" ]; then
42+
>&2 echo "error: Could determine the fully qualified domain name."
4743
return 1
4844
fi
49-
echo $FQDN
45+
echo "$UQDN"
5046
return 0;
5147
}
5248

@@ -62,7 +58,7 @@ dbuild () {
6258
docker build -f Dockerfile -t $IMAGE .
6359
}
6460

65-
dbuildalpine () {
61+
dbuildalpine () {
6662
docker build -f Dockerfile.alpine -t $ALPINE .
6763
}
6864

@@ -83,10 +79,10 @@ drun () {
8379
fi
8480

8581

86-
CMD="docker run --rm -i -t
87-
-p ${HTTPPORT}:${HTTPPORT}
88-
--name $NAME
89-
-v ${SDIR}/config:/config
82+
CMD="docker run --rm -i -t
83+
-p ${HTTPPORT}:${HTTPPORT}
84+
--name $NAME
85+
-v ${SDIR}/config:/config
9086
$WITHCERTS
9187
$IMAGE $* "
9288

@@ -126,7 +122,7 @@ bug_report() {
126122
CONFIG=config/config.yml
127123
REDACT=$*
128124

129-
if [ -z "$REDACT" ]; then
125+
if [ -z "$REDACT" ]; then
130126
cat <<EOF
131127
132128
bug_report cleans the ${CONFIG} and the Vouch Proxy logs of secrets and any additional strings (usually domains and email addresses)
@@ -138,7 +134,7 @@ bug_report() {
138134
EOF
139135
exit 1;
140136
fi
141-
echo -e "#\n# If sensitive information is still visible in the output, first try appending the string.."
137+
echo -e "#\n# If sensitive information is still visible in the output, first try appending the string.."
142138
echo -e "#\n# '$0 bug_report badstring1 badstring2'\n#\n"
143139
echo -e "#\n# Please consider submitting a PR for the './do.sh _redact' routine if you feel that it should be improved.\n#"
144140
echo -e "\n-------------------------\n\n#\n# redacted Vouch Proxy ${CONFIG}\n# $(date -I)\n#\n"
@@ -244,7 +240,7 @@ test_logging() {
244240
let "levelcount+=1"
245241
done
246242
echo "passed"
247-
243+
248244
echo "testing loglevel set from config file"
249245
levelcount=0
250246
for ll in ${levels[*]}; do
@@ -328,8 +324,8 @@ _print_license() {
328324
/*
329325
330326
Copyright $YEAR The Vouch Proxy Authors.
331-
Use of this source code is governed by The MIT License (MIT) that
332-
can be found in the LICENSE file. Software distributed under The
327+
Use of this source code is governed by The MIT License (MIT) that
328+
can be found in the LICENSE file. Software distributed under The
333329
MIT License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
334330
OR CONDITIONS OF ANY KIND, either express or implied.
335331
@@ -369,7 +365,7 @@ selfcert() {
369365
# openssl genrsa -out $SDIR/certs/server.key 2048
370366
openssl ecparam -genkey -name secp384r1 -out $SDIR/certs/server.key
371367
openssl req -new -x509 -sha256 -key $SDIR/certs/server.key -out $SDIR/certs/server.crt -days 3650
372-
echo -e "created self signed certs in '$SDIR/certs'\n"
368+
echo -e "created self signed certs in '$SDIR/certs'\n"
373369
}
374370

375371
usage() {

go.mod

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,54 @@
11
module github.com/vouch/vouch-proxy
22

3-
go 1.16
3+
go 1.18
44

55
require (
6-
cloud.google.com/go v0.89.0 // indirect
7-
github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b // indirect
8-
github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654 // indirect
96
github.com/golang-jwt/jwt v3.2.2+incompatible
10-
github.com/google/go-cmp v0.5.6
7+
github.com/google/go-cmp v0.5.9
118
github.com/gorilla/sessions v1.2.1
12-
github.com/influxdata/tdigest v0.0.1 // indirect
139
github.com/julienschmidt/httprouter v1.3.0
1410
github.com/karupanerura/go-mock-http-response v0.0.0-20171201120521-7c242a447d45
1511
github.com/kelseyhightower/envconfig v1.4.0
16-
github.com/mailru/easyjson v0.7.7 // indirect
17-
github.com/mitchellh/mapstructure v1.4.1
18-
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20170819232839-0fbfe93532da
12+
github.com/mitchellh/mapstructure v1.5.0
13+
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20220510032225-4f9f17eaec4c
1914
github.com/patrickmn/go-cache v2.1.0+incompatible
20-
github.com/spf13/cast v1.4.0 // indirect
21-
github.com/spf13/viper v1.8.1
22-
github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25 // indirect
23-
github.com/stretchr/testify v1.7.0
15+
github.com/spf13/viper v1.15.0
16+
github.com/stretchr/testify v1.8.1
2417
github.com/theckman/go-securerandom v0.1.1
2518
github.com/tsenart/vegeta v12.7.0+incompatible
26-
go.uber.org/atomic v1.9.0 // indirect
27-
go.uber.org/multierr v1.7.0 // indirect
28-
go.uber.org/zap v1.18.1
29-
golang.org/x/net v0.0.0-20220812174116-3211cb980234
30-
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
19+
go.uber.org/zap v1.24.0
20+
golang.org/x/net v0.5.0
21+
golang.org/x/oauth2 v0.4.0
3122
)
3223

33-
replace go.uber.org/atomic => go.uber.org/atomic v1.9.0
24+
require (
25+
cloud.google.com/go/compute v1.15.1 // indirect
26+
cloud.google.com/go/compute/metadata v0.2.3 // indirect
27+
github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b // indirect
28+
github.com/davecgh/go-spew v1.1.1 // indirect
29+
github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654 // indirect
30+
github.com/fsnotify/fsnotify v1.6.0 // indirect
31+
github.com/golang/protobuf v1.5.2 // indirect
32+
github.com/gorilla/securecookie v1.1.1 // indirect
33+
github.com/hashicorp/hcl v1.0.0 // indirect
34+
github.com/influxdata/tdigest v0.0.1 // indirect
35+
github.com/josharian/intern v1.0.0 // indirect
36+
github.com/magiconair/properties v1.8.7 // indirect
37+
github.com/mailru/easyjson v0.7.7 // indirect
38+
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
39+
github.com/pmezard/go-difflib v1.0.0 // indirect
40+
github.com/spf13/afero v1.9.3 // indirect
41+
github.com/spf13/cast v1.5.0 // indirect
42+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
43+
github.com/spf13/pflag v1.0.5 // indirect
44+
github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25 // indirect
45+
github.com/subosito/gotenv v1.4.2 // indirect
46+
go.uber.org/atomic v1.10.0 // indirect
47+
go.uber.org/multierr v1.9.0 // indirect
48+
golang.org/x/sys v0.4.0 // indirect
49+
golang.org/x/text v0.6.0 // indirect
50+
google.golang.org/appengine v1.6.7 // indirect
51+
google.golang.org/protobuf v1.28.1 // indirect
52+
gopkg.in/ini.v1 v1.67.0 // indirect
53+
gopkg.in/yaml.v3 v3.0.1 // indirect
54+
)

0 commit comments

Comments
 (0)