Use host-managed SSH accounts for browser terminal

This commit is contained in:
c4ch3c4d3
2026-04-13 19:40:38 -06:00
parent 13ce59d901
commit 5576142aec
10 changed files with 2 additions and 159 deletions
-86
View File
@@ -1,11 +1,3 @@
- name: Fail when student password hash is not configured
fail:
msg: >-
Set COURSEWARE_STUDENT_PASSWORD_HASH in the environment before running ./labctl up.
Example:
export COURSEWARE_STUDENT_PASSWORD_HASH="$(openssl passwd -6 'student-password')"
when: courseware_student_password_hash | trim | length == 0
- name: Install terminal prerequisites
become: true
apt:
@@ -79,84 +71,6 @@
- ansible_service_mgr != "systemd"
- courseware_terminal_sshd_pid.rc != 0
- name: Ensure managed terminal user exists
become: true
user:
name: "{{ courseware_student_username }}"
password: "{{ courseware_student_password_hash }}"
shell: /bin/bash
create_home: true
state: present
- name: Ensure lab 3 workspace root exists
become: true
file:
path: "{{ courseware_lab3_dir }}"
state: directory
owner: "{{ courseware_student_username }}"
group: "{{ courseware_student_username }}"
mode: "0755"
- name: Ensure lab 3 WhiteRabbitNeo workspace exists
become: true
file:
path: "{{ courseware_lab3_dir }}/WhiteRabbitNeo"
state: directory
owner: "{{ courseware_student_username }}"
group: "{{ courseware_student_username }}"
mode: "0755"
- name: Write lab 3 workspace README
become: true
template:
src: lab3-workspace-readme.txt.j2
dest: "{{ courseware_lab3_dir }}/README.txt"
owner: "{{ courseware_student_username }}"
group: "{{ courseware_student_username }}"
mode: "0644"
- name: Check for repo-local WhiteRabbitNeo base repo
stat:
path: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo-V3-7B"
register: courseware_lab3_base_repo_stat
- name: Check for repo-local WhiteRabbitNeo GGUF directory
stat:
path: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo_WhiteRabbitNeo-V3-7B-GGUF"
register: courseware_lab3_gguf_repo_stat
- name: Link WhiteRabbitNeo base repo into the student workspace when repo-local assets exist
become: true
file:
src: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo-V3-7B"
dest: "{{ courseware_lab3_dir }}/WhiteRabbitNeo/WhiteRabbitNeo-V3-7B"
state: link
force: true
owner: "{{ courseware_student_username }}"
group: "{{ courseware_student_username }}"
when: courseware_lab3_base_repo_stat.stat.exists
- name: Link WhiteRabbitNeo GGUF directory into the student workspace when repo-local assets exist
become: true
file:
src: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo_WhiteRabbitNeo-V3-7B-GGUF"
dest: "{{ courseware_lab3_dir }}/WhiteRabbitNeo/WhiteRabbitNeo_WhiteRabbitNeo-V3-7B-GGUF"
state: link
force: true
owner: "{{ courseware_student_username }}"
group: "{{ courseware_student_username }}"
when: courseware_lab3_gguf_repo_stat.stat.exists
- name: Link WhiteRabbitNeo download helper into the student workspace
become: true
file:
src: "{{ courseware_lab2_dir }}/download_whiterabbitneo-gguf.sh"
dest: "{{ courseware_lab3_dir }}/download_whiterabbitneo-gguf.sh"
state: link
force: true
owner: "{{ courseware_student_username }}"
group: "{{ courseware_student_username }}"
- name: Create contained WeTTY directory
file:
path: "{{ courseware_wetty_dir }}"
@@ -1,14 +0,0 @@
This workspace is managed for the Lab 3 browser terminal.
You should log in as:
- username: {{ courseware_student_username }}
Start here:
- working directory: {{ courseware_lab3_dir }}
Helpful paths:
- WhiteRabbitNeo helper: {{ courseware_lab3_dir }}/download_whiterabbitneo-gguf.sh
- repo-local base repo symlink: {{ courseware_lab3_dir }}/WhiteRabbitNeo/WhiteRabbitNeo-V3-7B
- repo-local GGUF symlink: {{ courseware_lab3_dir }}/WhiteRabbitNeo/WhiteRabbitNeo_WhiteRabbitNeo-V3-7B-GGUF
Some symlinks only appear after the corresponding repo-local lab assets are present.
@@ -6,7 +6,6 @@ PasswordAuthentication yes
KbdInteractiveAuthentication no
ChallengeResponseAuthentication no
UsePAM yes
AllowUsers {{ courseware_student_username }}
AllowTcpForwarding no
X11Forwarding no
PrintMotd no
@@ -1,5 +1,3 @@
{
"lab3TerminalUrl": "http://{{ courseware_url_host }}:{{ courseware_ports.wetty }}{{ courseware_wetty_base_path }}",
"lab3Username": "{{ courseware_student_username }}",
"lab3WorkingDirectory": "{{ courseware_lab3_dir }}"
"lab3TerminalUrl": "http://{{ courseware_url_host }}:{{ courseware_ports.wetty }}{{ courseware_wetty_base_path }}"
}