Browse Source

Teaks after 11/29 class

  * Add WiFi info for this class (need a generic instructions column)

  * Ignore `x11vnc` logout events for unauthenticated users

  * Add missing dependency for secure coding: sqlmap

  * Improve the visual layout of the instructor dashboard
master
Peter J. Jones 2 years ago
parent
commit
8ab79f885d
Signed by: Peter Jones <pjones@devalot.com> GPG Key ID: 9DAFAA8D01941E49

+ 12
- 2
docs/TODO.org View File

@@ -3,16 +3,22 @@
#+EMAIL: pjones@devalot.com
#+STARTUP: content

* Bugs [1/5]
* Bugs [2/7]
** TODO The term dashboard should show the name of the course
** TODO Space Leak on Each Snap Request
** TODO Remove Brittle SQL Used for Joins
- Post an issue on Groundhog
** TODO Cookies Should Expire
** TODO No Consistent Encryption Key for Cookies
** DONE Does =x11vnc= Fire the =-gone= Event For Failed Logins?
CLOSED: [2017-11-29 Wed 18:22]
- EC2 machines get probed constantly, even on port 5900
- =x11vnc= logs them as failed login attempts
- Merkel is getting a lot of VM logout events
** DONE Stopping a VM Should Remove Its IP Address
CLOSED: [2017-11-28 Tue 16:53]
* Milestones
** ATL Class on 2017-11-29 [8/8]
** ATL Class on 2017-11-29 [8/9]
*** DONE Reuse Existing VMs for Another Term
CLOSED: [2017-11-28 Tue 16:53]
- Add a =reuse= VM command
@@ -40,6 +46,10 @@
- Drop a flag in the home directory to signal completion
- Script to reset a home directory, (backup, remove, set up)
** Next Class
*** TODO Add Total Student Count to the Dashboard
*** TODO Add "Sessions" to terms
- A session is a small time slice of a term
- Dashboards can focus on specific time slices
*** DONE Disable Broken VMs
CLOSED: [2017-11-28 Tue 16:54]
- New VM command =disable=

+ 2
- 1
nixops/courses/secure-coding.nix View File

@@ -17,7 +17,7 @@
merkel.services.home.archives = lib.singleton {
src = pkgs.fetchurl {
url = "https://www.devalot.com/files/secure-coding/secure-coding.tar.xz";
sha256 = "43f40ea28c35236aff5b678cc023839b5f64fffa4377a895135562c5c5a45430";
sha256 = "c9ea56c6c0f4913a9ab06b3efa9217586461c0425dbe3abf7af773086c51f74f";
};

activationScript = ''
@@ -37,6 +37,7 @@
libnotify
maven
nodejs
python27Packages.sqlmap
sqlite
sqlite-interactive
unzip

+ 8
- 1
nixops/scripts/vmevents-send.sh View File

@@ -2,7 +2,6 @@

################################################################################
set -e
set -u

################################################################################
option_fifo=/run/vmevents.pipe
@@ -34,5 +33,13 @@ done

shift $((OPTIND-1))

################################################################################
# Limit VNC logout events to those that have already authenticated:
if [ "$1" = "logout" ]; then
if [ -n "$RFB_STATE" ] && [ "$RFB_STATE" != "NORMAL" ]; then
exit
fi
fi

################################################################################
echo "$@" > "$option_fifo"

+ 2
- 2
public/assets/app.css View File

@@ -33,7 +33,7 @@ form p {
flex-direction: column;
}

form label em {
form label em, tbody td em {
font-size: 0.9em;
color: #888;
}
@@ -74,7 +74,7 @@ ol.steps li p, ol.steps li table {
font-weight: normal;
}

ol.steps em {
ol.steps p em {
color: red;
}


+ 17
- 4
public/instructor/termboard.css View File

@@ -1,4 +1,7 @@
main > header h1, main > header h2 { text-align: center; }
main > header { margin: 0 0 2em 0; padding: 0; }
main > header * { text-align: center; }
main > header > p { margin: 0.25em; padding: 0; font-size: 1.5em; }
main > header .operator { font-size: 3rem; }

.initials, .vm { text-align: center; }
.initials { text-transform: uppercase; font-size: 1.2em; }
@@ -7,7 +10,6 @@ main > header h1, main > header h2 { text-align: center; }
.board {
padding-bottom: 1em;
margin-bottom: 1em;
border-bottom: 1px solid #888;
display: flex;
flex: 0 0;
flex-wrap: wrap;
@@ -32,8 +34,19 @@ main > header h1, main > header h2 { text-align: center; }
transition: all 500ms ease-out;
}

.events ul {
list-style-type: none;
.events {
position: fixed;
bottom: 0;
}

.events > * {
display: flex;
flex-wrap: wrap;
font-size: 0.5em;
font-family: monospace;
}

.events li {
margin-left: 3em;
padding: 0.5em;
}

+ 5
- 4
public/instructor/termboard.html View File

@@ -15,16 +15,17 @@

<script id="master" type="x-tmpl-mustache">
<header>
<h1>operator.devalot.com</h1>
<h2>Course Code: <span class="code">{{code}}</span></h2>
<p>Welcome to Secure Coding! Please go to:</p>
<p class="operator">operator.devalot.com</p>
<p>And use course code: <span class="code">{{code}}</span></p>
</header>

<section class="board">
</section>

<section class="events">
<ul>
</ul>
<ol>
</ol>
</section>
</script>


+ 9
- 4
public/instructor/termboard.js View File

@@ -19,6 +19,7 @@ $(function() {
tile.id = "tile-" + data.id;
tile.classList.add("tile");
tile.innerHTML = Mustache.render($("#tile").html(), data);
board.appendChild(tile);
}

if (tile) {
@@ -30,10 +31,11 @@ $(function() {
tile.classList.add("inactive");
}

board.insertBefore(tile, board.firstChild);
if (data.promote) {
board.insertBefore(tile, board.firstChild);
}
}
};
document.ut = updateTile;

// Function to truncate names.
var shortName = function(name) {
@@ -47,11 +49,13 @@ $(function() {
switch (event.data || event) {
case "VirtualMachineLogin":
data.active = true;
data.promote = true;
addMessage(data.vm + " virtual machine login");
break;

case "VirtualMachineLogout":
data.active = false;
data.promote = false;
addMessage(data.vm + " virtual machine logout");
break;
}
@@ -59,7 +63,7 @@ $(function() {

// Put a message in the messages area.
var addMessage = function(msg, klass) {
var ul = document.querySelector("#view .events ul");
var ul = document.querySelector("#view .events > *");
var li = document.createElement("li");

li.textContent = msg;
@@ -68,7 +72,7 @@ $(function() {
ul.insertBefore(li, ul.firstChild);
console.info(msg);

if (ul.children.length > 10) {
if (ul.children.length > 9) {
ul.removeChild(ul.lastElementChild);
}
};
@@ -100,6 +104,7 @@ $(function() {
data.initials = shortName(data.name);
data.vm = event.contents[2];
data.active = false;
data.promote = true;
addMessage("Enrollment for " + data.name);
break;


+ 20
- 0
public/operator/index.html View File

@@ -52,6 +52,26 @@
</p>
</li>

<li>
<p>
Please ensure that you are on the correct WiFi network:
</p>

<table>
<tbody>
<tr>
<td class="header">SSID: <em>(network name)</em></td>
<td class="code">student</td>
</tr>

<tr>
<td class="header">Password:</td>
<td class="password">riseup17</td>
</tr>
</tbody>
</table>
</li>

<li>
<p>
Start the RealVNC Viewer application and then create a new

Loading…
Cancel
Save