From 9faf43a6c4b933b5f97be4348d461bf91f5bf2e2 Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Mon, 24 Oct 2022 01:09:32 +0300
Subject: Spring Boot 3
---
.gitignore | 1 -
.settings/org.eclipse.jdt.core.prefs | 10 -
pom.xml | 738 +++++++++++----------
src/main/assets/scripts.js | 2 +
src/main/java/com/cliqset/xrd/Alias.java | 11 +-
src/main/java/com/cliqset/xrd/Expires.java | 2 +-
src/main/java/com/cliqset/xrd/Link.java | 14 +-
src/main/java/com/cliqset/xrd/Property.java | 12 +-
src/main/java/com/cliqset/xrd/Subject.java | 10 +-
src/main/java/com/cliqset/xrd/Title.java | 2 +-
src/main/java/com/cliqset/xrd/XRD.java | 6 +-
src/main/java/com/cliqset/xrd/package-info.java | 6 +-
src/main/java/com/juick/ActivityPubManager.java | 4 +-
src/main/java/com/juick/EmailManager.java | 20 +-
src/main/java/com/juick/TelegramBotManager.java | 2 +-
src/main/java/com/juick/XMPPManager.java | 6 +-
.../config/ActivityPubClientErrorHandler.java | 3 +-
.../java/com/juick/config/ActivityPubConfig.java | 3 +-
.../java/com/juick/config/HttpClientConfig.java | 51 +-
src/main/java/com/juick/config/SecurityConfig.java | 236 +++----
src/main/java/com/juick/config/WebConfig.java | 13 +-
src/main/java/com/juick/model/Message.java | 12 +-
src/main/java/com/juick/model/Tag.java | 7 +-
src/main/java/com/juick/model/User.java | 10 +-
src/main/java/com/juick/model/package-info.java | 6 +-
.../java/com/juick/service/UserServiceImpl.java | 2 +-
.../HTTPSignatureAuthenticationFilter.java | 17 +-
.../security/HashParamAuthenticationFilter.java | 54 +-
.../com/juick/util/adapters/SimpleDateAdapter.java | 3 +-
.../java/com/juick/util/xmpp/JidConverter.java | 4 +-
.../java/com/juick/util/xmpp/iq/MessageQuery.java | 2 +-
.../java/com/juick/util/xmpp/iq/package-info.java | 8 +-
src/main/java/com/juick/www/VaryHandler.java | 2 +-
src/main/java/com/juick/www/WebApp.java | 7 +-
.../java/com/juick/www/api/ApiSocialLogin.java | 2 +-
src/main/java/com/juick/www/api/Post.java | 2 +-
src/main/java/com/juick/www/api/Service.java | 9 +-
src/main/java/com/juick/www/controllers/Login.java | 3 +-
.../java/com/juick/www/controllers/Settings.java | 19 +-
src/main/java/com/juick/www/controllers/Site.java | 4 +-
.../com/juick/www/controllers/SocialLogin.java | 12 +-
.../java/com/juick/www/filters/AnythingFilter.java | 16 +-
src/main/java/com/juick/www/rss/MessagesView.java | 12 +-
src/main/java/com/juick/www/rss/RepliesView.java | 14 +-
.../pebble/extension/FormatterExtension.java | 3 +
.../extension/filters/FormatMessageFilter.java | 8 +-
.../pebble/extension/filters/PrettyTimeFilter.java | 6 +-
.../pebble/extension/filters/TagsListFilter.java | 6 +-
.../pebble/extension/filters/TimestampFilter.java | 6 +-
.../commons/mail/util/MimeMessageParser.java | 452 +++++++++++++
src/main/resources/application.properties | 1 +
src/main/resources/templates/layouts/default.html | 4 +-
src/main/resources/templates/layouts/login.html | 3 +-
src/main/resources/templates/views/post.html | 1 +
.../java/com/juick/server/tests/ServerTests.java | 668 ++++++++++++-------
55 files changed, 1604 insertions(+), 933 deletions(-)
delete mode 100644 .settings/org.eclipse.jdt.core.prefs
create mode 100644 src/main/java/org/apache/commons/mail/util/MimeMessageParser.java
diff --git a/.gitignore b/.gitignore
index d3a38a36..81a4a8c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,7 +12,6 @@
**/.classpath
**/.project
**/.settings/**
-!.settings/org.eclipse.jdt.core.prefs
**/bin/**
**/.DS_Store
**/out/**
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 13e5d65c..00000000
--- a/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,10 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
-org.eclipse.jdt.core.compiler.compliance=17
-org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
-org.eclipse.jdt.core.compiler.processAnnotations=disabled
-org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=17
diff --git a/pom.xml b/pom.xml
index 764b9db9..21ebdd9d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,360 +1,384 @@
- 4.0.0
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.7.5
-
-
- com.juick
- juick-api
- 2.0-SNAPSHOT
-
-
- 17
- 17
- 0.8.2
- 0.21.0
- 0.11.5
- 1.18.0
-
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 3.0.0
+
+
+ com.juick
+ juick-api
+ 2.0-SNAPSHOT
+
+ 17
+ 17
+ 0.8.2
+ 0.21.0
+ 0.11.5
+ 1.18.0
+
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+ org.springframework.boot
+ spring-boot-starter-mail
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-security
+
+
+ org.springframework.boot
+ spring-boot-starter-oauth2-client
+
+
+ org.springframework.boot
+ spring-boot-starter-cache
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+
+
+ org.springframework.boot
+ spring-boot-starter-json
+
+
+ org.springframework.boot
+ spring-boot-starter-undertow
+
+
+ io.undertow
+ undertow-websockets-jsr
+
+
+
+
+ org.apache.httpcomponents.client5
+ httpclient5
+
+
+ org.apache.commons
+ commons-lang3
+
+
+ jakarta.validation
+ jakarta.validation-api
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.springframework.security
+ spring-security-test
+ test
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ true
+
+
+ net.sourceforge.htmlunit
+ htmlunit
+ test
+
+
+ xml-apis
+ xml-apis
+
+
+
+
+ jakarta.xml.bind
+ jakarta.xml.bind-api
+
+
+ org.glassfish.jaxb
+ jaxb-runtime
+ runtime
+
+
+ org.flywaydb
+ flyway-core
+
+
+ com.github.ben-manes.caffeine
+ caffeine
+
+
+ org.mariadb.jdbc
+ mariadb-java-client
+ runtime
+
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-starter-tomcat
-
-
-
-
- org.springframework.boot
- spring-boot-starter-security
-
-
- org.springframework.boot
- spring-boot-starter-oauth2-client
-
-
- org.springframework.boot
- spring-boot-starter-cache
-
-
- org.springframework.boot
- spring-boot-starter-jdbc
-
-
- org.springframework.boot
- spring-boot-starter-json
-
-
- org.springframework.boot
- spring-boot-starter-undertow
-
-
- io.undertow
- undertow-websockets-jsr
-
-
-
-
- org.apache.httpcomponents
- httpclient
-
-
- org.apache.commons
- commons-lang3
-
-
- javax.validation
- validation-api
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.springframework.security
- spring-security-test
- test
-
-
- org.springframework.boot
- spring-boot-devtools
- true
-
-
- net.sourceforge.htmlunit
- htmlunit
- test
-
-
- xml-apis
- xml-apis
-
-
-
-
- javax.xml.bind
- jaxb-api
-
-
- org.glassfish.jaxb
- jaxb-runtime
- runtime
-
-
- org.flywaydb
- flyway-core
-
-
- com.github.ben-manes.caffeine
- caffeine
-
-
- org.mariadb.jdbc
- mariadb-java-client
- runtime
-
-
-
- javax.inject
- javax.inject
- 1
-
-
- org.apache.commons
- commons-email
- 1.5
-
-
- org.apache.commons
- commons-collections4
- 4.4
-
-
- org.apache.commons
- commons-text
- 1.10.0
-
-
- org.apache.commons
- commons-imaging
- 1.0-alpha3
-
-
- commons-io
- commons-io
- 2.11.0
-
-
- io.pebbletemplates
- pebble-spring5
- 3.1.6
-
-
- com.github.pengrad
- java-telegram-bot-api
- 6.2.0
-
-
- com.github.scribejava
- scribejava-apis
- 8.3.3
-
-
- rocks.xmpp
- xmpp-core-client
- ${babbler.version}
-
-
- rocks.xmpp
- xmpp-extensions-client
- ${babbler.version}
-
-
- org.commonmark
- commonmark
- ${commonmark.version}
-
-
- org.commonmark
- commonmark-ext-autolink
- ${commonmark.version}
-
-
- org.tomitribe
- tomitribe-http-signatures
- 1.8
-
-
- org.tomitribe
- churchkey
- 0.15
-
-
- com.google.code.findbugs
- jsr305
- 3.0.2
- provided
-
-
- com.kotcrab.remark
- remark
- 1.2.0
-
-
- io.jsonwebtoken
- jjwt-api
- ${jjwt.version}
-
-
- io.jsonwebtoken
- jjwt-jackson
- runtime
- ${jjwt.version}
-
-
- io.jsonwebtoken
- jjwt-impl
- runtime
- ${jjwt.version}
-
-
- org.imgscalr
- imgscalr-lib
- 4.2
-
-
- org.twitter4j
- twitter4j-core
- 4.1.2
-
-
- com.rometools
- rome
- ${rome.version}
-
-
- com.rometools
- rome-modules
- ${rome.version}
-
-
- com.twelvemonkeys.imageio
- imageio-jpeg
- 3.9.4
-
-
- org.ocpsoft.prettytime
- prettytime
- 5.0.6.Final
-
-
- org.springdoc
- springdoc-openapi-webmvc-core
- 1.6.13
-
-
- ch.vorburger.mariaDB4j
- mariaDB4j
- 2.6.0
- test
-
-
-
-
-
-
- org.codehaus.mojo
- exec-maven-plugin
- 3.1.0
-
-
- npm install
-
- exec
-
- initialize
-
- npm
-
- install
-
-
-
-
- npm run compile
-
- exec
-
- generate-resources
-
- npm
-
- run
- compile
-
-
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
- com.google.code.findbugs
- jsr305
-
-
-
-
-
-
-
-
- default
-
- true
-
-
-
- com.h2database
- h2
- runtime
-
-
-
- default
-
-
-
- mysql
-
- mysql
-
-
-
- production
-
- production
-
-
-
- net.java.dev.jna
- jna
- 5.12.1
-
-
-
-
+
+ javax.inject
+ javax.inject
+ 1
+
+
+ org.apache.commons
+ commons-collections4
+ 4.4
+
+
+ org.apache.commons
+ commons-text
+ 1.10.0
+
+
+ org.apache.commons
+ commons-imaging
+ 1.0-alpha3
+
+
+ commons-io
+ commons-io
+ 2.11.0
+
+
+ io.pebbletemplates
+ pebble-spring6
+ 3.2.0
+
+
+ com.github.pengrad
+ java-telegram-bot-api
+ 6.2.0
+
+
+ com.github.scribejava
+ scribejava-apis
+ 8.3.3
+
+
+ rocks.xmpp
+ xmpp-core-client
+ ${babbler.version}
+
+
+ rocks.xmpp
+ xmpp-extensions-client
+ ${babbler.version}
+
+
+ org.commonmark
+ commonmark
+ ${commonmark.version}
+
+
+ org.commonmark
+ commonmark-ext-autolink
+ ${commonmark.version}
+
+
+ org.tomitribe
+ tomitribe-http-signatures
+ 1.8
+
+
+ org.tomitribe
+ churchkey
+ 0.15
+
+
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+ provided
+
+
+ com.kotcrab.remark
+ remark
+ 1.2.0
+
+
+ io.jsonwebtoken
+ jjwt-api
+ ${jjwt.version}
+
+
+ io.jsonwebtoken
+ jjwt-jackson
+ runtime
+ ${jjwt.version}
+
+
+ io.jsonwebtoken
+ jjwt-impl
+ runtime
+ ${jjwt.version}
+
+
+ org.imgscalr
+ imgscalr-lib
+ 4.2
+
+
+ org.twitter4j
+ twitter4j-core
+ 4.1.2
+
+
+ com.rometools
+ rome
+ ${rome.version}
+
+
+ com.rometools
+ rome-modules
+ ${rome.version}
+
+
+ com.twelvemonkeys.imageio
+ imageio-jpeg
+ 3.9.4
+
+
+ org.ocpsoft.prettytime
+ prettytime
+ 5.0.6.Final
+
+
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ 2.0.0
+
+
+ ch.vorburger.mariaDB4j
+ mariaDB4j
+ 2.6.0
+ test
+
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+ 3.1.0
+
+
+ npm install
+
+ exec
+
+ initialize
+
+ npm
+
+ install
+
+
+
+
+ npm run compile
+
+ exec
+
+ generate-resources
+
+ npm
+
+ run
+ compile
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.1.0
+
+
+ enforce-maven
+
+ enforce
+
+
+
+
+ 3.2.5
+
+
+ (11,)
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+ com.google.code.findbugs
+ jsr305
+
+
+
+
+
+
+
+
+ default
+
+ true
+
+
+
+ com.h2database
+ h2
+ runtime
+
+
+
+ default
+
+
+
+ mysql
+
+ mysql
+
+
+
+ production
+
+ production
+
+
+
+ net.java.dev.jna
+ jna
+ 5.12.1
+
+
+
+
diff --git a/src/main/assets/scripts.js b/src/main/assets/scripts.js
index b103810d..cc811808 100644
--- a/src/main/assets/scripts.js
+++ b/src/main/assets/scripts.js
@@ -417,6 +417,7 @@ function checkUsername() {
/******************************************************************************/
function openDialogLogin() {
+ const token = document.body.getAttribute('data-token');
let html = `
${i18n('loginDialog.pleaseIntroduceYourself')}:
@@ -426,6 +427,7 @@ function openDialogLogin() {
${i18n('loginDialog.registeredAlready')}