diff --git a/src/main/java/eu/m724/talkpages/Startup.java b/src/main/java/eu/m724/talkpages/Startup.java index b0ce5fa..f1212d2 100644 --- a/src/main/java/eu/m724/talkpages/Startup.java +++ b/src/main/java/eu/m724/talkpages/Startup.java @@ -9,15 +9,20 @@ import jakarta.enterprise.event.Observes; import jakarta.inject.Inject; import jakarta.inject.Singleton; import jakarta.transaction.Transactional; +import org.eclipse.microprofile.config.inject.ConfigProperty; +// TODO remove this or make it only on first run @Singleton public class Startup { @Inject LaunchMode launchMode; + @ConfigProperty(name = "talkpages.systemUser.name") + private String username; + @Transactional public void examplePage(@Observes StartupEvent ignoredEvent) { - Account account = new Account("System"); + Account account = new Account(username); account.persistAndFlush(); addPage(account, "TalkPages", "
A website where the users collaboratively create content
"); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 64b3de0..6d0a85c 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1,2 @@ -talkpages.homePage=/ \ No newline at end of file +talkpages.homePage=/ +talkpages.systemUser.name=System \ No newline at end of file