Skip to content

Commit

Permalink
feat(installer)!: remove the --update-nginx flag (#2851)
Browse files Browse the repository at this point in the history
### Description

Related to #2543

BREAKING CHANGE: The `--update-nginx` flag was removed from the
installer. The nginx configuration deployed by the installer will now
always be overwritten. Make sure to move your customizations to a
reverse proxy configuration.
  • Loading branch information
jooola committed Dec 29, 2023
1 parent 62e5f4d commit 35d7eac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 35 deletions.
6 changes: 0 additions & 6 deletions docs/admin-manual/install/install-using-the-installer.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ When upgrading be sure to run the installer using the same arguments you used du

:::

:::warning

To update the LibreTime nginx configuration file, for example to change the `--listen-port`, make sure to add the `--update-nginx` flag to allow overwriting the existing configuration file.

:::

If you need to change some configuration, the install script can be configured using flags or environment variables. Changing the listening port of LibreTime or whether you want to install some dependency by yourself, you could run the following:

```bash
Expand Down
42 changes: 13 additions & 29 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ Options:
--no-setup-postgresql Do not setup Postgresql.
--no-setup-rabbitmq Do not setup RabbitMQ.
--update-nginx Update nginx files during upgrades.
Environment variables:
Advanced options can be changed using environment variables (flags will take
Expand Down Expand Up @@ -117,9 +115,6 @@ LIBRETIME_SETUP_POSTGRESQL=${LIBRETIME_SETUP_POSTGRESQL:-true}
# > Create a default rabbitmq user with a random password.
LIBRETIME_SETUP_RABBITMQ=${LIBRETIME_SETUP_RABBITMQ:-true}

# > Update nginx files during upgrades.
LIBRETIME_UPDATE_NGINX=${LIBRETIME_UPDATE_NGINX:-false}

# > Comma separated list of sections to exclude from packages list.
LIBRETIME_PACKAGES_EXCLUDES=${LIBRETIME_PACKAGES_EXCLUDES:-}

Expand All @@ -138,8 +133,7 @@ while [[ $# -gt 0 ]]; do
shift 1
;;
--update-nginx)
LIBRETIME_UPDATE_NGINX=true
shift 1
error "the '--update-nginx' option was removed in 4.0.0"
;;
--no-setup-icecast)
LIBRETIME_SETUP_ICECAST=false
Expand Down Expand Up @@ -743,35 +737,25 @@ template_file cp_if_different \

section "Nginx"

if $is_first_install || $LIBRETIME_UPDATE_NGINX; then
if $is_first_install; then
install_packages nginx

info "disabling nginx default site"
rm -f "/etc/nginx/sites-enabled/default"
fi

nginx_config_template_args=(
"${SCRIPT_DIR}/installer/nginx/libretime.conf"
"/etc/nginx/sites-available/libretime.conf"
sed
-e "s|@@LISTEN_PORT@@|${LIBRETIME_LISTEN_PORT}|g"
-e "s|@@LEGACY_WEB_ROOT@@|${LEGACY_WEB_ROOT}|g"
)

if $is_first_install || $LIBRETIME_UPDATE_NGINX; then
info "deploying libretime nginx config"
template_file cp_if_different "${nginx_config_template_args[@]}"
else
info "printing libretime nginx config differences"
template_file diff_if_exists "${nginx_config_template_args[@]}"
fi
info "deploying libretime nginx config"
template_file cp_if_different \
"${SCRIPT_DIR}/installer/nginx/libretime.conf" \
"/etc/nginx/sites-available/libretime.conf" \
sed \
-e "s|@@LISTEN_PORT@@|${LIBRETIME_LISTEN_PORT}|g" \
-e "s|@@LEGACY_WEB_ROOT@@|${LEGACY_WEB_ROOT}|g"

if $is_first_install || $LIBRETIME_UPDATE_NGINX; then
info "enabling libretime nginx config"
ln -s --force \
"/etc/nginx/sites-available/libretime.conf" \
"/etc/nginx/sites-enabled/libretime.conf"
fi
info "enabling libretime nginx config"
ln -s --force \
"/etc/nginx/sites-available/libretime.conf" \
"/etc/nginx/sites-enabled/libretime.conf"

# Finalize
########################################################################################
Expand Down

0 comments on commit 35d7eac

Please sign in to comment.