Steve/EV Dashboard/nginx 도커파일 및 설정파일 추가
This commit is contained in:
25
steve/Dockerfile
Normal file
25
steve/Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
FROM eclipse-temurin:21-jdk
|
||||
|
||||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
||||
|
||||
MAINTAINER Ling Li
|
||||
|
||||
# Download and install dockerize.
|
||||
# Needed so the web container will wait for MariaDB to start.
|
||||
ENV DOCKERIZE_VERSION v0.19.0
|
||||
RUN curl -sfL https://github.com/powerman/dockerize/releases/download/"$DOCKERIZE_VERSION"/dockerize-`uname -s`-`uname -m` | install /dev/stdin /usr/local/bin/dockerize
|
||||
|
||||
EXPOSE 8180
|
||||
EXPOSE 8443
|
||||
WORKDIR /code
|
||||
|
||||
VOLUME ["/code"]
|
||||
|
||||
# Copy the application's code
|
||||
COPY . /code
|
||||
|
||||
# Wait for the db to startup(via dockerize), then
|
||||
# Build and run steve, requires a db to be available on port 3306
|
||||
CMD dockerize -wait tcp://mariadb:3306 -timeout 60s && \
|
||||
./mvnw clean package -Pdocker,mariadb -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" && \
|
||||
java -XX:MaxRAMPercentage=85 -jar target/steve.war
|
||||
47
steve/JettyConfiguration.java
Normal file
47
steve/JettyConfiguration.java
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* SteVe - SteckdosenVerwaltung - https://github.com/steve-community/steve
|
||||
* Copyright (C) 2013-2026 SteVe Community Team
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package de.rwth.idsg.steve.config;
|
||||
|
||||
import org.eclipse.jetty.http.HttpCompliance;
|
||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.springframework.boot.jetty.JettyServerCustomizer;
|
||||
import org.springframework.boot.jetty.servlet.JettyServletWebServerFactory;
|
||||
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class JettyConfiguration {
|
||||
|
||||
@Bean
|
||||
public WebServerFactoryCustomizer<JettyServletWebServerFactory> jettyHttpComplianceCustomizer() {
|
||||
return factory -> factory.addServerCustomizers((JettyServerCustomizer) server -> {
|
||||
for (var connector : server.getConnectors()) {
|
||||
if (connector instanceof ServerConnector serverConnector) {
|
||||
for (var cf : serverConnector.getConnectionFactories()) {
|
||||
if (cf instanceof HttpConnectionFactory httpCF) {
|
||||
httpCF.getHttpConfiguration().setHttpCompliance(HttpCompliance.RFC7230_LEGACY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
66
steve/application-docker.properties
Normal file
66
steve/application-docker.properties
Normal file
@@ -0,0 +1,66 @@
|
||||
# Just to be backwards compatible with previous versions, this is set to "steve",
|
||||
# since there might be already configured chargepoints expecting the older path.
|
||||
# Otherwise, might as well be changed to something else or be left empty.
|
||||
#
|
||||
context.path = steve
|
||||
|
||||
# Database configuration
|
||||
#
|
||||
db.ip = mariadb
|
||||
db.port = 3306
|
||||
db.schema = stevedb
|
||||
db.user = steve
|
||||
db.password = changeme
|
||||
|
||||
# Credentials for Web interface access
|
||||
#
|
||||
auth.user = admin
|
||||
auth.password = 1234
|
||||
|
||||
# The header key and value for Web API access using API key authorization.
|
||||
# Both must be set for Web APIs to be enabled. Otherwise, we will block all calls.
|
||||
#
|
||||
webapi.key = STEVE-API-KEY
|
||||
webapi.value =
|
||||
|
||||
# Jetty configuration
|
||||
#
|
||||
server.host = 0.0.0.0
|
||||
server.gzip.enabled = false
|
||||
|
||||
# Jetty HTTP configuration
|
||||
#
|
||||
http.enabled = true
|
||||
http.port = 8180
|
||||
|
||||
# Jetty HTTPS configuration
|
||||
#
|
||||
https.enabled = false
|
||||
https.port = 8443
|
||||
keystore.path =
|
||||
keystore.password =
|
||||
|
||||
# When the WebSocket/Json charge point opens more than one WebSocket connection,
|
||||
# we need a mechanism/strategy to select one of them for outgoing requests.
|
||||
# For allowed values see de.rwth.idsg.steve.ocpp.ws.custom.WsSessionSelectStrategyEnum.
|
||||
#
|
||||
ws.session.select.strategy = ALWAYS_LAST
|
||||
|
||||
# if BootNotification messages arrive (SOAP) or WebSocket connection attempts are made (JSON) from unknown charging
|
||||
# stations, we reject these charging stations, because stations with these chargeBoxIds were NOT inserted into database
|
||||
# beforehand. by setting this property to true, this behaviour can be modified to automatically insert unknown
|
||||
# stations into database and accept their requests.
|
||||
#
|
||||
# CAUTION: setting this property to true is very dangerous, because we will accept EVERY BootNotification or WebSocket
|
||||
# connection attempt from ANY sender as long as the sender knows the URL and sends a valid message.
|
||||
#
|
||||
auto.register.unknown.stations = false
|
||||
|
||||
# if this field is set, it will take precedence over the default regex we are using in
|
||||
# de.rwth.idsg.steve.web.validation.ChargeBoxIdValidator.REGEX to validate the format of the chargeBoxId values
|
||||
#
|
||||
charge-box-id.validation.regex =
|
||||
|
||||
### DO NOT MODIFY ###
|
||||
db.sql.logging = false
|
||||
profile = prod
|
||||
31
steve/docker-compose.yml
Normal file
31
steve/docker-compose.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
version: "3.0"
|
||||
|
||||
volumes:
|
||||
db-data:
|
||||
external: false
|
||||
|
||||
services:
|
||||
|
||||
db:
|
||||
image: mariadb:10.11.16
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 3307:3306
|
||||
environment:
|
||||
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
|
||||
MYSQL_DATABASE: stevedb
|
||||
MYSQL_USER: steve
|
||||
MYSQL_PASSWORD: changeme
|
||||
app:
|
||||
restart: unless-stopped
|
||||
build: .
|
||||
links:
|
||||
- "db:mariadb"
|
||||
volumes:
|
||||
- .:/code
|
||||
ports:
|
||||
- "8180:8180"
|
||||
- "8445:8443"
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
Reference in New Issue
Block a user