root: initial merging of outpost and main project

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-06-16 12:02:02 +02:00
parent 9ba8a715b1
commit 690b7be1d8
42 changed files with 897 additions and 1107 deletions

View File

@ -27,7 +27,7 @@ values =
[bumpversion:file:internal/constants/constants.go] [bumpversion:file:internal/constants/constants.go]
[bumpversion:file:outpost/pkg/version.go] [bumpversion:file:internal/outpost/version.go]
[bumpversion:file:web/src/constants.ts] [bumpversion:file:web/src/constants.ts]

View File

@ -80,7 +80,7 @@ jobs:
beryju/authentik-proxy:latest, beryju/authentik-proxy:latest,
ghcr.io/goauthentik/proxy:2021.6.1-rc6, ghcr.io/goauthentik/proxy:2021.6.1-rc6,
ghcr.io/goauthentik/proxy:latest ghcr.io/goauthentik/proxy:latest
file: outpost/proxy.Dockerfile file: proxy.Dockerfile
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
- name: Building Docker Image (stable) - name: Building Docker Image (stable)
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
@ -123,7 +123,7 @@ jobs:
beryju/authentik-ldap:latest, beryju/authentik-ldap:latest,
ghcr.io/goauthentik/ldap:2021.6.1-rc6, ghcr.io/goauthentik/ldap:2021.6.1-rc6,
ghcr.io/goauthentik/ldap:latest ghcr.io/goauthentik/ldap:latest
file: outpost/ldap.Dockerfile file: ldap.Dockerfile
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
- name: Building Docker Image (stable) - name: Building Docker Image (stable)
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2

1
.gitignore vendored
View File

@ -200,3 +200,4 @@ media/
*mmdb *mmdb
.idea/ .idea/
api/

View File

@ -32,7 +32,7 @@ gen-build:
gen-clean: gen-clean:
rm -rf web/api/src/ rm -rf web/api/src/
rm -rf outpost/api/ rm -rf api/
gen-web: gen-web:
docker run \ docker run \
@ -55,9 +55,9 @@ gen-outpost:
--git-user-id api \ --git-user-id api \
-i /local/schema.yml \ -i /local/schema.yml \
-g go \ -g go \
-o /local/outpost/api \ -o /local/api \
--additional-properties=packageName=api,enumClassPrefix=true,useOneOfDiscriminatorLookup=true --additional-properties=packageName=api,enumClassPrefix=true,useOneOfDiscriminatorLookup=true
rm -f outpost/api/go.mod outpost/api/go.sum rm -f api/go.mod api/go.sum
gen: gen-build gen-clean gen-web gen-outpost gen: gen-build gen-clean gen-web gen-outpost

View File

@ -27,7 +27,7 @@ stages:
script: make gen-outpost script: make gen-outpost
- task: PublishPipelineArtifact@1 - task: PublishPipelineArtifact@1
inputs: inputs:
targetPath: 'outpost/api/' targetPath: 'api/'
artifact: 'go_api_client' artifact: 'go_api_client'
publishLocation: 'pipeline' publishLocation: 'pipeline'
- stage: lint - stage: lint
@ -43,7 +43,7 @@ stages:
inputs: inputs:
buildType: 'current' buildType: 'current'
artifactName: 'go_api_client' artifactName: 'go_api_client'
path: "outpost/api/" path: "api/"
- task: CmdLine@2 - task: CmdLine@2
inputs: inputs:
script: | script: |
@ -53,7 +53,6 @@ stages:
-w /app \ -w /app \
golangci/golangci-lint:v1.39.0 \ golangci/golangci-lint:v1.39.0 \
golangci-lint run -v --timeout 200s golangci-lint run -v --timeout 200s
workingDirectory: 'outpost/'
- stage: build_docker - stage: build_docker
jobs: jobs:
- job: proxy_build_docker - job: proxy_build_docker
@ -73,7 +72,7 @@ stages:
containerRegistry: 'beryjuorg-harbor' containerRegistry: 'beryjuorg-harbor'
repository: 'authentik/outpost-proxy' repository: 'authentik/outpost-proxy'
command: 'build' command: 'build'
Dockerfile: 'outpost/proxy.Dockerfile' Dockerfile: 'proxy.Dockerfile'
buildContext: '$(Build.SourcesDirectory)' buildContext: '$(Build.SourcesDirectory)'
tags: | tags: |
gh-$(branchName) gh-$(branchName)
@ -106,7 +105,7 @@ stages:
containerRegistry: 'beryjuorg-harbor' containerRegistry: 'beryjuorg-harbor'
repository: 'authentik/outpost-ldap' repository: 'authentik/outpost-ldap'
command: 'build' command: 'build'
Dockerfile: 'outpost/ldap.Dockerfile' Dockerfile: 'ldap.Dockerfile'
buildContext: '$(Build.SourcesDirectory)' buildContext: '$(Build.SourcesDirectory)'
tags: | tags: |
gh-$(branchName) gh-$(branchName)

