mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
usb_lib/*, vars/*: prevent Cheating (Copying) of homeworks, when teacher creates 'PUBLIC' folder on their USB stick
This commit is contained in:
parent
b0ef084ac8
commit
7c2f0c9c6e
15 changed files with 85 additions and 106 deletions
|
@ -67,7 +67,7 @@
|
|||
group: "{{ apache_user }}" # 2020-02-13: changed from iiab_admin_user, after discussion on weekly call (#1228, #2222)
|
||||
mode: 0775
|
||||
|
||||
- name: 'Install from template: /etc/udev/rules.d/usbmount.rules, /etc/systemd/system/usbmount@.service, /usr/bin/iiab-usb_lib-show-all-on, /usr/bin/iiab-usb_lib-show-all-off, /usr/sbin/iiab-clean-usb.sh'
|
||||
- name: 'Install from template: /etc/udev/rules.d/usbmount.rules, /etc/systemd/system/usbmount@.service, /usr/sbin/iiab-clean-usb.sh'
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
|
@ -75,8 +75,6 @@
|
|||
with_items:
|
||||
- { src: 'usbmount.rules.j2', dest: '/etc/udev/rules.d/usbmount.rules', mode: '0644' }
|
||||
- { src: 'usbmount@.service.j2', dest: '/etc/systemd/system/usbmount@.service', mode: '0644' }
|
||||
- { src: 'iiab-usb_lib-show-all-on', dest: '/usr/bin/', mode: '0755' }
|
||||
- { src: 'iiab-usb_lib-show-all-off', dest: '/usr/bin/', mode: '0755' }
|
||||
- { src: 'iiab-clean-usb.sh', dest: '/usr/sbin/', mode: '0755' }
|
||||
|
||||
- name: '2025-01-05: Add upload2usb app (#3875) directory to local_content'
|
||||
|
@ -90,7 +88,7 @@
|
|||
- name: '2025-01-05: Copy upload2usb app (#3875) files from files/upload/ to local_content'
|
||||
copy:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ doc_root }}/local_content/upload" # /library/www/html
|
||||
dest: "{{ doc_root }}/local_content/upload/" # /library/www/html
|
||||
with_fileglob:
|
||||
- upload/*
|
||||
|
||||
|
|
|
@ -66,11 +66,12 @@
|
|||
path: /etc/usbmount/mount.d/00_create_model_symlink
|
||||
state: absent
|
||||
|
||||
- name: Put variable in iiab.env that enables display of content at root of USB
|
||||
lineinfile:
|
||||
path: "{{ iiab_env_file }}"
|
||||
regexp: "^IIAB_USB_LIB_SHOW_ALL.*"
|
||||
line: "IIAB_USB_LIB_SHOW_ALL={{ iiab_usb_lib_show_all }}"
|
||||
# 20250125: using existence of PUBLIC folder on USB stick in lieu of this env variable.
|
||||
#- name: Put variable in iiab.env that enables display of content at root of USB
|
||||
# lineinfile:
|
||||
# path: "{{ iiab_env_file }}"
|
||||
# regexp: "^IIAB_USB_LIB_SHOW_ALL.*"
|
||||
# line: "IIAB_USB_LIB_SHOW_ALL={{ iiab_usb_lib_show_all }}"
|
||||
|
||||
|
||||
- name: Add 'usb_lib' variable values to {{ iiab_ini_file }}
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
- name: Install /etc/usbmount/mount.d/70-usb-library from template, if usb_lib_enabled
|
||||
template:
|
||||
src: mount.d/70-usb-library
|
||||
dest: /etc/usbmount/mount.d/
|
||||
src: mount.d/70-usb-library.j2
|
||||
dest: /etc/usbmount/mount.d/70-usb-library
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0751'
|
||||
when: usb_lib_enabled
|
||||
|
||||
- name: Install /etc/usbmount/umount.d/70-usb-library from template, if usb_lib_enabled
|
||||
template:
|
||||
src: umount.d/70-usb-library
|
||||
dest: /etc/usbmount/umount.d
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0751'
|
||||
when: usb_lib_enabled
|
||||
# 20250125: commenting out stale file, superseded by iiab-clean-usb.sh
|
||||
# - name: Install /etc/usbmount/umount.d/70-usb-library from template, if usb_lib_enabled
|
||||
# template:
|
||||
# src: umount.d/70-usb-library
|
||||
# dest: /etc/usbmount/umount.d
|
||||
# owner: root
|
||||
# group: root
|
||||
# mode: '0751'
|
||||
# when: usb_lib_enabled
|
||||
|
||||
- name: Remove /etc/usbmount/mount.d/70-usb-library if not usb_lib_enabled
|
||||
file:
|
||||
|
@ -22,11 +23,12 @@
|
|||
state: absent
|
||||
when: not usb_lib_enabled
|
||||
|
||||
- name: Remove /etc/usbmount/umount.d/70-usb-library if not usb_lib_enabled
|
||||
file:
|
||||
path: /etc/usbmount/umount.d/70-usb-library
|
||||
state: absent
|
||||
when: not usb_lib_enabled
|
||||
# 20250125: commenting out stale file, superseded by iiab-clean-usb.sh
|
||||
# - name: Remove /etc/usbmount/umount.d/70-usb-library if not usb_lib_enabled
|
||||
# file:
|
||||
# path: /etc/usbmount/umount.d/70-usb-library
|
||||
# state: absent
|
||||
# when: not usb_lib_enabled
|
||||
|
||||
- name: Restart 'nginx' systemd service
|
||||
systemd:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue