mirror of
https://github.com/YunoHost-Apps/flarum_ynh.git
synced 2024-09-03 18:36:24 +02:00
Merge pull request #155 from YunoHost-Apps/testing
Fix domain root installation, and misc improvements
This commit is contained in:
commit
1235ee11a5
5 changed files with 7 additions and 33 deletions
|
@ -11,8 +11,7 @@ location __PATH__/ {
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 )
|
# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 )
|
||||||
try_files $uri $uri/ __PATH_HACK__/index.php?$query_string;
|
try_files $uri $uri/ __PATH__/__PATH__/index.php?$query_string;
|
||||||
#if (!-e $request_filename) { rewrite ^ __PATH_HACK__/index.php last; }
|
|
||||||
|
|
||||||
location ~* \.php$ {
|
location ~* \.php$ {
|
||||||
fastcgi_split_path_info ^(.+.php)(/.+)$;
|
fastcgi_split_path_info ^(.+.php)(/.+)$;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"fr": "Un forum de nouvelle génération, simplement.",
|
"fr": "Un forum de nouvelle génération, simplement.",
|
||||||
"de": "Forum der nächsten Generation leicht gemacht."
|
"de": "Forum der nächsten Generation leicht gemacht."
|
||||||
},
|
},
|
||||||
"version": "0.1.0-beta.14~ynh1",
|
"version": "0.1.0-beta.14~ynh2",
|
||||||
"url": "http://flarum.org/",
|
"url": "http://flarum.org/",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
|
|
@ -29,11 +29,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
# Needed for helper "ynh_add_nginx_config"
|
# Needed for helper "ynh_add_nginx_config"
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
# Add settings here as needed by your application
|
|
||||||
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
|
||||||
#db_user=$db_name
|
|
||||||
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -84,12 +79,6 @@ then
|
||||||
# Set global variables for nginx helper
|
# Set global variables for nginx helper
|
||||||
domain="$old_domain"
|
domain="$old_domain"
|
||||||
path_url="$new_path"
|
path_url="$new_path"
|
||||||
# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 )
|
|
||||||
if [ $path_url = "/" ]; then
|
|
||||||
ynh_replace_string "__PATH_HACK__" "" "../conf/nginx.conf"
|
|
||||||
else
|
|
||||||
ynh_replace_string "__PATH_HACK__" "$path_url" "../conf/nginx.conf"
|
|
||||||
fi
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -69,7 +69,7 @@ ynh_app_setting_set --app=$app --key=ssowat_version --value=$ssowat_version
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing dependencies..." --weight=1
|
ynh_script_progression --message="Installing dependencies..." --weight=2
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=7
|
ynh_script_progression --message="Setting up source files..." --weight=3
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
|
@ -97,13 +97,6 @@ ynh_setup_source --dest_dir="$final_path"
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 )
|
|
||||||
if [ $path_url = "/" ]; then
|
|
||||||
ynh_replace_string "__PATH_HACK__" "" "../conf/nginx.conf"
|
|
||||||
else
|
|
||||||
ynh_replace_string "__PATH_HACK__" "$path_url/$path_url" "../conf/nginx.conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
|
@ -138,7 +131,7 @@ ynh_add_swap --size=$swap_needed
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL COMPOSER DEPENDENCIES
|
# INSTALL COMPOSER DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing composer dependencies..."
|
ynh_script_progression --message="Installing composer dependencies..." --weight=5
|
||||||
|
|
||||||
ynh_exec_warn_less ynh_install_composer --user=$app --phpversion="$phpversion" --workdir="$final_path"
|
ynh_exec_warn_less ynh_install_composer --user=$app --phpversion="$phpversion" --workdir="$final_path"
|
||||||
|
|
||||||
|
|
|
@ -160,20 +160,13 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1
|
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1
|
||||||
|
|
||||||
# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 )
|
|
||||||
if [ $path_url = "/" ]; then
|
|
||||||
ynh_replace_string "__PATH_HACK__" "" "../conf/nginx.conf"
|
|
||||||
else
|
|
||||||
ynh_replace_string "__PATH_HACK__" "$path_url/$path_url" "../conf/nginx.conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DEPENDENCIES
|
# UPGRADE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading dependencies..." --weight=1
|
ynh_script_progression --message="Upgrading dependencies..." --weight=2
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
|
@ -211,7 +204,7 @@ ynh_add_swap --size=$swap_needed
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Installing composer dependencies..."
|
ynh_script_progression --message="Installing composer dependencies..." --weight=5
|
||||||
|
|
||||||
# Set right permissions
|
# Set right permissions
|
||||||
chown -R $app:www-data $final_path
|
chown -R $app:www-data $final_path
|
||||||
|
|
Loading…
Add table
Reference in a new issue