Compare commits
71 Commits
ext/new_sy
...
945a2dbdf5
| Author | SHA1 | Date | |
|---|---|---|---|
| 945a2dbdf5 | |||
| d5cebf103d | |||
| de14f80a40 | |||
| 7ed6db537d | |||
| 9d8d88527c | |||
| a1c82878f2 | |||
| ab95c8ee32 | |||
| e50a49b198 | |||
| 4492888557 | |||
| ed5407fc42 | |||
| a2911f2ace | |||
| e99578d168 | |||
| d471ea71d7 | |||
| 56115df282 | |||
| 2e1194d216 | |||
| ee001d543c | |||
| a826eb319e | |||
| 6b557e9954 | |||
| 041a4d1b73 | |||
| c1a1741bfb | |||
| 6e1058c484 | |||
| 5f6fb38485 | |||
| c9046ffbd0 | |||
| cf97c5a88f | |||
| 3d1a8c4495 | |||
| 46dc07ef07 | |||
| d9ab2b8739 | |||
| 14032aaf50 | |||
| 73051c3d00 | |||
| a3c8c4a8cf | |||
| 453751a39e | |||
| ad23e91ece | |||
| baabdfc2ef | |||
| 263e3260c9 | |||
| a281bdbf77 | |||
| 338e7f4aa2 | |||
| a9212ce73a | |||
| f2e1fcb25f | |||
| f5630bc4d9 | |||
| dbccaecfd6 | |||
| de0842d3a8 | |||
| 05424f14b8 | |||
| 2587e6be7c | |||
| 20062fe5bc | |||
| 0ec6462ff4 | |||
| 567c7bb972 | |||
| 1c6322f1c2 | |||
| 603cdd1340 | |||
| a6164379c5 | |||
| fc9d6b3a36 | |||
| 8b14664dc7 | |||
| f0922d67df | |||
| 6e05b51fdc | |||
| 0999ef6309 | |||
| cae00f4606 | |||
| 941ae697e7 | |||
| fbf1ea8f5b | |||
| 4eef3ac40d | |||
| e6c90aa00f | |||
| ca306a3212 | |||
| e8864afe02 | |||
| f09ede8780 | |||
| 98146d3468 | |||
| 5f64b72a91 | |||
| acb2b5a37d | |||
| 9f9c48aaa7 | |||
| eb6e541e15 | |||
| e45ac5a78a | |||
| aebcb7b5e1 | |||
| c45f95ce3f | |||
| 640fa8e9f1 |
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
# We must fetch at least the immediate parents so that if this is
|
# We must fetch at least the immediate parents so that if this is
|
||||||
# a pull request then we can checkout the head.
|
# a pull request then we can checkout the head.
|
||||||
fetch-depth: 2
|
fetch-depth: 0
|
||||||
|
|
||||||
# If this run was triggered by a pull request event, then checkout
|
# If this run was triggered by a pull request event, then checkout
|
||||||
# the head of the pull request instead of the merge commit.
|
# the head of the pull request instead of the merge commit.
|
||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v1
|
uses: github/codeql-action/init@v2
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v1
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -7,8 +7,8 @@ out/
|
|||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
# Local dev config
|
# Local dev config
|
||||||
/ma1sd.yaml
|
/mxids.yaml
|
||||||
/application.yaml
|
/application.yaml
|
||||||
|
|
||||||
# Local dev storage
|
# Local dev storage
|
||||||
/ma1sd.db
|
/mxids.db
|
||||||
|
|||||||
14
Dockerfile
14
Dockerfile
@@ -10,17 +10,17 @@ FROM openjdk:8-jre-alpine
|
|||||||
|
|
||||||
RUN apk update && apk add bash && rm -rf /var/lib/apk/* /var/cache/apk/*
|
RUN apk update && apk add bash && rm -rf /var/lib/apk/* /var/cache/apk/*
|
||||||
|
|
||||||
VOLUME /etc/ma1sd
|
VOLUME /etc/mxids
|
||||||
VOLUME /var/ma1sd
|
VOLUME /var/mxids
|
||||||
EXPOSE 8090
|
EXPOSE 8090
|
||||||
|
|
||||||
ENV JAVA_OPTS=""
|
ENV JAVA_OPTS=""
|
||||||
ENV CONF_FILE_PATH="/etc/ma1sd/ma1sd.yaml"
|
ENV CONF_FILE_PATH="/etc/mxids/mxids.yaml"
|
||||||
ENV SIGN_KEY_PATH="/var/ma1sd/sign.key"
|
ENV SIGN_KEY_PATH="/var/mxids/sign.key"
|
||||||
ENV SQLITE_DATABASE_PATH="/var/ma1sd/ma1sd.db"
|
ENV SQLITE_DATABASE_PATH="/var/mxids/mxids.db"
|
||||||
|
|
||||||
CMD [ "/start.sh" ]
|
CMD [ "/start.sh" ]
|
||||||
|
|
||||||
ADD src/docker/start.sh /start.sh
|
ADD src/docker/start.sh /start.sh
|
||||||
ADD src/script/ma1sd /app/ma1sd
|
ADD src/script/mxids /app/mxids
|
||||||
COPY --from=builder /ma1sd/build/libs/ma1sd.jar /app/ma1sd.jar
|
COPY --from=builder /mxids/build/libs/mxids.jar /app/mxids.jar
|
||||||
|
|||||||
12
DockerfileX
12
DockerfileX
@@ -1,16 +1,16 @@
|
|||||||
FROM --platform=$BUILDPLATFORM openjdk:11.0.7-jre-slim
|
FROM --platform=$BUILDPLATFORM openjdk:11.0.16-jre-slim
|
||||||
|
|
||||||
VOLUME /etc/ma1sd
|
VOLUME /etc/ma1sd
|
||||||
VOLUME /var/ma1sd
|
VOLUME /var/ma1sd
|
||||||
EXPOSE 8090
|
EXPOSE 8090
|
||||||
|
|
||||||
ENV JAVA_OPTS=""
|
ENV JAVA_OPTS=""
|
||||||
ENV CONF_FILE_PATH="/etc/ma1sd/ma1sd.yaml"
|
ENV CONF_FILE_PATH="/etc/mxids/mxids.yaml"
|
||||||
ENV SIGN_KEY_PATH="/var/ma1sd/sign.key"
|
ENV SIGN_KEY_PATH="/var/mxids/sign.key"
|
||||||
ENV SQLITE_DATABASE_PATH="/var/ma1sd/ma1sd.db"
|
ENV SQLITE_DATABASE_PATH="/var/mxids/mxids.db"
|
||||||
|
|
||||||
CMD [ "/start.sh" ]
|
CMD [ "/start.sh" ]
|
||||||
|
|
||||||
ADD src/docker/start.sh /start.sh
|
ADD src/docker/start.sh /start.sh
|
||||||
ADD src/script/ma1sd /app/ma1sd
|
ADD src/script/mxids /app/mxids
|
||||||
ADD build/libs/ma1sd.jar /app/ma1sd.jar
|
ADD build/libs/mxids.jar /app/mxids.jar
|
||||||
|
|||||||
76
build.gradle
76
build.gradle
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* ma1sd - Matrix Identity Server Daemon
|
* mxids - Matrix Identity Server
|
||||||
* Copyright (C) 2017 Kamax Sarl
|
* Copyright (C) 2017 Kamax Sarl
|
||||||
*
|
*
|
||||||
* https://www.kamax.io/
|
* https://www.kamax.io/
|
||||||
@@ -26,16 +26,16 @@ apply plugin: 'com.github.johnrengelman.shadow'
|
|||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
apply plugin: 'com.github.ben-manes.versions'
|
apply plugin: 'com.github.ben-manes.versions'
|
||||||
|
|
||||||
def confFileName = "ma1sd.example.yaml"
|
def confFileName = "mxids.example.yaml"
|
||||||
def distDir = "${project.buildDir}/dist"
|
def distDir = "${project.buildDir}/dist"
|
||||||
|
|
||||||
def debBinPath = "/usr/lib/ma1sd"
|
def debBinPath = "/usr/lib/mxids"
|
||||||
def debConfPath = "/etc/ma1sd"
|
def debConfPath = "/etc/mxids"
|
||||||
def debDataPath = "/var/lib/ma1sd"
|
def debDataPath = "/var/lib/mxids"
|
||||||
def debSystemdPath = "/etc/systemd/system"
|
def debSystemdPath = "/etc/systemd/system"
|
||||||
|
|
||||||
def debConfFileName = confFileName
|
def debConfFileName = confFileName
|
||||||
def debStartScriptFilename = "ma1sd"
|
def debStartScriptFilename = "mxids"
|
||||||
|
|
||||||
def debBuildBasePath = "${project.buildDir}/tmp/debian"
|
def debBuildBasePath = "${project.buildDir}/tmp/debian"
|
||||||
def debBuildDebianPath = "${debBuildBasePath}/DEBIAN"
|
def debBuildDebianPath = "${debBuildBasePath}/DEBIAN"
|
||||||
@@ -44,8 +44,8 @@ def debBuildConfPath = "${debBuildBasePath}${debConfPath}"
|
|||||||
def debBuildDataPath = "${debBuildBasePath}${debDataPath}"
|
def debBuildDataPath = "${debBuildBasePath}${debDataPath}"
|
||||||
def debBuildSystemdPath = "${debBuildBasePath}${debSystemdPath}"
|
def debBuildSystemdPath = "${debBuildBasePath}${debSystemdPath}"
|
||||||
|
|
||||||
def dockerImageName = "ma1uta/ma1sd"
|
def dockerImageName = "cqrenet/mxids"
|
||||||
def dockerImageTag = "${dockerImageName}:${ma1sdVersion()}"
|
def dockerImageTag = "${dockerImageName}:${mxidsVersion()}"
|
||||||
|
|
||||||
group = 'io.kamax'
|
group = 'io.kamax'
|
||||||
mainClassName = 'io.kamax.mxisd.MxisdStandaloneExec'
|
mainClassName = 'io.kamax.mxisd.MxisdStandaloneExec'
|
||||||
@@ -55,7 +55,7 @@ targetCompatibility = '1.8'
|
|||||||
String ma1sdVersion() {
|
String ma1sdVersion() {
|
||||||
def versionPattern = Pattern.compile("v(\\d+\\.)?(\\d+\\.)?(\\d+)(-.*)?")
|
def versionPattern = Pattern.compile("v(\\d+\\.)?(\\d+\\.)?(\\d+)(-.*)?")
|
||||||
|
|
||||||
String version = System.getenv('MA1SD_BUILD_VERSION')
|
String version = System.getenv('MXIDS_BUILD_VERSION')
|
||||||
if (version == null || version.size() == 0) {
|
if (version == null || version.size() == 0) {
|
||||||
version = gitVersion()
|
version = gitVersion()
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ buildscript {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0'
|
classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0'
|
||||||
classpath 'com.github.ben-manes:gradle-versions-plugin:0.38.0'
|
classpath 'com.github.ben-manes:gradle-versions-plugin:0.51.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,21 +89,21 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Logging
|
// Logging
|
||||||
api 'org.slf4j:slf4j-simple:1.7.25'
|
api 'org.slf4j:slf4j-simple:1.7.36'
|
||||||
|
|
||||||
// Easy file management
|
// Easy file management
|
||||||
api 'commons-io:commons-io:2.8.0'
|
api 'commons-io:commons-io:2.15.1'
|
||||||
|
|
||||||
// Config management
|
// Config management
|
||||||
api 'org.yaml:snakeyaml:1.28'
|
api 'org.yaml:snakeyaml:1.33'
|
||||||
|
|
||||||
// Dependencies from old Matrix-java-sdk
|
// Dependencies from old Matrix-java-sdk
|
||||||
api 'org.apache.commons:commons-lang3:3.12.0'
|
api 'org.apache.commons:commons-lang3:3.14.0'
|
||||||
api 'com.squareup.okhttp3:okhttp:4.2.2'
|
api 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||||
api 'commons-codec:commons-codec:1.15'
|
api 'commons-codec:commons-codec:1.16.1'
|
||||||
|
|
||||||
// ORMLite
|
// ORMLite
|
||||||
api 'com.j256.ormlite:ormlite-jdbc:5.3'
|
api 'com.j256.ormlite:ormlite-jdbc:6.1'
|
||||||
|
|
||||||
// ed25519 handling
|
// ed25519 handling
|
||||||
api 'net.i2p.crypto:eddsa:0.3.0'
|
api 'net.i2p.crypto:eddsa:0.3.0'
|
||||||
@@ -112,61 +112,61 @@ dependencies {
|
|||||||
api 'org.apache.directory.api:api-all:1.0.3'
|
api 'org.apache.directory.api:api-all:1.0.3'
|
||||||
|
|
||||||
// DNS lookups
|
// DNS lookups
|
||||||
api 'dnsjava:dnsjava:2.1.9'
|
api 'dnsjava:dnsjava:3.5.3'
|
||||||
|
|
||||||
// HTTP connections
|
// HTTP connections
|
||||||
api 'org.apache.httpcomponents:httpclient:4.5.13'
|
api 'org.apache.httpcomponents:httpclient:4.5.14'
|
||||||
|
|
||||||
// Phone numbers validation
|
// Phone numbers validation
|
||||||
api 'com.googlecode.libphonenumber:libphonenumber:8.12.21'
|
api 'com.googlecode.libphonenumber:libphonenumber:8.13.33'
|
||||||
|
|
||||||
// E-mail sending
|
// E-mail sending
|
||||||
api 'javax.mail:javax.mail-api:1.6.2'
|
api 'javax.mail:javax.mail-api:1.6.2'
|
||||||
api 'com.sun.mail:javax.mail:1.6.2'
|
api 'com.sun.mail:javax.mail:1.6.2'
|
||||||
|
|
||||||
// Google Firebase Authentication backend
|
// Google Firebase Authentication backend
|
||||||
api 'com.google.firebase:firebase-admin:5.3.0'
|
api 'com.google.firebase:firebase-admin:9.2.0'
|
||||||
|
|
||||||
// Connection Pool
|
// Connection Pool
|
||||||
api 'com.mchange:c3p0:0.9.5.5'
|
api 'com.mchange:c3p0:0.10.0'
|
||||||
|
|
||||||
// SQLite
|
// SQLite
|
||||||
api 'org.xerial:sqlite-jdbc:3.34.0'
|
api 'org.xerial:sqlite-jdbc:3.45.2.0'
|
||||||
|
|
||||||
// PostgreSQL
|
// PostgreSQL
|
||||||
api 'org.postgresql:postgresql:42.2.19'
|
api 'org.postgresql:postgresql:42.7.3'
|
||||||
|
|
||||||
// MariaDB/MySQL
|
// MariaDB/MySQL
|
||||||
api 'org.mariadb.jdbc:mariadb-java-client:2.7.2'
|
api 'org.mariadb.jdbc:mariadb-java-client:2.7.12'
|
||||||
|
|
||||||
// UNIX sockets
|
// UNIX sockets
|
||||||
api 'com.kohlschutter.junixsocket:junixsocket-core:2.3.3'
|
api 'com.kohlschutter.junixsocket:junixsocket-core:2.9.0'
|
||||||
|
|
||||||
// Twilio SDK for SMS
|
// Twilio SDK for SMS
|
||||||
api 'com.twilio.sdk:twilio:7.45.0'
|
api 'com.twilio.sdk:twilio:10.1.2'
|
||||||
|
|
||||||
// SendGrid SDK to send emails from GCE
|
// SendGrid SDK to send emails from GCE
|
||||||
api 'com.sendgrid:sendgrid-java:2.2.2'
|
api 'com.sendgrid:sendgrid-java:4.10.2'
|
||||||
|
|
||||||
// ZT-Exec for exec identity store
|
// ZT-Exec for exec identity store
|
||||||
api 'org.zeroturnaround:zt-exec:1.12'
|
api 'org.zeroturnaround:zt-exec:1.12'
|
||||||
|
|
||||||
// HTTP server
|
// HTTP server
|
||||||
api 'io.undertow:undertow-core:2.2.7.Final'
|
api 'io.undertow:undertow-core:2.3.12.Final'
|
||||||
|
|
||||||
// Command parser for AS interface
|
// Command parser for AS interface
|
||||||
api 'commons-cli:commons-cli:1.4'
|
api 'commons-cli:commons-cli:1.6.0'
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
testImplementation 'com.github.tomakehurst:wiremock:2.27.2'
|
testImplementation 'com.github.tomakehurst:wiremock:3.0.1'
|
||||||
testImplementation 'com.unboundid:unboundid-ldapsdk:4.0.12'
|
testImplementation 'com.unboundid:unboundid-ldapsdk:7.0.0'
|
||||||
testImplementation 'com.icegreen:greenmail:1.5.11'
|
testImplementation 'com.icegreen:greenmail:2.0.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
attributes(
|
attributes(
|
||||||
'Implementation-Version': ma1sdVersion()
|
'Implementation-Version': mxidsVersion()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,7 +179,7 @@ shadowJar {
|
|||||||
|
|
||||||
task debBuild(dependsOn: shadowJar) {
|
task debBuild(dependsOn: shadowJar) {
|
||||||
doLast {
|
doLast {
|
||||||
String debVersion = ma1sdVersion()
|
String debVersion = mxidsVersion()
|
||||||
println "Version for package: ${debVersion}"
|
println "Version for package: ${debVersion}"
|
||||||
mkdir distDir
|
mkdir distDir
|
||||||
mkdir debBuildBasePath
|
mkdir debBuildBasePath
|
||||||
@@ -190,7 +190,7 @@ task debBuild(dependsOn: shadowJar) {
|
|||||||
mkdir debBuildSystemdPath
|
mkdir debBuildSystemdPath
|
||||||
|
|
||||||
copy {
|
copy {
|
||||||
from "${project.buildDir}/libs/ma1sd.jar"
|
from "${project.buildDir}/libs/mxids.jar"
|
||||||
into debBuildBinPath
|
into debBuildBinPath
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ task debBuild(dependsOn: shadowJar) {
|
|||||||
ant.replace(
|
ant.replace(
|
||||||
file: "${debBuildDebianPath}/postinst",
|
file: "${debBuildDebianPath}/postinst",
|
||||||
token: '%DEB_CONF_FILE%',
|
token: '%DEB_CONF_FILE%',
|
||||||
value: "${debConfPath}/ma1sd.yaml"
|
value: "${debConfPath}/mxids.yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
ant.chmod(
|
ant.chmod(
|
||||||
@@ -252,7 +252,7 @@ task debBuild(dependsOn: shadowJar) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
copy {
|
copy {
|
||||||
from "${project.file('src/systemd/ma1sd.service')}"
|
from "${project.file('src/systemd/mxids.service')}"
|
||||||
into debBuildSystemdPath
|
into debBuildSystemdPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
# From source
|
# From source
|
||||||
- [Binaries](#binaries)
|
- [From source](#from-source)
|
||||||
|
- [Binaries](#binaries)
|
||||||
- [Requirements](#requirements)
|
- [Requirements](#requirements)
|
||||||
- [Build](#build)
|
- [Build](#build)
|
||||||
- [Debian package](#debian-package)
|
- [Debian package](#debian-package)
|
||||||
- [Docker image](#docker-image)
|
- [Docker image](#docker-image)
|
||||||
- [Next steps](#next-steps)
|
- [Multi-platform builds](#multi-platform-builds)
|
||||||
|
- [Next steps](#next-steps)
|
||||||
|
|
||||||
## Binaries
|
## Binaries
|
||||||
### Requirements
|
### Requirements
|
||||||
@@ -19,7 +21,7 @@ cd ma1sd
|
|||||||
./gradlew build
|
./gradlew build
|
||||||
```
|
```
|
||||||
|
|
||||||
Create a new configuration file by coping `ma1sd.example.yaml` to `ma1sd.yaml` and edit to your needs.
|
Create a new configuration file by coping `mxids.example.yaml` to `mxids.yaml` and edit to your needs.
|
||||||
For advanced configuration, see the [Configure section](configure.md).
|
For advanced configuration, see the [Configure section](configure.md).
|
||||||
|
|
||||||
Start the server in foreground to validate the build and configuration:
|
Start the server in foreground to validate the build and configuration:
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
|||||||
#Thu Dec 05 22:39:36 MSK 2019
|
#Thu Dec 05 22:39:36 MSK 2019
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
11
renovate.json
Normal file
11
renovate.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"config:base"
|
||||||
|
],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"updateTypes": ["minor", "patch", "pin", "digest"],
|
||||||
|
"automerge": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -53,7 +53,7 @@ public class MatrixPath {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MatrixPath clientR0() {
|
public static MatrixPath clientR0() {
|
||||||
return client().add("r0");
|
return client().add("v3");
|
||||||
}
|
}
|
||||||
|
|
||||||
private StringBuilder path = new StringBuilder();
|
private StringBuilder path = new StringBuilder();
|
||||||
|
|||||||
@@ -375,13 +375,13 @@ public abstract class AMatrixHttpClient implements _MatrixClientRaw {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected HttpUrl.Builder getClientPathBuilder(String... segments) {
|
protected HttpUrl.Builder getClientPathBuilder(String... segments) {
|
||||||
String[] base = { "client", "r0" };
|
String[] base = { "client", "v3" };
|
||||||
segments = ArrayUtils.addAll(base, segments);
|
segments = ArrayUtils.addAll(base, segments);
|
||||||
return getPathBuilder(segments);
|
return getPathBuilder(segments);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected HttpUrl.Builder getMediaPathBuilder(String... segments) {
|
protected HttpUrl.Builder getMediaPathBuilder(String... segments) {
|
||||||
String[] base = { "media", "r0" };
|
String[] base = { "media", "v3" };
|
||||||
segments = ArrayUtils.addAll(base, segments);
|
segments = ArrayUtils.addAll(base, segments);
|
||||||
return getPathBuilder(segments);
|
return getPathBuilder(segments);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,6 @@ import io.kamax.mxisd.http.undertow.handler.BasicHttpHandler;
|
|||||||
|
|
||||||
public abstract class LoginHandler extends BasicHttpHandler {
|
public abstract class LoginHandler extends BasicHttpHandler {
|
||||||
|
|
||||||
public static final String Path = "/_matrix/client/r0/login";
|
public static final String Path = "/_matrix/client/v3/login";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import java.net.URI;
|
|||||||
|
|
||||||
public class UserDirectorySearchHandler extends HomeserverProxyHandler {
|
public class UserDirectorySearchHandler extends HomeserverProxyHandler {
|
||||||
|
|
||||||
public static final String Path = "/_matrix/client/r0/user_directory/search";
|
public static final String Path = "/_matrix/client/v3/user_directory/search";
|
||||||
|
|
||||||
private DirectoryManager mgr;
|
private DirectoryManager mgr;
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import java.util.Optional;
|
|||||||
|
|
||||||
public class RoomInviteHandler extends BasicHttpHandler {
|
public class RoomInviteHandler extends BasicHttpHandler {
|
||||||
|
|
||||||
public static final String Path = "/_matrix/client/r0/rooms/{roomId}/invite";
|
public static final String Path = "/_matrix/client/v3/rooms/{roomId}/invite";
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(RoomInviteHandler.class);
|
private static final Logger log = LoggerFactory.getLogger(RoomInviteHandler.class);
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ public class RoomInviteHandler extends BasicHttpHandler {
|
|||||||
public void handleRequest(HttpServerExchange exchange) {
|
public void handleRequest(HttpServerExchange exchange) {
|
||||||
String accessToken = getAccessToken(exchange);
|
String accessToken = getAccessToken(exchange);
|
||||||
|
|
||||||
String whoamiUri = dns.transform(URI.create(exchange.getRequestURL()).resolve(URI.create("/_matrix/client/r0/account/whoami"))).toString();
|
String whoamiUri = dns.transform(URI.create(exchange.getRequestURL()).resolve(URI.create("/_matrix/client/v3/account/whoami"))).toString();
|
||||||
log.info("Who Am I URL: {}", whoamiUri);
|
log.info("Who Am I URL: {}", whoamiUri);
|
||||||
HttpGet whoAmIReq = new HttpGet(whoamiUri);
|
HttpGet whoAmIReq = new HttpGet(whoamiUri);
|
||||||
whoAmIReq.addHeader("Authorization", "Bearer " + accessToken);
|
whoAmIReq.addHeader("Authorization", "Bearer " + accessToken);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import java.util.Optional;
|
|||||||
public class ProfileHandler extends HomeserverProxyHandler {
|
public class ProfileHandler extends HomeserverProxyHandler {
|
||||||
|
|
||||||
public static final String UserID = "userId";
|
public static final String UserID = "userId";
|
||||||
public static final String Path = "/_matrix/client/r0/profile/{" + UserID + "}";
|
public static final String Path = "/_matrix/client/v3/profile/{" + UserID + "}";
|
||||||
|
|
||||||
protected ProfileManager mgr;
|
protected ProfileManager mgr;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
public class Register3pidRequestTokenHandler extends BasicHttpHandler {
|
public class Register3pidRequestTokenHandler extends BasicHttpHandler {
|
||||||
|
|
||||||
public static final String Key = "medium";
|
public static final String Key = "medium";
|
||||||
public static final String Path = "/_matrix/client/r0/register/{" + Key + "}/requestToken";
|
public static final String Path = "/_matrix/client/v3/register/{" + Key + "}/requestToken";
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(Register3pidRequestTokenHandler.class);
|
private static final Logger log = LoggerFactory.getLogger(Register3pidRequestTokenHandler.class);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user