Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • arsnova/arsnova-backend
  • pcvl72/arsnova-backend
  • tksl38/arsnova-backend
3 results
Show changes
Showing
with 779 additions and 199 deletions
package de.thm.arsnova.websocket.message;
import java.util.Arrays;
public class FeedbackChangedPayload implements WebSocketPayload {
int[] values = new int[4];
public int[] getValues() {
return values;
}
public void setValues(final int[] values) {
this.values = values;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final FeedbackChangedPayload that = (FeedbackChangedPayload) o;
return Arrays.equals(values, that.values);
}
@Override
public int hashCode() {
return Arrays.hashCode(values);
}
}
package de.thm.arsnova.websocket.message;
public class GetFeedback extends WebSocketMessage<WebSocketPayload> {
public GetFeedback() {
super(GetFeedback.class.getSimpleName());
}
}
package de.thm.arsnova.websocket.message;
public class Patched extends WebSocketMessage<PatchedPayload> {
public Patched(final String type) {
super(type);
}
}
package de.thm.arsnova.websocket.message;
public class PatchedPayload implements WebSocketPayload {
String type;
String id;
String propertyName;
boolean propertyValue;
public PatchedPayload(final String type) {
this.type = type;
}
public String getType() {
return type;
}
public void setType(final String type) {
this.type = type;
}
public String getId() {
return id;
}
public void setId(final String id) {
this.id = id;
}
public String getPropertyName() {
return propertyName;
}
public void setPropertyName(final String propertyName) {
this.propertyName = propertyName;
}
public boolean isPropertyValue() {
return propertyValue;
}
public void setPropertyValue(final boolean propertyValue) {
this.propertyValue = propertyValue;
}
}
/*
* Copyright (C) 2012 THM webMedia
* This file is part of ARSnova Backend.
* Copyright (C) 2012-2019 The ARSnova Team and Contributors
*
* This file is part of ARSnova.
*
* ARSnova is free software: you can redistribute it and/or modify
* ARSnova Backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ARSnova is distributed in the hope that it will be useful,
* ARSnova Backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
......@@ -16,49 +15,20 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.thm.arsnova.entities;
public class VisitedSession {
private String _id;
private String name;
private String keyword;
package de.thm.arsnova.websocket.message;
public VisitedSession() {
}
public VisitedSession(Session s) {
this._id = s.get_id();
this.name = s.getName();
this.keyword = s.getKeyword();
}
public String get_id() {
return _id;
}
public void set_id(String _id) {
this._id = _id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/**
* Represents a session.
*/
public class Room {
private String keyword;
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
public void setKeyword(final String keyword) {
this.keyword = keyword;
}
@Override
public String toString() {
return "VisitedSession [_id=" + _id + ", name=" + name + ", keyword="
+ keyword + "]";
}
}
\ No newline at end of file
}
package de.thm.arsnova.websocket.message;
public class WebSocketMessage<P extends WebSocketPayload> {
private String type;
private P payload;
public WebSocketMessage(final String type) {
this.type = type;
}
public String getType() {
return type;
}
public void setType(final String type) {
this.type = type;
}
public P getPayload() {
return payload;
}
public void setPayload(final P payload) {
this.payload = payload;
}
}
package de.thm.arsnova.websocket.message;
public interface WebSocketPayload {
}
/**
* Contains classes that are used as web socket messages.
*/
package de.thm.arsnova.websocket.message;
/**
* Classes and interfaces for communication over web sockets.
*/
package de.thm.arsnova.websocket;
<?xml version="1.0" encoding="UTF-8"?>
<aspectj>
<weaver options="-verbose -showWeaveInfo">
<include within="de.thm.arsnova..*"/>
<include within="com.corundumstudio.socketio.listener.*"/>
</weaver>
<aspects>
<aspect name="de.thm.arsnova.web.RangeAspect"/>
<aspect name="de.thm.arsnova.web.InternalEntityAspect"/>
<aspect name="de.thm.arsnova.websocket.WebsocketAuthenticationAspect"/>
<!-- Micrometer does not have a aop.xml config for its aspects. -->
<!-- Disabled for now, see https://github.com/micrometer-metrics/micrometer/issues/1149.
<aspect name="io.micrometer.core.aop.TimedAspect"/>
-->
</aspects>
</aspectj>
org.springframework.boot.autoconfigure.AutoConfigurationImportFilter=\
de.thm.arsnova.config.ActuatorAutoConfigurationFilter
################################################################################
# General server settings
################################################################################
# The URL under which the ARSnova server is reachable. Use
# http://localhost:8080 for development.
root-url=https://example.com
# The context paths where the ARSnova modules have been deployed
customization.path=/customization
mobile.path=/mobile
presenter.path=/presenter
# SSL configuration
security.ssl=false
security.keystore=/etc/arsnova/arsnova.jks
security.storepass=arsnova
# WebSockets server
socketio.ip=0.0.0.0
socketio.port=10443
################################################################################
# Database
################################################################################
couchdb.host=localhost
couchdb.port=5984
couchdb.name=arsnova
couchdb.username=admin
couchdb.password=
################################################################################
# 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
# Configuration parameters for authentication services:
# enabled: enable or disable the service
# 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.order=0
security.guest.lecturer.enabled=true
# 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.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.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\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}
# 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.title=LDAP
security.ldap.login-dialog-path=login-ldap.html
security.ldap.image=
security.ldap.order=0
security.ldap.url=ldap://example.com:33389/dc=example,dc=com
security.ldap.user-dn-pattern=uid={0},ou=arsnova
# Not yet implemented parameters
#security.ldap.user-search-filter=(uid={0})
#security.ldap.user-search-base="ou=people"
# CAS authentication
#
security.cas.enabled=false
security.cas.title=CAS
security.cas.image=
security.cas.order=0
security.cas-server-url=https://example.com/cas
# 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.order=0
security.facebook.key=
security.facebook.secret=
# Twitter
#
security.twitter.enabled=false
security.twitter.order=0
security.twitter.key=
security.twitter.secret=
# Google
#
security.google.enabled=false
security.google.order=0
security.google.key=
security.google.secret=
################################################################################
# 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
# 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.markdown.enabled=false
features.learning-progress.enabled=false
features.question-format.flashcard.enabled=false
features.question-format.grid-square.enabled=false
################################################################################
# Customization
################################################################################
# minutes, after which the feedback is deleted
feedback.cleanup=10
# maximal filesize in bytes
upload.filesize_b=1048576
# 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
# Links which are displayed in the frontend applications
#
links.documentation.url=https://arsnova.eu/manual/
links.overlay.url=https://arsnova.eu/overlay/
links.organization.url=
links.imprint.url=
links.privacy-policy.url=
arsnova:
management:
endpoints:
web:
base-path: /management
exposure:
include: "*"
endpoint:
health:
show-details: when-authorized
roles:
- ADMIN
- MONITORING
metrics:
web:
server:
auto-time-requests: true
arsnova:
##############################################################################
# System settings
##############################################################################
system:
# 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:
proxy-path: ~
# Database
couchdb:
host: localhost
port: 5984
db-name: arsnova3
username: admin
password: ""
# Mail server
mail:
host: ""
sender-name: ARSnova
sender-address: ""
# Message broker for internal service communication
message-broker:
relay:
enabled: false
host: localhost
port: 61613
username: arsnova
password: arsnova
# LMS connector service
lms-connector:
enabled: false
host-url: http://localhost:8080/lms-connector-service
username: test
password: test
# Legacy WebSocket server
socketio:
bind-address: localhost
port: 8090
proxy-path: /socket.io
inactivity-thresholds:
# Anonymize user content for users with X days of inactivity
anonymize-users: 180
# Delete guest sessions automatically after X days of owner inactivity.
delete-guest-rooms: 180
uploads:
# Maximal filesize in bytes
max-filesize: 4194304
thumbnail:
# Maximal thumbnail size in pixels
width: 400
height: 400
##############################################################################
# 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: ""
# 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: 6H
# 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://
authentication-providers:
# Guest authentication
guest:
enabled: true
allowed-roles:
- moderator
- participant
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.
registered:
enabled: true
allowed-roles:
- moderator
- participant
title: ARSnova
order: 0
allowed-email-domains:
- '*'
registration-mail-subject: ARSnova Registration
registration-mail-body: |-
Welcome to ARSnova!
Here is the activation code you need for your first login to ARSnova:
{0}
{1}
reset-password-mail-subject: ARSnova Password Reset
reset-password-mail-body: |-
You requested to reset your password.
Here is the confirmation code you need to set a new password:
{0}
{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.
ldap:
- enabled: false
allowed-roles:
- moderator
- participant
title: LDAP
order: 0
host-url: ldaps://example.com:636/dc=example,dc=com
user-dn-pattern: uid={0},ou=arsnova
user-id-attribute: uid
# 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
# Timeout for establishing a connection in milliseconds
connect-timeout: 5000
# SAML authentication
saml:
enabled: false
allowed-roles:
- moderator
- participant
title: SAML
order: 0
idp:
meta-file: saml-idp.xml
sp:
meta-file: ""
entity-id: ""
keystore:
file: arsnova.jks
store-password: arsnova
key-alias: saml
key-password: arsnova
user-id-attribute: uid
assertion-consumer-service-index: 0
max-authentication-lifetime: 3600
# CAS authentication
cas:
enabled: false
allowed-roles:
- moderator
- participant
title: CAS
order: 0
host-url: https://example.com/cas
# OpenID Connect authentication
oidc:
- enabled: false
allowed-roles:
- moderator
- participant
title: OIDC
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
oauth:
facebook:
enabled: false
allowed-roles:
- moderator
- participant
order: 0
key: ""
secret: ""
twitter:
enabled: false
allowed-roles:
- moderator
- participant
order: 0
key: ""
secret: ""
google:
enabled: false
allowed-roles:
- moderator
- participant
order: 0
key: ""
secret: ""
##############################################################################
# Features
##############################################################################
features:
contents:
enabled: true
formats:
grid-square:
enabled: false
freetext:
imageanswer:
enabled: false
# Maximal number of answer options allowed for a skill question
answer-option-limit: 8
comments:
enabled: true
live-feedback:
enabled: true
# Minutes, after which the feedback is deleted
reset-interval: 10
content-pool:
enabled: false
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
# Logo file size in bytes
logo-max-filesize: 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
##############################################################################
# User interface
##############################################################################
ui:
# Label underneath ARSnova logo
slogan: Audience Response System
# Demo room short id to show above room login button
# You can freely use the demo room of https://arsnova.eu/mobile which can
# be imported from the repo:
# https://github.com/thm-projects/arsnova-mobile/tree/master/demo-sessions
demo-room-id: ""
# 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: ""
# 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
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
# Number of "you've lost me"/"abgehängt" votes, starting to show warning
# sign
feedback-warning: 15
# 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: ""
# 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: ""
# The context paths where the ARSnova modules have been deployed
customization:
path: /customization
mobile:
path: /mobile
presenter:
path: /presenter
var designDoc = {
"_id": "_design/Answer",
"language": "javascript",
"views": {
"by_id": {
"map": function (doc) {
if (doc.type === "Answer") {
emit(doc._id, {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_contentid": {
"map": function (doc) {
if (doc.type === "Answer") {
emit(doc.contentId, {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_contentid_round_body_subject": {
"map": function (doc) {
if (doc.type === "Answer") {
emit([doc.contentId, doc.round, doc.abstention, doc.body, doc.subject, doc.successfulFreeTextAnswer], {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_contentid_round_selectedchoiceindexes": {
"map": function (doc) {
if (doc.type === "Answer") {
emit([doc.contentId, doc.round, doc.selectedChoiceIndexes], {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_contentid_creationtimestamp": {
"map": function (doc) {
if (doc.type === "Answer") {
emit([doc.contentId, doc.creationTimestamp], {_rev: doc._rev});
}
}
},
"by_contentid_creatorid_round": {
"map": function (doc) {
if (doc.type === "Answer") {
emit([doc.contentId, doc.creatorId, doc.round], {_rev: doc._rev});
}
}
},
"by_roomid": {
"map": function (doc) {
if (doc.type === "Answer") {
emit(doc.roomId, {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_creatorid_roomid": {
"map": function (doc) {
if (doc.type === "Answer") {
emit([doc.creatorId, doc.roomId], {_rev: doc._rev});
}
}
}
}
};
var designDoc = {
"_id": "_design/Attachment",
"language": "javascript",
"views": {
"by_id": {
"map": function (doc) {
if (doc.type === "Attachment") {
emit(doc._id, {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_creatorid": {
"map": function (doc) {
if (doc.type === "Attachment") {
emit(doc.creatorId, {_rev: doc._rev});
}
},
"reduce": "_count"
}
}
}
var designDoc = {
"_id": "_design/Comment",
"language": "javascript",
"views": {
"by_id": {
"map": function (doc) {
if (doc.type === "Comment") {
emit(doc._id, {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_roomid": {
"map": function (doc) {
if (doc.type === "Comment") {
emit(doc.roomId, {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_roomid_creatorid_read": {
"map": function (doc) {
if (doc.type === "Comment") {
emit([doc.roomId, doc.creatorId, doc.read], {_rev: doc._rev})
}
},
"reduce": "_count"
},
"by_roomid_creatorid_creationtimestamp": {
"map": function (doc) {
if (doc.type === "Comment") {
emit([doc.roomId, doc.creatorId, doc.creationTimestamp], {_rev: doc._rev});
}
}
},
"by_roomid_read": {
"map": function (doc) {
if (doc.type === "Comment") {
emit([doc.roomId, doc.read], {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_roomid_creationtimestamp": {
"map": function (doc) {
if (doc.type === "Comment") {
emit([doc.roomId, doc.creationTimestamp], {_rev: doc._rev});
}
}
}
}
};
var designDoc = {
"_id": "_design/Content",
"language": "javascript",
"views": {
"by_id": {
"map": function (doc) {
if (doc.type === "Content") {
emit(doc._id, {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_roomid": {
"map": function (doc) {
if (doc.type === "Content") {
emit(doc.roomId, {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_roomid_locked": {
"map": function (doc) {
if (doc.type === "Content") {
emit([doc.roomId, doc.locked, doc.subject, doc.body.substr(0, 16)], {_rev: doc._rev});
}
},
"reduce": "_count"
}
}
};
var designDoc = {
"_id": "_design/ContentGroup",
"language": "javascript",
"views": {
"by_id": {
"map": function (doc) {
if (doc.type === "ContentGroup") {
emit(doc._id, {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_roomid_name": {
"map": function (doc) {
if (doc.type === "ContentGroup") {
emit([doc.roomId, doc.name], {_rev: doc._rev});
}
},
"reduce": "_count"
}
}
};
var designDoc = {
"_id": "_design/Motd",
"language": "javascript",
"views": {
"by_id": {
"map": function (doc) {
if (doc.type === "Motd") {
emit(doc._id, {_rev: doc._rev});
}
},
"reduce": "_count"
},
"by_audience_for_global": {
"map": function (doc) {
if (doc.type === "Motd" && doc.audience !== "ROOM") {
emit(doc.audience, {_rev: doc._rev});
}
}
},
"by_id": {
"map": function (doc) {
if (doc.type === "Motd") {
emit(doc.id, {_rev: doc._rev});
}
}
},
"by_roomid": {
"map": function (doc) {
if (doc.type === "Motd" && doc.audience === "ROOM") {
emit(doc.roomId, {_rev: doc._rev});
}
}
}
}
};