websites/d…and…t: Configure formsubmit

To handle the RSVP form on *dustinandtabitha.com*, we are going to use
*formsubmit*.  It runs on the same machine that hosts the website, so
there's no dealing with CORS.  The */submit/rsvp* path, which is proxied
to the backend, is the RSVP form's target.
This commit is contained in:
2022-02-27 17:50:06 -06:00
parent b350698148
commit 5485fc6f93
5 changed files with 41 additions and 0 deletions

View File

@@ -19,6 +19,8 @@ SSLCertificateFile /etc/pki/tls/certs/dustinandtabitha.com.cer
Strict-Transport-Security "max-age=63072000; includeSubDomains"
</IfModule>
RewriteEngine On
RewriteRule /submit/rsvp http://127.0.0.1:8000/weddingrsvp [P]
DocumentRoot /srv/www/dustinandtabitha/htdocs
<Directory /srv/www/dustinandtabitha/htdocs>

View File

@@ -35,3 +35,22 @@
dest: /etc/httpd/conf.d/dustinandtabitha.conf
mode: '0644'
notify: reload httpd
- name: ensure dustinandtabitha.com data directory exists
file:
path: /srv/www/dustinandtabitha/data
mode: ug=rwx,o=
owner: webapp.dustinandtabitha
group: apache
setype: httpd_sys_rw_content_t
state: directory
tags:
- datadir
- name: ensure formsubmit is configured for dustinandtabitha.com
copy:
content: '{{ dustinandtabitha_formsubmit|to_nice_yaml(indent=2) }}'
dest: /etc/formsubmit/weddingrsvp.yml
mode: u=rw,go=r
tags:
- config

View File

@@ -0,0 +1,10 @@
dustinandtabitha_formsubmit:
csvfile: /srv/www/dustinandtabitha/data/rsvp.csv
defaults:
adult: 0
preschool: 0
school: 0
matrix:
homeserver: hatch.chat
room: '!qJoqJkHxCHgDSTZwwX:hatch.chat'
access_token: '{{ dustinandtabitha_formsubmit_matrix_token }}'