Improve lego service to be more dynamic
This commit is contained in:
parent
fa2059bb32
commit
be3c610bd4
14 changed files with 64 additions and 46 deletions
roles/lego/files/hooks
12
roles/lego/files/hooks/auth.serguzim.me
Executable file
12
roles/lego/files/hooks/auth.serguzim.me
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
domain="auth.serguzim.me"
|
||||
|
||||
_install() {
|
||||
install --owner=root --group=root --mode=600 \
|
||||
"$CERTIFICATES_PATH/$domain.$1" \
|
||||
"/opt/services/authentik/certs/$domain.$2"
|
||||
}
|
||||
|
||||
_install crt pem
|
||||
_install key key
|
16
roles/lego/files/hooks/db.serguzim.me
Executable file
16
roles/lego/files/hooks/db.serguzim.me
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
domain="db.serguzim.me"
|
||||
|
||||
_install() {
|
||||
install --owner=postgres --group=postgres --mode=600 \
|
||||
"$CERTIFICATES_PATH/$domain.$1" \
|
||||
"/var/lib/postgres/data/server.$1"
|
||||
}
|
||||
|
||||
_install crt
|
||||
_install key
|
||||
|
||||
sudo -u postgres pg_ctl -D /var/lib/postgres/data/ reload
|
||||
|
||||
# vim: ft=sh
|
Loading…
Add table
Add a link
Reference in a new issue