View File

@ -10,8 +10,8 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"goauthentik.io/outpost/pkg/ak" "goauthentik.io/internal/outpost/ak"
"goauthentik.io/outpost/pkg/ldap" "goauthentik.io/internal/outpost/ldap"
) )
const helpMessage = `authentik ldap const helpMessage = `authentik ldap

View File

@ -10,8 +10,8 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"goauthentik.io/outpost/pkg/ak" "goauthentik.io/internal/outpost/ak"
"goauthentik.io/outpost/pkg/proxy" "goauthentik.io/internal/outpost/proxy"
) )
const helpMessage = `authentik proxy const helpMessage = `authentik proxy

42
go.mod
View File

@ -3,11 +3,47 @@ module goauthentik.io
go 1.16 go 1.16
require ( require (
github.com/getsentry/sentry-go v0.10.0 // indirect github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/getsentry/sentry-go v0.11.0
github.com/go-ldap/ldap/v3 v3.3.0
github.com/go-openapi/analysis v0.20.1 // indirect
github.com/go-openapi/errors v0.20.0 // indirect
github.com/go-openapi/runtime v0.19.29
github.com/go-openapi/strfmt v0.20.1
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-openapi/validate v0.20.2 // indirect
github.com/go-redis/redis/v7 v7.4.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.2.0
github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.4.2
github.com/imdario/mergo v0.3.12 // indirect github.com/imdario/mergo v0.3.12 // indirect
github.com/pkg/errors v0.8.1 // indirect github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a
github.com/justinas/alice v1.2.0
github.com/kr/pretty v0.2.1 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/nmcclain/asn1-ber v0.0.0-20170104154839-2661553a0484 // indirect
github.com/nmcclain/ldap v0.0.0-20191021200707-3b3b69a7e9e3
github.com/oauth2-proxy/oauth2-proxy v0.0.0-20200831161845-e4e5580852dc
github.com/pelletier/go-toml v1.9.1 // indirect
github.com/pkg/errors v0.9.1
github.com/pquerna/cachecontrol v0.0.0-20201205024021-ac21108117ac // indirect
github.com/recws-org/recws v1.3.1
github.com/sirupsen/logrus v1.8.1 github.com/sirupsen/logrus v1.8.1
gopkg.in/yaml.v2 v2.3.0 // indirect github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.1 // indirect
go.mongodb.org/mongo-driver v1.5.2 // indirect
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
) )

826
go.sum

File diff suppressed because it is too large Load Diff

View File

@ -13,8 +13,8 @@ import (
"github.com/google/uuid" "github.com/google/uuid"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/recws-org/recws" "github.com/recws-org/recws"
pkg "goauthentik.io/internal/outpost"
"goauthentik.io/outpost/api" "goauthentik.io/outpost/api"
"goauthentik.io/outpost/pkg"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )

View File

@ -12,7 +12,7 @@ import (
"github.com/go-openapi/strfmt" "github.com/go-openapi/strfmt"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"github.com/recws-org/recws" "github.com/recws-org/recws"
"goauthentik.io/outpost/pkg" pkg "goauthentik.io/internal/outpost"
) )
func (ac *APIController) initWS(akURL url.URL, outpostUUID strfmt.UUID) { func (ac *APIController) initWS(akURL url.URL, outpostUUID strfmt.UUID) {

View File

@ -9,7 +9,7 @@ import (
"github.com/getsentry/sentry-go" "github.com/getsentry/sentry-go"
httptransport "github.com/go-openapi/runtime/client" httptransport "github.com/go-openapi/runtime/client"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"goauthentik.io/outpost/pkg" pkg "goauthentik.io/internal/outpost"
) )
func doGlobalSetup(config map[string]interface{}) { func doGlobalSetup(config map[string]interface{}) {

View File

@ -13,9 +13,9 @@ import (
goldap "github.com/go-ldap/ldap/v3" goldap "github.com/go-ldap/ldap/v3"
"github.com/nmcclain/ldap" "github.com/nmcclain/ldap"
pkg "goauthentik.io/internal/outpost"
"goauthentik.io/internal/outpost/ak"
"goauthentik.io/outpost/api" "goauthentik.io/outpost/api"
"goauthentik.io/outpost/pkg"
"goauthentik.io/outpost/pkg/ak"
) )
const ContextUserKey = "ak_user" const ContextUserKey = "ak_user"

View File

@ -6,7 +6,7 @@ import (
"github.com/go-openapi/strfmt" "github.com/go-openapi/strfmt"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"goauthentik.io/outpost/api" "goauthentik.io/outpost/api"
"goauthentik.io/outpost/pkg/ak" "goauthentik.io/internal/outpost/ak"
"github.com/nmcclain/ldap" "github.com/nmcclain/ldap"
) )

View File

@ -10,7 +10,7 @@ import (
"time" "time"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"goauthentik.io/outpost/pkg/ak" "goauthentik.io/internal/outpost/ak"
) )
// Server represents an HTTP server // Server represents an HTTP server

