1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

Add oauth2-proxy 6.1.1, OAuth 2.0 proxy server.

PR:		252832
Submitted by:	freebsd@rheinwolf.de
This commit is contained in:
Vanilla I. Shu 2021-01-21 08:39:47 +00:00
parent f73d8c4d30
commit 278dbc375b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=562177
6 changed files with 306 additions and 0 deletions

View File

@ -468,6 +468,7 @@
SUBDIR += npm-node12
SUBDIR += npm-node14
SUBDIR += nspluginwrapper
SUBDIR += oauth2-proxy
SUBDIR += obhttpd
SUBDIR += oneshot
SUBDIR += onionbalance

96
www/oauth2-proxy/Makefile Normal file
View File

@ -0,0 +1,96 @@
# $FreeBSD$
PORTNAME= oauth2-proxy
PORTVERSION= 6.1.1
DISTVERSIONPREFIX= v
CATEGORIES= www
MAINTAINER= freebsd@rheinwolf.de
COMMENT= OAuth 2.0 proxy server
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= go:modules
USE_RC_SUBR= oauth2-proxy
USE_GITHUB= yes
GH_TUPLE= \
Bose:minisentinel:917c5a9223bb:bose_minisentinel/vendor/github.com/Bose/minisentinel \
alicebob:gopher-json:a9ecdc9d1d3a:alicebob_gopher_json/vendor/github.com/alicebob/gopher-json \
alicebob:miniredis:v2.13.0:alicebob_miniredis_v2/vendor/github.com/alicebob/miniredis/v2 \
bitly:go-simplejson:v0.5.0:bitly_go_simplejson/vendor/github.com/bitly/go-simplejson \
bmizerany:assert:b7ed37b82869:bmizerany_assert/vendor/github.com/bmizerany/assert \
census-instrumentation:opencensus-go:v0.21.0:census_instrumentation_opencensus_go/vendor/go.opencensus.io \
coreos:go-oidc:v2.2.1:coreos_go_oidc/vendor/github.com/coreos/go-oidc \
davecgh:go-spew:v1.1.1:davecgh_go_spew/vendor/github.com/davecgh/go-spew \
dgrijalva:jwt-go:v3.2.0:dgrijalva_jwt_go/vendor/github.com/dgrijalva/jwt-go \
frankban:quicktest:v1.10.0:frankban_quicktest/vendor/github.com/frankban/quicktest \
fsnotify:fsnotify:v1.4.9:fsnotify_fsnotify/vendor/github.com/fsnotify/fsnotify \
go-ini:ini:v1.51.0:go_ini_ini/vendor/gopkg.in/ini.v1 \
go-redis:redis:v7.2.0:go_redis_redis_v7/vendor/github.com/go-redis/redis/v7 \
go-tomb:tomb:dd632973f1e7:go_tomb_tomb/vendor/gopkg.in/tomb.v1 \
go-yaml:yaml:v2.3.0:go_yaml_yaml/vendor/gopkg.in/yaml.v2 \
golang:appengine:v1.6.5:golang_appengine/vendor/google.golang.org/appengine \
golang:crypto:c2843e01d9a2:golang_crypto/vendor/golang.org/x/crypto \
golang:net:59133d7f0dd7:golang_net/vendor/golang.org/x/net \
golang:oauth2:bf48bf16ab8d:golang_oauth2/vendor/golang.org/x/oauth2 \
golang:protobuf:v1.4.2:golang_protobuf/vendor/github.com/golang/protobuf \
golang:sys:fe76b779f299:golang_sys/vendor/golang.org/x/sys \
golang:text:v0.3.2:golang_text/vendor/golang.org/x/text \
golang:xerrors:9bdfabe68543:golang_xerrors/vendor/golang.org/x/xerrors \
google:go-genproto:24fa4b261c55:google_go_genproto/vendor/google.golang.org/genproto \
google:uuid:v1.1.1:google_uuid/vendor/github.com/google/uuid \
googleapis:gax-go:v2.0.5:googleapis_gax_go_v2/vendor/github.com/googleapis/gax-go \
googleapis:google-api-go-client:v0.20.0:googleapis_google_api_go_client/vendor/google.golang.org/api \
googleapis:google-cloud-go:v0.38.0:googleapis_google_cloud_go/vendor/cloud.google.com/go \
grpc:grpc-go:v1.27.0:grpc_grpc_go/vendor/google.golang.org/grpc \
hashicorp:golang-lru:v0.5.1:hashicorp_golang_lru/vendor/github.com/hashicorp/golang-lru \
hashicorp:hcl:v1.0.0:hashicorp_hcl/vendor/github.com/hashicorp/hcl \
justinas:alice:v1.2.0:justinas_alice/vendor/github.com/justinas/alice \
magiconair:properties:v1.8.1:magiconair_properties/vendor/github.com/magiconair/properties \
mbland:hmacauth:44256dfd4bfa:mbland_hmacauth/vendor/github.com/mbland/hmacauth \
mitchellh:mapstructure:v1.1.2:mitchellh_mapstructure/vendor/github.com/mitchellh/mapstructure \
natefinch:lumberjack:v2.0.0:natefinch_lumberjack/vendor/gopkg.in/natefinch/lumberjack.v2 \
nxadm:tail:v1.4.4:nxadm_tail/vendor/github.com/nxadm/tail \
onsi:ginkgo:v1.14.0:onsi_ginkgo/vendor/github.com/onsi/ginkgo \
onsi:gomega:v1.10.1:onsi_gomega/vendor/github.com/onsi/gomega \
pelletier:go-toml:v1.2.0:pelletier_go_toml/vendor/github.com/pelletier/go-toml \
pierrec:lz4:v2.5.2:pierrec_lz4/vendor/github.com/pierrec/lz4 \
pmezard:go-difflib:v1.0.0:pmezard_go_difflib/vendor/github.com/pmezard/go-difflib \
pquerna:cachecontrol:1555304b9b35:pquerna_cachecontrol/vendor/github.com/pquerna/cachecontrol \
protocolbuffers:protobuf-go:v1.23.0:protocolbuffers_protobuf_go/vendor/google.golang.org/protobuf \
spf13:afero:v1.1.2:spf13_afero/vendor/github.com/spf13/afero \
spf13:cast:v1.3.0:spf13_cast/vendor/github.com/spf13/cast \
spf13:jwalterweatherman:v1.0.0:spf13_jwalterweatherman/vendor/github.com/spf13/jwalterweatherman \
spf13:pflag:v1.0.3:spf13_pflag/vendor/github.com/spf13/pflag \
spf13:viper:v1.6.3:spf13_viper/vendor/github.com/spf13/viper \
square:go-jose:v2.4.1:square_go_jose/vendor/gopkg.in/square/go-jose.v2 \
stretchr:testify:v1.5.1:stretchr_testify/vendor/github.com/stretchr/testify \
subosito:gotenv:v1.2.0:subosito_gotenv/vendor/github.com/subosito/gotenv \
vmihailenco:msgpack:v4.3.11:vmihailenco_msgpack_v4/vendor/github.com/vmihailenco/msgpack/v4 \
vmihailenco:tagparser:v0.1.1:vmihailenco_tagparser/vendor/github.com/vmihailenco/tagparser \
yhat:wsutil:1d66fa95c997:yhat_wsutil/vendor/github.com/yhat/wsutil \
yuin:gopher-lua:ab39c6098bdb:yuin_gopher_lua/vendor/github.com/yuin/gopher-lua
USER= www
GROUP= www
VAR_DIR?= /var
LOG_DIR?= ${VAR_DIR}/log/${PORTNAME}
RUN_DIR?= ${VAR_DIR}/run/${PORTNAME}
SUB_LIST+= GROUP=${GROUP} \
LOG_DIR=${LOG_DIR} \
PORTNAME=${PORTNAME} \
PREFIX=${PREFIX} \
RUN_DIR=${RUN_DIR} \
USER=${USER}
post-install:
${MKDIR} ${STAGEDIR}${LOG_DIR}
${MKDIR} ${STAGEDIR}${RUN_DIR}
${INSTALL_DATA} ${WRKSRC}/contrib/${PORTNAME}.cfg.example ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.cfg.sample
.include <bsd.port.mk>

