1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/funkwhale_ynh.git synced 2024-09-03 18:36:24 +02:00

Remove manual modification of nginx domain file

Fix #84
This commit is contained in:
Jean-Baptiste Holcroft 2019-11-02 15:09:14 +01:00
parent be482df34f
commit e20af67e94
5 changed files with 1 additions and 47 deletions

View file

@ -5,7 +5,7 @@
"description": { "description": {
"en": "A modern, convivial and free music server" "en": "A modern, convivial and free music server"
}, },
"version": "0.20.1~ynh2", "version": "0.20.1~ynh3",
"url": "https://funkwhale.audio", "url": "https://funkwhale.audio",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"maintainer": { "maintainer": {

View file

@ -15,40 +15,6 @@ pkg_dependencies="build-essential curl ffmpeg \
# PERSONAL HELPERS # PERSONAL HELPERS
#================================================= #=================================================
# funkwhale needs edits to the domain config file
# this function removes funkwhale specifics
funkwhale_nginx_domain_cleaning() {
local line
local tempFile
local nginxConf
nginxConf="/etc/nginx/conf.d/$domain.conf"
tempFile="$nginxConf.temp"
line=$(sed -n '/server /=' "$nginxConf" | head -n 1)
tail -n +"$line" "$nginxConf" > "$tempFile"
mv "$tempFile" "$nginxConf"
}
# funkwhale needs edits to the domain config file
# this function adds funkwhale specifics
funkwhale_nginx_domain_configure() {
local tempFile
local nginxConf
nginxConf="/etc/nginx/conf.d/$domain.conf"
tempFile="$nginxConf.temp"
echo "
# required for websocket support
map \$http_upgrade \$connection_upgrade {
default upgrade;
'' close;
}
" | cat - "$nginxConf" > "$tempFile"
mv "$tempFile" "$nginxConf"
}
#================================================= #=================================================
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS

View file

@ -106,9 +106,6 @@ ynh_setup_source --dest_dir="$final_path/code" --source_id="app-frontend"
#================================================= #=================================================
ynh_print_info --message="Configuring nginx web server..." ynh_print_info --message="Configuring nginx web server..."
# add funkwhale specifics at the beginning of the domain configuration
funkwhale_nginx_domain_configure
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config

View file

@ -103,9 +103,6 @@ ynh_secure_remove --file="/var/log/$app"
#================================================= #=================================================
ynh_print_info --message="Removing nginx web server configuration" ynh_print_info --message="Removing nginx web server configuration"
# remove domain specific configuration
funkwhale_nginx_domain_cleaning
# Remove the dedicated nginx config # Remove the dedicated nginx config
ynh_remove_nginx_config ynh_remove_nginx_config

View file

@ -128,12 +128,6 @@ ynh_setup_source --dest_dir="$final_path/code" --source_id="app-frontend"
#================================================= #=================================================
ynh_print_info --message="Upgrading nginx web server configuration..." ynh_print_info --message="Upgrading nginx web server configuration..."
# remove domain specific configuration
funkwhale_nginx_domain_cleaning
# add funkwhale specifics at the beginning of the domain configuration
funkwhale_nginx_domain_configure
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config