diff --git a/doc/development.md b/doc/development.md index 99a4b0bd..560f2a5c 100644 --- a/doc/development.md +++ b/doc/development.md @@ -4,7 +4,7 @@ Frontend of the application is developed separately. The setup requires the following steps: 1) configure the application according to [Setup Guide](setup.md) -2) configure `config.properties` to contain `security.sameSite=None` +2) configure `application.properties` to contain `security.sameSite=None` This is important if you are running the application over HTTP so web browser would not block requests to the server due to CORS policy. 3) build the backend `mvn clean package` diff --git a/doc/setup.md b/doc/setup.md index 40d32b4b..b170458c 100644 --- a/doc/setup.md +++ b/doc/setup.md @@ -9,7 +9,7 @@ ### Application Configuration -The application uses `src/main/resources/config.properties` to configure: +The application uses `src/main/resources/application.properties` to configure: * connection to internal triple store * REST endpoint of Form service * SMTP configuration for sending emails @@ -54,7 +54,7 @@ SForms service is configured in `formGenServiceUrl`, the call to the service sho ### OpenID Connect Authentication RecordManager can work with an external authentication service implementing the OpenID Connect protocol. To use it, -set the `security.provider` (in `config.properties` or via `SECURITY_PROVIDER` via an environment variable) configuration to `oidc` +set the `security.provider` (in `application.properties` or via `SECURITY_PROVIDER` via an environment variable) configuration to `oidc` and configure the `spring.security.oauth2.resourceserver.jwt.issuer-uri` (in `application.properties` or using an environment variable) parameter to the URI of the OAuth2 token issuer. When using Keycloak, this corresponds to the URI of the realm through which Record Manager users authenticate their requests. For example, the value may be `http://localhost:8080/realms/record-manager`. diff --git a/src/main/java/cz/cvut/kbss/study/RecordManagerApplication.java b/src/main/java/cz/cvut/kbss/study/RecordManagerApplication.java index df496f36..28ae6281 100644 --- a/src/main/java/cz/cvut/kbss/study/RecordManagerApplication.java +++ b/src/main/java/cz/cvut/kbss/study/RecordManagerApplication.java @@ -5,7 +5,6 @@ import org.springframework.context.annotation.PropertySource; @SpringBootApplication -@PropertySource("classpath:config.properties") public class RecordManagerApplication { public static void main(String[] args) { diff --git a/src/main/java/cz/cvut/kbss/study/persistence/FormGenPersistenceFactory.java b/src/main/java/cz/cvut/kbss/study/persistence/FormGenPersistenceFactory.java index bad6ff41..0bab5333 100644 --- a/src/main/java/cz/cvut/kbss/study/persistence/FormGenPersistenceFactory.java +++ b/src/main/java/cz/cvut/kbss/study/persistence/FormGenPersistenceFactory.java @@ -19,7 +19,6 @@ import static cz.cvut.kbss.study.util.ConfigParam.FORM_GEN_REPOSITORY_URL; @Configuration -@PropertySource("classpath:config.properties") public class FormGenPersistenceFactory { private final Environment environment; diff --git a/src/main/java/cz/cvut/kbss/study/util/ConfigParam.java b/src/main/java/cz/cvut/kbss/study/util/ConfigParam.java index 676c0c7b..80c1c3f7 100644 --- a/src/main/java/cz/cvut/kbss/study/util/ConfigParam.java +++ b/src/main/java/cz/cvut/kbss/study/util/ConfigParam.java @@ -39,6 +39,8 @@ public enum ConfigParam { E_PROFILE_UPDATE_SUBJECT("email.profileUpdateSubject"), E_PROFILE_UPDATE_CONTENT("email.profileUpdateContent"), + SECURITY_PROVIDER("security.provider"), + OIDC_ROLE_CLAIM("security.oidc.roleClaim"), CORS_ALLOWED_ORIGINS("security.cors.allowedOrigins"), diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index e43a0b0e..c829826c 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,2 +1,69 @@ server.servlet.context-path=/record-manager -management.endpoints.web.exposure.include=health \ No newline at end of file +management.endpoints.web.exposure.include=health + +# Driver to manage triple stores +driver=cz.cvut.kbss.ontodriver.rdf4j.Rdf4jDataSource +# URL of repository that holds main data of the application +repositoryUrl=http://localhost:7200/repositories/record-manager-app +# URL of repository where output and configuration of form-generator should be held +formGenRepositoryUrl=http://localhost:7200/repositories/record-manager-formgen +# REST endpoint of form generator service +formGenServiceUrl=http://localhost:8080/s-pipes/service?_pId=transform&sgovRepositoryUrl=https%3A%2F%2Fgraphdb.onto.fel.cvut.cz%2Frepositories%2Fkodi-slovnik-gov-cz +# Option to pass sameSite attribute for set-cookie headers. Possible values are None,Lax,Strict. In case of None value also attribute "Secure;" is added. +security.sameSite= + +# Url of the website for password reset emails. e.g. https://study.com/ (must have "/" at the end) +appContext=http://localhost:3000/record-manager + +# SMTP host +smtp.host=smtp.gmail.com +# SMTP port +smtp.port=587 +# SMTP user +smtp.user=recordmanager@gmail.com +# SMTP password +smtp.password=AdminOrganization123 + +# Email display name +email.displayName=Record Manager +# if email.from is not entered, smtp.user is used instead +email.from= +# Email cc addresses where all invitations will be sent. For more use delimiter "," (can remain empty) +email.replyTo= +email.cc= +email.bcc= + +# You can use variables in email contents by using {{variable}}, available variables are listed before email content property +# Password Reset email subject +email.passwordResetSubject=Password Reset +# PasswordReset email html content, variables: username, link, appContext +email.passwordResetContent=
Dear user {{username}},
please set your new password here: {{link}}
Best regards,
StudyManager
Dear {{name}},
you have been invited to a study running at {{appContext}}.
Your username is: {{username}}.
\ +Please set your password here: {{link}}
Best regards,
StudyManager
Dear user {{username}},
your password has been changed.
Best regards,
RecordManager
Dear user {{username}},
your profile at {{appContext}} has been updated by a study coordinator.
Best regards,
RecordManager
Dear user {{username}},
please set your new password here: {{link}}
Best regards,
StudyManager
Dear {{name}},
you have been invited to a study running at {{appContext}}.
Your username is: {{username}}.
\ -Please set your password here: {{link}}
Best regards,
StudyManager
Dear user {{username}},
your password has been changed.
Best regards,
RecordManager
Dear user {{username}},
your profile at {{appContext}} has been updated by a study coordinator.
Best regards,
RecordManager