core: sanitize appname for certificate generation (#9552)

* Update SSL key and certificate paths for Actual Budget

* Use lowercase app name for certificate paths

* revert changes at actualbudget

---------

Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com>
This commit is contained in:
Slaviša Arežina
2025-12-01 20:35:12 +01:00
committed by GitHub
parent c34659ced2
commit e5cc0a4726

View File

@@ -1535,9 +1535,10 @@ check_for_gh_release() {
# ------------------------------------------------------------------------------
create_self_signed_cert() {
local APP_NAME="${1:-${APPLICATION}}"
local CERT_DIR="/etc/ssl/${APP_NAME}"
local CERT_KEY="${CERT_DIR}/${APP_NAME}.key"
local CERT_CRT="${CERT_DIR}/${APP_NAME}.crt"
local APP_NAME_LC=$(echo "${APP_NAME,,}" | tr -d ' ')
local CERT_DIR="/etc/ssl/${APP_NAME_LC}"
local CERT_KEY="${CERT_DIR}/${APP_NAME_LC}.key"
local CERT_CRT="${CERT_DIR}/${APP_NAME_LC}.crt"
if [[ -f "$CERT_CRT" && -f "$CERT_KEY" ]]; then
return 0