Skip to content

Commit

Permalink
v0.16.0 (see NEWS)
Browse files Browse the repository at this point in the history
  • Loading branch information
nondeterministic committed Jan 13, 2024
1 parent a12696a commit a3aef45
Show file tree
Hide file tree
Showing 35 changed files with 914 additions and 886 deletions.
14 changes: 8 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
image: eclipse-temurin:11
image: eclipse-temurin:17

services:
- postgres:11

variables:
SBT_VERSION: "1.9.7"
OOREP_DB_PASS: test
OOREP_DB_HOST: postgres
OOREP_DB_PORT: 5432
Expand All @@ -15,14 +16,15 @@ variables:
PGPASSWORD: test

before_script:
# Install SBT
- wget https://scala.jfrog.io/artifactory/debian/sbt-1.3.4.deb
- dpkg -i sbt-1.3.4.deb
- apt-get update -y
- apt-get install -y zip unzip
- wget https://github.com/sbt/sbt/releases/download/v${SBT_VERSION}/sbt-${SBT_VERSION}.zip
- unzip sbt-${SBT_VERSION}.zip

build:
script:
- sbt ++2.13.1 compile
- sbt ++2.13.1 dist
- ./sbt/bin/sbt ++2.13.12 compile
- ./sbt/bin/sbt ++2.13.12 dist

# Testing currently only works from within IntelliJ.
#
Expand Down
23 changes: 18 additions & 5 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@
██║ ╚████║███████╗╚███╔███╔╝███████║
╚═╝ ╚═══╝╚══════╝ ╚══╝╚══╝ ╚══════╝

v0.15.0 Sa 16. Sep 13:36:29 CEST 2023
v0.16.0 (development) Sa 13. Jan 14:28:21 CET 2024
--------------------------------------------------------
- Main features:
- Update to Java 17, Play 2.9 and sbt 1.9
- Update to ScalaJS 1.15.0 and Scala 2.13.12
- Replaced unmaintained RosHTTP library with sttp
- Removed unmaintained scalatags-rx library (as we want to use
Laminar in the future)

- Minor improvements and changes:
- Routinely updated a bunch of other library versions, where it
didn't hurt or require huge code restructurings

