Skip to content

Commit

Permalink
Merge branch 'prod' into update/aws-java-sdk-s3-1.12.677
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmpp authored Mar 13, 2024
2 parents 4a1b73b + 9ab845d commit 14620dc
Show file tree
Hide file tree
Showing 50 changed files with 1,441 additions and 803 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependency-graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ jobs:
name: Update Dependency Graph
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: scalacenter/sbt-dependency-submission@v2
6 changes: 3 additions & 3 deletions .github/workflows/sbt-docker-prepublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install locales
run: sudo apt-get -y install locales
- name: Fix up git URLs
run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin
- name: Docker Login
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sbt-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install locales
run: sudo apt-get -y install locales
- name: Fix up git URLs
run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin
- name: Docker Login
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/sbt-test.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
name: sbt test

on:
push:
on: [push, pull_request]

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install locales
run: sudo apt-get -y install locales
- name: Fix up git URLs
run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin
- name: Run Tests
run: sbt "coverage; test; coverageReport; coverageAggregate;"
Expand Down
60 changes: 30 additions & 30 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
scalaVersion := "2.13.10"
scalaVersion := "2.13.13"

enablePlugins(JavaServerAppPackaging)
enablePlugins(DockerPlugin)
Expand Down Expand Up @@ -27,24 +27,24 @@ import java.text.SimpleDateFormat
import java.util.Calendar


val specs2V = "4.19.0" // based on spray 1.3.x built in support
val specs2V = "4.20.5" // based on spray 1.3.x built in support
val akkaV = "2.7.+"

val sprayV = "1.3.+"
val scalalikeV = "4.0.0"
val akkaHttpVersion = "10.2.10"
val akkaVersion = "2.7.0"
val testContainersVersion = "1.17.6"
val scalalikeV = "4.2.1"
val akkaHttpVersion = "10.5.3"
val akkaVersion = "2.8.5"
val testContainersVersion = "1.19.7"

resolvers += Resolver.typesafeRepo("releases")

