From 1b7a8885b834bf805bd2ae017dee4abeb2d76bc1 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Mon, 9 Jan 2023 12:59:58 -0600 Subject: [PATCH] r/web/hlc: Configure formsubmit Tabitha's Hatch Learning Center site has two user submission forms: one for signing in/out students for class, and another for parents to register new students for the program. These are handled by *formsubmit* and store data in CSV spreadsheets. --- .../files/hatchlearningcenter.org.httpd.conf | 4 +++ .../hatchlearningcenter.org/tasks/main.yml | 26 +++++++++++++++++++ .../hatchlearningcenter.org/vars/main.yml | 7 +++++ 3 files changed, 37 insertions(+) create mode 100644 roles/websites/hatchlearningcenter.org/vars/main.yml diff --git a/roles/websites/hatchlearningcenter.org/files/hatchlearningcenter.org.httpd.conf b/roles/websites/hatchlearningcenter.org/files/hatchlearningcenter.org.httpd.conf index dc86bc1..4da6040 100644 --- a/roles/websites/hatchlearningcenter.org/files/hatchlearningcenter.org.httpd.conf +++ b/roles/websites/hatchlearningcenter.org/files/hatchlearningcenter.org.httpd.conf @@ -57,6 +57,10 @@ Header always set \ Strict-Transport-Security "max-age=63072000; includeSubDomains" + RewriteEngine On + RewriteRule /submit/attendance http://127.0.0.1:8000/hlc-attendance [P] + RewriteRule /submit/signup http://127.0.0.1:8000/hlc-signup [P] + DocumentRoot /srv/www/hatchlearningcenter.org/htdocs Require all granted diff --git a/roles/websites/hatchlearningcenter.org/tasks/main.yml b/roles/websites/hatchlearningcenter.org/tasks/main.yml index 77c73c9..6a530ce 100644 --- a/roles/websites/hatchlearningcenter.org/tasks/main.yml +++ b/roles/websites/hatchlearningcenter.org/tasks/main.yml @@ -49,3 +49,29 @@ notify: reload httpd tags: - apache-config + +- name: ensure hatchlearningcenter.org data directory exists + file: + path: /srv/www/hatchlearningcenter.org/data + mode: ug=rwx,o= + owner: webapp.hlc + group: apache + setype: httpd_sys_rw_content_t + state: directory + tags: + - datadir + +- name: ensure formsubmit is configured hatchlearningcenter.org attendance + copy: + content: '{{ hlc_formsubmit_attendance|to_nice_yaml(indent=2) }}' + dest: /etc/formsubmit/hlc-attendance.yml + mode: u=rw,go=r + tags: + - config +- name: ensure formsubmit is configured hatchlearningcenter.org signup + copy: + content: '{{ hlc_formsubmit_signup|to_nice_yaml(indent=2) }}' + dest: /etc/formsubmit/hlc-signup.yml + mode: u=rw,go=r + tags: + - config diff --git a/roles/websites/hatchlearningcenter.org/vars/main.yml b/roles/websites/hatchlearningcenter.org/vars/main.yml new file mode 100644 index 0000000..9eef3bc --- /dev/null +++ b/roles/websites/hatchlearningcenter.org/vars/main.yml @@ -0,0 +1,7 @@ +hlc_formsubmit_attendance: + csvfile: /srv/www/hatchlearningcenter.org/data/attendance.csv + date_field: date + time_field: time +hlc_formsubmit_signup: + csvfile: /srv/www/hatchlearningcenter.org/data/signup.csv + date_field: date