Merge branch 'main' into module/files

This commit is contained in:
2025-10-02 09:01:31 +02:00
2 changed files with 27 additions and 26 deletions

View File

@@ -3,6 +3,7 @@ package de.srsoftware.umbrella.backend;
import static de.srsoftware.umbrella.core.Constants.*;
import static de.srsoftware.umbrella.core.Util.mapLogLevel;
import static java.lang.System.Logger.Level.ERROR;
import static java.lang.System.Logger.Level.INFO;
import com.sun.net.httpserver.HttpServer;
@@ -59,7 +60,7 @@ public class Application {
config.get("umbrella.plantuml").map(Object::toString).map(File::new).filter(File::exists).ifPresent(Util::setPlantUmlJar);
var server = HttpServer.create(new InetSocketAddress(port), 0);
try {
new Translations().bindPath("/api/translations").on(server);
new MessageSystem(config);
new UserModule(config).bindPath("/api/user").on(server);
@@ -81,7 +82,10 @@ public class Application {
new WebHandler().bindPath("/").on(server);
new WikiModule(config).bindPath("/api/wiki").on(server);
new FileModule(config).bindPath("/api/files").on(server);
} catch (Exception e) {
LOG.log(ERROR,"Startup failed",e);
System.exit(-1);
}
server.setExecutor(Executors.newFixedThreadPool(threads));
server.start();
LOG.log(INFO,"Started web server at port {0}",port);

View File

@@ -34,13 +34,10 @@ import java.util.*;
public class SqliteDB extends BaseDb implements LoginServiceDb, UserDb {
private static final System.Logger LOG = System.getLogger(SqliteDB.class.getSimpleName());
private static final int INITIAL_DB_VERSION = 4;
public SqliteDB(Connection conn){
super(conn);
}
private void createLoginServiceTables() {
var createTable = """
CREATE TABLE IF NOT EXISTS {0} (