Skip to content

Commit 12abe7e

Browse files
authored
Merge pull request #336 from mrFlick72/build-system-fix
add config manager to teh build system
2 parents 5b26ae5 + fa76eb3 commit 12abe7e

12 files changed

Lines changed: 142 additions & 48 deletions

File tree

.github/workflows/auth-server-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build VAuthenticator
1+
name: build VAuthenticator Auth Server
22

33
on:
44
push: { }
@@ -78,10 +78,10 @@ jobs:
7878
- name: checkout
7979
uses: actions/checkout@v4
8080

81-
- name: Set up JDK 21
81+
- name: Set up JDK 25
8282
uses: actions/setup-java@v4
8383
with:
84-
java-version: 21
84+
java-version: 25
8585
distribution: 'corretto'
8686

8787
- name: Build
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: build VAuthenticator Management UI config-manager
2+
3+
on:
4+
push: { }
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: 'make a tag'
9+
required: false
10+
type: string
11+
12+
newversion:
13+
description: 'Next desired version'
14+
required: false
15+
type: string
16+
17+
jobs:
18+
# tag-artifact:
19+
# if: github.event.inputs.version != '' || github.event.inputs.version != ' '
20+
# needs:
21+
# - build-backend
22+
# - ui-backend
23+
#
24+
# runs-on: ubuntu-22.04
25+
# steps:
26+
# - name: checkout
27+
# uses: actions/checkout@v4
28+
#
29+
# - name: make an echo
30+
# run: |
31+
# echo version ${{github.event.inputs.version}}
32+
#
33+
# - name: set the Tag version
34+
# run: |
35+
# git config --global user.email "${{ secrets.GIT_EMAIL }}"
36+
# git config --global user.name "${{ secrets.GIT_USERNAME }}"
37+
#
38+
# mvn versions:set -DnewVersion=${{github.event.inputs.version}}
39+
# git commit -am "[skip-ci] new version release ${{github.event.inputs.version}}"
40+
# git push
41+
#
42+
# - name: Create tag
43+
# uses: ncipollo/release-action@v1
44+
# with:
45+
# bodyFile: changelog/${{github.event.inputs.version}}.md
46+
# tag: ${{github.event.inputs.version}}
47+
#
48+
# - name: set the Next Development version
49+
# run: |
50+
# git config --global user.email "${{ secrets.GIT_EMAIL }}"
51+
# git config --global user.name "${{ secrets.GIT_USERNAME }}"
52+
#
53+
# mvn versions:set -DnewVersion=${{github.event.inputs.newversion}}
54+
# git commit -am "[skip-ci] new version release ${{github.event.inputs.newversion}}"
55+
# git push
56+
57+
build-backend:
58+
runs-on: ubuntu-22.04
59+
defaults:
60+
run:
61+
working-directory: config-manager
62+
steps:
63+
- name: checkout
64+
uses: actions/checkout@v6
65+
66+
- name: Set up Golang
67+
uses: actions/setup-go@v6
68+
with:
69+
go-version: 1.25.1
70+
71+
- name: Build budget-api package
72+
run: |
73+
CGO_ENABLED=0 GOOS=linux go build -o app .
74+
75+
- name: Run tests
76+
env:
77+
AWS_ACCESS_KEY_ID: test
78+
AWS_SECRET_ACCESS_KEY: test
79+
AWS_DEFAULT_REGION: us-east-1
80+
KAFKA_BROKERS: localhost:9092
81+
run: |
82+
go test -tags test ./...
83+
84+
85+
- name: docker push
86+
run: |
87+
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_PASSWORD }}
88+
89+
if [[ ${GITHUB_REF##*/} == 'main' ]]
90+
then
91+
DOCKER_TAG="latest"
92+
else
93+
DOCKER_TAG="${GITHUB_REF##*/}"
94+
fi
95+
96+
echo "$DOCKER_TAG"
97+
docker build -t mrflick72/vauthenticator-config-manager-k8s:$DOCKER_TAG -f application.Dockerfile .
98+
docker push mrflick72/vauthenticator-config-manager-k8s:$DOCKER_TAG

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ The nginx config in `management-ui/local` proxies `GET /api/config` to `config-m
8787
- [Auth server MFA](auth-server/docs/mfa.md)
8888
- [Auth server Lambda token customization](auth-server/docs/lambda.md)
8989
- [Auth server management endpoints](auth-server/docs/management.md)
90+
- [Auth server security assessment](auth-server/docs/security-assessment.md)
9091
- [Management UI agent guide](management-ui/AGENTS.md)
9192
- [Config manager README](config-manager/README.md)
9293
- [Helm chart README](helm-charts/README.md)

auth-server/AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ As additional capability I would suggest to use the context7 MCP server to gain
1414

1515
## Stack
1616

17-
- Backend: Spring Boot 4.0.x, Kotlin 2.2, Java 21
17+
- Backend: Spring Boot 4.0.x, Kotlin 2.3, Java 25
1818
- Security: Spring Security, Spring Authorization Server, OAuth2 Resource Server
1919
- Persistence: PostgreSQL or DynamoDB depending on active profile
2020
- Cache/session: Redis, Spring Session
@@ -117,6 +117,8 @@ Backend:
117117
- `./mvnw package`
118118
- `./mvnw spring-boot:run`
119119

120+
Use a Java 25 runtime/toolchain for Maven builds and local runs. The application image is based on `amazoncorretto:25-al2023`.
121+
120122
Frontend:
121123

122124
- `cd src/main/frontend && npm install`

auth-server/application.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM alpine:latest AS security_provider
22
RUN addgroup -S application \
33
&& adduser -S application -G application
44

5-
FROM amazoncorretto:21-al2023
5+
FROM amazoncorretto:25-al2023
66

77
COPY --from=security_provider /etc/passwd /etc/passwd
88
USER application

auth-server/pom.xml

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<description>OpenId Connect/OAuth2 Authorization Server for VAuthenticator Open Source Product</description>
1919

2020
<properties>
21-
<java.version>21</java.version>
22-
<kotlin.version>2.2.21</kotlin.version>
21+
<java.version>25</java.version>
22+
<kotlin.version>2.3.21</kotlin.version>
2323

2424
<io.mockk.version>1.14.6</io.mockk.version>
2525
<aws.sdk.version>2.44.6</aws.sdk.version>
@@ -257,6 +257,7 @@
257257
<configuration>
258258
<args>
259259
<arg>-Xjsr305=strict</arg>
260+
<arg>-Xannotation-default-target=param-property</arg>
260261
</args>
261262
<compilerPlugins>
262263
<plugin>spring</plugin>
@@ -270,38 +271,6 @@
270271
</dependency>
271272
</dependencies>
272273
</plugin>
273-
274-
<plugin>
275-
<groupId>org.jacoco</groupId>
276-
<artifactId>jacoco-maven-plugin</artifactId>
277-
<version>0.8.12</version>
278-
<configuration>
279-
<excludes>
280-
<exclude>**/*Config.*</exclude>
281-
<exclude>**/VAuthenticatorApplication.*</exclude>
282-
</excludes>
283-
</configuration>
284-
<executions>
285-
<execution>
286-
<id>prepare-agent</id>
287-
<goals>
288-
<goal>prepare-agent</goal>
289-
</goals>
290-
</execution>
291-
<execution>
292-
<id>report</id>
293-
<goals>
294-
<goal>report</goal>
295-
</goals>
296-
<configuration>
297-
<formats>
298-
<format>HTML</format>
299-
<format>XML</format>
300-
</formats>
301-
</configuration>
302-
</execution>
303-
</executions>
304-
</plugin>
305274
</plugins>
306275
</build>
307276
<repositories>

config-manager/AGENTS.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ The relevant skills if available for this project include: $golang-documentation
1818

1919
## Repository Layout
2020

21-
- `cmd/config-manager`: executable entry point
21+
- `main.go`: executable entry point and graceful shutdown
2222
- `internal/api`: Gin router and HTTP endpoint tests
2323
- `internal/config`: environment and `.env` file loading, parsing, and validation
2424
- `.env.example`: local configuration example
2525
- `Makefile`: build, run, test, and tidy shortcuts
26+
- `application.Dockerfile`: runtime image definition used by CI
27+
- `.github/workflows/config-manager.yml`: CI workflow that builds, tests, and publishes the config-manager image
2628

2729
## Runtime Contract
2830

@@ -69,10 +71,12 @@ Optional value:
6971
Equivalent direct commands:
7072

7173
- `go test ./...`
72-
- `go run ./cmd/config-manager`
73-
- `go build -o bin/config-manager ./cmd/config-manager`
74+
- `go run .`
75+
- `go build -o bin/config-manager .`
7476
- `go mod tidy`
7577

78+
The CI workflow builds a Linux binary named `app` and uses `application.Dockerfile` to publish `mrflick72/vauthenticator-config-manager-k8s`.
79+
7680
## Conventions For Changes
7781

7882
- Keep the executable entry point thin; put HTTP behavior in `internal/api` and configuration rules in `internal/config`.
@@ -84,7 +88,7 @@ Equivalent direct commands:
8488

8589
## Files Worth Reading First
8690

87-
- `cmd/config-manager/main.go`
91+
- `main.go`
8892
- `internal/api/router.go`
8993
- `internal/config/config.go`
9094
- `README.md`

config-manager/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.PHONY: build run test tidy
22

33
build:
4-
go build -o bin/config-manager ./cmd/config-manager
4+
go build -o bin/config-manager .
55

66
run:
7-
go run ./cmd/config-manager
7+
go run .
88

99
test:
1010
go test ./...

config-manager/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ The direct Go equivalents are:
5050

5151
```bash
5252
go test ./...
53-
go build -o bin/config-manager ./cmd/config-manager
53+
go build -o bin/config-manager .
5454
go mod tidy
5555
```
5656

57+
CI builds a Linux binary named `app`, packages it with `application.Dockerfile`, and publishes `mrflick72/vauthenticator-config-manager-k8s` tagged as `latest` from `main` or with the branch name otherwise.
58+
5759
## API
5860

5961
### `GET /api/config`
@@ -74,8 +76,9 @@ The management UI caches this response in `sessionStorage` under the `appConfig`
7476

7577
## Project Layout
7678

77-
- `cmd/config-manager`: executable entry point and graceful shutdown
79+
- `main.go`: executable entry point and graceful shutdown
7880
- `internal/api`: Gin router and `/api/config` endpoint
7981
- `internal/config`: environment loading, parsing, defaults, and validation
8082
- `.env.example`: local configuration example
8183
- `Makefile`: development commands
84+
- `application.Dockerfile`: runtime image definition used by CI
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ubuntu:24.04
2+
3+
# create a group + “system” user, no home directory
4+
RUN useradd -ms /bin/bash application
5+
6+
RUN apt-get update && \
7+
apt-get install -y --no-install-recommends ca-certificates && \
8+
update-ca-certificates && \
9+
rm -rf /var/lib/apt/lists/*
10+
11+
# all following instructions,
12+
# switch to that unprivileged user for the rest of the build
13+
USER application
14+
15+
WORKDIR /opt/app
16+
COPY app /opt/app/app
17+
ENTRYPOINT ["/opt/app/app"]

0 commit comments

Comments
 (0)