added some logging
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -9,6 +9,7 @@ import static de.srsoftware.tools.Optionals.nullable;
|
||||
import static de.srsoftware.tools.Paths.configDir;
|
||||
import static de.srsoftware.tools.Strings.uuid;
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
import static java.lang.System.getenv;
|
||||
import static java.util.Optional.empty;
|
||||
|
||||
@@ -51,6 +52,7 @@ public class Application {
|
||||
private static final System.Logger LOG = System.getLogger("Application"); // new ColorLogger("Application").setLogLevel(DEBUG);
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
LOG.log(INFO,"Starting LightOIDC…");
|
||||
var argMap = map(args);
|
||||
Optional<Path> basePath = argMap.get(BASE_PATH) instanceof Path p ? Optional.of(p) : empty();
|
||||
var configDir = configDir(APP_NAME);
|
||||
@@ -63,6 +65,8 @@ public class Application {
|
||||
var firstUser = new User(FIRST_USER, firstHash, FIRST_USER, "%s@internal".formatted(FIRST_USER), FIRST_UUID).add(MANAGE_CLIENTS, MANAGE_PERMISSIONS, MANAGE_SMTP, MANAGE_USERS);
|
||||
|
||||
|
||||
if (encryptionKey.isPresent()) LOG.log(INFO,"Encryption key is set, using encrypted database.");
|
||||
|
||||
FileStoreProvider fileStoreProvider = new FileStoreProvider(passHasher);
|
||||
var userService = setupUserService(config, encryptionKey, defaultFile, fileStoreProvider, passHasher).init(firstUser);
|
||||
var sessionService = setupSessionService(config, defaultFile, fileStoreProvider);
|
||||
|
||||
@@ -12,10 +12,12 @@ import java.util.Optional;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class Configuration {
|
||||
private static final System.Logger LOG = System.getLogger(Configuration.class.getSimpleName());
|
||||
private final JSONObject json;
|
||||
private final Path storageFile;
|
||||
|
||||
public Configuration(File storage) throws IOException {
|
||||
LOG.log(System.Logger.Level.INFO,"Using configuration from {}",storage);
|
||||
storageFile = storage.toPath();
|
||||
if (!storage.exists()) {
|
||||
var parent = storage.getParentFile();
|
||||
|
||||
Reference in New Issue
Block a user