More permissions changes for SSL certs.

This commit is contained in:
Buster "Silver Eagle" Neece 2022-03-09 22:09:11 -06:00
parent 4d8d31e3f0
commit 93d12960e7
No known key found for this signature in database
GPG Key ID: 9FC8B9E008872109
2 changed files with 7 additions and 13 deletions

View File

@ -16,19 +16,10 @@ shopt -s expand_aliases
function set_ownership_and_permissions {
local path="${1:?}"
# The default ownership is root:root, with 755 permissions for folders and 644 for files.
local user="${FILES_UID:-root}"
local group="${FILES_GID:-$user}"
local f_perms="${FILES_PERMS:-644}"
local d_perms="${FOLDERS_PERMS:-755}"
if [[ ! "$f_perms" =~ ^[0-7]{3,4}$ ]]; then
echo "Warning : the provided files permission octal ($f_perms) is incorrect. Skipping ownership and permissions check."
return 1
fi
if [[ ! "$d_perms" =~ ^[0-7]{3,4}$ ]]; then
echo "Warning : the provided folders permission octal ($d_perms) is incorrect. Skipping ownership and permissions check."
return 1
fi
local user="azuracast"
local group="azuracast"
local f_perms="644"
local d_perms="755"
[[ "$DEBUG" == 1 ]] && echo "Debug: checking $path ownership and permissions."

View File

@ -14,3 +14,6 @@ if [ ! -f /etc/nginx/certs/default.crt ]; then
-keyout /etc/nginx/certs/default.key \
-out /etc/nginx/certs/default.crt
fi
chown azuracast:azuracast /etc/nginx/certs/default.* || true
chmod 644 /etc/nginx/certs/default.* || true