Skip to content
Snippets Groups Projects
Commit b05237a4 authored by Felix Sidokhine's avatar Felix Sidokhine
Browse files

exported missing package to module.info

parent a0704bdc
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
<parent>
<artifactId>jams3-parent</artifactId>
<groupId>net.jami</groupId>
<version>2.0</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -14,13 +14,13 @@
<dependency>
<groupId>net.jami</groupId>
<artifactId>jams-common</artifactId>
<version>2.0</version>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.jami</groupId>
<artifactId>datastore</artifactId>
<version>2.0</version>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
</dependencies>
......
module jami.nameserver {
requires jams.common;
requires datastore;
requires lombok;
exports net.jami.jams.nameserver;
requires org.slf4j;
requires jsoniter;
}
\ No newline at end of file
......@@ -16,4 +16,5 @@ module jams.server {
exports net.jami.jams.server.servlets.api.auth.login to org.apache.tomcat.embed.core;
exports net.jami.jams.server.servlets.api.auth.device to org.apache.tomcat.embed.core;
exports net.jami.jams.server.servlets.api.install to org.apache.tomcat.embed.core;
exports net.jami.jams.server.servlets.api.jaminameserver to org.apache.tomcat.embed.core;
}
\ No newline at end of file
......@@ -7,6 +7,8 @@ import net.jami.jams.common.objects.roots.X509Fields;
import net.jami.jams.common.objects.system.SystemAccount;
import net.jami.jams.common.objects.system.SystemAccountType;
import net.jami.jams.common.server.ServerSettings;
import net.jami.jams.nameserver.LocalNameServer;
import net.jami.jams.nameserver.PublicNameServer;
import net.jami.jams.server.Server;
import net.jami.jams.server.servlets.api.install.CachedObjects;
import net.jami.jams.server.startup.AuthModuleLoader;
......@@ -26,13 +28,25 @@ public class InstallationFinalizer {
log.info("Building configuration from submitted variables...");
ServerSettings serverSettings = new ServerSettings();
serverSettings.setCaConfiguration(JsonStream.serialize(CachedObjects.certificateAuthorityConfig));
if (CachedObjects.activeDirectorySettings != null)
if (CachedObjects.activeDirectorySettings != null) {
serverSettings.setActiveDirectoryConfiguration(JsonStream.serialize(CachedObjects.activeDirectorySettings));
if (CachedObjects.ldapSettings != null)
nameServer = new LocalNameServer(dataStore);
log.info("Server configured to use Active Directory as the authentication backend!");
}
if (CachedObjects.ldapSettings != null) {
serverSettings.setLdapConfiguration(JsonStream.serialize(CachedObjects.ldapSettings));
if (CachedObjects.localAuthSettings != null)
nameServer = new LocalNameServer(dataStore);
log.info("Server configured to use LDAP as the authentication backend!");
}
if (CachedObjects.localAuthSettings != null) {
serverSettings.setLocalDirectoryConfiguration(JsonStream.serialize(CachedObjects.localAuthSettings));
if(CachedObjects.localAuthSettings.getPublicNames()){
nameServer = new PublicNameServer(CachedObjects.localAuthSettings.getPublicNameServer());
log.warn("Server configured to use {} as the nameserver for Jami clients !",CachedObjects.localAuthSettings.getPublicNameServer());
}
else nameServer = new LocalNameServer(dataStore);
log.info("Server is configured to use local authentication engine");
}
//Now flush the server settings.
OutputStream os = new FileOutputStream(new File("config.json"));
os.write(JsonStream.serialize(serverSettings).getBytes());
......@@ -66,7 +80,7 @@ public class InstallationFinalizer {
if(serverSettings.getLdapConfiguration() != null)
userAuthenticationModule.attachAuthSource(AuthenticationSourceType.LDAP,serverSettings.getLdapConfiguration());
Server.isInstalled.set(true);
log.info("The installation has completed succesfully, you can now use JAMS!");
log.info("The installation has completed successfully, you can now use JAMS!");
} catch (Exception e) {
log.error("Could not save settings to disk with error: " + e.toString());
return false;
......
......@@ -17,8 +17,7 @@ public class NameServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String[] path = req.getServletPath().split("/");
NameLookupResponse nameLookupResponse = nameServer.getAddressFromName(path[path.length - 1]);
NameLookupResponse nameLookupResponse = nameServer.getAddressFromName(req.getPathInfo().replace("/",""));
if(nameLookupResponse == null) resp.sendError(404);
else resp.getOutputStream().write(JsonStream.serialize(nameLookupResponse).getBytes());
}
......
......@@ -3,6 +3,7 @@ package net.jami.jams.server.core.jaminamserver;
import net.jami.jams.common.jami.NameLookupResponse;
import net.jami.jams.common.jami.NameRegistrationRequest;
import net.jami.jams.common.jami.NameServer;
import net.jami.jams.nameserver.PublicNameServer;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment