Compare commits

..

24 commits

Author SHA1 Message Date
3b83ebf3fb Merge pull request 'survey-end' (#211) from survey-end into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #211
2021-07-30 09:04:42 +00:00
a626e32cbe Remove apiurl so that no longer the data will get logged
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-07-30 11:01:19 +02:00
4c01e68264 Make a box that the study is finished 2021-07-30 11:00:02 +02:00
7026909c61 Merge pull request 'Remove logging of password and update privacy(fix #203)' (#210) from frontend/remove-log into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #210
2021-07-25 21:36:41 +00:00
d01a70f925 Updated licenses and privacy
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-07-25 23:36:05 +02:00
41143c361b Remove logging of password
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-07-25 23:27:49 +02:00
3f6b622088 Merge pull request 'backend/update-requirements' (#209) from backend/update-requirements into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #209
2021-07-24 22:19:50 +00:00
d5c6aad834 Updated dockerfile
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-07-25 00:19:26 +02:00
fe5b563139 Updated python requirements
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-25 00:15:05 +02:00
ae82024e94 Merge pull request 'infra/bumpversion' (#208) from infra/bumpversion into main
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #208
2021-07-24 22:07:26 +00:00
c5b595ad40 Updated some things for infrastructure
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-07-25 00:05:11 +02:00
8bb37bbc21 Updated to upstream
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-24 02:11:17 +02:00
74ca8d8973 Merge branch 'main' into infra/bumpversion 2021-07-24 02:08:39 +02:00
deecf9ccad Removed unused function
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2021-07-24 01:16:39 +02:00
94070d8f75 Merge pull request 'Update logger config and create a session usermapping (fix #178 and fix #188)' (#206) from frontend/logger-update into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #206
2021-07-23 23:15:34 +00:00
c52308e623 Update logger config and create a session usermapping
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-07-24 01:14:25 +02:00
d220f86cb8 Remove the input if someone typed the wrong password
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2021-07-24 01:10:40 +02:00
a97c95f762 Bumped version of mongodb 2021-07-24 01:08:17 +02:00
5816d4f914 Remove unused fontawesome usages
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2021-07-23 03:46:43 +02:00
617741218c Add things about privacy for the user
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2021-07-23 03:35:09 +02:00
a373ad4dce Merge pull request 'Fix various issues in the frontend (fix #197 & fix #192)' (#200) from frontend/fix-paste-errormessage into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #200
2021-07-22 23:07:18 +00:00
9f4e097e27 Merge branch 'main' into frontend/fix-paste-errormessage
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-07-23 01:05:32 +02:00
8e6a74d30c Added a bugfix in the backend
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-22 23:05:13 +00:00
a1a719088d Added some more options to requests-script
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2021-07-23 00:51:28 +02:00
15 changed files with 152 additions and 25 deletions

View file

@ -4,6 +4,9 @@ WORKDIR /app
COPY requirements.txt .
RUN apt-get -y update
RUN apt-get -y install sqlite3
RUN pip install -r requirements.txt
COPY /src .

View file

@ -6,6 +6,8 @@ RUN apt-get -y update && apt-get -y upgrade
COPY requirements.txt .
RUN apt-get -y install sqlite3
RUN pip install -r requirements.txt
COPY /src .

View file

@ -1,3 +1,4 @@
autopep8==1.5.7
blinker==1.4
click==7.1.2
Deprecated==1.2.12
@ -16,11 +17,13 @@ MarkupSafe==1.1.1
passlib==1.7.4
pendulum==2.1.2
py-buzz==1.0.3
pycodestyle==2.7.0
PyJWT==2.1.0
python-dateutil==2.8.1
python-dotenv==0.17.1
pytzdata==2020.1
six==1.16.0
SQLAlchemy==1.4.15
toml==0.10.2
Werkzeug==1.0.1
wrapt==1.12.1

View file

@ -113,7 +113,7 @@ def refresh():
$ curl http://localhost:5000/api/refresh -X GET \
-H "Authorization: Bearer <your_token>"
"""
old_token = request.get_data()
old_token = flask.request.get_data()
new_token = guard.refresh_jwt_token(old_token)
ret = {'access_token': new_token}
return ret, 200

View file

@ -8,6 +8,8 @@ services:
backend-prod:
image: caminsha/bt-backend
container_name: backend-prod
volumes:
- "./database.db:/app/database.db:z"
environment:
DEBUG: "no"
PORT: 5050
@ -20,6 +22,6 @@ services:
environment:
- MONGO_URI=mongodb://mongodb:27017/behametrics
mongodb:
image: mongo:4.0.1
image: mongo:4.0.25
container_name: "behametrics-mongo"
command: mongod --smallfiles

View file

@ -35,6 +35,6 @@ services:
environment:
- MONGO_URI=mongodb://mongodb:27017/behametrics
mongodb:
image: mongo:4.0.1
image: mongo:4.0.25
container_name: "behametrics-mongo"
command: mongod --smallfiles

View file

@ -97,3 +97,13 @@ h1 {
font-weight: bold;
user-select: none;
}
.study-finished {
background-color: var(--primary);
padding: 0.5em;
}
.study-finished > p {
color: var(--error);
font-size: 2em;
}

View file

@ -1,7 +1,6 @@
import React from "react";
import { Link } from "react-router-dom";
import "./Footer.css";
import "@fortawesome/fontawesome-free/css/all.css";
function Footer() {
return (

View file

@ -2,11 +2,6 @@ import React from "react";
import "../App.css";
export default function GeneratedPassword(props) {
const handleOnCopyEvent = (e) => {
e.preventDefault();
return false;
};
return (
<>
<p>

View file

@ -2,8 +2,8 @@ import React from "react";
import "../App.css";
import { Button } from "./Button";
import "./HeroSection.css";
import "@fortawesome/fontawesome-free/css/all.css";
import { useAuth } from "../auth/AuthProvider";
import StudyFinished from "./StudyFinished";
export default function HeroSection() {
const [isLoggedIn] = useAuth();
@ -11,6 +11,7 @@ export default function HeroSection() {
return (
<div className="hero-container">
<h1>Herzlich Willkommen</h1>
<StudyFinished />
<div className="hero-btns">
{isLoggedIn ? (
<Button

View file

@ -0,0 +1,11 @@
import React from "react";
import "../App.css"
export default function StudyFinished() {
return (
<div className="study-finished">
<p>Die Studie wurde beendet.</p>
<p>Vielen Dank für die Teilnahme an der Studie</p>
</div>
);
}

View file

@ -73,7 +73,7 @@ export default function Lizenzen() {
</a>
</li>
<li>
Behametrics Serverimplementierung (MIT-Lizenz)
Behametrics Serverimplementierung (MIT-Lizenz):{" "}
<a href="https://gitlab.com/behametrics/server">
https://gitlab.com/behametrics/server
</a>

View file

@ -7,6 +7,89 @@ export default function Privacy() {
<>
<div className="sitePage">
<h1>Datenschutz</h1>
<p>
Nachfolgend werden Sie informiert, welche Daten ich von Ihnen erfasse
und erhebe. Grundsätzlich gilt, dass ich sämtliche Daten nach der
Bachelorthesis wieder lösche. Ausserdem gebe ich keine
personenbezogenen Daten an Dritte weiter. Nachfolgend werden die Daten
in folgende drei Kategorien eingeteilt:
</p>
<ul>
<li>Daten des Webservers</li>
<li>Anmelde- und Umfragedaten</li>
<li>Daten zu biometrischen Verhaltensmerkmalen</li>
</ul>
<h2>Daten des Webservers</h2>
<p>
Diese Webanwendung wird auf einem virtuellen Server bei{" "}
<a href="https://netcup.de">netcup</a> betrieben. Um diese
Webanwendung grundsätzlich bereitzustellen, werden die folgenden Daten
erhoben:{" "}
</p>
<ul>
<li>IP-Adresse der Anfrage</li>
<li>URL der Anfrage</li>
<li>
User-Agent der Anfrage (also z.B. der verwendete Browser usw.)
</li>
<li>Status der Antwort</li>
</ul>
<p>
Diese Informationen werden verwendet, um den reibungslosen Betrieb der
Webseit zu gewährleisten.{" "}
</p>
<h2>Anmelde- und Umfragedaten</h2>
<p>
Im Rahmen der Bachelorthesis erfasse ich einige Merkmale über Sie.
Hierzu zählen einerseits die Logindaten, welche erfasst werden müssen,
damit Sie sich einloggen können. Ausserdem erfasse ich die folgenden
Daten mit einer Umfrage:{" "}
</p>
<ul>
<li>Alter </li>
<li>Geschlecht </li>
<li>Höchster Bildungsstand </li>
<li>Geschätzte Anwenderkenntnisse im Informatikbereich</li>
</ul>
<p>
Die Anmeldedaten werden verwendet, damit Sie sich auf der Webseite
einloggen können. Damit Sie sich nicht jedes Mal anmelden müssen,
verwende ich die Methode von LocalStorage. Im Localstorage wird der
Wert REACT_TOKEN_AUTH_KEY gespeichert, welcher einen Zugangscode
enthält. Die Umfragedaten werden ausgewertet, damit ich die
Teilnehmenden einordnen kann. Die Daten werst sonst nicht
weiterverwertet.
</p>
<h2>Daten zu biometrischen Verhaltensmerkmalen</h2>
<p>
Während der Studie werden biometirsche Daten gesammelt. Zu den
biometrischen Daten gehören Mausbewegungen und Tastaturanschläge.
Diese Daten werden lediglich im Rahmen der Bachelorthesis verwendet
und ausgewertet. Nachdem die Bachelorthesis beendet ist, werden
sämtliche Daten gelöscht. Es erfolgt keine Auswertung der
biometrischen Daten im Zusammenhang mit den Daten der Umfrage.
Allerdings kann der Benutzername, welchen Sie bei der Anmeldung
angegeben haben, verwendet werden.
</p>
<h2>Weitergabe der Daten</h2>
<p>
Grundsätzlich werden die Daten nicht an Dritte weitergegeben. Folgende
Ausnahmen gibt es:
</p>
<ul>
<li>
Der Fernfachhochschule Schweiz werden die Daten falls notwendig
weitergegeben.
</li>
<li>
Sofern es eine gesetzliche Grundlage gibt, werden die Daten auch
weitergegeben.
</li>
<li>
Wie bereits oben erwähnt, läuft die Webanwendung auf einem
virtuellen Server bei <a href="https://netcup.de">netcup</a>. Hierbei gelten die Datenschutzbestimmungen von netcup, welche <a href="https://www.netcup.de/kontakt/datenschutzerklaerung.php">hier</a> eingesehen werden können.
</li>
</ul>
</div>
<Footer />
</>

View file

@ -12,6 +12,7 @@ import BehaviorPhone from "../BehaviorPhone";
import BehaviorStanding from "../BehaviorStanding";
import BehaviorStudyEnd from "../BehaviorStudyEnd";
import { authFetch } from "../../auth/AuthProvider";
import StudyFinished from "../StudyFinished";
export default function Study() {
const _logger = useRef(0);
@ -32,11 +33,7 @@ export default function Study() {
useEffect(() => {
_logger.current = new Logger({
//inputs: ["cursor", "wheel", "keyboard", "touch"],
inputs: ["keyboard"],
// apiUrl: "https://behavior.marcocamenzind.ch",
apiUrl: "http://localhost:5000",
logToConsole: true,
inputs: ["keyboard", "wheel", "cursor", "custom"],
});
_logger.current.init();
authFetch("/api/username", {
@ -94,7 +91,6 @@ export default function Study() {
method: "get",
}).then((response) => {
response.json().then((resp) => {
console.log(resp.random_password);
setGenPassword(resp.random_password);
});
});
@ -112,13 +108,18 @@ export default function Study() {
receiveRandomPassword();
setState(STATES.NORMAL);
handleLoggerOn();
// map username and session with the logs
_logger.current.logCustomEvent({
name: serverUsername,
});
};
const resetInputValues = () => {
let inputElements = document.querySelectorAll('div input:not([type="submit"])');
for (let i=0; i < inputElements.length; i++){
inputElements[i].value = ""
let inputElements = document.querySelectorAll(
'div input:not([type="submit"])'
);
for (let i = 0; i < inputElements.length; i++) {
inputElements[i].value = "";
}
};
@ -269,6 +270,7 @@ export default function Study() {
<>
<div className="sitePage">
<h1>Studie</h1>
<StudyFinished />
{state === STATES.START ? study_start : null}
{state === STATES.NORMAL ? study_normal : null}
{state === STATES.PHONE ? study_phone : null}

View file

@ -1,11 +1,11 @@
#!/bin/bash
ACTION=$1
TOKEN=$2
ACTIONS=(login register rcvpw username)
VALUE=$2
ACTIONS=(login register rcvpw username data csv prod_data prod_csv)
print_help(){
echo "Usage: $0 ACTION [TOKEN]"
echo "Usage: $0 ACTION [TOKEN|INPUT_TYPE]"
echo
echo "available actions:"
for el in "${ACTIONS[@]}"; do
@ -34,7 +34,23 @@ case $ACTION in
;;
"${ACTIONS[3]}") # get current username
echo "get username action"
curl localhost:5050/api/username -X GET -H "Authorization: Bearer $TOKEN"
curl localhost:5050/api/username -X GET -H "Authorization: Bearer $VALUE"
;;
"${ACTIONS[4]}") # get all data from behametricsserver
echo "get data action"
curl localhost:5000/data
;;
"${ACTIONS[5]}") # get all data from behametricsserver
echo "get csv from input action"
curl localhost:5000/data/csv/"${VALUE}"
;;
"${ACTIONS[6]}") # get all data from behametricsserver
echo "get prod data action"
curl behavior.marcocamenzind.ch:5000/data
;;
"${ACTIONS[7]}") # get all data from behametricsserver
echo "get prod csv from input action"
curl behavior.marcocamenzind.ch:5000/data/csv/"${VALUE}"
;;
*)
echo "Error: Action not available"