root: initial go proxy, update compose and helm

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-05-03 00:49:16 +02:00
parent 40a885aaaa
commit 988cf15b71
25 changed files with 667 additions and 206 deletions

View File

@ -1,15 +0,0 @@
FROM node as npm-builder
COPY . /static/
ENV NODE_ENV=production
RUN cd /static && npm i --production=false && npm run build
FROM nginx
RUN mkdir /usr/share/nginx/html/.well-known
COPY --from=npm-builder /static/robots.txt /usr/share/nginx/html/robots.txt
COPY --from=npm-builder /static/security.txt /usr/share/nginx/html/.well-known/security.txt
COPY --from=npm-builder /static/dist/ /usr/share/nginx/html/static/dist/
COPY --from=npm-builder /static/authentik/ /usr/share/nginx/html/static/authentik/
COPY ./nginx.conf /etc/nginx/nginx.conf

View File

@ -3,12 +3,6 @@ trigger:
- next
- version-*
variables:
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
branchName: ${{ replace(variables['System.PullRequest.SourceBranch'], '/', '-') }}
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/') }}:
branchName: ${{ replace(variables['Build.SourceBranchName'], 'refs/heads/', '') }}
stages:
- stage: generate
jobs:
@ -99,27 +93,3 @@ stages:
command: 'custom'
workingDir: 'web/'
customCommand: 'run build'
- stage: build_docker
jobs:
- job: build_static
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'ts_swagger_client'
path: "web/api/"
- task: Bash@3
inputs:
targetType: 'inline'
script: |
python ./scripts/az_do_set_branch.py
- task: Docker@2
inputs:
containerRegistry: 'beryjuorg-harbor'
repository: 'authentik/static'
command: 'buildAndPush'
Dockerfile: 'web/Dockerfile'
tags: "gh-$(branchName)"
buildContext: 'web/'

21
web/static.go Normal file
View File

@ -0,0 +1,21 @@
package web
import "embed"
//go:embed dist/*
var StaticDist embed.FS
//go:embed authentik
var StaticAuthentik embed.FS
//go:embed dist/if/flow/index.html
var InterfaceFlow []byte
//go:embed dist/if/admin/index.html
var InterfaceAdmin []byte
//go:embed robots.txt
var RobotsTxt []byte
//go:embed security.txt
var SecurityTxt []byte