meza icon indicating copy to clipboard operation
meza copied to clipboard

removing SAML conf has residual error

Open revansx opened this issue 5 years ago • 4 comments

Environment

  • RHEL7
  • Meza 31.8.0

Issue summary

After removing SAML configuration from public and secret yml pages and performing a successful redeploy, landing page fails with residual SAML error.

Issue details

  1. Performed a Fresh install of Meza on a new server
  2. Everything is verified to work well. --- landing page works --- demo wiki works)
  3. First customization activity was to edit the public.yml and secret.yml with the SAML configuration for my environment.
  4. Deploy fails because my organization has not yet set-up the remote SAML agent
  5. Reverted public.yml and secret.yml back to their non-SAML revision (No SAML)
  6. Deploy is successful --- Demo Wiki works --- Landing page fails (Error 500)

Apache Error logs contains:

[Wed Jun 05 14:52:28.728999 2019] [php7:warn] [pid 3402] [client 127.0.0.1:40248] PHP Warning: require_once(/opt/htdocs/NonMediaWikiSimpleSamlAuth.php): failed to open stream: No such file or directory in /opt/htdocs/index.php on line 5

[Wed Jun 05 14:52:28.729080 2019] [php7:error] [pid 3402] [client 127.0.0.1:40248] PHP Fatal error: require_once(): Failed opening required '/opt/htdocs/NonMediaWikiSimpleSamlAuth.php' (include_path='.:/usr/share/pear:/usr/share/php') in /opt/htdocs/index.php on line 5

revansx avatar Jun 05 '19 21:06 revansx

I think removing /opt/.deploy-meza/SAMLConfig.php should solve the problem in the short term. In the long term the following code needs to be changed in src/roles/htdocs files files/BackupDownload/download.php, files/BackupDownload/index.php, and template/index.php:

if ( is_file( '/opt/.deploy-meza/SAMLConfig.php' ) ) {
	require_once __DIR__ . '/NonMediaWikiSimpleSamlAuth.php';
}

Should become:

{% if saml_public is defined %}
require_once __DIR__ . '/NonMediaWikiSimpleSamlAuth.php';
{% endif %}

jamesmontalvo3 avatar Jun 06 '19 23:06 jamesmontalvo3

I think i have provided the pull requests for the 3 files you mentioned. In the first two, I had to add the {% else %} part and include the else case. Let me know if this does the trick. Thank you!

revansx avatar Jun 06 '19 23:06 revansx

Deploy runs fine. I removed SAMLConfig.php in .deploy-meza and that didn't fix it, but it did change the behavior from sending me to the SSO link to generating the following error:

Bad Request Your browser sent a request that this server could not understand. Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request.

..might I also need to remove "samlLocalSettings.php"?

revansx avatar Jun 06 '19 23:06 revansx

My site works well now. Deleting the SAMLconfig.php file in .Deploy-Meza did the trick. The other issue I was having is unrelated to SAML.

revansx avatar Jun 07 '19 01:06 revansx