Commit Graph

4 Commits (b2213416d0c6ed75d2a095e6f4d96a8c4d5fc4a1)

Author SHA1 Message Date
Dustin b1fa4fc8a7 r/web/chmod777.sh: Add HTTP redirect
The HTTP->HTTPS redirect for chmod777.sh was only working by
coincidence.  It needs its own virtual host to ensure it works
irrespective of how other websites are configured.
2023-01-09 13:06:56 -06:00
Dustin 7b04326146 roles/websites/chmod777: Remove HTTP vhost
Since there are no other plain HTTP virtual hosts, the one defined for
chmod777.sh became the "default."  Since it explicitly redirects all
requests to https://chmod777.sh, it caused all non-HTTPS requests to be
redirected there, regardless of the requested name.  This was
particularly confusing for Tabitha, as she frequently forgets to put
https://…, and would find herself at my stupid blog instead of
Nextcloud.
2021-03-11 19:57:37 -06:00
Dustin d1cdc8bfc3 roles/cert: Add handler topic notification
Changing/renewing a certificate generally requires restarting or
reloading some service.  Since the *cert* role is intended to be generic
and reusable, it naturally does not know what action to take to effect
the change.  It works well for the initial deployment of a new
application, since the service is reloaded anyway in order for the new
configuration to be applied.  It fails, however, for continuous
enforcement, when a certificate is renewed automatically (i.e. by
`lego`) but no other changes are being made.  This has caused a number
of disruptions when some certificate expires and its replacement is
available but has not yet been loaded.

To address this issue, I have added a handler "topic" notification to
the *certs* role.  When either the certificate or private key file is
replaced, the relevant task will "notify" a generic handler "topic."
This allows some other role to define a specific handler, which
"listens" for these notifications, and takes the appropriate action for
its respective service.

For this mechanism to work, though, the *cert* role can only be used as
a dependency of another role.  That role must define the handler and
configure it to listen to the generic "certificate changed" topic.  As
such, each of the roles that are associated with a certificate deployed
by the *cert* role now declare it as a dependency, and the top-level
playbooks only include those roles.
2020-12-26 10:38:17 -06:00
Dustin db6d13013a websites: Add chmod777.sh
*chmod777.sh* is a simple static website, generated by Hugo.  It is
built and published from a Jenkins pipeline, which runs automatically
when new commits are pushed to Gitea.

The HTTPS certificate for this site is signed by Let's Encrypt and
managed by `lego` in the `certs` submodule.
2020-03-09 20:29:52 -05:00