From 682974af447f25506a0ad83f16976abecc1c434d Mon Sep 17 00:00:00 2001 From: Sven Carstensen Date: Tue, 24 Mar 2026 14:28:29 +0100 Subject: [PATCH] update .gitignore, MainView.java, application.properties; add .env.example --- .env.example | 33 ++++++++++++++ .gitignore | 3 ++ .../aimailassistant/mail/ui/MainView.java | 4 +- src/main/resources/application.properties | 43 ++++++++++--------- 4 files changed, 60 insertions(+), 23 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3c4f274 --- /dev/null +++ b/.env.example @@ -0,0 +1,33 @@ +# Application +PORT=8080 + +# Database +SPRING_DATASOURCE_URL=jdbc:h2:file:./data/mailassistant;DB_CLOSE_ON_EXIT=FALSE +SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.h2.Driver +SPRING_DATASOURCE_USERNAME=sa +SPRING_DATASOURCE_PASSWORD= + +# IMAP +MAIL_IMAP_HOST=mailhub.assecutor.org +MAIL_IMAP_PORT=993 +MAIL_IMAP_USERNAME= +MAIL_IMAP_PASSWORD= +MAIL_IMAP_SSL=true +MAIL_IMAP_FOLDER=INBOX +MAIL_IMAP_POLL_INTERVAL_SECONDS=60 + +# SMTP +SPRING_MAIL_HOST=mailhub.assecutor.org +SPRING_MAIL_PORT=465 +SPRING_MAIL_USERNAME= +SPRING_MAIL_PASSWORD= +SPRING_MAIL_SMTP_AUTH=true +SPRING_MAIL_SMTP_SSL_ENABLE=true +SPRING_MAIL_SMTP_SSL_REQUIRED=true + +# LLM +LLM_API_URL=http://127.0.0.1:1234/v1/chat/completions +LLM_API_MODEL=local-model + +# Google Maps +GOOGLE_MAPS_API_KEY= diff --git a/.gitignore b/.gitignore index 8ae5a02..c49d71d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,9 @@ *.iml .DS_Store +.env +.env.* +!.env.example # H2 Database files /data/ diff --git a/src/main/java/de/assecutor/aimailassistant/mail/ui/MainView.java b/src/main/java/de/assecutor/aimailassistant/mail/ui/MainView.java index 2fb3a28..fd0fede 100644 --- a/src/main/java/de/assecutor/aimailassistant/mail/ui/MainView.java +++ b/src/main/java/de/assecutor/aimailassistant/mail/ui/MainView.java @@ -129,13 +129,13 @@ public class MainView extends VerticalLayout { // Type column with badge grid.addColumn(new ComponentRenderer<>(this::createTypeBadge)) .setHeader("Typ") - .setAutoWidth(true) + .setWidth("200px") .setFlexGrow(0); // Status column with badge grid.addColumn(new ComponentRenderer<>(this::createStatusBadge)) .setHeader("Status") - .setAutoWidth(true) + .setWidth("200px") .setFlexGrow(0); // Actions column with delete button diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index fd5f7ed..00dda13 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,3 +1,4 @@ +spring.config.import=optional:file:.env[.properties] server.port=${PORT:8080} logging.level.org.atmosphere=warn @@ -8,35 +9,35 @@ vaadin.launch-browser=true vaadin.allowed-packages=com.vaadin,org.vaadin,com.flowingcode,de.assecutor.aimailassistant # H2 Database Configuration (file-based for persistence) -spring.datasource.url=jdbc:h2:file:./data/mailassistant;DB_CLOSE_ON_EXIT=FALSE -spring.datasource.driverClassName=org.h2.Driver -spring.datasource.username=sa -spring.datasource.password= +spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:h2:file:./data/mailassistant;DB_CLOSE_ON_EXIT=FALSE} +spring.datasource.driverClassName=${SPRING_DATASOURCE_DRIVER_CLASS_NAME:org.h2.Driver} +spring.datasource.username=${SPRING_DATASOURCE_USERNAME:sa} +spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:} spring.jpa.database-platform=org.hibernate.dialect.H2Dialect spring.jpa.hibernate.ddl-auto=update spring.h2.console.enabled=true # IMAP Configuration -mail.imap.host=mailhub.assecutor.org -mail.imap.port=993 -mail.imap.username=sb-anfrage@assecutor.org -mail.imap.password=?,mpIpto,88 -mail.imap.ssl=true -mail.imap.folder=INBOX -mail.imap.poll-interval-seconds=60 +mail.imap.host=${MAIL_IMAP_HOST:mailhub.assecutor.org} +mail.imap.port=${MAIL_IMAP_PORT:993} +mail.imap.username=${MAIL_IMAP_USERNAME:} +mail.imap.password=${MAIL_IMAP_PASSWORD:} +mail.imap.ssl=${MAIL_IMAP_SSL:true} +mail.imap.folder=${MAIL_IMAP_FOLDER:INBOX} +mail.imap.poll-interval-seconds=${MAIL_IMAP_POLL_INTERVAL_SECONDS:60} # SMTP Configuration -spring.mail.host=mailhub.assecutor.org -spring.mail.port=465 -spring.mail.username=sb-anfrage@assecutor.org -spring.mail.password=?,mpIpto,88 -spring.mail.properties.mail.smtp.auth=true -spring.mail.properties.mail.smtp.ssl.enable=true -spring.mail.properties.mail.smtp.ssl.required=true +spring.mail.host=${SPRING_MAIL_HOST:mailhub.assecutor.org} +spring.mail.port=${SPRING_MAIL_PORT:465} +spring.mail.username=${SPRING_MAIL_USERNAME:} +spring.mail.password=${SPRING_MAIL_PASSWORD:} +spring.mail.properties.mail.smtp.auth=${SPRING_MAIL_SMTP_AUTH:true} +spring.mail.properties.mail.smtp.ssl.enable=${SPRING_MAIL_SMTP_SSL_ENABLE:true} +spring.mail.properties.mail.smtp.ssl.required=${SPRING_MAIL_SMTP_SSL_REQUIRED:true} # LM Studio Configuration -llm.api.url=http://192.168.180.10:1234/v1/chat/completions -llm.api.model=local-model +llm.api.url=${LLM_API_URL:http://192.168.180.3:1234/v1/chat/completions} +llm.api.model=${LLM_API_MODEL:local-model} # Google Maps Configuration -google.maps.api.key=AIzaSyDnbitL06iLp3elmj-WtPudCykX9xvXcVE +google.maps.api.key=${GOOGLE_MAPS_API_KEY:}