From b129d88a6befd88697393317e3b3bee3c2658df8 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Tue, 3 Apr 2018 18:27:06 +0200 Subject: [PATCH] Patch ldap-auth plugin to fix subfolder installation see https://github.com/omniauth/omniauth-ldap/pull/16 --- conf/ldap-auth-fix-subfolder.patch | 12 ++++++++++++ scripts/install | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 conf/ldap-auth-fix-subfolder.patch diff --git a/conf/ldap-auth-fix-subfolder.patch b/conf/ldap-auth-fix-subfolder.patch new file mode 100644 index 0000000..de005c7 --- /dev/null +++ b/conf/ldap-auth-fix-subfolder.patch @@ -0,0 +1,12 @@ +--- discourse-ldap-auth.orig/gems/2.3.3/gems/omniauth-ldap-1.0.5/lib/omniauth/strategies/ldap.rb 2018-04-02 17:58:36.830909997 +0200 ++++ discourse-ldap-auth/gems/2.3.3/gems/omniauth-ldap-1.0.5/lib/omniauth/strategies/ldap.rb 2018-04-02 19:17:51.903732202 +0200 +@@ -27,7 +27,8 @@ + + def request_phase + OmniAuth::LDAP::Adaptor.validate @options +- f = OmniAuth::Form.new(:title => (options[:title] || "LDAP Authentication"), :url => callback_path) ++ #Patch applied: https://github.com/omniauth/omniauth-ldap/pull/16 ++ f = OmniAuth::Form.new(:title => (options[:title] || "LDAP Authentication"), :url => callback_url) + f.text_field 'Login', 'username' + f.password_field 'Password', 'password' + f.button "Sign In" diff --git a/scripts/install b/scripts/install index e63dc56..673c799 100644 --- a/scripts/install +++ b/scripts/install @@ -201,7 +201,14 @@ $rake_exec assets:precompile) # (cd "$final_path" # exec_as $app bin/rake RAILS_ENV=production assets:precompile) -# TODO setup +#================================================= +# CONFIGURE PLUGINS +#================================================= + +# Patch ldap-auth plugin to fix it when using domain subfolder +# (Can only do that now because we are patching dependencies which have just been downloaded) +(cd $final_path/plugins/discourse-ldap-auth +patch -p1 < $YNH_CWD/../conf/ldap-auth-fix-subfolder.patch) #================================================= # SETUP SYSTEMD