Update ma1sd to mxids

This commit is contained in:
2024-03-26 13:21:48 +01:00
parent e45ac5a78a
commit acb2b5a37d
5 changed files with 37 additions and 35 deletions

4
.gitignore vendored
View File

@@ -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

View File

@@ -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

View File

@@ -5,12 +5,12 @@ 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

View File

@@ -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()
} }
@@ -166,7 +166,7 @@ dependencies {
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
} }

View File

@@ -1,10 +1,12 @@
# From source # From source
- [Binaries](#binaries) - [From source](#from-source)
- [Requirements](#requirements) - [Binaries](#binaries)
- [Build](#build) - [Requirements](#requirements)
- [Debian package](#debian-package) - [Build](#build)
- [Docker image](#docker-image) - [Debian package](#debian-package)
- [Next steps](#next-steps) - [Docker image](#docker-image)
- [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: