From 1f5343428b60dde1f6cc9b12ae9ca17831e145b2 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Thu, 21 Apr 2022 21:47:49 +0200 Subject: [PATCH 1/6] bugfixes --- pom.xml | 2 +- src/main/java/de/srsoftware/widerhall/data/Database.java | 2 +- .../java/de/srsoftware/widerhall/data/DatabaseTest.java | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index c00c192..2a93c53 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.example Widerhall - 0.2.2 + 0.2.3 diff --git a/src/main/java/de/srsoftware/widerhall/data/Database.java b/src/main/java/de/srsoftware/widerhall/data/Database.java index 31e143e..c7af879 100644 --- a/src/main/java/de/srsoftware/widerhall/data/Database.java +++ b/src/main/java/de/srsoftware/widerhall/data/Database.java @@ -133,7 +133,7 @@ public class Database { @Override protected Request clone() { - Request clone = new Request(sql); + Request clone = new Request(new StringBuilder(sql)); clone.where.putAll(where); clone.values.putAll(values); return clone; diff --git a/src/test/java/de/srsoftware/widerhall/data/DatabaseTest.java b/src/test/java/de/srsoftware/widerhall/data/DatabaseTest.java index 5ba1279..3d3da66 100644 --- a/src/test/java/de/srsoftware/widerhall/data/DatabaseTest.java +++ b/src/test/java/de/srsoftware/widerhall/data/DatabaseTest.java @@ -50,8 +50,8 @@ public class DatabaseTest extends TestCase { } public void testUpdate(){ - assertEquals("UPDATE Test",Database.open().update("Test").sql()); - assertEquals("UPDATE Test SET x = 5",Database.open().update("Test").set("x",5).sql()); - assertEquals("UPDATE Test SET x = 5, y = 6",Database.open().update("Test").set("x",5).set("y",6).sql()); + assertEquals("UPDATE Test",Database.open().update("Test").compile().toString()); + assertEquals("UPDATE Test SET x = 5",Database.open().update("Test").set("x",5).compile().toString()); + assertEquals("UPDATE Test SET x = 5, y = 6",Database.open().update("Test").set("x",5).set("y",6).compile().toString()); } -} \ No newline at end of file +} From d522e32f377550fa2cb89aaf3de4579d0a58e9c8 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Thu, 21 Apr 2022 21:55:58 +0200 Subject: [PATCH 2/6] added maven-jar-plugin to pom.xml --- pom.xml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2a93c53..fb6b050 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.example Widerhall - 0.2.3 + 0.2.4 @@ -17,6 +17,18 @@ 16 + + org.apache.maven.plugins + maven-jar-plugin + + + + true + de.srsoftware.widerhall.Application + + + + From 483bd48d2d72433bbc7d421b0f421e8f46547015 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Thu, 21 Apr 2022 22:05:03 +0200 Subject: [PATCH 3/6] altering maven to provide executable jar --- pom.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index fb6b050..8f3ca66 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.example Widerhall - 0.2.4 + 0.2.5 @@ -18,15 +18,16 @@ - org.apache.maven.plugins - maven-jar-plugin + maven-assembly-plugin - true de.srsoftware.widerhall.Application + + jar-with-dependencies + From 3e5a7390525d111d901ad491fa1c4b5aa840ed7e Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Thu, 21 Apr 2022 22:15:11 +0200 Subject: [PATCH 4/6] added debug output --- pom.xml | 2 +- src/main/java/de/srsoftware/widerhall/Configuration.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8f3ca66..6d13828 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.example Widerhall - 0.2.5 + 0.2.6 diff --git a/src/main/java/de/srsoftware/widerhall/Configuration.java b/src/main/java/de/srsoftware/widerhall/Configuration.java index 0acb2fa..c0b9d29 100644 --- a/src/main/java/de/srsoftware/widerhall/Configuration.java +++ b/src/main/java/de/srsoftware/widerhall/Configuration.java @@ -33,6 +33,7 @@ public class Configuration { public Configuration load(File file) { this.file = file; if (file.exists()) try { + LOG.info("Loading configuration from {}",file); var newVals = (JSONObject) new JSONParser().parse(Files.readString(file.toPath())); data.putAll(newVals); } catch (ParseException | IOException e){ From c9ba176a91b8f518dcd45027922a6f599baa8140 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Thu, 21 Apr 2022 22:46:23 +0200 Subject: [PATCH 5/6] updated pom --- pom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6d13828..b25221e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,12 +6,13 @@ org.example Widerhall - 0.2.6 + 0.2.7 org.apache.maven.plugins maven-compiler-plugin + 3.10.1 16 16 @@ -19,6 +20,7 @@ maven-assembly-plugin + 3.3.0 From db057c16a4789abaa5f8a83babbf50f00827afe6 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Thu, 21 Apr 2022 23:03:43 +0200 Subject: [PATCH 6/6] added Dockerfile, fixed css ids --- Dockerfile | 21 +++++++++++++++++++++ pom.xml | 2 +- static/templates/css.st | 3 ++- static/templates/register.st | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d6a66cd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM alpine:3.15 +MAINTAINER Stephan Richter + +RUN apk add --no-cache --update bash git maven openjdk17 + +# get the sources +RUN git clone https://git.srsoftware.de/StephanRichter/Widerhall.git +WORKDIR Widerhall + +# compile +RUN mvn --no-transfer-progress clean test compile assembly:single +RUN ln -s target/*.jar widerhall.jar + +# configure +RUN mkdir /data +RUN echo '{"locations":{"database":"/data/widerhall.sqlite3","configuration":"/data/widerhall.config.json","archive":"/data/archive","base":"/Widerhall"}}' > config/config.json + +# get JQUERY +RUN wget https://code.jquery.com/jquery-3.6.0.min.js -O static/jquery-3.6.0.min.js + +CMD java -jar widerhall.jar \ No newline at end of file diff --git a/pom.xml b/pom.xml index b25221e..24df9ef 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.example Widerhall - 0.2.7 + 0.2.8 diff --git a/static/templates/css.st b/static/templates/css.st index 24211fc..606bcdb 100644 --- a/static/templates/css.st +++ b/static/templates/css.st @@ -3,7 +3,8 @@ label { margin: 5px 0; } -#login form { +#login form, +#register form{ width: 450px; margin: 0 auto; } diff --git a/static/templates/register.st b/static/templates/register.st index c716bab..dabc911 100644 --- a/static/templates/register.st +++ b/static/templates/register.st @@ -6,7 +6,7 @@ - + «navigation()» «userinfo()»

Widerhall user registration