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

Fix the install dir of the ldap plugin

This commit is contained in:
Félix Piédallu 2024-08-30 13:28:50 +02:00
parent f82973aebd
commit c8c6ece943
2 changed files with 12 additions and 6 deletions

View file

@ -79,7 +79,8 @@ fi
ynh_setup_source --dest_dir="$install_dir/discourse" ynh_setup_source --dest_dir="$install_dir/discourse"
# Install LDAP plugin # Install LDAP plugin
ynh_setup_source --source_id=ldap-auth --dest_dir="$install_dir/discourse/plugins/discourse-ldap-auth" # See https://github.com/jonmbake/discourse-ldap-auth/issues/77
ynh_setup_source --source_id=ldap-auth --dest_dir="$install_dir/discourse/plugins/ldap"
# Add a pids and socket directory for the systemd script. # Add a pids and socket directory for the systemd script.
mkdir -p "$install_dir/discourse/tmp/pids" mkdir -p "$install_dir/discourse/tmp/pids"
@ -101,7 +102,7 @@ ynh_script_progression --message="Adding $app's configuration file..."
ynh_add_config --template="discourse_defaults.conf" --destination="$install_dir/discourse/config/discourse.conf" ynh_add_config --template="discourse_defaults.conf" --destination="$install_dir/discourse/config/discourse.conf"
ynh_add_config --template="secrets.yml" --destination="$install_dir/discourse/config/secrets.yml" ynh_add_config --template="secrets.yml" --destination="$install_dir/discourse/config/secrets.yml"
ynh_add_config --template="settings.yml" --destination="$install_dir/discourse/plugins/discourse-ldap-auth/config/settings.yml" ynh_add_config --template="settings.yml" --destination="$install_dir/discourse/plugins/ldap/config/settings.yml"
# Disable svgo worker # Disable svgo worker
echo "svgo: false" | ynh_exec_as "$app" tee "$install_dir/discourse/.image_optim.yml" >/dev/null echo "svgo: false" | ynh_exec_as "$app" tee "$install_dir/discourse/.image_optim.yml" >/dev/null
@ -184,7 +185,7 @@ ynh_script_progression --message="Configuring plugins..."
# Patch ldap-auth plugin dependency (omniauth-ldap) to fix it when using domain subfolder # Patch ldap-auth plugin dependency (omniauth-ldap) to fix it when using domain subfolder
# (Can only do that now because we are patching dependencies which have just been downloaded) # (Can only do that now because we are patching dependencies which have just been downloaded)
# Patch applied: https://github.com/omniauth/omniauth-ldap/pull/16 # Patch applied: https://github.com/omniauth/omniauth-ldap/pull/16
patch -p1 -d "$install_dir/discourse/plugins/discourse-ldap-auth/gems/$ruby_version/gems/omniauth-ldap"*/ \ patch -p1 -d "$install_dir/discourse/plugins/ldap/gems/$ruby_version/gems/omniauth-ldap"*/ \
< "../conf/ldap-auth-fix-subfolder.patch" < "../conf/ldap-auth-fix-subfolder.patch"
#================================================= #=================================================

View file

@ -58,6 +58,11 @@ if [ -f "$install_dir/tmp/sockets/unicorn.sock" ]; then
mv "$install_dir/__new__" "$install_dir/discourse" mv "$install_dir/__new__" "$install_dir/discourse"
fi fi
# See https://github.com/jonmbake/discourse-ldap-auth/issues/77
if [ -d "$install_dir/discourse/plugins/discourse-ldap-auth" ]; then
mv "$install_dir/discourse/plugins/discourse-ldap-auth" "$install_dir/discourse/plugins/ldap"
fi
#================================================= #=================================================
# UPGRADING DEPENDENCIES # UPGRADING DEPENDENCIES
#================================================= #=================================================
@ -99,7 +104,7 @@ done
ynh_secure_remove --file="$install_dir/discourse/plugins_old" ynh_secure_remove --file="$install_dir/discourse/plugins_old"
# Install LDAP plugin # Install LDAP plugin
ynh_setup_source --source_id=ldap-auth --dest_dir="$install_dir/discourse/plugins/discourse-ldap-auth" --full_replace=1 \ ynh_setup_source --source_id=ldap-auth --dest_dir="$install_dir/discourse/plugins/ldap" --full_replace=1 \
--keep="config/settings.yml" --keep="config/settings.yml"
# Add a pids and socket directory for the systemd script. # Add a pids and socket directory for the systemd script.
@ -123,7 +128,7 @@ ynh_script_progression --message="Updating $app's config file..."
ynh_add_config --template="discourse_defaults.conf" --destination="$install_dir/discourse/config/discourse.conf" ynh_add_config --template="discourse_defaults.conf" --destination="$install_dir/discourse/config/discourse.conf"
ynh_add_config --template="secrets.yml" --destination="$install_dir/discourse/config/secrets.yml" ynh_add_config --template="secrets.yml" --destination="$install_dir/discourse/config/secrets.yml"
ynh_add_config --template="settings.yml" --destination="$install_dir/discourse/plugins/discourse-ldap-auth/config/settings.yml" ynh_add_config --template="settings.yml" --destination="$install_dir/discourse/plugins/ldap/config/settings.yml"
# Disable svgo worker # Disable svgo worker
echo "svgo: false" | ynh_exec_as "$app" tee "$install_dir/discourse/.image_optim.yml" >/dev/null echo "svgo: false" | ynh_exec_as "$app" tee "$install_dir/discourse/.image_optim.yml" >/dev/null
@ -197,7 +202,7 @@ ynh_script_progression --message="Configuring plugins..."
# Patch ldap-auth plugin dependency (omniauth-ldap) to fix it when using domain subfolder # Patch ldap-auth plugin dependency (omniauth-ldap) to fix it when using domain subfolder
# (Can only do that now because we are patching dependencies which have just been downloaded) # (Can only do that now because we are patching dependencies which have just been downloaded)
# Patch applied: https://github.com/omniauth/omniauth-ldap/pull/16 # Patch applied: https://github.com/omniauth/omniauth-ldap/pull/16
patch -p1 -d "$install_dir/discourse/plugins/discourse-ldap-auth/gems/$ruby_version/gems/omniauth-ldap"*/ \ patch -p1 -d "$install_dir/discourse/plugins/ldap/gems/$ruby_version/gems/omniauth-ldap"*/ \
< "../conf/ldap-auth-fix-subfolder.patch" < "../conf/ldap-auth-fix-subfolder.patch"
#================================================= #=================================================