val buildSettings = Seq(
scalariformPreferences := scalariformPreferences.value
.setPreference(DanglingCloseParenthesis, Force)
.setPreference(AlignSingleLineCaseStatements, true),
organization := "ch.openolitor.scalamacros",
version := "2.6.28",
scalaVersion := "2.13.10",
crossScalaVersions := Seq("2.13.8", "2.13.10"),
version := "2.6.29",
scalaVersion := "2.13.13",
crossScalaVersions := Seq("2.13.8", "2.13.13"),
resolvers ++= Resolver.sonatypeOssRepos("snapshots"),
resolvers ++= Resolver.sonatypeOssRepos("releases"),
resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/",
Expand All @@ -53,7 +53,7 @@ val buildSettings = Seq(

libraryDependencies ++= {
Seq(
"org.scala-lang.modules" %% "scala-xml" % "2.1.0",
"org.scala-lang.modules" %% "scala-xml" % "2.2.0",
"javax.xml.bind" % "jaxb-api" % "2.3.1",
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http-caching" % akkaHttpVersion,
Expand All @@ -73,21 +73,21 @@ val buildSettings = Seq(
"org.specs2" %% "specs2-junit" % specs2V % "test",
"org.specs2" %% "specs2-scalacheck" % specs2V % "test",
"org.mockito" %% "mockito-scala" % "1.17.7" % "test",
"org.scalaz" %% "scalaz-core" % "7.3.6", // ### Scala 3
"org.scalaz" %% "scalaz-core" % "7.3.8", // ### Scala 3
//use scala logging to log outside of the actor system
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5", // ### Scala 3
"org.scalikejdbc" %% "scalikejdbc-async" % "0.15.0",
"org.scalikejdbc" %% "scalikejdbc-async" % "0.19.0",
"org.scalikejdbc" %% "scalikejdbc-config" % scalalikeV, // ### Scala 3
"org.scalikejdbc" %% "scalikejdbc-test" % scalalikeV % "test", // ### Scala 3
"org.scalikejdbc" %% "scalikejdbc-syntax-support-macro" % scalalikeV, // ### Scala 3
"org.scalikejdbc" %% "scalikejdbc-joda-time" % scalalikeV, // ### Scala 3
"com.github.jasync-sql" % "jasync-mysql" % "2.1.+",
"com.github.jasync-sql" % "jasync-mysql" % "2.2.4",
"com.h2database" % "h2" % "2.1.214" % "test",
"org.testcontainers" % "mariadb" % testContainersVersion % "test",
"io.findify" %% "s3mock" % "0.2.6" % "test",
"ch.qos.logback" % "logback-classic" % "1.4.5",
"org.mariadb.jdbc" % "mariadb-java-client" % "3.1.0",
"mysql" % "mysql-connector-java" % "8.0.31",
"ch.qos.logback" % "logback-classic" % "1.5.3",
"org.mariadb.jdbc" % "mariadb-java-client" % "3.1.4",
"mysql" % "mysql-connector-java" % "8.0.33",
// Libreoffice document API
"org.odftoolkit" % "simple-odf" % "0.9.0" withSources(),
"com.scalapenos" %% "stamina-json" % "0.1.6", // ### NO Scala 3
Expand All @@ -100,27 +100,27 @@ val buildSettings = Seq(
"com.github.blemale" %% "scaffeine" % "5.2.1", // ### Scala 3
"de.zalando" %% "beard" % "0.3.3" exclude("ch.qos.logback", "logback-classic") from "https://github.com/OpenOlitor/beard/releases/download/0.3.3/beard_2.13-0.3.3.jar", // ### NO Scala 3, NO Scala 2.13
// transitive dependencies of legacy de.zalando.beard
"org.antlr" % "antlr4" % "4.8-1",
"io.monix" %% "monix" % "3.4.0", // ### Scala 3
"net.codecrete.qrbill" % "qrbill-generator" % "2.4.3",
"io.nayuki" % "qrcodegen" % "1.6.0",
"org.apache.pdfbox" % "pdfbox" % "2.0.26",
"org.apache.pdfbox" % "pdfbox-parent" % "2.0.26" pomOnly(),
"org.apache.xmlgraphics" % "batik-transcoder" % "1.16",
"org.apache.xmlgraphics" % "batik-codec" % "1.16",
"org.antlr" % "antlr4" % "4.13.1",
"io.monix" %% "monix" % "3.4.1", // ### Scala 3
"net.codecrete.qrbill" % "qrbill-generator" % "3.2.0",
"io.nayuki" % "qrcodegen" % "1.8.0",
"org.apache.pdfbox" % "pdfbox" % "2.0.30",
"org.apache.pdfbox" % "pdfbox-parent" % "2.0.30" pomOnly(),
"org.apache.xmlgraphics" % "batik-transcoder" % "1.17",
"org.apache.xmlgraphics" % "batik-codec" % "1.17",
"com.tegonal" %% "cf-env-config-loader" % "1.1.2", // ### NO Scala 3, NO Scala 2.13
"com.eatthepath" % "java-otp" % "0.4.0",
"org.apache.pdfbox" % "pdfbox-tools" % "2.0.27"
"org.apache.pdfbox" % "pdfbox-tools" % "2.0.30"
)
},
dependencyOverrides ++= Seq(
"org.scala-lang.modules" %% "scala-parser-combinators" % "2.1.1",
"xerces" % "xercesImpl" % "2.12.2",
"org.apache.commons" % "commons-compress" % "1.22",
"io.netty" % "netty-handler" % "4.1.85.Final",
"org.apache.commons" % "commons-compress" % "1.26.0",
"io.netty" % "netty-handler" % "4.1.107.Final",
"org.apache.jena" % "jena-core" % "4.6.1",
"com.google.protobuf" % "protobuf-java" % "3.21.10",
"com.google.guava" % "guava" % "31.1-jre"
"com.google.guava" % "guava" % "33.0.0-jre"
)
)

Expand Down Expand Up @@ -189,7 +189,7 @@ val updateLatest = sys.env.get("DOCKER_UPDATE_LATEST") match {
}

dockerUpdateLatest := updateLatest
dockerBaseImage := "eclipse-temurin:17-alpine"
dockerBaseImage := "eclipse-temurin:21-alpine"
dockerExposedPorts ++= Seq(9003)

// the directories created, e.g. /var/log/openolitor-server, are created using user id 1000,
Expand Down
3 changes: 2 additions & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
sbt.version=1.8.0
sbt.version=1.9.9

10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.11")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16")

addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.3")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")

addSbtPlugin("org.scalaxb" % "sbt-scalaxb" % "1.9.0")
addSbtPlugin("org.scalaxb" % "sbt-scalaxb" % "1.12.0")

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.0.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.5")
//addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.5.10")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.6")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.11")

dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.1.0"
dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "2.2.0"
37 changes: 22 additions & 15 deletions scalastyle-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,28 @@
</check>
<check level="warning" class="org.scalastyle.file.HeaderMatchesChecker" enabled="true">
<parameters>
<parameter name="header"><![CDATA[// Copyright (C) 2011-2012 the original author or authors.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.]]></parameter>
<parameter name="header"><![CDATA[/* *\
* ____ ____ ___ __ *
* / __ \____ ___ ____ / __ \/ (_) /_____ _____ *
* / / / / __ \/ _ \/ __ \/ / / / / / __/ __ \/ ___/ OpenOlitor *
* / /_/ / /_/ / __/ / / / /_/ / / / /_/ /_/ / / contributed by tegonal *
* \____/ .___/\___/_/ /_/\____/_/_/\__/\____/_/ http://openolitor.ch *
* /_/ *
* *
* 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 http://www.gnu.org/licenses/ *
* *
\* */]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.SpacesAfterPlusChecker" enabled="true"></check>
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ openolitor {
slick {
profile = "slick.jdbc.MySQLProfile$"
db {
url = "jdbc:mysql://localhost:3306/csa1?cachePrepStmts=true&cacheCallableStmts=true&cacheServerConfiguration=true&useLocalSessionState=true&elideSetAutoCommits=true&alwaysSendSetIsolation=false&enableQueryTimeouts=false&connectionAttributes=none&verifyServerCertificate=false&useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&useLegacyDatetimeCode=false&serverTimezone=UTC&rewriteBatchedStatements=true"
user = "user_csa1"
password = "changeThisPasswrod"
url = "jdbc:mysql://localhost:3307/try?cachePrepStmts=true&cacheCallableStmts=true&cacheServerConfiguration=true&useLocalSessionState=true&elideSetAutoCommits=true&alwaysSendSetIsolation=false&enableQueryTimeouts=false&connectionAttributes=none&verifyServerCertificate=false&useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&useLegacyDatetimeCode=false&serverTimezone=UTC&rewriteBatchedStatements=true"
user = "super"
password = "thedefaultdbpasswordneedstobechanged"
driver = "com.mysql.cj.jdbc.Driver"
connectionPool = HikariCP
numThreads = 5
Expand All @@ -320,10 +320,10 @@ openolitor {
# Mandant specific db settings
db: {
default: {
url = "jdbc:mysql://localhost:3306/csa1"
url = "jdbc:mysql://localhost:3307/try"
driver = "com.mysql.cj.jdbc.Driver"
user = "user_csa1"
password = "changeThisPasswrod"
user = "super"
password = "thedefaultdbpasswordneedstobechanged"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import ch.openolitor.arbeitseinsatz.ArbeitseinsatzCommandHandler._
import ch.openolitor.core._
import ch.openolitor.core.db._
import ch.openolitor.core.domain._
import ch.openolitor.stammdaten.EmailHandler
import ch.openolitor.stammdaten.MailCommandForwarder
import akka.util.Timeout

import scala.concurrent.duration._
Expand All @@ -42,39 +42,22 @@ import ch.openolitor.core.repositories.EventPublishingImplicits._
import scala.concurrent.ExecutionContext.Implicits._

object ArbeitseinsatzAktionenService {
def apply(implicit sysConfig: SystemConfig, system: ActorSystem, mailService: ActorRef): ArbeitseinsatzAktionenService = new DefaultArbeitseinsatzAktionenService(sysConfig, system, mailService)
def apply(implicit sysConfig: SystemConfig, system: ActorSystem): ArbeitseinsatzAktionenService = new DefaultArbeitseinsatzAktionenService(sysConfig, system)
}

class DefaultArbeitseinsatzAktionenService(sysConfig: SystemConfig, override val system: ActorSystem, override val mailService: ActorRef)
extends ArbeitseinsatzAktionenService(sysConfig, mailService) with DefaultArbeitseinsatzWriteRepositoryComponent {
class DefaultArbeitseinsatzAktionenService(sysConfig: SystemConfig, override val system: ActorSystem)
extends ArbeitseinsatzAktionenService(sysConfig) with DefaultArbeitseinsatzWriteRepositoryComponent {
}

/**
* Actor zum Verarbeiten der Aktionen für das Arbeitseinsatz Modul
*/
class ArbeitseinsatzAktionenService(override val sysConfig: SystemConfig, override val mailService: ActorRef) extends EventService[PersistentEvent] with LazyLogging with AsyncConnectionPoolContextAware with EmailHandler
with ArbeitseinsatzDBMappings with MailServiceReference with ArbeitseinsatzEventStoreSerializer {
class ArbeitseinsatzAktionenService(override val sysConfig: SystemConfig) extends EventService[PersistentEvent] with LazyLogging with AsyncConnectionPoolContextAware
with ArbeitseinsatzDBMappings with ArbeitseinsatzEventStoreSerializer {
self: ArbeitseinsatzWriteRepositoryComponent =>

implicit val timeout = Timeout(15.seconds) //sending mails might take a little longer

val handle: Handle = {
case SendEmailToArbeitsangebotPersonenEvent(meta, subject, body, replyTo, context) =>
checkBccAndSend(meta, subject, body, replyTo, context.person, context, mailService)
case e =>
logger.warn(s"Unknown event:$e")
}

protected def checkBccAndSend(meta: EventMetadata, subject: String, body: String, replyTo: Option[String], person: PersonEmailData, context: Product, mailService: ActorRef)(implicit originator: PersonId = meta.originator): Unit = {
DB localTxPostPublish { implicit session => implicit publisher =>
lazy val bccAddress = config.getString("smtp.bcc")
arbeitseinsatzWriteRepository.getProjekt map { projekt: Projekt =>
projekt.sendEmailToBcc match {
case true => sendEmail(meta, subject, body, replyTo, Some(bccAddress), person, None, context, mailService)
case false => sendEmail(meta, subject, body, replyTo, None, person, None, context, mailService)
}
}
}
}

}
Loading

0 comments on commit 14620dc

Please sign in to comment.