feat: Test using HTTPS and HTTP2

This commit is contained in:
Alexander Polynomdivision 2018-09-30 20:15:27 +02:00
parent b47b18c373
commit 4a6b40ad72
6 changed files with 31 additions and 8 deletions

View File

@ -31,6 +31,8 @@ services:
# TODO: DEBUG # TODO: DEBUG
- ./server/nginx.conf:/etc/nginx/nginx.conf:ro - ./server/nginx.conf:/etc/nginx/nginx.conf:ro
- ./frontend/dist/:/srv/www/:ro - ./frontend/dist/:/srv/www/:ro
- ./server/ssl.key.pem:/etc/ssl/lateinicus.key:ro
- ./server/ssl.pem:/etc/ssl/lateinicus.pem:ro
depends_on: depends_on:
- backend - backend

View File

@ -8,6 +8,7 @@ import TableCell from "@material-ui/core/TableCell";
import Typography from "@material-ui/core/Typography"; import Typography from "@material-ui/core/Typography";
import { TopTen } from "../models/learner"; import { TopTen } from "../models/learner";
import { userScoreToLevel } from "../models/user";
interface IProps { interface IProps {
topTen: TopTen[]; topTen: TopTen[];
@ -43,10 +44,12 @@ export default class Scoreboard extends React.Component<IProps> {
<TableCell> <TableCell>
<Typography component="b">{username}</Typography> <Typography component="b">{username}</Typography>
</TableCell> </TableCell>
{/*<TableCell numeric>{learner.level}</TableCell>*/} <TableCell numeric>
{userScoreToLevel(learner.score).level}
</TableCell>
{/* To make this fit on both mobile and desktop, we don't use {/* To make this fit on both mobile and desktop, we don't use
numeric, as it would otherwise look weir otherwise look weird */} numeric, as it would otherwise look weir otherwise look weird */}
<TableCell>{learner.score}</TableCell> <TableCell numeric>{learner.score}</TableCell>
</TableRow> </TableRow>
} }
@ -66,8 +69,8 @@ export default class Scoreboard extends React.Component<IProps> {
<TableRow> <TableRow>
<TableCell>#</TableCell> <TableCell>#</TableCell>
<TableCell>User</TableCell> <TableCell>User</TableCell>
{/*<TableCell>Level</TableCell>*/} <TableCell numeric>Level</TableCell>
<TableCell>Punktzahl</TableCell> <TableCell numeric>Punktzahl</TableCell>
</TableRow> </TableRow>
</TableHead> </TableHead>
<TableBody> <TableBody>

View File

@ -1,4 +1,5 @@
// Maximum distance from the answer to be still considered correct // Maximum distance from the answer to be still considered correct
export const LEVENSHTEIN_MAX_DISTANCE = 2; export const LEVENSHTEIN_MAX_DISTANCE = 2;
export const BACKEND_URL = "http://127.0.0.1"; // export const BACKEND_URL = "http://127.0.0.1";
export const BACKEND_URL = "https://192.168.178.100";

View File

@ -1,6 +1,5 @@
export interface ILearner { export interface ILearner {
username: string; username: string;
level: number;
score: number; score: number;
} }

View File

@ -146,7 +146,8 @@ const ReviewPageWithRouter = withRouter(
// W | W | W // W | W | W
// (1)C | - | C // (1)C | - | C
// (2)W | - | W // (2)W | - | W
// @correct: Was the answer given correct? // Args:
// @correct: Was the answer given correct?
updateGroupSM2 = (correct: boolean) => { updateGroupSM2 = (correct: boolean) => {
const { id } = this.props.current; const { id } = this.props.current;
switch (correct) { switch (correct) {

View File

@ -8,10 +8,27 @@ http {
# No idea, but nginx refuses to start without it # No idea, but nginx refuses to start without it
server_names_hash_bucket_size 64; server_names_hash_bucket_size 64;
# The redirection server
server {
listen 80 default_server;
add_header Strict-Transport-Security "max-age=31536000" always;
return 301 https://$host$request_uri;
}
# The actual webserver duties # The actual webserver duties
server { server {
# server_name lateinicus; # server_name lateinicus;
listen 80 default_server; listen 443 ssl http2;
add_header Strict-Transport-Security "max-age=31536000" always;
# SSL configuration
ssl_certificate /etc/ssl/lateinicus.pem;
ssl_certificate_key /etc/ssl/lateinicus.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
keepalive_timeout 70;
# Enable gzip compression # Enable gzip compression
gzip on; gzip on;