borgbutler-docker/app/entrypoint.sh
@@ -47,7 +47,7 @@ #Trap SIGTERM trap cleanup INT SIGTERM echo "Starting java ${JAVA_OPTS} -cp app/web/*:app/lib/* -DborgbutlerHome=/BorgButler/ -DapplicationHome=/app -DbindAddress=0.0.0.0 -DallowedClientIps=172.17. de.micromata.borgbutler.server.Main -q ${JAVA_ARGS}" echo "Starting java ${JAVA_OPTS} -cp app/web/*:app/lib/* -DBorgButlerHome=/BorgButler/ -DapplicationHome=/app -DbindAddress=0.0.0.0 -DallowedClientIps=172.17. de.micromata.borgbutler.server.Main -q ${JAVA_ARGS}" java $JAVA_OPTS -cp app/web/*:app/lib/* -DborgbutlerHome=/BorgButler/ -DapplicationHome=/app -DbindAddress=0.0.0.0 -DallowedClientIps=172.17. de.micromata.borgbutler.server.Main -q $JAVA_ARGS & borgbutler-server/build.gradle
@@ -25,6 +25,8 @@ // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.4.5' implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: '2.12.3' implementation 'io.github.microutils:kotlin-logging-jvm:2.0.6' // https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient borgbutler-server/src/main/java/de/micromata/borgbutler/server/user/UserFilter.java
@@ -1,12 +1,10 @@ package de.micromata.borgbutler.server.user; import de.micromata.borgbutler.server.rest.RequestLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import javax.servlet.*; import javax.servlet.http.HttpServletRequest; import java.io.IOException; /** @@ -45,7 +43,7 @@ userData = UserManager.instance().getUser("dummy"); UserUtils.setUser(userData, request.getLocale()); if (log.isDebugEnabled()) log.debug("Request for user: " + userData); log.info("Request for user: " + userData + ": " + RequestLog.asString((HttpServletRequest) request)); //log.info("Request for user: " + userData + ": " + RequestLog.asString((HttpServletRequest) request)); chain.doFilter(request, response); } finally { UserUtils.removeUser(); borgbutler-server/src/main/kotlin/de/micromata/borgbutler/server/BorgButlerApplication.kt
@@ -37,6 +37,18 @@ private fun _start(args: Array<out String>) { setConfigClazz(ServerConfiguration::class.java) var borgButlerHome = System.getProperty("BorgButlerHome") if (borgButlerHome.isNullOrBlank()) { borgButlerHome = File(System.getProperty("user.home"), ".borgbutler").absolutePath System.setProperty("BorgButlerHome", borgButlerHome) } if (System.getProperty("LOG_PATH").isNullOrBlank()) { System.setProperty("LOG_PATH", borgButlerHome) } if (borgButlerHome != null) { init(borgButlerHome) } SpringApplication.run(BorgButlerApplication::class.java, *args) // create Options object val options = Options() options.addOption( @@ -77,10 +89,6 @@ return } } val applicationHome = System.getProperty("borgbutlerHome") if (applicationHome != null) { init(applicationHome) } if (Desktop.isDesktopSupported()) { RunningMode.setServerType(RunningMode.ServerType.DESKTOP) } else { @@ -126,7 +134,6 @@ @JvmStatic fun main(vararg args: String) { main._start(args) SpringApplication.run(BorgButlerApplication::class.java, *args) } private fun printHelp(options: Options) { borgbutler-server/src/main/kotlin/de/micromata/borgbutler/server/WebConfig.kt
@@ -14,7 +14,7 @@ @EnableWebMvc open class WebConfig : WebMvcConfigurer { override fun addCorsMappings(registry: CorsRegistry) { if (ServerConfiguration.get().isWebDevelopmentMode) { if (RunningMode.isDevelopmentMode() || ServerConfiguration.get().isWebDevelopmentMode) { log.warn("*********************************") log.warn("*********** **********") log.warn("*********** ATTENTION! **********") borgbutler-server/src/main/resources/logback-spring.xml
@@ -1,19 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <configuration> <include resource="org/springframework/boot/logging/logback/defaults.xml"/> <property name="LOG_HOME" value="${borgbutlerHome:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}}"/> <property name="LOG_HOME" value="${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}"/> <include resource="org/springframework/boot/logging/logback/console-appender.xml"/> <appender name="ROLLING-FILE-ALL" class="ch.qos.logback.core.rolling.RollingFileAppender"> <encoder> <pattern>%d{MM-dd-yy HH:mm:ss} %-5level %mdc %logger{60}::%M:%line - %msg%n </pattern> <pattern>%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} %X{user}@%X{ip} %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}</pattern> </encoder> <file>${LOG_HOME}borgbutler.log</file> <file>${LOG_HOME}/borgbutler.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> <fileNamePattern>${LOG_HOME}/borgbutler.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern> <fileNamePattern>borgbutler.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern> <minIndex>1</minIndex> <maxIndex>10</maxIndex> </rollingPolicy>