v0.15.0 (stable) Sa 16. Sep 13:36:29 CEST 2023
--------------------------------------------------------
- Main features:
- Change of database schema (not a user visible one, but
Expand All @@ -37,7 +50,7 @@ v0.15.0 Sa 16. Sep 13:36:29 CEST 2023
- OOREP would often crash after any kind of network transmission
error, whereas now it fails more gracefully

v0.14.2 Mo 15. Mai 18:31:05 CEST 2023
v0.14.2 (stable) Mo 15. Mai 18:31:05 CEST 2023
--------------------------------------------------------
- Minor improvements and changes:
- Prevent anonymous users from accessing protected materia medicas
Expand All @@ -55,7 +68,7 @@ v0.14.2 Mo 15. Mai 18:31:05 CEST 2023
- Logged-in users can now access "protected" but not "private" resources
(useful for preview of resources to selected testers, etc.)

v0.14.1 Sat Jan 21 11:11:56 CET 2023
v0.14.1 (stable) Sat Jan 21 11:11:56 CET 2023
--------------------------------------------------------
- Minor improvements and changes:
- Update FAQ with example searches
Expand All @@ -66,7 +79,7 @@ v0.14.1 Sat Jan 21 11:11:56 CET 2023
search
- Sharing of search link would fail when quotation marks were used

v0.14.0 Wed Dec 28 17:39:17 CET 2022
v0.14.0 (stable) Wed Dec 28 17:39:17 CET 2022
--------------------------------------------------------
- Main features:
- Buttons for sharing repertory search results and opening them in
Expand All @@ -86,7 +99,7 @@ v0.14.0 Wed Dec 28 17:39:17 CET 2022
- Fix race condition that would prevent public link to repertory
search from loading

v0.13.0 Thu May 26 12:13:11 PM CEST 2022
v0.13.0 (stable) Thu May 26 12:13:11 PM CEST 2022
--------------------------------------------------------
- Main features:
- Not really a user-visible one: but now would require
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ can also be found at https://www.oorep.com/.
## Current status / what's new

Besides the aforementioned homepage, check out the [NEWS](NEWS) file for the
latest development updates.
latest development updates. (You may want to to focus on releases marked as 'stable'.)

## Running the program

Expand Down Expand Up @@ -39,9 +39,9 @@ intended for any production environments or the like without further modificatio

#### Prerequisites

* Java SDK versions 8 or 11
* Scala Build Tool SBT >= 1.3.0
* A PostgreSQL database server >= 9.6
* Java SDK >= v17
* Scala Build Tool SBT >= v1.9.7
* A PostgreSQL database server >= v11

Before executing SBT, the database (which is provided here as an SQL dump) needs
to be up and running and PostgreSQL's pgcrypto-extension created (e.g., as
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Delete @Inject()(cc: ControllerComponents, dbContext: DBContext) extends A
def apiSecDelCaseRubricsFromCaze() = Action { request: Request[AnyContent] =>
getAuthenticatedUser(request) match {
case Some(_) => {
val requestData = request.body.asMultipartFormData.get.dataParts
val requestData = request.body.asFormUrlEncoded.get

(requestData("memberID"), requestData("caseID"), requestData("caserubrics")) match {
case (Seq(memberIdStr), Seq(cazeIDStr), Seq(caserubricsJson)) if (cazeIDStr.forall(_.isDigit) && (memberIdStr.forall(_.isDigit))) =>
Expand Down Expand Up @@ -50,7 +50,7 @@ class Delete @Inject()(cc: ControllerComponents, dbContext: DBContext) extends A
def apiSecDelCaze() = Action { request: Request[AnyContent] =>
getAuthenticatedUser(request) match {
case Some(_) => {
val requestData = request.body.asMultipartFormData.get.dataParts
val requestData = request.body.asFormUrlEncoded.get

(requestData("caseId"), requestData("memberId")) match {
case (Seq(caseIdStr), Seq(memberIdStr)) if (caseIdStr.forall(_.isDigit) && (memberIdStr.forall(_.isDigit))) =>
Expand All @@ -73,7 +73,7 @@ class Delete @Inject()(cc: ControllerComponents, dbContext: DBContext) extends A
def apiSecDelFileAndCases() = Action { request: Request[AnyContent] =>
getAuthenticatedUser(request) match {
case Some(_) => {
val requestData = request.body.asMultipartFormData.get.dataParts
val requestData = request.body.asFormUrlEncoded.get

(requestData("memberId"), requestData("fileId")) match {
case (Seq(memberIdStr), Seq(fileIdStr)) if (fileIdStr.forall(_.isDigit) && (memberIdStr.forall(_.isDigit))) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class Post @Inject()(cc: ControllerComponents, dbContext: DBContext) extends Abs
def saveCaze() = Action { request: Request[AnyContent] =>
getAuthenticatedUser(request) match {
case Some(_) => {
val requestData = request.body.asMultipartFormData.get.dataParts
val requestData = request.body.asFormUrlEncoded.get
(requestData("fileId"), requestData("case").toList) match {
case (Seq(fileId), cazeJson :: Nil) => {
Caze.decode(cazeJson.toString) match {
Expand Down Expand Up @@ -223,7 +223,7 @@ class Post @Inject()(cc: ControllerComponents, dbContext: DBContext) extends Abs
def addCaseRubricsToCaze() = Action { request: Request[AnyContent] =>
getAuthenticatedUser(request) match {
case Some(_) => {
val requestData = request.body.asMultipartFormData.get.dataParts
val requestData = request.body.asFormUrlEncoded.get

(requestData("memberID"), requestData("caseID"), requestData("caserubrics")) match {
case (Seq(memberIdStr), Seq(cazeIDStr), Seq(caserubricsJson)) if (cazeIDStr.forall(_.isDigit) && (memberIdStr.forall(_.isDigit))) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Put @Inject()(cc: ControllerComponents, dbContext: DBContext) extends Abst
def updateCaseRubricsUserDefinedValues() = Action { implicit request: Request[AnyContent] =>
getAuthenticatedUser(request) match {
case Some(_) => {
val requestData = request.body.asMultipartFormData.get.dataParts
val requestData = request.body.asFormUrlEncoded.get

(requestData("memberID"), requestData("caseID"), requestData("caserubrics")) match {
case (Seq(memberIdStr), Seq(cazeIDStr), Seq(caserubricsJson)) if (cazeIDStr.forall(_.isDigit) && (memberIdStr.forall(_.isDigit))) =>
Expand Down Expand Up @@ -51,7 +51,7 @@ class Put @Inject()(cc: ControllerComponents, dbContext: DBContext) extends Abst
def updateCaseDescription() = Action { implicit request =>
getAuthenticatedUser(request) match {
case Some(_) => {
val requestData = request.body.asMultipartFormData.get.dataParts
val requestData = request.body.asFormUrlEncoded.get

(requestData("memberID"), requestData("caseID"), requestData("casedescription")) match {
case (Seq(memberIdStr), Seq(cazeIDStr), Seq(casedescription)) if (cazeIDStr.forall(_.isDigit) && (memberIdStr.forall(_.isDigit))) =>
Expand Down Expand Up @@ -80,7 +80,8 @@ class Put @Inject()(cc: ControllerComponents, dbContext: DBContext) extends Abst
def updateFileDescription() = Action { implicit request =>
getAuthenticatedUser(request) match {
case Some(_) => {
val requestData = request.body.asMultipartFormData.get.dataParts
val requestData = request.body.asFormUrlEncoded.get

(requestData("filedescr"), requestData("fileId")) match {
case (Seq(filedescr), Seq(fileId)) if (fileId.forall(_.isDigit)) =>
// Get file from DB to extract a memberId for authorisation
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/index_changepassword.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h1 style="font-size:20pt;">
<!-- Load JavaScript application first (e.g., in case of /show?), then execute below script. -->
<script id="main_script" data-landing="change_password"
data-memberid="@memberId" data-pcrid="@pcrId"
src="/assets/frontend-opt.js"></script>
src="/assets/frontend-opt/main.js"></script>

@partial.disclaimer()

Expand Down
4 changes: 2 additions & 2 deletions backend/app/views/index_landing.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ <h1 style="font-size:20pt;">

@if(org.multics.baueran.frep.backend.controllers.getAuthenticatedUser(request) == None) {

<script async id="main_script" src="/assets/frontend-opt.js"></script>
<script async id="main_script" src="/assets/frontend-opt/main.js"></script>

@partial.about()

@partial.features()

} else {

<script async id="main_script" src="/assets/sec_frontend-opt.js"></script>
<script async id="main_script" src="/assets/sec_frontend-opt/main.js"></script>

}

Expand Down
4 changes: 2 additions & 2 deletions backend/app/views/index_lookup.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ <h1 style="font-size:20pt;">

<script id="main_script" data-landing="lookup_rep"
data-repertory="@repertory" data-symptom="@symptom" data-page="@page" data-remedystring="@remedyString" data-minweight="@minWeight"
src="/assets/frontend-opt.js"></script>
src="/assets/frontend-opt/main.js"></script>

} else {

<script id="main_script" data-landing="lookup_rep"
data-repertory="@repertory" data-symptom="@symptom" data-page="@page" data-remedystring="@remedyString" data-minweight="@minWeight"
src="/assets/sec_frontend-opt.js"></script>
src="/assets/sec_frontend-opt/main.js"></script>

}
}
4 changes: 2 additions & 2 deletions backend/app/views/index_lookup_mm.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ <h1 style="font-size:20pt;">

<script id="main_script" data-landing="lookup_mm"
data-mm="@materiaMedica" data-symptom="@symptom" data-page="@page" data-hidesections="@hideSections" data-remedystring="@remedyString"
src="/assets/frontend-opt.js"></script>
src="/assets/frontend-opt/main.js"></script>

} else {

<script id="main_script" data-landing="lookup_mm"
data-mm="@materiaMedica" data-symptom="@symptom" data-page="@page" data-hidesections="@hideSections" data-remedystring="@remedyString"
src="/assets/sec_frontend-opt.js"></script>
src="/assets/sec_frontend-opt/main.js"></script>

}

Expand Down
4 changes: 2 additions & 2 deletions backend/app/views/index_static_content.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

@if(org.multics.baueran.frep.backend.controllers.getAuthenticatedUser(request) == None) {

<script async id="main_script" src="/assets/frontend-opt.js"></script>
<script async id="main_script" src="/assets/frontend-opt/main.js"></script>

} else {

<script async id="main_script" src="/assets/sec_frontend-opt.js"></script>
<script async id="main_script" src="/assets/sec_frontend-opt/main.js"></script>

}

Expand Down
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.2
sbt.version=1.9.7
53 changes: 22 additions & 31 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
import sbt.Keys.libraryDependencies

val myScalaVersion = "2.13.11"
val myScalaVersion = "2.13.12"
val scalaTestPlusVersion = "5.1.0"
val scalaJsDomVersion = "1.2.0"
val scalaTagsVersion = "0.9.4" // Can't seem to go higher than that as ScalaTagsRx then breaks...
val scalatagsrxVersion = "0.5.0"
val scalaJsDomVersion = "2.3.0"
val scalaTagsVersion = "0.12.0"
val circeVersion = "0.14.5"
val rosHttpVersion = "3.0.0"
val quillVersion = "4.6.1"
val pgDriverVersion = "42.5.4"
val quillVersion = "4.8.0"
val pgDriverVersion = "42.7.1"
val scriptsVersion = "1.2.0"
val apacheCommonsMailV = "1.5"
val scalarxVersion = "0.4.3"
val sttpVersion = "4.0.0-M8"
val monixVersion = "3.2.1"

useJCenter := true

ThisBuild / scalaVersion := myScalaVersion
ThisBuild / evictionErrorLevel := Level.Info

scalaJSStage in Global := FullOptStage

lazy val backend = (project in file("backend")).settings(commonSettings).settings(
scalaJSProjects := Seq(frontend, sec_frontend),
Assets / pipelineStages := Seq(scalaJSPipeline),
pipelineStages := Seq(scalaJSProd, gzip),
Assets / pipelineStages := Seq(scalaJSPipeline, gzip),
pipelineStages := Seq(digest, gzip),
// triggers scalaJSPipeline when using compile or continuous compilation
Compile / compile := ((Compile / compile) dependsOn scalaJSPipeline).value,
scalaJSStage := FullOptStage,
scalaJSPipeline / isDevMode := false,

libraryDependencies ++= Seq(
"com.vmunier" %% "scalajs-scripts" % scriptsVersion,
Expand All @@ -40,8 +42,8 @@ lazy val backend = (project in file("backend")).settings(commonSettings).setting
guice,
specs2 % Test
)
).enablePlugins(PlayScala)
.dependsOn(sharedJvm)
).enablePlugins(PlayScala, SbtWeb)
.dependsOn(shared.jvm)

lazy val frontend = (project in file("frontend")).settings(commonSettings).settings(
scalaJSUseMainModuleInitializer := true,
Expand All @@ -53,11 +55,10 @@ lazy val frontend = (project in file("frontend")).settings(commonSettings).setti
"io.circe" %%% "circe-core" % circeVersion,
"io.circe" %%% "circe-generic" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion,
"com.github.nondeterministic" %%% "roshttp" % rosHttpVersion,
"com.timushev" %%% "scalatags-rx" % scalatagsrxVersion
"com.softwaremill.sttp.client4" %%% "core" % sttpVersion
),
).enablePlugins(ScalaJSPlugin, ScalaJSWeb)
.dependsOn(sharedJs)
.dependsOn(shared.js)

lazy val sec_frontend = (project in file("sec_frontend")).settings(commonSettings).settings(
scalaJSUseMainModuleInitializer := true,
Expand All @@ -68,11 +69,10 @@ lazy val sec_frontend = (project in file("sec_frontend")).settings(commonSetting
"io.circe" %%% "circe-core" % circeVersion,
"io.circe" %%% "circe-generic" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion,
"com.github.nondeterministic" %%% "roshttp" % rosHttpVersion,
"com.timushev" %%% "scalatags-rx" % scalatagsrxVersion
"com.softwaremill.sttp.client4" %%% "core" % sttpVersion
),
).enablePlugins(ScalaJSPlugin, ScalaJSWeb)
.dependsOn(sharedJs)
.dependsOn(shared.js)

lazy val shared = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
Expand All @@ -83,32 +83,23 @@ lazy val shared = crossProject(JSPlatform, JVMPlatform)
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"org.scala-js" %%% "scalajs-dom" % scalaJsDomVersion,
"com.lihaoyi" %%% "scalarx" % scalarxVersion,
"com.lihaoyi" %%% "scalatags" % scalaTagsVersion,
"com.github.nondeterministic" %%% "roshttp" % rosHttpVersion,
"com.timushev" %%% "scalatags-rx" % scalatagsrxVersion,
"com.softwaremill.sttp.client4" %%% "core" % sttpVersion,
"io.monix" %%% "monix" % monixVersion,
"org.scalatestplus.play" %% "scalatestplus-play" % scalaTestPlusVersion % "test",
guice,
specs2 % Test
),
)
.enablePlugins(ScalaJSPlugin, ScalaJSWeb)

lazy val sharedJvm = shared.jvm
lazy val sharedJs = shared.js
lazy val commonSettings = Seq(
scalaVersion := myScalaVersion,
organization := "org.multics.baueran.frep",
maintainer := "baueran@gmail.com",
version := "0.15.0"
version := "0.16.0"
)

// TODO: This doesn't work, and I can't be bothered to get it to work.
// It turns out Akka has default chunk size of 1MB whereas RosHttp only had 8192 bytes.
//
// https://discuss.lightbend.com/t/how-to-adjust-the-max-upload-chunk-size-in-play/2260
// https://www.playframework.com/documentation/2.8.x/ConfigFile
// import PlayKeys._
// PlayKeys.devSettings += "akka.http.parsing.max-chunk-size" -> "8192 b"

// loads the frontend project at sbt startup
onLoad in Global := (onLoad in Global).value andThen {s: State => "project backend" :: s}
2 changes: 1 addition & 1 deletion docker/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=0.15.0
VERSION=0.16.0
2 changes: 1 addition & 1 deletion docker/oorep_app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:11
FROM eclipse-temurin:17

ARG VERSION
ARG PLAYDIR=/usr/local
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.2
sbt.version=1.9.7
Loading

0 comments on commit a3aef45

Please sign in to comment.