Merge branch 'main' into module/files
This commit is contained in:
@@ -3,6 +3,7 @@ package de.srsoftware.umbrella.backend;
|
|||||||
|
|
||||||
import static de.srsoftware.umbrella.core.Constants.*;
|
import static de.srsoftware.umbrella.core.Constants.*;
|
||||||
import static de.srsoftware.umbrella.core.Util.mapLogLevel;
|
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 static java.lang.System.Logger.Level.INFO;
|
||||||
|
|
||||||
import com.sun.net.httpserver.HttpServer;
|
import com.sun.net.httpserver.HttpServer;
|
||||||
@@ -59,29 +60,32 @@ public class Application {
|
|||||||
config.get("umbrella.plantuml").map(Object::toString).map(File::new).filter(File::exists).ifPresent(Util::setPlantUmlJar);
|
config.get("umbrella.plantuml").map(Object::toString).map(File::new).filter(File::exists).ifPresent(Util::setPlantUmlJar);
|
||||||
|
|
||||||
var server = HttpServer.create(new InetSocketAddress(port), 0);
|
var server = HttpServer.create(new InetSocketAddress(port), 0);
|
||||||
|
try {
|
||||||
new Translations().bindPath("/api/translations").on(server);
|
new Translations().bindPath("/api/translations").on(server);
|
||||||
new MessageSystem(config);
|
new MessageSystem(config);
|
||||||
new UserModule(config).bindPath("/api/user").on(server);
|
new UserModule(config).bindPath("/api/user").on(server);
|
||||||
new TagModule(config).bindPath("/api/tags").on(server);
|
new TagModule(config).bindPath("/api/tags").on(server);
|
||||||
new BookmarkApi(config).bindPath("/api/bookmark").on(server);
|
new BookmarkApi(config).bindPath("/api/bookmark").on(server);
|
||||||
new CompanyModule(config).bindPath("/api/company").on(server);
|
new CompanyModule(config).bindPath("/api/company").on(server);
|
||||||
new CompanyLegacy(config).bindPath("/legacy/company").on(server);
|
new CompanyLegacy(config).bindPath("/legacy/company").on(server);
|
||||||
new DocumentApi(config).bindPath("/api/document").on(server);
|
new DocumentApi(config).bindPath("/api/document").on(server);
|
||||||
new ItemApi(config).bindPath("/api/items").on(server);
|
new ItemApi(config).bindPath("/api/items").on(server);
|
||||||
new UserLegacy(config).bindPath("/legacy/user").on(server);
|
new UserLegacy(config).bindPath("/legacy/user").on(server);
|
||||||
new NotesLegacy(config).bindPath("/legacy/notes").on(server);
|
new NotesLegacy(config).bindPath("/legacy/notes").on(server);
|
||||||
new MarkdownApi().bindPath("/api/markdown").on(server);
|
new MarkdownApi().bindPath("/api/markdown").on(server);
|
||||||
new NoteModule(config).bindPath("/api/notes").on(server);
|
new NoteModule(config).bindPath("/api/notes").on(server);
|
||||||
new ProjectModule(config).bindPath("/api/project").on(server);
|
new ProjectModule(config).bindPath("/api/project").on(server);
|
||||||
new ProjectLegacy(config).bindPath("/legacy/project").on(server);
|
new ProjectLegacy(config).bindPath("/legacy/project").on(server);
|
||||||
new TaskModule(config).bindPath("/api/task").on(server);
|
new TaskModule(config).bindPath("/api/task").on(server);
|
||||||
new TaskLegacy().bindPath("/legacy/task").on(server);
|
new TaskLegacy().bindPath("/legacy/task").on(server);
|
||||||
new TimeModule(config).bindPath("/api/time").on(server);
|
new TimeModule(config).bindPath("/api/time").on(server);
|
||||||
new WebHandler().bindPath("/").on(server);
|
new WebHandler().bindPath("/").on(server);
|
||||||
new WikiModule(config).bindPath("/api/wiki").on(server);
|
new WikiModule(config).bindPath("/api/wiki").on(server);
|
||||||
new FileModule(config).bindPath("/api/files").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.setExecutor(Executors.newFixedThreadPool(threads));
|
||||||
server.start();
|
server.start();
|
||||||
LOG.log(INFO,"Started web server at port {0}",port);
|
LOG.log(INFO,"Started web server at port {0}",port);
|
||||||
|
|||||||
@@ -34,13 +34,10 @@ import java.util.*;
|
|||||||
public class SqliteDB extends BaseDb implements LoginServiceDb, UserDb {
|
public class SqliteDB extends BaseDb implements LoginServiceDb, UserDb {
|
||||||
private static final System.Logger LOG = System.getLogger(SqliteDB.class.getSimpleName());
|
private static final System.Logger LOG = System.getLogger(SqliteDB.class.getSimpleName());
|
||||||
|
|
||||||
private static final int INITIAL_DB_VERSION = 4;
|
|
||||||
|
|
||||||
public SqliteDB(Connection conn){
|
public SqliteDB(Connection conn){
|
||||||
super(conn);
|
super(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void createLoginServiceTables() {
|
private void createLoginServiceTables() {
|
||||||
var createTable = """
|
var createTable = """
|
||||||
CREATE TABLE IF NOT EXISTS {0} (
|
CREATE TABLE IF NOT EXISTS {0} (
|
||||||
|
|||||||
Reference in New Issue
Block a user