115
www/oauth2-proxy/distinfo Normal file
View File

@ -0,0 +1,115 @@
TIMESTAMP = 1606838077
SHA256 (oauth2-proxy-oauth2-proxy-v6.1.1_GH0.tar.gz) = d5fb4129d7f1d1c39f4f45184b319e9b60fcb186f3acdd7c3ea415c56f69079c
SIZE (oauth2-proxy-oauth2-proxy-v6.1.1_GH0.tar.gz) = 430480
SHA256 (Bose-minisentinel-917c5a9223bb_GH0.tar.gz) = c765c12a0ed631ae864f74ee606279a0962f3a87c4274cea6e8d922b0ad8a98e
SIZE (Bose-minisentinel-917c5a9223bb_GH0.tar.gz) = 8352
SHA256 (alicebob-gopher-json-a9ecdc9d1d3a_GH0.tar.gz) = ce51bf794d26ef3a8a4d0e4e8a4b477ce4e78bbad6d317fd7c839af9ebfcc68a
SIZE (alicebob-gopher-json-a9ecdc9d1d3a_GH0.tar.gz) = 3630
SHA256 (alicebob-miniredis-v2.13.0_GH0.tar.gz) = 4ff3ca22c22bab47966ab7465a89bf44b70341bd4f3242970f141b66c9424b12
SIZE (alicebob-miniredis-v2.13.0_GH0.tar.gz) = 124631
SHA256 (bitly-go-simplejson-v0.5.0_GH0.tar.gz) = 44196c95263e74277372319e5a6cb7f53b29ef7ddab8c7fed6ce6fc80144d465
SIZE (bitly-go-simplejson-v0.5.0_GH0.tar.gz) = 5994
SHA256 (bmizerany-assert-b7ed37b82869_GH0.tar.gz) = f7dc11f10c5e52a94c836e15e7aff05ad4afba7436f66e5f4506806627c4635e
SIZE (bmizerany-assert-b7ed37b82869_GH0.tar.gz) = 1469
SHA256 (census-instrumentation-opencensus-go-v0.21.0_GH0.tar.gz) = e7129aebb9bcb590f01b4fb773b6cf0b10109211cb38cfbaf1f097d191043251
SIZE (census-instrumentation-opencensus-go-v0.21.0_GH0.tar.gz) = 161522
SHA256 (coreos-go-oidc-v2.2.1_GH0.tar.gz) = e9a5b72b34e4657f526bb85d11b9afc05e84418a430713844a6aa3365b4373d0
SIZE (coreos-go-oidc-v2.2.1_GH0.tar.gz) = 24136
SHA256 (davecgh-go-spew-v1.1.1_GH0.tar.gz) = 7d82b9bb7291adbe7498fe946920ab3e7fc9e6cbfc3b2294693fad00bf0dd17e
SIZE (davecgh-go-spew-v1.1.1_GH0.tar.gz) = 42152
SHA256 (dgrijalva-jwt-go-v3.2.0_GH0.tar.gz) = 197465ef53219f3aeb1a6940b70e16d288fe4e4108d4831b91ea101118440e63
SIZE (dgrijalva-jwt-go-v3.2.0_GH0.tar.gz) = 36960
SHA256 (frankban-quicktest-v1.10.0_GH0.tar.gz) = 7d6311aa7864748a60c1e564e736d4d213800309027698f070131236788eae31
SIZE (frankban-quicktest-v1.10.0_GH0.tar.gz) = 33165
SHA256 (fsnotify-fsnotify-v1.4.9_GH0.tar.gz) = 4f888b1cb132026227826751d156c0a2958e7d492e5e38386cde8848ef494dcb
SIZE (fsnotify-fsnotify-v1.4.9_GH0.tar.gz) = 31900
SHA256 (go-ini-ini-v1.51.0_GH0.tar.gz) = 6c98311d375afbe36a246c5d29acb5cb428634a4186e591ce9b7fe2fa4f2a471
SIZE (go-ini-ini-v1.51.0_GH0.tar.gz) = 43536
SHA256 (go-redis-redis-v7.2.0_GH0.tar.gz) = 9aa836b2ae3be6214a12efbce7cf54d234525396e51a4ebcdadc35942807958a
SIZE (go-redis-redis-v7.2.0_GH0.tar.gz) = 101816
SHA256 (go-tomb-tomb-dd632973f1e7_GH0.tar.gz) = b67f4ee9324a78176bc3196fe262388696aeb3f31d9879d498200219f9c4c554
SIZE (go-tomb-tomb-dd632973f1e7_GH0.tar.gz) = 3631
SHA256 (go-yaml-yaml-v2.3.0_GH0.tar.gz) = 42027002bf258009d498600b04b8c9cbb29d2193185ea7bfa8fefe194fe72a07
SIZE (go-yaml-yaml-v2.3.0_GH0.tar.gz) = 72816
SHA256 (golang-appengine-v1.6.5_GH0.tar.gz) = 4e7df5d4ec2dda0f59f26925b36a087843fd1a165adb938712068376bf791316
SIZE (golang-appengine-v1.6.5_GH0.tar.gz) = 332903
SHA256 (golang-crypto-c2843e01d9a2_GH0.tar.gz) = a4d91350f176b2ef99084cd71f990ecee5f549efed72ef59a5b9e425a00d454a
SIZE (golang-crypto-c2843e01d9a2_GH0.tar.gz) = 1650817
SHA256 (golang-net-59133d7f0dd7_GH0.tar.gz) = ea0a358ca3f8e31ba20c4f20177c4fb8a081ad5119543ea454cabfd8707b5b16
SIZE (golang-net-59133d7f0dd7_GH0.tar.gz) = 1174691
SHA256 (golang-oauth2-bf48bf16ab8d_GH0.tar.gz) = 28b3a51a8bd90beb5952d1080218ea238127edfe9455ad48921989619ff918a8
SIZE (golang-oauth2-bf48bf16ab8d_GH0.tar.gz) = 47016
SHA256 (golang-protobuf-v1.4.2_GH0.tar.gz) = a1e486b3ed6f502c43e10cb28bde4e8f020a420ef9958d3fbe61801492c07c87
SIZE (golang-protobuf-v1.4.2_GH0.tar.gz) = 171778
SHA256 (golang-sys-fe76b779f299_GH0.tar.gz) = 84cda22938ed183a5629979d1f16ab82aa2fab1d2bbb078b6440deada7b360f5
SIZE (golang-sys-fe76b779f299_GH0.tar.gz) = 1052710
SHA256 (golang-text-v0.3.2_GH0.tar.gz) = 0b9309698f5708531c5377ab1e29b423a6d9e20c55a8d386c3b8283428212f22
SIZE (golang-text-v0.3.2_GH0.tar.gz) = 7168069
SHA256 (golang-xerrors-9bdfabe68543_GH0.tar.gz) = 54bb4d99e6cba2e3e5331d064f46640cc01a0e630ee6a684ae810bd94a7e4eb7
SIZE (golang-xerrors-9bdfabe68543_GH0.tar.gz) = 13657
SHA256 (google-go-genproto-24fa4b261c55_GH0.tar.gz) = 96481b64c5971de2dd22d7c6f764d2acbeb4cd85ab6166856284115c3f99238c
SIZE (google-go-genproto-24fa4b261c55_GH0.tar.gz) = 5332241
SHA256 (google-uuid-v1.1.1_GH0.tar.gz) = bebd4b0b4ea152a9793615ef23c83f688876d8c284a2092264d20a4bf4ffc423
SIZE (google-uuid-v1.1.1_GH0.tar.gz) = 13543
SHA256 (googleapis-gax-go-v2.0.5_GH0.tar.gz) = 3089affe6f5e27f7a6d494cb399aa6baf232384f763f548ad5ddfbea0e88e59c
SIZE (googleapis-gax-go-v2.0.5_GH0.tar.gz) = 15328
SHA256 (googleapis-google-api-go-client-v0.20.0_GH0.tar.gz) = 93f55b3f529e26e0c9c263aa323b3968f90b5d8a4faa09e7b24b05bc59226cd5
SIZE (googleapis-google-api-go-client-v0.20.0_GH0.tar.gz) = 14017412
SHA256 (googleapis-google-cloud-go-v0.38.0_GH0.tar.gz) = fec2263c5a5d12a32a2af6f4940e3d072a2ef3847b192545e8f56898dd80cbe5
SIZE (googleapis-google-cloud-go-v0.38.0_GH0.tar.gz) = 1919592
SHA256 (grpc-grpc-go-v1.27.0_GH0.tar.gz) = 53082da10cb09b2cb850ed3c0a41ed13e61fdcbff24fb43c473f8427d1c6dcbf
SIZE (grpc-grpc-go-v1.27.0_GH0.tar.gz) = 825961
SHA256 (hashicorp-golang-lru-v0.5.1_GH0.tar.gz) = 3bf57512af746dc0338651ba1c35c65fe907ff214ccb22d679539f7ea791511e
SIZE (hashicorp-golang-lru-v0.5.1_GH0.tar.gz) = 12982
SHA256 (hashicorp-hcl-v1.0.0_GH0.tar.gz) = 50632428210503070fd2fde748c88b7414bf84a6a0eadebf9d8e596a033bead2
SIZE (hashicorp-hcl-v1.0.0_GH0.tar.gz) = 70658
SHA256 (justinas-alice-v1.2.0_GH0.tar.gz) = 12171459da7096e0d34a0972387e15978ad7b0e73c83ce04ba2f89c44a22336b
SIZE (justinas-alice-v1.2.0_GH0.tar.gz) = 4568
SHA256 (magiconair-properties-v1.8.1_GH0.tar.gz) = 4449df3d2be86608bfc997228f66f1cff57bf620cc5bf9ba44339c7e4c5612dd
SIZE (magiconair-properties-v1.8.1_GH0.tar.gz) = 29735
SHA256 (mbland-hmacauth-44256dfd4bfa_GH0.tar.gz) = f5b9d6aff7eba04766d11cdc780d08458324f158f893ba84479f045dde75cb23
SIZE (mbland-hmacauth-44256dfd4bfa_GH0.tar.gz) = 6192
SHA256 (mitchellh-mapstructure-v1.1.2_GH0.tar.gz) = 53fbc06b125ff1c9c73a4eb1764346932671a29c67a45a92e2ebc6855635069b
SIZE (mitchellh-mapstructure-v1.1.2_GH0.tar.gz) = 20980
SHA256 (natefinch-lumberjack-v2.0.0_GH0.tar.gz) = 5817941b45096eb70b8114d7a4bf392ea47c4fe8030ff383ca54c67dfa0617bd
SIZE (natefinch-lumberjack-v2.0.0_GH0.tar.gz) = 12631
SHA256 (nxadm-tail-v1.4.4_GH0.tar.gz) = 08a132336f9043bdb364f2c50552f3105263108b97319f3b69fbcccfacbef76b
SIZE (nxadm-tail-v1.4.4_GH0.tar.gz) = 1238275
SHA256 (onsi-ginkgo-v1.14.0_GH0.tar.gz) = 71805486a70986eaba23ffaa28048e7c12055be10694cc554e892c4ade35f9e8
SIZE (onsi-ginkgo-v1.14.0_GH0.tar.gz) = 145809
SHA256 (onsi-gomega-v1.10.1_GH0.tar.gz) = c54eb65efc0e4b226dac7798b962135ce6e749ffab056611c04337e2c4367dc8
SIZE (onsi-gomega-v1.10.1_GH0.tar.gz) = 97294
SHA256 (pelletier-go-toml-v1.2.0_GH0.tar.gz) = 1a5a620f680033f17e34148bee8f26d96d8c27ff1d7f56f0fe1c7253595b5244
SIZE (pelletier-go-toml-v1.2.0_GH0.tar.gz) = 57496
SHA256 (pierrec-lz4-v2.5.2_GH0.tar.gz) = bf5ad1ce74f264bad828cea8a546e5d2100a7ab67695bf7badcbe14c57ec4df4
SIZE (pierrec-lz4-v2.5.2_GH0.tar.gz) = 20509582
SHA256 (pmezard-go-difflib-v1.0.0_GH0.tar.gz) = 28f3dc1b5c0efd61203ab07233f774740d3bf08da4d8153fb5310db6cea0ebda
SIZE (pmezard-go-difflib-v1.0.0_GH0.tar.gz) = 11398
SHA256 (pquerna-cachecontrol-1555304b9b35_GH0.tar.gz) = 3611cc14c2de3c0f2df51d98d440673b32f6a906de213098abbdb0bb5eed6919
SIZE (pquerna-cachecontrol-1555304b9b35_GH0.tar.gz) = 18998
SHA256 (protocolbuffers-protobuf-go-v1.23.0_GH0.tar.gz) = e7266bedaa4f110216fce52ae533dc5eba475d3829bb0592e8876684e202ae1f
SIZE (protocolbuffers-protobuf-go-v1.23.0_GH0.tar.gz) = 1214648
SHA256 (spf13-afero-v1.1.2_GH0.tar.gz) = 66554a6b09b0009340ae77c119d5a14e2460bb3aea56e75e138c87e621f3803b
SIZE (spf13-afero-v1.1.2_GH0.tar.gz) = 45309
SHA256 (spf13-cast-v1.3.0_GH0.tar.gz) = e685282ea33f89e9354d148ad1886f532bcebe86b0b60a167988f7c6d081085f
SIZE (spf13-cast-v1.3.0_GH0.tar.gz) = 11085
SHA256 (spf13-jwalterweatherman-v1.0.0_GH0.tar.gz) = 2ece12b964e0d230b10851555185d42d3c81b401efda044265ae716eb1d0bc2d
SIZE (spf13-jwalterweatherman-v1.0.0_GH0.tar.gz) = 6392
SHA256 (spf13-pflag-v1.0.3_GH0.tar.gz) = 9e57f86f493f04d9077fccd04e7139ebf243dd544e917ab83d35729b3e54a124
SIZE (spf13-pflag-v1.0.3_GH0.tar.gz) = 46002
SHA256 (spf13-viper-v1.6.3_GH0.tar.gz) = a58703b5a80523d752d67ba1238473ec507e2f752268926f3a4fd79e3cb44e47
SIZE (spf13-viper-v1.6.3_GH0.tar.gz) = 52318
SHA256 (square-go-jose-v2.4.1_GH0.tar.gz) = b675a128c23f9181f9779f74631a442bbe93f24e18aef5b161788019c4445dac
SIZE (square-go-jose-v2.4.1_GH0.tar.gz) = 304063
SHA256 (stretchr-testify-v1.5.1_GH0.tar.gz) = 6d65f92aeff186bb261dbdb885d9f3ba09db3d79eb5f212fcace1fd4a2858263
SIZE (stretchr-testify-v1.5.1_GH0.tar.gz) = 78657
SHA256 (subosito-gotenv-v1.2.0_GH0.tar.gz) = 5f6826992c11981018c77377f33dbc56d0be932e0d38a2f51e795c99725e7ba5
SIZE (subosito-gotenv-v1.2.0_GH0.tar.gz) = 7359
SHA256 (vmihailenco-msgpack-v4.3.11_GH0.tar.gz) = 99b599c1e6f7d4f82bf147722d54ba5180c5e9febaccd8bbaea2a31ac2923dfd
SIZE (vmihailenco-msgpack-v4.3.11_GH0.tar.gz) = 31465
SHA256 (vmihailenco-tagparser-v0.1.1_GH0.tar.gz) = 0d83a863ff6488f469cb783a3910079fd158b3b400da1aa44f27ec93961a2c08
SIZE (vmihailenco-tagparser-v0.1.1_GH0.tar.gz) = 3649
SHA256 (yhat-wsutil-1d66fa95c997_GH0.tar.gz) = 05da8fa8530e85820f9e8bc0657354501be321e5024bec2346e60ef71a381105
SIZE (yhat-wsutil-1d66fa95c997_GH0.tar.gz) = 11163
SHA256 (yuin-gopher-lua-ab39c6098bdb_GH0.tar.gz) = 709a4aeb7a033157f678db2a5f785a1bfc541cbeb5cf53a1e92ba8d8fd93fd07
SIZE (yuin-gopher-lua-ab39c6098bdb_GH0.tar.gz) = 161569

