Skip to content

Commit e5cc0a4

Browse files
tremor021MickLesk
andauthored
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 <[email protected]>
1 parent c34659c commit e5cc0a4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

misc/tools.func

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,9 +1535,10 @@ check_for_gh_release() {
15351535
# ------------------------------------------------------------------------------
15361536
create_self_signed_cert() {
15371537
local APP_NAME="${1:-${APPLICATION}}"
1538-
local CERT_DIR="/etc/ssl/${APP_NAME}"
1539-
local CERT_KEY="${CERT_DIR}/${APP_NAME}.key"
1540-
local CERT_CRT="${CERT_DIR}/${APP_NAME}.crt"
1538+
local APP_NAME_LC=$(echo "${APP_NAME,,}" | tr -d ' ')
1539+
local CERT_DIR="/etc/ssl/${APP_NAME_LC}"
1540+
local CERT_KEY="${CERT_DIR}/${APP_NAME_LC}.key"
1541+
local CERT_CRT="${CERT_DIR}/${APP_NAME_LC}.crt"
15411542

15421543
if [[ -f "$CERT_CRT" && -f "$CERT_KEY" ]]; then
15431544
return 0

0 commit comments

Comments
 (0)