Skip to content

Commit 78beb12

Browse files
committed
Merge branch 'steve-master' into MailUserAtTransactionStop
# Conflicts: # src/main/java/de/rwth/idsg/steve/repository/dto/User.java # src/main/java/de/rwth/idsg/steve/repository/impl/UserRepositoryImpl.java # src/main/java/de/rwth/idsg/steve/service/MailService.java # src/main/java/de/rwth/idsg/steve/service/MailServiceDefault.java # src/main/java/de/rwth/idsg/steve/service/NotificationService.java # src/main/java/de/rwth/idsg/steve/utils/mapper/UserFormMapper.java # src/main/java/de/rwth/idsg/steve/web/controller/UsersController.java
2 parents 7b0d4a8 + 8a7baac commit 78beb12

File tree

283 files changed

+2260
-2662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

283 files changed

+2260
-2662
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
strategy:
77
fail-fast: false
88
matrix:
9-
os: [ ubuntu-20.04, ubuntu-22.04 ]
10-
java: [ '17', '21' ]
9+
os: [ ubuntu-latest ]
10+
java: [ '21', '23' ]
1111
db: [ 'mysql:8.0', 'mariadb:10.3', 'mariadb:10.4.30', 'mariadb:10.5.21', 'mariadb:10.6.14' ]
1212
runs-on: ${{ matrix.os }}
1313
services:
@@ -21,9 +21,9 @@ jobs:
2121
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
2222

2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v5
2525
- name: Set up Java ${{ matrix.Java }}
26-
uses: actions/setup-java@v4
26+
uses: actions/setup-java@v5
2727
with:
2828
java-version: ${{ matrix.java }}
2929
distribution: 'temurin'
@@ -42,7 +42,7 @@ jobs:
4242
- name: Start the app and visit signin web page
4343
run: |
4444
sudo apt-get install -y elinks
45-
java -Djava.net.preferIPv4Stack=true -jar target/steve.jar &
45+
java -Djava.net.preferIPv4Stack=true -jar target/steve.war &
4646
sleep 30
4747
elinks -dump -no-references http://localhost:8080/steve/manager/signin
4848
killall java

.github/workflows/review.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ jobs:
55
license-check:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v4
8+
- uses: actions/checkout@v5
99
with:
1010
fetch-depth: 0
1111

12-
- name: Set up Java 17
13-
uses: actions/setup-java@v4
12+
- name: Set up Java
13+
uses: actions/setup-java@v5
1414
with:
15-
java-version: 17
15+
java-version: 21
1616
distribution: 'temurin'
1717
cache: maven
1818

@@ -21,8 +21,8 @@ jobs:
2121
checkstyle:
2222
runs-on: 'ubuntu-latest'
2323
steps:
24-
- uses: actions/checkout@v4
25-
- uses: actions/setup-java@v4
24+
- uses: actions/checkout@v5
25+
- uses: actions/setup-java@v5
2626
with:
2727
distribution: 'temurin'
2828
java-version: '17'

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eclipse-temurin:17-jdk
1+
FROM eclipse-temurin:21-jdk
22

33
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
44

@@ -22,5 +22,5 @@ COPY . /code
2222
# Build and run steve, requires a db to be available on port 3306
2323
CMD dockerize -wait tcp://mariadb:3306 -timeout 60s && \
2424
./mvnw clean package -Pdocker -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" && \
25-
java -XX:MaxRAMPercentage=85 -jar target/steve.jar
25+
java -XX:MaxRAMPercentage=85 -jar target/steve.war
2626

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![SteVe](src/main/resources/webapp/static/images/logo.png)
1+
![SteVe](src/main/webapp/static/images/logo.png)
22

