diff --git a/pom.xml b/pom.xml index 586da22263047c692701ae73ab2218ecab38b33f..d794be47756f359daba3477afc37d032f99b15e2 100644 --- a/pom.xml +++ b/pom.xml @@ -313,6 +313,10 @@ <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </dependency> + <dependency> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> diff --git a/src/main/java/de/thm/arsnova/config/AppConfig.java b/src/main/java/de/thm/arsnova/config/AppConfig.java index 4f21115f2c3eb92a5ee038010d46a9d52197840d..b8cbe1b6b5b7b74e3c912a7c8f7f6fc4a2d876a3 100644 --- a/src/main/java/de/thm/arsnova/config/AppConfig.java +++ b/src/main/java/de/thm/arsnova/config/AppConfig.java @@ -97,9 +97,10 @@ import de.thm.arsnova.websocket.ArsnovaSocketioServerImpl; @EnableSpringConfigured @EnableWebMvc @PropertySource( - value = {"classpath:arsnova.properties.example", "file:/etc/arsnova/arsnova.properties"}, + value = {"classpath:config/defaults.yml", "file:/etc/arsnova/application.yml"}, ignoreResourceNotFound = true, - encoding = "UTF-8" + encoding = "UTF-8", + factory = YamlPropertySourceFactory.class ) public class AppConfig implements WebMvcConfigurer { public static final String API_V2_MEDIA_TYPE_VALUE = "application/vnd.de.thm.arsnova.v2+json"; diff --git a/src/main/java/de/thm/arsnova/config/PrefixedYamlPropertiesFactoryBean.java b/src/main/java/de/thm/arsnova/config/PrefixedYamlPropertiesFactoryBean.java new file mode 100644 index 0000000000000000000000000000000000000000..4b5bf3f2ed7828839214b5af9e5c06d63108cc02 --- /dev/null +++ b/src/main/java/de/thm/arsnova/config/PrefixedYamlPropertiesFactoryBean.java @@ -0,0 +1,21 @@ +package de.thm.arsnova.config; + +import java.util.Properties; +import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; +import org.springframework.core.CollectionFactory; + +public class PrefixedYamlPropertiesFactoryBean extends YamlPropertiesFactoryBean { + private static final String PREFIX = "arsnova"; + + @Override + protected Properties createProperties() { + final Properties result = CollectionFactory.createStringAdaptingProperties(); + process((properties, map) -> properties.forEach((k, v) -> { + if (k.toString().startsWith(PREFIX + ".")) { + result.put(k.toString().substring(PREFIX.length() + 1), v); + } + })); + + return result; + } +} diff --git a/src/main/java/de/thm/arsnova/config/YamlPropertySourceFactory.java b/src/main/java/de/thm/arsnova/config/YamlPropertySourceFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..3e1253e44b00ea0dd6b02817e42a3c79ca29d7d2 --- /dev/null +++ b/src/main/java/de/thm/arsnova/config/YamlPropertySourceFactory.java @@ -0,0 +1,30 @@ +package de.thm.arsnova.config; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Properties; +import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; +import org.springframework.core.env.PropertiesPropertySource; +import org.springframework.core.env.PropertySource; +import org.springframework.core.io.support.DefaultPropertySourceFactory; +import org.springframework.core.io.support.EncodedResource; + +public class YamlPropertySourceFactory extends DefaultPropertySourceFactory { + @Override + public PropertySource<?> createPropertySource(final String name, final EncodedResource resource) + throws IOException { + try { + final YamlPropertiesFactoryBean yamlPropertiesFactoryBean = new PrefixedYamlPropertiesFactoryBean(); + yamlPropertiesFactoryBean.setResources(resource.getResource()); + yamlPropertiesFactoryBean.afterPropertiesSet(); + final Properties properties = yamlPropertiesFactoryBean.getObject(); + + return new PropertiesPropertySource(name != null ? name : resource.getResource().getFilename(), properties); + } catch (final IllegalStateException e) { + if (e.getCause() instanceof FileNotFoundException) { + throw (FileNotFoundException) e.getCause(); + } + throw e; + } + } +} diff --git a/src/main/resources/arsnova.properties.example b/src/main/resources/arsnova.properties.example deleted file mode 100644 index 9871a88e05c3f8ff1e2d86728411c794bc556580..0000000000000000000000000000000000000000 --- a/src/main/resources/arsnova.properties.example +++ /dev/null @@ -1,349 +0,0 @@ -################################################################################ -# General server settings -################################################################################ -# The URL under which the ARSnova server is reachable. Use -# http://localhost:8080 for development. -root-url=https://example.com - -# The path where the ARSnova API is accessible by clients. By default, this path -# is set to the context path of the backend. If you are running the backend -# behind a proxy server, you might need to set this path manually. -#api.path=/api - -# The context paths where the ARSnova modules have been deployed -customization.path=/customization -mobile.path=/mobile -presenter.path=/presenter - -# WebSockets server -socketio.bind-address=localhost -socketio.port=8090 -# SSL/TLS configuration -# To enable SSL for Socket.IO you have to import your key and certificate files into a Java Key Store. If you tunnel -# WebSocket connections through a proxy server, you can skip this configuration. -# See https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html -# -#socketio.ssl.jks-file=/etc/arsnova/arsnova.jks -#socketio.ssl.jks-password=arsnova -#socketio.proxy-path=/socket.io - -# Admin accounts -# Usernames of the accounts which are allowed to manage global messages of the -# day. Multiple accounts are separated by commas. -security.admin-accounts= - - -################################################################################ -# Database -################################################################################ -couchdb.host=localhost -couchdb.port=5984 -couchdb.name=arsnova3 -couchdb.username=admin -couchdb.password= -#couchdb.migrate-from=arsnova - - -################################################################################ -# E-Mail -################################################################################ -mail.sender.name=ARSnova -mail.sender.address= -mail.host= - - -################################################################################ -# Authentication -################################################################################ -# After the specified number of login tries the client IP will be banned for -# several minutes -security.authentication.login-try-limit=50 - -# JSON Web Tokens -# -security.jwt.serverId=arsnova.backend.v3:com.example -security.jwt.secret= -security.jwt.validity-period=T6H - -# Configuration parameters for authentication services: -# enabled: enable or disable the service -# allowed-roles: enable/disable service for a specific role (valid roles: speaker, student) -# (security note: this is currently only handled by the frontend!) -# title: the title which is displayed by frontends -# login-dialog-path: URL of a login dialog page -# image: an image which is used for frontend buttons - -# Guest authentication -# -security.guest.enabled=true -security.guest.allowed-roles=speaker,student -security.guest.order=0 - -# Setup combined login if you want to use a single, customized login page -# which is used for multiple authentication services. -# -security.custom-login.enabled=false -security.custom-login.allowed-roles=speaker,student -security.custom-login.title=University -security.custom-login.login-dialog-path= -security.custom-login.image= -security.custom-login.order=0 - -# Internal authentication -# -# Specific parameters: -# activation-path: URL of the account activation page -# allowed-email-domains: Allows you to restrict registration to specific -# domains. You can use wildcards (*), e. g. *.*.example.com. Multiple -# entries are separated by commas. -# registration-mail.subject: Subject used for registration e-mail -# registration-mail.body: Text body used for registration e-mail. {0} will be -# replaced by the value of activation-path. -# -security.user-db.enabled=true -security.user-db.allowed-roles=speaker,student -security.user-db.title=ARSnova -security.user-db.login-dialog-path=account.html -security.user-db.activation-path=account.html -security.user-db.reset-password-path=account.html -security.user-db.image= -security.user-db.order=0 -security.user-db.allowed-email-domains=* -security.user-db.registration-mail.subject=ARSnova Registration -security.user-db.registration-mail.body=Welcome to ARSnova!\n\nPlease confirm \ - your registration by visiting the following web address:\n{0}\n\ - Your activation key is:\n{1}\n\n\ - Afterwards, you can log into ARSnova with your e-mail address and password. -security.user-db.reset-password-mail.subject=ARSnova Password Reset -security.user-db.reset-password-mail.body=You requested to reset your \ - password.\n\nPlease follow the link below to set a new password:\n{0}\n\n\ - Your reset key is:\n{1} - -# LDAP authentication -# -# Specific parameters: -# url: LDAP server URL -# user-dn-pattern: Pattern used to check user credentials against the LDAP -# server. {0} will be replaced with the user ID by ARSnova. -# -security.ldap.enabled=false -security.ldap.allowed-roles=speaker,student -security.ldap.title=LDAP -security.ldap.login-dialog-path=login-ldap.html -security.ldap.image= -security.ldap.order=0 -security.ldap.url=ldaps://example.com:636/dc=example,dc=com -security.ldap.user-dn-pattern=uid={0},ou=arsnova -# Set the following properties if you want to use LDAP search instead of binding -# with a DN pattern -#security.ldap.user-search-filter=(uid={0}) -#security.ldap.user-search-base="ou=people" -# Configure the LDAP manager user if anonymous binding is not allowed -#security.ldap.manager-user-dn=cn=arsnova-manager,dc=example,dc=com -#security.ldap.manager-password=arsnova - -# CAS authentication -# -security.cas.enabled=false -security.cas.allowed-roles=speaker,student -security.cas.title=CAS -security.cas.image= -security.cas.order=0 -security.cas-server-url=https://example.com/cas - -# OpenID Connect authentication -# -security.oidc.enabled=false -security.oidc.allowed-roles=speaker,student -security.oidc.title=OIDC -security.oidc.image= -security.oidc.order=0 -security.oidc.issuer=https://example.com/oidc -security.oidc.client-id= -security.oidc.secret= - -# OAuth authentication with third party services -# Specific parameters: -# key: OAuth key/id provided by a third party auth service -# secret: OAuth secret provided by a third party auth service - -# Facebook -# -security.facebook.enabled=false -security.facebook.allowed-roles=speaker,student -security.facebook.order=0 -security.facebook.key= -security.facebook.secret= - -# Twitter -# -security.twitter.enabled=false -security.twitter.allowed-roles=speaker,student -security.twitter.order=0 -security.twitter.key= -security.twitter.secret= - -# Google -# -security.google.enabled=false -security.google.allowed-roles=speaker,student -security.google.order=0 -security.google.key= -security.google.secret= - - -################################################################################ -# Cross-Origin Resource Sharing -################################################################################ -# CORS grants full API access to client-side (browser) applications from other -# domains. Multiple entries are separated by commas. Untrusted and vulnerable -# applications running on these domains pose a security risk to ARSnova users. -#security.cors.origins=https:// - - -################################################################################ -# ARSnova Connector (for LMS) -################################################################################ -connector.enable=false -connector.uri=http://localhost:8080/connector-service -connector.username=test -connector.password=test - - -################################################################################ -# Features -################################################################################ -# Enable MathJax to allow the use of Math formulas written in TeX syntax in -# text fields. -features.mathjax.enabled=true -features.mathjax.src=//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js - -# The following features are considered experimental because they have not been -# tested in a production environment over a longer time frame and/or their -# behavior will change in future releases. -# -features.freetext-imageanswer.enabled=true -features.question-format.grid-square.enabled=true - -# Without enabled session-import-export feature no sessions can be added to the -# public pool -# -features.session-import-export.enabled=true -features.public-pool.enabled=true -features.export-to-click.enabled=true - -################################################################################ -# Customization -################################################################################ -# Minutes, after which the feedback is deleted -feedback.cleanup=10 - -# Number of "you've lost me"/"abgehängt" votes, starting to show warning sign -feedback.warning=15 - -# Maximal filesize in bytes -upload.filesize_b=4194304 - -# Maximal thumbnail size in pixels -imageupload.thumbnail.width=400 -imageupload.thumbnail.height=400 - -# Maximal number of answer options allowed for a skill question -question.answer-option-limit=8 - -# Enable Markdown and MathJax parsing in answer options. Formatting in answer -# options should be used cautiously since it could lead to display errors. -# Answer options will still not be parsed in diagrams. This setting has no -# effect if neither MathJax nor Markdown are enabled. -question.parse-answer-option-formatting=false - -# Demo session id to show above session login button -# You can freely use the demo session of https://arsnova.eu/mobile which can be -# imported from the repro: -# https://github.com/thm-projects/arsnova-mobile/tree/master/demo-sessions -session.demo-id= - -# Delete guest sessions automatically after X days of owner inactivity. -#session.guest-session.cleanup-days=180 - -# Anonymize user content for users with X days of inactivity -#user.cleanup-days=180 - -# Label underneath ARSnova logo -ui.slogan=Audience Response System - -# Splashscreen configuration -# Best results are achieved with logos that have the same width and height. -# -ui.splashscreen.logo-path=resources/images/arsnova-logo.png -ui.splashscreen.slogan=Audience Response System -ui.splashscreen.min-delay=3000 - -# Splash screen colors -# These settings override the default colors of the frontend theme. -# -#ui.splashscreen.slogan-color= -#ui.splashscreen.background-color= -#ui.splashscreen.loading-ind-color= - -# Links which are displayed in the frontend applications -# -links.blog.url=https://arsnova.eu/blog/ -links.documentation.url=https://arsnova.eu/manual/ -links.presenter-documentation.url= -links.overlay.url=https://arsnova.eu/overlay/ -links.organization.url= -links.imprint.url= -links.privacy-policy.url= - -# Configuration for the public pool -# -pp.subjects = Allgemeines,Anglistik,Architektur,Bauingenieurwesen,Betriebswirtschaftslehre,Biologie,Chemie,Elektrotechnik,Geographie,Geowissenschaften,Germanistik,Geschichtswissenschaft,Informatik,Kunst,Kunstpädagogik,Maschinenbau,Mathematik,Medienwissenschaften,Medizin,Musik,Pharmazie,Physik,Psychologie,Rechtswissenschaften,Stadtplanung,Theaterwissenschaften,Theologie,Vermessungswesen,Volkswirtschaftslehre -pp.licenses = CC by - Attribution,\ - CC nc - Non-Commercial,\ - CC nd - No Derivatives,\ - CC sa - Share Alike,\ - CCO - Public Domain,\ - CC by-nd - Attribution-No Derivatives,\ - CC by-c - Attribution-Non-Commercial,\ - CC by-nc-sa - Attribution-Non-Derivatives-Share Alike,\ - CC by-nc-nd Attribution-Non-Commercial- No Derivatives,\ - GNU GPL - GNU General Public License -pp.logofilesize_b = 102400 -# Do not reorder levels. Append new levels to the end of the list. Otherwise, -# references in existing public sessions could be mixed up. -# -pp.session-levels.de = Allgemeinbildung,\ - Abitur,\ - Bachelor,\ - Master,\ - Wer wird Millionär,\ - Sonstiges -pp.session-levels.en = General Education,\ - Highschool,\ - Bachelor,\ - Master,\ - Who Wants to Be a Millionaire,\ - Miscellaneous - - -################################################################################ -# Messaging / Microservices -################################################################################ -messaging.relay.enabled=false -messaging.relay.host=localhost -messaging.relay.port=61613 -messaging.relay.user=arsnova -messaging.relay.password=arsnova - - - -################################################################################ -# Tracking -################################################################################ -# It is possible to use an external tracking software with ARSnova. Currently -# Matomo is the only supported tracking provider. -# -tracking.provider=matomo -tracking.tracker-url= -tracking.site-id= diff --git a/src/main/resources/config/defaults.yml b/src/main/resources/config/defaults.yml new file mode 100644 index 0000000000000000000000000000000000000000..a5469f1be46d0faaa1cc1c580137a13ba4b4faaf --- /dev/null +++ b/src/main/resources/config/defaults.yml @@ -0,0 +1,334 @@ +arsnova: + ################################################################################ + # General server settings + ################################################################################ + + # The URL under which the ARSnova server is reachable. Use + # http://localhost:8080 for development. + root-url: https://example.com + + # The path where the ARSnova API is accessible by clients. By default, this path + # is set to the context path of the backend. If you are running the backend + # behind a proxy server, you might need to set this path manually. + api: + path: /api + + # The context paths where the ARSnova modules have been deployed + customization: + path: /customization + mobile: + path: /mobile + presenter: + path: /presenter + + # WebSocket server + socketio: + bind-address: localhost + port: 8090 + ssl: + # To enable SSL for Socket.IO you have to import your key and certificate files into a Java Key Store. If you tunnel + # WebSocket connections through a proxy server, you can skip this configuration. + # See https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html + jks-file: /etc/arsnova/arsnova.jks + jks-password: arsnova + proxy-path: /socket.io + + ################################################################################ + # Database + ################################################################################ + couchdb: + host: localhost + port: 5984 + name: arsnova3 + username: admin + password: "" + migrate-from: arsnova + + ################################################################################ + # E-Mail + ################################################################################ + mail: + sender: + name: ARSnova + address: "" + host: "" + + ################################################################################ + # Authentication + ################################################################################ + security: + # Admin accounts + # Usernames of the accounts which are allowed to manage global messages of the + # day. Multiple accounts are separated by commas. + admin-accounts: "" + authentication: + # After the specified number of login tries the client IP will be banned for + # several minutes + login-try-limit: 50 + + # JSON Web Tokens + jwt: + serverId: arsnova.backend.v3:com.example + secret: "" + validity-period: T6H + + # CORS grants full API access to client-side (browser) applications from other + # domains. Multiple entries are separated by commas. Untrusted and vulnerable + # applications running on these domains pose a security risk to ARSnova users. + cors: + origins: https:// + + # Guest authentication + guest: + enabled: true + allowed-roles: speaker,student + order: 0 + + # Setup combined login if you want to use a single, customized login page + # which is used for multiple authentication services. + custom-login: + enabled: false + allowed-roles: speaker,student + title: University + login-dialog-path: "" + image: "" + order: 0 + + # Internal authentication + # + # Specific parameters: + # activation-path: URL of the account activation page + # allowed-email-domains: Allows you to restrict registration to specific + # domains. You can use wildcards (*), e. g. *.*.example.com. Multiple + # entries are separated by commas. + # registration-mail.subject: Subject used for registration e-mail + # registration-mail.body: Text body used for registration e-mail. {0} will be + # replaced by the value of activation-path. + user-db: + enabled: true + allowed-roles: speaker,student + title: ARSnova + login-dialog-path: account.html + activation-path: account.html + reset-password-path: account.html + image: "" + order: 0 + allowed-email-domains: '*' + registration-mail: + subject: ARSnova Registration + body: |- + Welcome to ARSnova! + + Please confirm your registration by visiting the following web address: + {0} + + Afterwards, you can log into ARSnova with your e-mail address and password. + reset-password-mail: + subject: ARSnova Password Reset + body: |- + You requested to reset your password. + + Please follow the link below to set a new password: + {0} + + # LDAP authentication + # + # Specific parameters: + # url: LDAP server URL + # user-dn-pattern: Pattern used to check user credentials against the LDAP + # server. {0} will be replaced with the user ID by ARSnova. + ldap: + enabled: false + allowed-roles: speaker,student + title: LDAP + login-dialog-path: login-ldap.html + image: "" + order: 0 + url: ldaps://example.com:636/dc=example,dc=com + user-dn-pattern: uid={0},ou=arsnova + # Set the following properties if you want to use LDAP search instead of binding + # with a DN pattern + user-search-filter: (uid={0}) + user-search-base: '"ou=people"' + # Configure the LDAP manager user if anonymous binding is not allowed + manager-user-dn: cn=arsnova-manager,dc=example,dc=com + manager-password: arsnova + + # CAS authentication + cas: + enabled: false + allowed-roles: speaker,student + title: CAS + image: "" + order: 0 + cas-server-url: https://example.com/cas + + # OpenID Connect authentication + oidc: + enabled: false + allowed-roles: speaker,student + title: OIDC + image: "" + order: 0 + issuer: https://example.com/oidc + client-id: "" + secret: "" + + # OAuth authentication with third party services + # Specific parameters: + # key: OAuth key/id provided by a third party auth service + # secret: OAuth secret provided by a third party auth service + facebook: + enabled: false + allowed-roles: speaker,student + order: 0 + key: "" + secret: "" + twitter: + enabled: false + allowed-roles: speaker,student + order: 0 + key: "" + secret: "" + google: + enabled: false + allowed-roles: speaker,student + order: 0 + key: "" + secret: "" + + messaging: + relay: + enabled: false + host: localhost + port: 61613 + user: arsnova + password: arsnova + + ################################################################################ + # ARSnova Connector (for LMS) + ################################################################################ + connector: + enable: false + uri: http://localhost:8080/connector-service + username: test + password: test + + ################################################################################ + # Features + ################################################################################ + features: + mathjax: + # Enable MathJax to allow the use of Math formulas written in TeX syntax in + # text fields. + enabled: true + src: //cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js + + # The following features are considered experimental because they have not been + # tested in a production environment over a longer time frame and/or their + # behavior will change in future releases. + freetext-imageanswer: + enabled: true + question-format: + grid-square: + enabled: true + + # Without enabled session-import-export feature no sessions can be added to the + # public pool + session-import-export: + enabled: true + public-pool: + enabled: true + export-to-click: + enabled: true + + ################################################################################ + # Customization + ################################################################################ + feedback: + # Minutes, after which the feedback is deleted + cleanup: 10 + # Number of "you've lost me"/"abgehängt" votes, starting to show warning sign + warning: 15 + upload: + # Maximal filesize in bytes + filesize_b: 4194304 + imageupload: + thumbnail: + # Maximal thumbnail size in pixels + width: 400 + height: 400 + question: + # Maximal number of answer options allowed for a skill question + answer-option-limit: 8 + # Enable Markdown and MathJax parsing in answer options. Formatting in answer + # options should be used cautiously since it could lead to display errors. + # Answer options will still not be parsed in diagrams. This setting has no + # effect if neither MathJax nor Markdown are enabled. + parse-answer-option-formatting: false + session: + # Demo session id to show above session login button + # You can freely use the demo session of https://arsnova.eu/mobile which can be + # imported from the repro: + # https://github.com/thm-projects/arsnova-mobile/tree/master/demo-sessions + demo-id: "" + guest-session: + # Delete guest sessions automatically after X days of owner inactivity. + cleanup-days: 180 + user: + # Anonymize user content for users with X days of inactivity + cleanup-days: 180 + ui: + # Label underneath ARSnova logo + slogan: Audience Response System + + # Splashscreen configuration + # Best results are achieved with logos that have the same width and height. + splashscreen: + logo-path: resources/images/arsnova-logo.png + slogan: Audience Response System + min-delay: 3000 + + # Splash screen colors + # These settings override the default colors of the frontend theme. + slogan-color: "" + background-color: "" + loading-ind-color: "" + + # Links which are displayed in the frontend applications + links: + blog: + url: https://arsnova.eu/blog/ + documentation: + url: https://arsnova.eu/manual/ + presenter-documentation: + url: "" + overlay: + url: https://arsnova.eu/overlay/ + organization: + url: "" + imprint: + url: "" + privacy-policy: + url: "" + + # Configuration for the public pool + pp: + subjects: Allgemeines,Anglistik,Architektur,Bauingenieurwesen,Betriebswirtschaftslehre,Biologie,Chemie,Elektrotechnik,Geographie,Geowissenschaften,Germanistik,Geschichtswissenschaft,Informatik,Kunst,Kunstpädagogik,Maschinenbau,Mathematik,Medienwissenschaften,Medizin,Musik,Pharmazie,Physik,Psychologie,Rechtswissenschaften,Stadtplanung,Theaterwissenschaften,Theologie,Vermessungswesen,Volkswirtschaftslehre + licenses: CC by - Attribution,CC nc - Non-Commercial,CC nd - No Derivatives,CC sa - Share Alike,CCO - Public Domain,CC by-nd - Attribution-No Derivatives,CC by-c - Attribution-Non-Commercial,CC by-nc-sa - Attribution-Non-Derivatives-Share Alike,CC by-nc-nd Attribution-Non-Commercial- No Derivatives,GNU GPL - GNU General Public License + logofilesize_b: 102400 + # Do not reorder levels. Append new levels to the end of the list. Otherwise, + # references in existing public sessions could be mixed up. + session-levels: + de: Allgemeinbildung,Abitur,Bachelor,Master,Wer wird Millionär,Sonstiges + en: General Education,Highschool,Bachelor,Master,Who Wants to Be a Millionaire,Miscellaneous + + ################################################################################ + # Tracking + ################################################################################ + # It is possible to use an external tracking software with ARSnova. Currently + # Matomo is the only supported tracking provider. + tracking: + provider: matomo + tracker-url: "" + site-id: "" diff --git a/src/test/java/de/thm/arsnova/config/TestAppConfig.java b/src/test/java/de/thm/arsnova/config/TestAppConfig.java index b63470c6fc7d795f42fca2f788188bb56a6d795d..9791a6d204e4c734d726b445fbfebf327043cb50 100644 --- a/src/test/java/de/thm/arsnova/config/TestAppConfig.java +++ b/src/test/java/de/thm/arsnova/config/TestAppConfig.java @@ -61,8 +61,9 @@ import de.thm.arsnova.websocket.ArsnovaSocketioServerImpl; @EnableSpringConfigured @EnableWebMvc @PropertySource( - value = "classpath:arsnova.test.properties.example", - encoding = "UTF-8" + value = "classpath:config/test.yml", + encoding = "UTF-8", + factory = YamlPropertySourceFactory.class ) @Profile("test") public class TestAppConfig { diff --git a/src/test/resources/arsnova.test.properties.example b/src/test/resources/arsnova.test.properties.example deleted file mode 100644 index 2464f2026e93baddcc0513e965082199ae605f38..0000000000000000000000000000000000000000 --- a/src/test/resources/arsnova.test.properties.example +++ /dev/null @@ -1,349 +0,0 @@ -################################################################################ -# General server settings -################################################################################ -# The URL under which the ARSnova server is reachable. Use -# http://localhost:8080 for development. -root-url=https://example.com - -# The path where the ARSnova API is accessible by clients. By default, this path -# is set to the context path of the backend. If you are running the backend -# behind a proxy server, you might need to set this path manually. -#api.path=/api - -# The context paths where the ARSnova modules have been deployed -customization.path=/customization -mobile.path=/mobile -presenter.path=/presenter - -# WebSockets server -socketio.bind-address=localhost -socketio.port=8090 -# SSL/TLS configuration -# To enable SSL for Socket.IO you have to import your key and certificate files into a Java Key Store. If you tunnel -# WebSocket connections through a proxy server, you can skip this configuration. -# See https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html -# -#socketio.ssl.jks-file=/etc/arsnova/arsnova.jks -#socketio.ssl.jks-password=arsnova -#socketio.proxy-path=/socket.io - -# Admin accounts -# Usernames of the accounts which are allowed to manage global messages of the -# day. Multiple accounts are separated by commas. -security.admin-accounts=TestAdmin - - -################################################################################ -# Database -################################################################################ -couchdb.host=localhost -couchdb.port=5984 -couchdb.name=arsnova3 -couchdb.username=admin -couchdb.password= -#couchdb.migrate-from=arsnova - - -################################################################################ -# E-Mail -################################################################################ -mail.sender.name=ARSnova -mail.sender.address= -mail.host= - - -################################################################################ -# Authentication -################################################################################ -# After the specified number of login tries the client IP will be banned for -# several minutes -security.authentication.login-try-limit=50 - -# JSON Web Tokens -# -security.jwt.serverId=arsnova.backend.v3:com.example -security.jwt.secret= -security.jwt.validity-period=T6H - -# Configuration parameters for authentication services: -# enabled: enable or disable the service -# allowed-roles: enable/disable service for a specific role (valid roles: speaker, student) -# (security note: this is currently only handled by the frontend!) -# title: the title which is displayed by frontends -# login-dialog-path: URL of a login dialog page -# image: an image which is used for frontend buttons - -# Guest authentication -# -security.guest.enabled=true -security.guest.allowed-roles=speaker,student -security.guest.order=0 - -# Setup combined login if you want to use a single, customized login page -# which is used for multiple authentication services. -# -security.custom-login.enabled=false -security.custom-login.allowed-roles=speaker,student -security.custom-login.title=University -security.custom-login.login-dialog-path= -security.custom-login.image= -security.custom-login.order=0 - -# Internal authentication -# -# Specific parameters: -# activation-path: URL of the account activation page -# allowed-email-domains: Allows you to restrict registration to specific -# domains. You can use wildcards (*), e. g. *.*.example.com. Multiple -# entries are separated by commas. -# registration-mail.subject: Subject used for registration e-mail -# registration-mail.body: Text body used for registration e-mail. {0} will be -# replaced by the value of activation-path. -# -security.user-db.enabled=true -security.user-db.allowed-roles=speaker,student -security.user-db.title=ARSnova -security.user-db.login-dialog-path=account.html -security.user-db.activation-path=account.html -security.user-db.reset-password-path=account.html -security.user-db.image= -security.user-db.order=0 -security.user-db.allowed-email-domains=* -security.user-db.registration-mail.subject=ARSnova Registration -security.user-db.registration-mail.body=Welcome to ARSnova!\n\nPlease confirm \ - your registration by visiting the following web address:\n{0}\n\ - Your activation key is:\n{1}\n\n\ - Afterwards, you can log into ARSnova with your e-mail address and password. -security.user-db.reset-password-mail.subject=ARSnova Password Reset -security.user-db.reset-password-mail.body=You requested to reset your \ - password.\n\nPlease follow the link below to set a new password:\n{0}\n\n\ - Your reset key is:\n{1} - -# LDAP authentication -# -# Specific parameters: -# url: LDAP server URL -# user-dn-pattern: Pattern used to check user credentials against the LDAP -# server. {0} will be replaced with the user ID by ARSnova. -# -security.ldap.enabled=false -security.ldap.allowed-roles=speaker,student -security.ldap.title=LDAP -security.ldap.login-dialog-path=login-ldap.html -security.ldap.image= -security.ldap.order=0 -security.ldap.url=ldaps://example.com:636/dc=example,dc=com -security.ldap.user-dn-pattern=uid={0},ou=arsnova -# Set the following properties if you want to use LDAP search instead of binding -# with a DN pattern -#security.ldap.user-search-filter=(uid={0}) -#security.ldap.user-search-base="ou=people" -# Configure the LDAP manager user if anonymous binding is not allowed -#security.ldap.manager-user-dn=cn=arsnova-manager,dc=example,dc=com -#security.ldap.manager-password=arsnova - -# CAS authentication -# -security.cas.enabled=false -security.cas.allowed-roles=speaker,student -security.cas.title=CAS -security.cas.image= -security.cas.order=0 -security.cas-server-url=https://example.com/cas - -# OpenID Connect authentication -# -security.oidc.enabled=false -security.oidc.allowed-roles=speaker,student -security.oidc.title=OIDC -security.oidc.image= -security.oidc.order=0 -security.oidc.issuer=https://example.com/oidc -security.oidc.client-id= -security.oidc.secret= - -# OAuth authentication with third party services -# Specific parameters: -# key: OAuth key/id provided by a third party auth service -# secret: OAuth secret provided by a third party auth service - -# Facebook -# -security.facebook.enabled=false -security.facebook.allowed-roles=speaker,student -security.facebook.order=0 -security.facebook.key= -security.facebook.secret= - -# Twitter -# -security.twitter.enabled=false -security.twitter.allowed-roles=speaker,student -security.twitter.order=0 -security.twitter.key= -security.twitter.secret= - -# Google -# -security.google.enabled=false -security.google.allowed-roles=speaker,student -security.google.order=0 -security.google.key= -security.google.secret= - - -################################################################################ -# Cross-Origin Resource Sharing -################################################################################ -# CORS grants full API access to client-side (browser) applications from other -# domains. Multiple entries are separated by commas. Untrusted and vulnerable -# applications running on these domains pose a security risk to ARSnova users. -#security.cors.origins=https:// - - -################################################################################ -# ARSnova Connector (for LMS) -################################################################################ -connector.enable=false -connector.uri=http://localhost:8080/connector-service -connector.username=test -connector.password=test - - -################################################################################ -# Features -################################################################################ -# Enable MathJax to allow the use of Math formulas written in TeX syntax in -# text fields. -features.mathjax.enabled=true -features.mathjax.src=//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js - -# The following features are considered experimental because they have not been -# tested in a production environment over a longer time frame and/or their -# behavior will change in future releases. -# -features.freetext-imageanswer.enabled=true -features.question-format.grid-square.enabled=true - -# Without enabled session-import-export feature no sessions can be added to the -# public pool -# -features.session-import-export.enabled=true -features.public-pool.enabled=true -features.export-to-click.enabled=true - -################################################################################ -# Customization -################################################################################ -# Minutes, after which the feedback is deleted -feedback.cleanup=10 - -# Number of "you've lost me"/"abgehängt" votes, starting to show warning sign -feedback.warning=15 - -# Maximal filesize in bytes -upload.filesize_b=4194304 - -# Maximal thumbnail size in pixels -imageupload.thumbnail.width=400 -imageupload.thumbnail.height=400 - -# Maximal number of answer options allowed for a skill question -question.answer-option-limit=8 - -# Enable Markdown and MathJax parsing in answer options. Formatting in answer -# options should be used cautiously since it could lead to display errors. -# Answer options will still not be parsed in diagrams. This setting has no -# effect if neither MathJax nor Markdown are enabled. -question.parse-answer-option-formatting=false - -# Demo session id to show above session login button -# You can freely use the demo session of https://arsnova.eu/mobile which can be -# imported from the repro: -# https://github.com/thm-projects/arsnova-mobile/tree/master/demo-sessions -session.demo-id= - -# Delete guest sessions automatically after X days of owner inactivity. -#session.guest-session.cleanup-days=180 - -# Anonymize user content for users with X days of inactivity -#user.cleanup-days=180 - -# Label underneath ARSnova logo -ui.slogan=Audience Response System - -# Splashscreen configuration -# Best results are achieved with logos that have the same width and height. -# -ui.splashscreen.logo-path=resources/images/arsnova-logo.png -ui.splashscreen.slogan=Audience Response System -ui.splashscreen.min-delay=3000 - -# Splash screen colors -# These settings override the default colors of the frontend theme. -# -#ui.splashscreen.slogan-color= -#ui.splashscreen.background-color= -#ui.splashscreen.loading-ind-color= - -# Links which are displayed in the frontend applications -# -links.blog.url=https://arsnova.eu/blog/ -links.documentation.url=https://arsnova.eu/manual/ -links.presenter-documentation.url= -links.overlay.url=https://arsnova.eu/overlay/ -links.organization.url= -links.imprint.url= -links.privacy-policy.url= - -# Configuration for the public pool -# -pp.subjects = Allgemeines,Anglistik,Architektur,Bauingenieurwesen,Betriebswirtschaftslehre,Biologie,Chemie,Elektrotechnik,Geographie,Geowissenschaften,Germanistik,Geschichtswissenschaft,Informatik,Kunst,Kunstpädagogik,Maschinenbau,Mathematik,Medienwissenschaften,Medizin,Musik,Pharmazie,Physik,Psychologie,Rechtswissenschaften,Stadtplanung,Theaterwissenschaften,Theologie,Vermessungswesen,Volkswirtschaftslehre -pp.licenses = CC by - Attribution,\ - CC nc - Non-Commercial,\ - CC nd - No Derivatives,\ - CC sa - Share Alike,\ - CCO - Public Domain,\ - CC by-nd - Attribution-No Derivatives,\ - CC by-c - Attribution-Non-Commercial,\ - CC by-nc-sa - Attribution-Non-Derivatives-Share Alike,\ - CC by-nc-nd Attribution-Non-Commercial- No Derivatives,\ - GNU GPL - GNU General Public License -pp.logofilesize_b = 102400 -# Do not reorder levels. Append new levels to the end of the list. Otherwise, -# references in existing public sessions could be mixed up. -# -pp.session-levels.de = Allgemeinbildung,\ - Abitur,\ - Bachelor,\ - Master,\ - Wer wird Millionär,\ - Sonstiges -pp.session-levels.en = General Education,\ - Highschool,\ - Bachelor,\ - Master,\ - Who Wants to Be a Millionaire,\ - Miscellaneous - - -################################################################################ -# Messaging / Microservices -################################################################################ -messaging.relay.enabled=false -messaging.relay.host=localhost -messaging.relay.port=61613 -messaging.relay.user=arsnova -messaging.relay.password=arsnova - - - -################################################################################ -# Tracking -################################################################################ -# It is possible to use an external tracking software with ARSnova. Currently -# Matomo is the only supported tracking provider. -# -tracking.provider=matomo -tracking.tracker-url= -tracking.site-id= diff --git a/src/test/resources/config/test.yml b/src/test/resources/config/test.yml new file mode 100644 index 0000000000000000000000000000000000000000..84180481fd369332d521ee3caeed85fcbe317077 --- /dev/null +++ b/src/test/resources/config/test.yml @@ -0,0 +1,4 @@ +# Configuration overrides for test environment +arsnova: + security: + admin-accounts: "TestAdmin"