summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/openvpn_simple_smb
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2018-10-13 21:58:29 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2018-10-13 21:59:11 +0200
commite4e109c16ef27012157cb38cf6375c1ae4d2ef69 (patch)
treeff2350f8f769d92544202cb5d2149155aa1d04cb /kpov_judge/tasks/openvpn_simple_smb
parentf2060d5143f5c4b14bfff723d238c497a0053f17 (diff)
parent5439f75ca2e1a38803a96853b6cac0ce5c9f58ce (diff)
Merge branch 'improve-web'
Store instructions in HTML and render with jinja2. Add i18n with gettext / pybabel. Improve styling.
Diffstat (limited to 'kpov_judge/tasks/openvpn_simple_smb')
-rw-r--r--kpov_judge/tasks/openvpn_simple_smb/task.py55
1 files changed, 25 insertions, 30 deletions
diff --git a/kpov_judge/tasks/openvpn_simple_smb/task.py b/kpov_judge/tasks/openvpn_simple_smb/task.py
index d4bb510..5d7c22f 100644
--- a/kpov_judge/tasks/openvpn_simple_smb/task.py
+++ b/kpov_judge/tasks/openvpn_simple_smb/task.py
@@ -1,40 +1,33 @@
# kpov_util should be imported by add_assignment.py
instructions = {
- 'si':"""
-Postavi dva navidezna računalnika - SimpleArbiter z diska SimpleArbiterVPN ter
-VPNClient1. Poskrbite, da bosta povezana med seboj in v Internet.
-Na VPNClient1 namestite OpenVPN in program za nadzor nad virtualnimi napravami
-(s katerim kreirate napravo tap).
+ 'si': '''\
+<p>
+Postavi dva navidezna računalnika: <em>SimpleArbiter</em> in <em>VPNClient1</em>. Poskrbite, da bosta povezana med seboj in v internet. Na <em>VPNClient1</em> namestite OpenVPN in program za nadzor nad virtualnimi napravami (s katerim kreirate napravo <code>tap</code>).
-Na strežniku SimpleArbiterVPN že teče VPN strežnik in uporablja skrivnost,
-ki jo najdete tudi na VPNClient1 v domačem imeniku uporabnika student.
-Na VPNClient1 vzpostavite VPN tako, da napišete primerno datoteko z
-nastavitvami. VPNClient1 na navideznem lokalnem omrežju nastavite naslov
-{IP_VPNClient1}
+<p>
+Na strežniku <em>SimpleArbiter</em> že teče strežnik in uporablja skrivnost, ki jo najdete tudi na <em>VPNClient1</em> v domačem imeniku uporabnika <code>student</code>. Na <em>VPNClient1</em> vzpostavite VPN tako, da napišete primerno datoteko z nastavitvami. Računalniku <em>VPNClient1</em> na navideznem lokalnem omrežju nastavite naslov
+<code>{{IP_VPNClient1}}</code>.
-Nato poskrbite, da bo na VPNClient1 na navideznem omrežju prek NFS omogočen
-dostop do imenika /home/test/{DIRNAME}.
-V ta imenik skopirajte datoteke, ki so prek SMB dostopne na SimpleArbiter.
-""",
- 'en':"""
-Setup two virtual machines - SimpleArbiterVPN and a VPN client (VPNClient1).
-Set the client's network up so that it has access to the internal network and
-the internet.
-On VPNClient1, install OpenVPN and a program for supervising virtual devices
-(which you will use to create a tap device). On the VPN, set the IP for
-VPNClient1 to {IP_VPNClient1}.
+<p>
+Nato poskrbite, da bo na <em>VPNClient1</em> na navideznem omrežju prek NFS omogočen
+dostop do imenika <code>/home/test/{{DIRNAME}}</code>. V ta imenik skopirajte datoteke, ki so prek SMB dostopne na <em>SimpleArbiter</em>.
+''',
+ 'en': '''\
+<p>
+Setup two virtual machines: <em>SimpleArbiter</em> and <em>VPNClient1</em>. Set the client's network up so that it has access to the internal network and the internet. On <em>VPNClient1</em>, install OpenVPN and a program for supervising virtual devices
+(which you will use to create a <code>tap</code> device). On the VPN, set the IP for
+<em>VPNClient1</em> to <code>{{IP_VPNClient1}}</code>.
-An OpenVPN server is already running on SimpleArbiterVPN. Use the secret
-available on VPNClient1 in the home directory of user student to connect to
-the VPN server on SimpleArbiterVPN. To do that, you will have to write your
-own OpenVPN configuration file.
+<p>
+An OpenVPN server is already running on <em>SimpleArbiter</em>. Use the secret
+available on <em>VPNClient1</em> in the home directory of user <code>student</code> to connect to the VPN server on <em>SimpleArbiter</em>. To do that, you will have to write your
+own OpenVPN configuration file.
-After you have set up the VPN, make the directory
-/home/test/{DIRNAME} on VPNClient1 available over NFS from SimpleArbiter over
-your VPN. Copy files that are available from SimpleArbiter over SMB to
-/home/test/{DIRNAME}.
-"""
+<p>
+After you have set up the VPN, make the directory <code>/home/test/{{DIRNAME}}</code> on <em>VPNClient1</em> available over NFS from <em>SimpleArbiter</em> over
+your VPN. Copy files that are available from <em>SimpleArbiter</em> over SMB to <code>/home/test/{{DIRNAME}}</code>.
+'''
}
computers = {
@@ -264,3 +257,5 @@ iface tap0 inet static
templates['student-VPNClient1'].write("/home/student/" + keyfile, s)
# uid, gid (student = )
templates['student-VPNClient1'].chown(1000, 1000, "/home/student/" + keyfile)
+
+ write_default_config(templates['simpleArbiterDhcpGWVPN'], global_params)