33
[![build and run tests](https://github.com/steve-community/steve/actions/workflows/main.yml/badge.svg)](https://github.com/steve-community/steve/actions/workflows/main.yml)
44

@@ -38,7 +38,7 @@ https://github.com/steve-community/steve/wiki/Charging-Station-Compatibility
3838
### System Requirements
3939

4040
SteVe requires
41-
* JDK 17 or newer
41+
* JDK 21 or newer
4242
* Maven
4343
* MySQL or MariaDB. You should use [one of these](.github/workflows/main.yml#L11) supported versions.
4444

@@ -72,17 +72,17 @@ SteVe is designed to run standalone, a java servlet container / web server (e.g.
7272
7373
3. Configure SteVe **before** building:
7474
75-
The basic configuration is defined in [main.properties](src/main/resources/config/prod/main.properties):
76-
- You _must_ change [database configuration](src/main/resources/config/prod/main.properties#L9-L13)
77-
- You _must_ change [the host](src/main/resources/config/prod/main.properties#L22) to the correct IP address of your server
78-
- You _must_ change [web interface credentials](src/main/resources/config/prod/main.properties#L17-L18)
79-
- You _can_ access the application via HTTPS, by [enabling it and setting the keystore properties](src/main/resources/config/prod/main.properties#L32-L35)
75+
The basic configuration is defined in [application-prod.properties](src/main/resources/application-prod.properties):
76+
- You _must_ change [database configuration](src/main/resources/application-prod.properties)
77+
- You _must_ change [the host](src/main/resources/application-prod.properties) to the correct IP address of your server
78+
- You _must_ change [web interface credentials](src/main/resources/application-prod.properties)
79+
- You _can_ access the application via HTTPS, by [enabling it and setting the keystore properties](src/main/resources/application-prod.properties)
8080
8181
For advanced configuration please see the [Configuration wiki](https://github.com/steve-community/steve/wiki/Configuration)
8282
8383
4. Build SteVe:
8484
85-
To compile SteVe simply use Maven. A runnable `jar` file containing the application and configuration will be created in the subdirectory `steve/target`.
85+
To compile SteVe simply use Maven. A runnable `war` file containing the application and configuration will be created in the subdirectory `steve/target`.
8686
8787
```
8888
# ./mvnw package
@@ -93,15 +93,15 @@ SteVe is designed to run standalone, a java servlet container / web server (e.g.
9393
To start the application run (please do not run SteVe as root):
9494
9595
```
96-
# java -jar target/steve.jar
96+
# java -jar target/steve.war
9797
```
9898
9999
# Docker
100100
101101
If you prefer to build and start this project via docker (you can skip the steps 1, 4 and 5 from above), this can be done as follows: `docker compose up -d`
102102
103103
Because the docker compose file is written to build the project for you, you still have to change the project configuration settings from step 3.
104-
Instead of changing the [main.properties in the prod directory](src/main/resources/config/prod/main.properties), you have to change the [main.properties in the docker directory](src/main/resources/config/docker/main.properties). There you have to change all configurations which are described in step 3.
104+
Instead of changing the [application-prod.properties](src/main/resources/application-prod.properties), you have to change the [application-docker.properties](src/main/resources/application-docker.properties). There you have to change all configurations which are described in step 3.
105105
The database password for the user "steve" has to be the same as you have configured it in the docker compose file.
106106
107107
With the default docker compose configuration, the web interface will be accessible at: `http://localhost:8180`

k8s/docker/Dockerfile

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,52 @@
1-
FROM eclipse-temurin:17-jdk
1+
FROM eclipse-temurin:21-jdk AS base
22
MAINTAINER daynnnnn
33

4+
# Setting environment variables
45
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
56

7+
# Arguments for database configuration
68
ARG DB_HOST
79
ARG DB_USERNAME
810
ARG DB_PASSWORD
911
ARG DB_DATABASE
1012
ARG DB_PORT
1113

14+
# Build Stage
15+
FROM base as build
16+
17+
# Set the working directory for the build stage
1218
WORKDIR /code
1319

20+
# Copy project files to the build stage
1421
ADD /src /code/src
1522
ADD /website /code/website
1623
ADD /pom.xml /code/pom.xml
24+
ADD mvnw /code/mvnw
25+
ADD .mvn /code/.mvn
1726

27+
# Replace placeholders in pom.xml with actual environment values
1828
RUN sed -i 's|${db.ip}|${env.DB_HOST}|g' pom.xml
1929
RUN sed -i 's|${db.port}|${env.DB_PORT}|g' pom.xml
2030
RUN sed -i 's|${db.user}|${env.DB_USERNAME}|g' pom.xml
2131
RUN sed -i 's|${db.password}|${env.DB_PASSWORD}|g' pom.xml
2232
RUN sed -i 's|${db.schema}|${env.DB_DATABASE}|g' pom.xml
33+
RUN sed -i 's|${server.host}|${env.SERVER_HOST}|g' pom.xml
34+
35+
# Make the Maven wrapper executable
36+
RUN chmod +x mvnw
2337

38+
# Build the project
2439
RUN ./mvnw clean package -Pkubernetes -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2"
2540

26-
CMD java -jar target/steve.jar
41+
# Release Stage
42+
FROM base AS release
43+
44+
# Copy relevant files from the build stage
45+
COPY --from=build /code/target/steve.jar /app/steve.war
46+
COPY --from=build /code/target/libs /app/libs
47+
48+
# Expose any necessary ports (example: 8080)
49+
EXPOSE 8080
2750

51+
# Define the entrypoint for the release stage
52+
CMD ["java", "-jar", "/app/steve.war"]

k8s/yaml/Deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ spec:
2828
value: ""
2929
- name: DB_DATABASE
3030
value: ""
31+
- name: SERVER_HOST
32+
value: "0.0.0.0"
3133
- name: ADMIN_USERNAME
3234
value: ""
3335
- name: ADMIN_PASSWORD

0 commit comments

Comments
 (0)