Skip to content

Commit 01b87d5

Browse files
author
Lenhard Reuter
committed
Add login-text variables
1 parent 6d5af5b commit 01b87d5

File tree

3 files changed

+35
-14
lines changed

3 files changed

+35
-14
lines changed

learners/conf/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ def __init__(self):
118118
"vnc_clients": None,
119119
"url_documentation": f"{self.documentation.get('endpoint')}/{self.language}/index.html",
120120
"url_exercises": f"{self.exercises.get('endpoint')}/{self.language}/index.html",
121+
"login_headline": learners_config.get("learners").get("login_headline"),
122+
"login_headline_highlight": learners_config.get("learners").get("login_headline_highlight"),
123+
"welcome_text": learners_config.get("learners").get("welcome_text"),
124+
"login_text": learners_config.get("learners").get("login_text"),
121125
}
122126

123127

learners/conf/config_schema.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
1-
from strictyaml import Map, Str, Int, Seq, Bool, Any, Optional, MapPattern, EmptyDict, EmptyNone, EmptyList
1+
from strictyaml import Any, Bool, EmptyDict, EmptyList, EmptyNone, Int, Map, MapPattern, Optional, Seq, Str
22

33
config_schema = Map(
44
{
5-
Optional("learners", default={"theme": "dark", "branding": False, "language": "en"}): Map(
5+
Optional(
6+
"learners",
7+
default={
8+
"theme": "dark",
9+
"branding": False,
10+
"language": "en",
11+
"login_headline": "Welcome to the",
12+
"login_headline_highlight": "AIT CyberRange",
13+
"welcome_text": "This is the default welcome text.",
14+
"login_text": "In order to participate in the exercises, please log in with your credentials. You will then get access to the documentation and the introduction to the tools to be used, the Exercises-Control and get access to the VNC client from which the exercises can be performed.",
15+
},
16+
): Map(
617
{
718
Optional("theme", default="dark"): Str(),
819
Optional("branding", default=False): Bool(),
920
Optional("language", default="en"): Str(),
21+
Optional("login_headline", default="Welcome to the"): Str(),
22+
Optional("login_headline_highlight", default="AIT CyberRange"): Str(),
23+
Optional("welcome_text", default="This is the default welcome text."): Str(),
24+
Optional(
25+
"login_text",
26+
default="In order to participate in the exercises, please log in with your credentials. You will then get access to the documentation and the introduction to the tools to be used, the Exercises-Control and get access to the VNC client from which the exercises can be performed.",
27+
): Str(),
1028
}
1129
),
1230
"jwt": Map(

learners/templates/login.html

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,26 @@
3030

3131
<div class="center-content">
3232
<h1>
33-
Welcome to the<br />
34-
<span class="heading_highlight">RTC Exercise</span>
33+
{{ login_headline }}<br />
34+
{% if login_headline_highlight %}
35+
<span class="heading_highlight"> {{ login_headline_highlight }}</span>
36+
{% endif %}
3537
</h1>
3638

39+
{% if welcome_text %}
3740
<p style="margin-top: 2.4em">
38-
This exercise was developed in collaboration with the AIT, Austrian
39-
Institute of Technology and the IAEA, International Atomic Energy Agency,
40-
and serves to further educate and sensitize employees with regard to
41-
cyber-criminal activities. The scenario constructed here is a fictitious
42-
one, but it is based on realistic settings in terms of its basic structure
43-
and the behavior of the malware.
41+
{{ welcome_text }}
4442
</p>
43+
{% endif %}
4544

4645
{% if not success %}
4746
<h4 style="margin-top: 2.4em">Login</h4>
47+
48+
{% if login_text %}
4849
<p style="margin-bottom: 2em">
49-
In order to participate in the exercises, please log in with your
50-
credentials. You will then get access to the documentation and the
51-
introduction to the tools to be used, the Exercises-Control and get access
52-
to the VNC client from which the exercises can be performed.
50+
{{ login_text }}
5351
</p>
52+
{% endif %}
5453

5554
<form action="/login" method="post">
5655
<div class="input-row">

0 commit comments

Comments
 (0)