feat: KIAUH v4.0.0 #191
@@ -77,6 +77,8 @@ function install_fluidd() {
|
||||
set_upstream_nginx_cfg
|
||||
### create /etc/nginx/sites-available/<interface config>
|
||||
set_nginx_cfg "fluidd"
|
||||
### nginx on ubuntu 21 and above needs special permissions to access the files
|
||||
set_nginx_permissions
|
||||
|
||||
### symlink nginx log
|
||||
symlink_webui_nginx_log "fluidd"
|
||||
|
||||
@@ -77,6 +77,8 @@ function install_mainsail() {
|
||||
set_upstream_nginx_cfg
|
||||
### create /etc/nginx/sites-available/<interface config>
|
||||
set_nginx_cfg "mainsail"
|
||||
### nginx on ubuntu 21 and above needs special permissions to access the files
|
||||
set_nginx_permissions
|
||||
|
||||
### symlink nginx log
|
||||
symlink_webui_nginx_log "mainsail"
|
||||
|
||||
@@ -284,6 +284,20 @@ function set_nginx_cfg() {
|
||||
fi
|
||||
}
|
||||
|
||||
function set_nginx_permissions() {
|
||||
local distro_name version_id
|
||||
|
||||
distro_name=$(grep -E "^NAME=" /etc/os-release | cut -d'"' -f2)
|
||||
version_id=$(grep -E "^VERSION_ID=" /etc/os-release | cut -d'"' -f2)
|
||||
|
||||
if [[ ${distro_name} == "Ubuntu" && ( ${version_id} == "21.10" || ${version_id} == "22.04") ]]; then
|
||||
|
|
||||
status_msg "Granting NGINX the required permissions ..."
|
||||
chmod og+x "${HOME}" && ok_msg "Done!"
|
||||
fi
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
function read_listen_port() {
|
||||
local port interface=${1}
|
||||
port=$(grep listen "/etc/nginx/sites-enabled/${interface}" | head -1 | sed 's/^\s*//' | cut -d" " -f2 | cut -d";" -f1)
|
||||
|
||||
Reference in New Issue
Block a user
This will require attention again in October when 22.10 comes out. Unless this change is harmful on 21.04 it may be better to just remove the version check altogether.
Perhaps the script could simply check if the nginx user has sufficient permission and run chmod if it does not? Unsure if things like selinux or other sandboxing may come into play here.
Fair point. Maybe not a bad idea indeed. Or at least something like checking if
distro_name == "Ubuntu"and if that is the case i then check for the required permissions. Another way would be to check for major version greater than20. Because up until Ubuntu 20, no permission changes are required.