Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9fba20475b | ||
|
9af5fce014 | ||
|
9843e14c1a | ||
|
60e6f1e23c | ||
|
6cdbcc69c7 | ||
|
ed7c714738 | ||
|
a9d783192b | ||
|
2bb5a734d1 | ||
|
9aa5c4cca9 | ||
|
7c94bd4744 |
16
DockerfileX
Normal file
16
DockerfileX
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
FROM --platform=$BUILDPLATFORM openjdk:11.0.7-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"
|
||||||
|
|
||||||
|
CMD [ "/start.sh" ]
|
||||||
|
|
||||||
|
ADD src/docker/start.sh /start.sh
|
||||||
|
ADD src/script/ma1sd /app/ma1sd
|
||||||
|
ADD build/libs/ma1sd.jar /app/ma1sd.jar
|
33
build.gradle
33
build.gradle
@@ -274,6 +274,27 @@ task dockerBuild(type: Exec, dependsOn: shadowJar) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task dockerBuildX(type: Exec, dependsOn: shadowJar) {
|
||||||
|
commandLine 'docker', 'buildx', 'build', '--load', '--platform', 'linux/arm64', '-t', dockerImageTag + '-arm64', project.rootDir
|
||||||
|
doLast {
|
||||||
|
exec {
|
||||||
|
commandLine 'docker', 'buildx', 'build', '--load', '--platform', 'linux/amd64', '-t', dockerImageTag + '-amd64', project.rootDir
|
||||||
|
}
|
||||||
|
|
||||||
|
exec {
|
||||||
|
commandLine 'docker', 'tag', dockerImageTag + '-arm64', "${dockerImageName}:latest-arm64-dev"
|
||||||
|
}
|
||||||
|
|
||||||
|
exec {
|
||||||
|
commandLine 'docker', 'tag', dockerImageTag + '-amd64', "${dockerImageName}:latest-amd64-dev"
|
||||||
|
}
|
||||||
|
|
||||||
|
exec {
|
||||||
|
commandLine 'docker', 'tag', dockerImageTag + '-amd64', "${dockerImageName}:latest-dev"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
task dockerPush(type: Exec) {
|
task dockerPush(type: Exec) {
|
||||||
commandLine 'docker', 'push', dockerImageTag
|
commandLine 'docker', 'push', dockerImageTag
|
||||||
|
|
||||||
@@ -283,3 +304,15 @@ task dockerPush(type: Exec) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task dockerPushX(type: Exec) {
|
||||||
|
commandLine 'docker', 'push', dockerImageTag
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
exec {
|
||||||
|
commandLine 'docker', 'push', "${dockerImageName}:latest-dev"
|
||||||
|
commandLine 'docker', 'push', "${dockerImageName}:latest-amd64-dev"
|
||||||
|
commandLine 'docker', 'push', "${dockerImageName}:latest-arm64-dev"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -9,6 +9,8 @@
|
|||||||
## Binaries
|
## Binaries
|
||||||
### Requirements
|
### Requirements
|
||||||
- JDK 1.8
|
- JDK 1.8
|
||||||
|
- OpenJDK 11
|
||||||
|
- OpenJDK 14
|
||||||
|
|
||||||
### Build
|
### Build
|
||||||
```bash
|
```bash
|
||||||
@@ -70,5 +72,13 @@ Then follow the instruction in the [Debian package](install/debian.md) document.
|
|||||||
```
|
```
|
||||||
Then follow the instructions in the [Docker install](install/docker.md#configure) document.
|
Then follow the instructions in the [Docker install](install/docker.md#configure) document.
|
||||||
|
|
||||||
|
### Multi-platform builds
|
||||||
|
|
||||||
|
Provided with experimental docker feature [buildx](https://docs.docker.com/buildx/working-with-buildx/)
|
||||||
|
To build the arm64 and amd64 images run:
|
||||||
|
```bash
|
||||||
|
./gradlew dockerBuildX
|
||||||
|
```
|
||||||
|
|
||||||
## Next steps
|
## Next steps
|
||||||
- [Integrate with your infrastructure](getting-started.md#integrate)
|
- [Integrate with your infrastructure](getting-started.md#integrate)
|
||||||
|
@@ -56,8 +56,7 @@ Accounts cannot currently migrate/move from one server to another.
|
|||||||
See a [brief explanation document](concepts.md) about Matrix and ma1sd concepts and vocabulary.
|
See a [brief explanation document](concepts.md) about Matrix and ma1sd concepts and vocabulary.
|
||||||
|
|
||||||
### I already use the synapse LDAP3 auth provider. Why should I care about ma1sd?
|
### I already use the synapse LDAP3 auth provider. Why should I care about ma1sd?
|
||||||
The [synapse LDAP3 auth provider](https://github.com/matrix-org/matrix-synapse-ldap3) is not longer maintained despite
|
The [synapse LDAP3 auth provider](https://github.com/matrix-org/matrix-synapse-ldap3) only handles one specific flow: validate credentials at login.
|
||||||
saying so and only handles on specific flow: validate credentials at login.
|
|
||||||
|
|
||||||
It does not:
|
It does not:
|
||||||
- Auto-provision user profiles
|
- Auto-provision user profiles
|
||||||
|
@@ -27,7 +27,7 @@ public class ThreePid implements _ThreePid {
|
|||||||
|
|
||||||
public ThreePid(String medium, String address) {
|
public ThreePid(String medium, String address) {
|
||||||
this.medium = medium;
|
this.medium = medium;
|
||||||
this.address = address;
|
this.address = address.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -51,7 +51,7 @@ public class SynapseQueries {
|
|||||||
if (StringUtils.equals("sqlite", type)) {
|
if (StringUtils.equals("sqlite", type)) {
|
||||||
return "select " + getUserId(type, domain) + ", displayname from profiles p where displayname like ?";
|
return "select " + getUserId(type, domain) + ", displayname from profiles p where displayname like ?";
|
||||||
} else if (StringUtils.equals("postgresql", type)) {
|
} else if (StringUtils.equals("postgresql", type)) {
|
||||||
return "select " + getUserId(type, domain) + ", displayname from profiles p where displayname ilike ?";
|
return "SELECT u.name,p.displayname FROM users u JOIN profiles p ON u.name LIKE concat('@',p.user_id,':%') WHERE u.is_guest = 0 AND u.appservice_id IS NULL AND p.displayname LIKE ?";
|
||||||
} else {
|
} else {
|
||||||
throw new ConfigurationException("Invalid Synapse SQL type: " + type);
|
throw new ConfigurationException("Invalid Synapse SQL type: " + type);
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class HashingConfig {
|
public class HashingConfig {
|
||||||
|
|
||||||
@@ -13,7 +14,7 @@ public class HashingConfig {
|
|||||||
private boolean enabled = false;
|
private boolean enabled = false;
|
||||||
private int pepperLength = 20;
|
private int pepperLength = 20;
|
||||||
private RotationPolicyEnum rotationPolicy;
|
private RotationPolicyEnum rotationPolicy;
|
||||||
private HashStorageEnum hashStorageType;
|
private HashStorageEnum hashStorageType = HashStorageEnum.in_memory;
|
||||||
private String delay = "10s";
|
private String delay = "10s";
|
||||||
private transient long delayInSeconds = 10;
|
private transient long delayInSeconds = 10;
|
||||||
private int requests = 10;
|
private int requests = 10;
|
||||||
@@ -25,6 +26,7 @@ public class HashingConfig {
|
|||||||
LOGGER.info(" Pepper length: {}", getPepperLength());
|
LOGGER.info(" Pepper length: {}", getPepperLength());
|
||||||
LOGGER.info(" Rotation policy: {}", getRotationPolicy());
|
LOGGER.info(" Rotation policy: {}", getRotationPolicy());
|
||||||
LOGGER.info(" Hash storage type: {}", getHashStorageType());
|
LOGGER.info(" Hash storage type: {}", getHashStorageType());
|
||||||
|
Objects.requireNonNull(getHashStorageType(), "Storage type must be specified");
|
||||||
if (RotationPolicyEnum.per_seconds == getRotationPolicy()) {
|
if (RotationPolicyEnum.per_seconds == getRotationPolicy()) {
|
||||||
setDelayInSeconds(new DurationDeserializer().deserialize(getDelay()));
|
setDelayInSeconds(new DurationDeserializer().deserialize(getDelay()));
|
||||||
LOGGER.info(" Rotation delay: {}", getDelay());
|
LOGGER.info(" Rotation delay: {}", getDelay());
|
||||||
|
@@ -130,7 +130,9 @@ public class HomeserverFederationResolver {
|
|||||||
|
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException("Error while trying to lookup well-known for " + domain, e);
|
log.info("Error while trying to lookup well-known for " + domain);
|
||||||
|
log.trace("Error while trying to lookup well-known for " + domain, e);
|
||||||
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user