View File

@ -0,0 +1,79 @@
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: oauth2_proxy
# REQUIRE: NETWORKING SERVERS
# KEYWORD: shutdown
#
# Add these following line to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# oauth2_proxy_enable (bool): Set it to YES to enable keycloak on startup.
# Default: NO
# oauth2_proxy_user (string): User account to run with.
# Default: www
# oauth2_proxy_flags (string): Additional flags for the startup script.
#
. /etc/rc.subr
name=oauth2_proxy
rcvar=oauth2_proxy_enable
desc="OAuth 2.0 proxy server"
load_rc_config $name
: ${oauth2_proxy_enable:=NO}
: ${oauth2_proxy_user:=%%USER%%}
: ${oauth2_proxy_group:=%%GROUP%%}
: ${oauth2_proxy_flags:=""}
: ${oauth2_proxy_restart:=60}
pidfile=%%RUN_DIR%%/%%PORTNAME%%.pid
command=/usr/sbin/daemon
command_args="-u ${oauth2_proxy_user} -o %%LOG_DIR%%/%%PORTNAME%%.out -t %%PORTNAME%% -R ${oauth2_proxy_restart} -P ${pidfile}"
start_cmd="oauth2_proxy_start"
stop_cmd="oauth2_proxy_stop"
oauth2_proxy_start()
{
if [ ! -d "%%LOG_DIR%%" ]; then
install -d -o ${oauth2_proxy_user} %%LOG_DIR%%
fi
if [ ! -d "%%RUN_DIR%%" ]; then
install -d -o ${oauth2_proxy_user} %%RUN_DIR%%
fi
chown -R ${oauth2_proxy_user} %%LOG_DIR%%
echo "Starting %%PORTNAME%%."
${command} ${command_args} \
%%PREFIX%%/bin/%%PORTNAME%% \
--config %%PREFIX%%/etc/%%PORTNAME%%.cfg \
${oauth2_proxy_flags}
}
oauth2_proxy_stop()
{
local pid_daemon
local pid_child
echo "Stopping %%PORTNAME%%."
pid_daemon=$(check_pidfile ${pidfile} ${command})
if [ ! -z "${pid_daemon}" ]; then
kill -TERM ${pid_daemon}
fi
pid_child=$(pgrep -U ${oauth2_proxy_user} -f %%PREFIX%%/bin/%%PORTNAME%%)
if [ ! -z "${pid_child}" ]; then
kill -TERM ${pid_child}
fi
wait_for_pids ${pid_daemon} ${pid_child}
}
run_rc_command "$1"

View File

@ -0,0 +1,5 @@
A reverse proxy and static file server that provides authentication using
Providers (Google, GitHub, and others) to validate accounts by email, domain
or group.
WWW: https://github.com/oauth2-proxy/oauth2-proxy

View File

@ -0,0 +1,10 @@
bin/oauth2-proxy
@owner www
@group www
@mode 600
@sample %%ETCDIR%%.cfg.sample
@mode
@dir /var/log/oauth2-proxy
@dir /var/run/oauth2-proxy
@owner
@group