Compare commits
23 Commits
ext/new_sy
...
603cdd1340
| Author | SHA1 | Date | |
|---|---|---|---|
| 603cdd1340 | |||
| fc9d6b3a36 | |||
| 8b14664dc7 | |||
| f0922d67df | |||
| 6e05b51fdc | |||
| 0999ef6309 | |||
| cae00f4606 | |||
| 941ae697e7 | |||
| fbf1ea8f5b | |||
| 4eef3ac40d | |||
| e6c90aa00f | |||
| ca306a3212 | |||
| e8864afe02 | |||
| f09ede8780 | |||
| 98146d3468 | |||
| 5f64b72a91 | |||
| acb2b5a37d | |||
| 9f9c48aaa7 | |||
| eb6e541e15 | |||
| e45ac5a78a | |||
| aebcb7b5e1 | |||
| c45f95ce3f | |||
| 640fa8e9f1 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -7,8 +7,8 @@ out/
|
||||
.idea/
|
||||
|
||||
# Local dev config
|
||||
/ma1sd.yaml
|
||||
/mxids.yaml
|
||||
/application.yaml
|
||||
|
||||
# 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/*
|
||||
|
||||
VOLUME /etc/ma1sd
|
||||
VOLUME /var/ma1sd
|
||||
VOLUME /etc/mxids
|
||||
VOLUME /var/mxids
|
||||
EXPOSE 8090
|
||||
|
||||
ENV JAVA_OPTS=""
|
||||
ENV CONF_FILE_PATH="/etc/ma1sd/ma1sd.yaml"
|
||||
ENV SIGN_KEY_PATH="/var/ma1sd/sign.key"
|
||||
ENV SQLITE_DATABASE_PATH="/var/ma1sd/ma1sd.db"
|
||||
ENV CONF_FILE_PATH="/etc/mxids/mxids.yaml"
|
||||
ENV SIGN_KEY_PATH="/var/mxids/sign.key"
|
||||
ENV SQLITE_DATABASE_PATH="/var/mxids/mxids.db"
|
||||
|
||||
CMD [ "/start.sh" ]
|
||||
|
||||
ADD src/docker/start.sh /start.sh
|
||||
ADD src/script/ma1sd /app/ma1sd
|
||||
COPY --from=builder /ma1sd/build/libs/ma1sd.jar /app/ma1sd.jar
|
||||
ADD src/script/mxids /app/mxids
|
||||
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 /var/ma1sd
|
||||
EXPOSE 8090
|
||||
|
||||
ENV JAVA_OPTS=""
|
||||
ENV CONF_FILE_PATH="/etc/ma1sd/ma1sd.yaml"
|
||||
ENV SIGN_KEY_PATH="/var/ma1sd/sign.key"
|
||||
ENV SQLITE_DATABASE_PATH="/var/ma1sd/ma1sd.db"
|
||||
ENV CONF_FILE_PATH="/etc/mxids/mxids.yaml"
|
||||
ENV SIGN_KEY_PATH="/var/mxids/sign.key"
|
||||
ENV SQLITE_DATABASE_PATH="/var/mxids/mxids.db"
|
||||
|
||||
CMD [ "/start.sh" ]
|
||||
|
||||
ADD src/docker/start.sh /start.sh
|
||||
ADD src/script/ma1sd /app/ma1sd
|
||||
ADD build/libs/ma1sd.jar /app/ma1sd.jar
|
||||
ADD src/script/mxids /app/mxids
|
||||
ADD build/libs/mxids.jar /app/mxids.jar
|
||||
|
||||
44
build.gradle
44
build.gradle
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* ma1sd - Matrix Identity Server Daemon
|
||||
* mxids - Matrix Identity Server
|
||||
* Copyright (C) 2017 Kamax Sarl
|
||||
*
|
||||
* https://www.kamax.io/
|
||||
@@ -26,16 +26,16 @@ apply plugin: 'com.github.johnrengelman.shadow'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'com.github.ben-manes.versions'
|
||||
|
||||
def confFileName = "ma1sd.example.yaml"
|
||||
def confFileName = "mxids.example.yaml"
|
||||
def distDir = "${project.buildDir}/dist"
|
||||
|
||||
def debBinPath = "/usr/lib/ma1sd"
|
||||
def debConfPath = "/etc/ma1sd"
|
||||
def debDataPath = "/var/lib/ma1sd"
|
||||
def debBinPath = "/usr/lib/mxids"
|
||||
def debConfPath = "/etc/mxids"
|
||||
def debDataPath = "/var/lib/mxids"
|
||||
def debSystemdPath = "/etc/systemd/system"
|
||||
|
||||
def debConfFileName = confFileName
|
||||
def debStartScriptFilename = "ma1sd"
|
||||
def debStartScriptFilename = "mxids"
|
||||
|
||||
def debBuildBasePath = "${project.buildDir}/tmp/debian"
|
||||
def debBuildDebianPath = "${debBuildBasePath}/DEBIAN"
|
||||
@@ -44,8 +44,8 @@ def debBuildConfPath = "${debBuildBasePath}${debConfPath}"
|
||||
def debBuildDataPath = "${debBuildBasePath}${debDataPath}"
|
||||
def debBuildSystemdPath = "${debBuildBasePath}${debSystemdPath}"
|
||||
|
||||
def dockerImageName = "ma1uta/ma1sd"
|
||||
def dockerImageTag = "${dockerImageName}:${ma1sdVersion()}"
|
||||
def dockerImageName = "cqrenet/mxids"
|
||||
def dockerImageTag = "${dockerImageName}:${mxidsVersion()}"
|
||||
|
||||
group = 'io.kamax'
|
||||
mainClassName = 'io.kamax.mxisd.MxisdStandaloneExec'
|
||||
@@ -55,7 +55,7 @@ targetCompatibility = '1.8'
|
||||
String ma1sdVersion() {
|
||||
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) {
|
||||
version = gitVersion()
|
||||
}
|
||||
@@ -79,7 +79,7 @@ buildscript {
|
||||
|
||||
dependencies {
|
||||
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,7 +89,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
// Logging
|
||||
api 'org.slf4j:slf4j-simple:1.7.25'
|
||||
api 'org.slf4j:slf4j-simple:1.7.36'
|
||||
|
||||
// Easy file management
|
||||
api 'commons-io:commons-io:2.8.0'
|
||||
@@ -115,17 +115,17 @@ dependencies {
|
||||
api 'dnsjava:dnsjava:2.1.9'
|
||||
|
||||
// HTTP connections
|
||||
api 'org.apache.httpcomponents:httpclient:4.5.13'
|
||||
api 'org.apache.httpcomponents:httpclient:4.5.14'
|
||||
|
||||
// Phone numbers validation
|
||||
api 'com.googlecode.libphonenumber:libphonenumber:8.12.21'
|
||||
api 'com.googlecode.libphonenumber:libphonenumber:8.13.33'
|
||||
|
||||
// E-mail sending
|
||||
api 'javax.mail:javax.mail-api:1.6.2'
|
||||
api 'com.sun.mail:javax.mail:1.6.2'
|
||||
|
||||
// Google Firebase Authentication backend
|
||||
api 'com.google.firebase:firebase-admin:5.3.0'
|
||||
api 'com.google.firebase:firebase-admin:5.11.0'
|
||||
|
||||
// Connection Pool
|
||||
api 'com.mchange:c3p0:0.9.5.5'
|
||||
@@ -137,7 +137,7 @@ dependencies {
|
||||
api 'org.postgresql:postgresql:42.2.19'
|
||||
|
||||
// MariaDB/MySQL
|
||||
api 'org.mariadb.jdbc:mariadb-java-client:2.7.2'
|
||||
api 'org.mariadb.jdbc:mariadb-java-client:2.7.12'
|
||||
|
||||
// UNIX sockets
|
||||
api 'com.kohlschutter.junixsocket:junixsocket-core:2.3.3'
|
||||
@@ -159,14 +159,14 @@ dependencies {
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
testImplementation 'com.github.tomakehurst:wiremock:2.27.2'
|
||||
testImplementation 'com.unboundid:unboundid-ldapsdk:4.0.12'
|
||||
testImplementation 'com.icegreen:greenmail:1.5.11'
|
||||
testImplementation 'com.unboundid:unboundid-ldapsdk:4.0.14'
|
||||
testImplementation 'com.icegreen:greenmail:1.6.15'
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes(
|
||||
'Implementation-Version': ma1sdVersion()
|
||||
'Implementation-Version': mxidsVersion()
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ shadowJar {
|
||||
|
||||
task debBuild(dependsOn: shadowJar) {
|
||||
doLast {
|
||||
String debVersion = ma1sdVersion()
|
||||
String debVersion = mxidsVersion()
|
||||
println "Version for package: ${debVersion}"
|
||||
mkdir distDir
|
||||
mkdir debBuildBasePath
|
||||
@@ -190,7 +190,7 @@ task debBuild(dependsOn: shadowJar) {
|
||||
mkdir debBuildSystemdPath
|
||||
|
||||
copy {
|
||||
from "${project.buildDir}/libs/ma1sd.jar"
|
||||
from "${project.buildDir}/libs/mxids.jar"
|
||||
into debBuildBinPath
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ task debBuild(dependsOn: shadowJar) {
|
||||
ant.replace(
|
||||
file: "${debBuildDebianPath}/postinst",
|
||||
token: '%DEB_CONF_FILE%',
|
||||
value: "${debConfPath}/ma1sd.yaml"
|
||||
value: "${debConfPath}/mxids.yaml"
|
||||
)
|
||||
|
||||
ant.chmod(
|
||||
@@ -252,7 +252,7 @@ task debBuild(dependsOn: shadowJar) {
|
||||
)
|
||||
|
||||
copy {
|
||||
from "${project.file('src/systemd/ma1sd.service')}"
|
||||
from "${project.file('src/systemd/mxids.service')}"
|
||||
into debBuildSystemdPath
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
# From source
|
||||
- [Binaries](#binaries)
|
||||
- [Requirements](#requirements)
|
||||
- [Build](#build)
|
||||
- [Debian package](#debian-package)
|
||||
- [Docker image](#docker-image)
|
||||
- [Next steps](#next-steps)
|
||||
- [From source](#from-source)
|
||||
- [Binaries](#binaries)
|
||||
- [Requirements](#requirements)
|
||||
- [Build](#build)
|
||||
- [Debian package](#debian-package)
|
||||
- [Docker image](#docker-image)
|
||||
- [Multi-platform builds](#multi-platform-builds)
|
||||
- [Next steps](#next-steps)
|
||||
|
||||
## Binaries
|
||||
### Requirements
|
||||
@@ -19,7 +21,7 @@ cd ma1sd
|
||||
./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).
|
||||
|
||||
Start the server in foreground to validate the build and configuration:
|
||||
|
||||
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() {
|
||||
return client().add("r0");
|
||||
return client().add("v3");
|
||||
}
|
||||
|
||||
private StringBuilder path = new StringBuilder();
|
||||
|
||||
@@ -375,13 +375,13 @@ public abstract class AMatrixHttpClient implements _MatrixClientRaw {
|
||||
}
|
||||
|
||||
protected HttpUrl.Builder getClientPathBuilder(String... segments) {
|
||||
String[] base = { "client", "r0" };
|
||||
String[] base = { "client", "v3" };
|
||||
segments = ArrayUtils.addAll(base, segments);
|
||||
return getPathBuilder(segments);
|
||||
}
|
||||
|
||||
protected HttpUrl.Builder getMediaPathBuilder(String... segments) {
|
||||
String[] base = { "media", "r0" };
|
||||
String[] base = { "media", "v3" };
|
||||
segments = ArrayUtils.addAll(base, segments);
|
||||
return getPathBuilder(segments);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@ import io.kamax.mxisd.http.undertow.handler.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 static final String Path = "/_matrix/client/r0/user_directory/search";
|
||||
public static final String Path = "/_matrix/client/v3/user_directory/search";
|
||||
|
||||
private DirectoryManager mgr;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ import java.util.Optional;
|
||||
|
||||
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);
|
||||
|
||||
@@ -62,7 +62,7 @@ public class RoomInviteHandler extends BasicHttpHandler {
|
||||
public void handleRequest(HttpServerExchange 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);
|
||||
HttpGet whoAmIReq = new HttpGet(whoamiUri);
|
||||
whoAmIReq.addHeader("Authorization", "Bearer " + accessToken);
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.Optional;
|
||||
public class ProfileHandler extends HomeserverProxyHandler {
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
|
||||
public class Register3pidRequestTokenHandler extends BasicHttpHandler {
|
||||
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user