Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for nginx with disabled ipv6 #2254

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions installation/includes/02_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,21 @@ verify_file_contains_string() {
log " CHECK"
}

verify_file_does_not_contain_string() {
local string="$1"
local file="$2"
log " Verify '${string}' not found in '${file}'"

if [[ -z "${string}" || -z "${file}" ]]; then
exit_on_error "ERROR: at least one parameter value is missing!"
fi

if grep -iq "${string}" "${file}"; then
exit_on_error "ERROR: '${string}' found in '${file}'"
fi
log " CHECK"
}

verify_file_contains_string_once() {
local string="$1"
local file="$2"
Expand Down
8 changes: 8 additions & 0 deletions installation/routines/setup_jukebox_webapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ _jukebox_webapp_register_as_system_service_with_nginx() {
sudo cp -f "${INSTALLATION_PATH}/resources/default-settings/nginx.default" "${WEBAPP_NGINX_SITE_DEFAULT_CONF}"
sudo sed -i "s|%%INSTALLATION_PATH%%|${INSTALLATION_PATH}|g" "${WEBAPP_NGINX_SITE_DEFAULT_CONF}"

if [ "$DISABLE_IPv6" = true ] ; then
sudo sed -i '/listen \[::\]:80/d' "${WEBAPP_NGINX_SITE_DEFAULT_CONF}"
fi

# make sure nginx can access the home directory of the user
sudo chmod o+x "${HOME_PATH}"

Expand Down Expand Up @@ -147,6 +151,10 @@ _jukebox_webapp_check() {
verify_apt_packages nginx
verify_files_exists "${WEBAPP_NGINX_SITE_DEFAULT_CONF}"

if [ "$DISABLE_IPv6" = true ] ; then
verify_file_does_not_contain_string "listen [::]:80" "${WEBAPP_NGINX_SITE_DEFAULT_CONF}"
fi

verify_service_enablement nginx.service enabled
}

Expand Down
Loading