Compare commits

...

2 Commits

Author SHA1 Message Date
John Lancaster
11efff6829 pruning 2025-12-28 23:38:24 -06:00
John Lancaster
83ada5bd70 using step path for cert default 2025-12-28 23:34:01 -06:00
2 changed files with 3 additions and 6 deletions

View File

@@ -118,7 +118,7 @@ echo "-----------------------------"
# 1. Collect Inputs # 1. Collect Inputs
# Example: # Example:
get_input "HOST_NAME" "Enter Hostname" "$(hostname)" "false" get_input "HOST_NAME" "Enter Hostname" "$(hostname)" "false"
get_input "CERT_DIR" "Enter directory for certificates" "${HOME}/.step/certs" "false" get_input "CERT_DIR" "Enter directory for certificates" "$(step path)/certs" "false"
get_input "CERT_LOCATION" "Enter specific path for cert" "${CERT_DIR}/${HOSTNAME}.crt" "false" get_input "CERT_LOCATION" "Enter specific path for cert" "${CERT_DIR}/${HOSTNAME}.crt" "false"
get_input "KEY_LOCATION" "Enter specific path for private key" "${CERT_DIR}/${HOSTNAME}.key" "false" get_input "KEY_LOCATION" "Enter specific path for private key" "${CERT_DIR}/${HOSTNAME}.key" "false"

View File

@@ -9,9 +9,6 @@ StartLimitIntervalSec=0
Type=oneshot Type=oneshot
User=root User=root
Environment=CERT_LOCATION=/home/john/soteria/certs/soteria.crt \
KEY_LOCATION=/home/john/soteria/certs/soteria.key
; ExecCondition checks if the certificate is ready for renewal, ; ExecCondition checks if the certificate is ready for renewal,
; based on the exit status of the command. ; based on the exit status of the command.
; (In systemd <242, you can use ExecStartPre= here.) ; (In systemd <242, you can use ExecStartPre= here.)
@@ -20,8 +17,8 @@ ExecCondition=/usr/bin/step certificate needs-renewal ${CERT_LOCATION}
; ExecStart renews the certificate, if ExecStartPre was successful. ; ExecStart renews the certificate, if ExecStartPre was successful.
ExecStart=/usr/bin/step ca renew --force ${CERT_LOCATION} ${KEY_LOCATION} ExecStart=/usr/bin/step ca renew --force ${CERT_LOCATION} ${KEY_LOCATION}
ExecStartPost=/usr/bin/openssl x509 -noout -enddate -in ${CERT_LOCATION} ; ExecStartPost=/usr/bin/openssl x509 -noout -enddate -in ${CERT_LOCATION}
ExecStartPost=/usr/bin/docker exec caddy caddy reload --config /etc/caddy/Caddyfile ; ExecStartPost=/usr/bin/docker exec caddy caddy reload --config /etc/caddy/Caddyfile
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target