View File

@ -9,19 +9,19 @@ RUN docker-entrypoint.sh generate \
--git-user-id api \ --git-user-id api \
-i /local/schema.yml \ -i /local/schema.yml \
-g go \ -g go \
-o /local/outpost/api \ -o /local/api \
--additional-properties=packageName=api,enumClassPrefix=true,useOneOfDiscriminatorLookup=true && \ --additional-properties=packageName=api,enumClassPrefix=true,useOneOfDiscriminatorLookup=true && \
rm -f /local/outpost/api/go.mod /local/outpost/api/go.sum rm -f /local/api/go.mod /local/api/go.sum
# Stage 2: Build # Stage 2: Build
FROM golang:1.16.5 AS builder FROM golang:1.16.5 AS builder
ARG GIT_BUILD_HASH ARG GIT_BUILD_HASH
ENV GIT_BUILD_HASH=$GIT_BUILD_HASH ENV GIT_BUILD_HASH=$GIT_BUILD_HASH
WORKDIR /go/src/goauthentik.io/outpost WORKDIR /go/src/goauthentik.io
COPY ./outpost . COPY . .
COPY --from=api-builder /local/outpost/api api COPY --from=api-builder /local/api api
RUN go build -o /go/ldap ./cmd/ldap RUN go build -o /go/ldap ./cmd/ldap

1
outpost/.gitignore vendored
View File

@ -1 +0,0 @@
api/

View File

@ -1,46 +0,0 @@
module goauthentik.io/outpost
go 1.16
require (
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/getsentry/sentry-go v0.11.0
github.com/go-ldap/ldap/v3 v3.3.0
github.com/go-openapi/analysis v0.20.1 // indirect
github.com/go-openapi/errors v0.20.0 // indirect
github.com/go-openapi/runtime v0.19.29
github.com/go-openapi/strfmt v0.20.1
github.com/go-openapi/swag v0.19.15 // indirect
github.com/go-openapi/validate v0.20.2 // indirect
github.com/go-redis/redis/v7 v7.4.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.2.0
github.com/gorilla/websocket v1.4.2
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a
github.com/justinas/alice v1.2.0
github.com/kr/pretty v0.2.1 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/nmcclain/asn1-ber v0.0.0-20170104154839-2661553a0484 // indirect
github.com/nmcclain/ldap v0.0.0-20191021200707-3b3b69a7e9e3
github.com/oauth2-proxy/oauth2-proxy v0.0.0-20200831161845-e4e5580852dc
github.com/pelletier/go-toml v1.9.1 // indirect
github.com/pkg/errors v0.9.1
github.com/pquerna/cachecontrol v0.0.0-20201205024021-ac21108117ac // indirect
github.com/recws-org/recws v1.3.1
github.com/sirupsen/logrus v1.8.1
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.1 // indirect
go.mongodb.org/mongo-driver v1.5.2 // indirect
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 // indirect
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
)

File diff suppressed because it is too large Load Diff

View File

@ -9,19 +9,19 @@ RUN docker-entrypoint.sh generate \
--git-user-id api \ --git-user-id api \
-i /local/schema.yml \ -i /local/schema.yml \
-g go \ -g go \
-o /local/outpost/api \ -o /local/api \
--additional-properties=packageName=api,enumClassPrefix=true,useOneOfDiscriminatorLookup=true && \ --additional-properties=packageName=api,enumClassPrefix=true,useOneOfDiscriminatorLookup=true && \
rm -f /local/outpost/api/go.mod /local/outpost/api/go.sum rm -f /local/api/go.mod /local/api/go.sum
# Stage 2: Build # Stage 2: Build
FROM golang:1.16.5 AS builder FROM golang:1.16.5 AS builder
ARG GIT_BUILD_HASH ARG GIT_BUILD_HASH
ENV GIT_BUILD_HASH=$GIT_BUILD_HASH ENV GIT_BUILD_HASH=$GIT_BUILD_HASH
WORKDIR /go/src/goauthentik.io/outpost WORKDIR /go/src/goauthentik.io
COPY ./outpost . COPY . .
COPY --from=api-builder /local/outpost/api api COPY --from=api-builder /local/api api
RUN go build -o /go/proxy ./cmd/proxy RUN go build -o /go/proxy ./cmd/proxy