Browse Source

separating storage from configuration

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
sqlite
Stephan Richter 3 months ago
parent
commit
db59964c98
  1. 8
      de.srsoftware.oidc.app/build.gradle
  2. 3
      de.srsoftware.oidc.app/src/main/java/de/srsoftware/oidc/app/Application.java

8
de.srsoftware.oidc.app/build.gradle

@ -27,6 +27,14 @@ test { @@ -27,6 +27,14 @@ test {
useJUnitPlatform()
}
task run(type: JavaExec) {
group = "application"
description = "Run the main class with JavaExecTask"
classpath = sourceSets.main.runtimeClasspath
mainClass = 'de.srsoftware.oidc.app.Application'
args = ['--base','/home/srichter/workspace/LightOIDC/de.srsoftware.oidc.web/src/main/resources']
}
jar {
manifest {
attributes "Main-Class": "de.srsoftware.oidc.app.Application"

3
de.srsoftware.oidc.app/src/main/java/de/srsoftware/oidc/app/Application.java

@ -51,7 +51,8 @@ public class Application { @@ -51,7 +51,8 @@ public class Application {
public static void main(String[] args) throws Exception {
var argMap = map(args);
Optional<Path> basePath = argMap.get(BASE_PATH) instanceof Path p ? Optional.of(p) : empty();
var storageFile = (argMap.get(CONFIG_PATH) instanceof Path p ? p : configDir(APP_NAME).resolve("data.json")).toFile();
var configFile = (argMap.get(CONFIG_PATH) instanceof Path p ? p : configDir(APP_NAME).resolve("config.json")).toFile();
var storageFile = configDir(APP_NAME).resolve("data.json").toFile();
var keyDir = storageFile.getParentFile().toPath().resolve("keys");
var passwordHasher = new UuidHasher();
var firstHash = passwordHasher.hash(FIRST_USER_PASS, FIRST_UUID);

Loading…
Cancel
Save