EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #10059


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Links dynamically generated lose the "/cgi" part


CAUTION: This e-mail originated outside the University of Southampton.

Hello again,

After asking last week and failing to isolate the cause for my repository to
have a broken handling for http→https, I ended up reverting my configuration to
what I had on backup — my repository is now serving part of the links via http,
part via https, and I cannot seem to understand how to fix it.

But, sigh, lets continue — At least I can work with the repository! However...

When connecting via http, things work mostly fine. Only that, browsers (and
aggregators) nowadays shun insecure http connections.

And when I connect via https, links non-statically generated miss the "/cgi"
component (that is, i.e. when I click on "New element" from "My deposits" or on
any of the icons to work with a specific existing item, the browser opens
/users/home instead of /cgi/users/home). Of course, this gives me an ugly 404
error.

Following the advice given by John Salter, I queried the running configuration,
and found that:

    $ perl -I/usr/share/eprints3/perl_lib/ -e 'use EPrints; use Data::Dumper; $Data::Dumper::Maxdepth=2; $s = new EPrints::Session(1, "iiec", 0); print Dumper($s->{config});' | egrep https?_cgiurl
                 'http_cgiurl' => bless( do{\(my $o = 'https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fru.iiec.unam.mx%2Fcgi&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C34de740fe1a844797edb08dd6a95e699%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638783914239558503%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=rIp%2BdlV1oUedDN5IF7xrTTNDa0AyulS9SRMozM7KcMU%3D&reserved=0')}, 'URI::http' ),
                 'https_cgiurl' => bless( do{\(my $o = 'https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fru.iiec.unam.mx%2F&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C34de740fe1a844797edb08dd6a95e699%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638783914239577881%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=BlIBOWwwvECFv%2BH%2FofreOcJkAYf9zlm3hobdAizeJpQ%3D&reserved=0')}, 'URI::http' ),

Which is exactly what I would expect to yield this behavior (although I don't
understand _why_ it does).

I tried adding the following to archives/iiec/cfg/cfg.d/20_baeurls.pl:

    $c->{https_cgiurl} = URI::https->new( "https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C34de740fe1a844797edb08dd6a95e699%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638783914239591142%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=U5AvmodF%2F1YPgvhrQCBeePH7hviqePGZlSHNlNASvvc%3D&reserved=0";);

Now, the values obtained from dumping $s->{config} are correct:

    $ perl -I/usr/share/eprints3/perl_lib/ -e 'use EPrints; use Data::Dumper; $Data::Dumper::Maxdepth=2; $s = new EPrints::Session(1, "iiec", 0); print Dumper($s->{config});' | egrep https?_cgiurl
                 'https_cgiurl' => bless( do{\(my $o = 'https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fru.iiec.unam.mx%2Fcgi&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C34de740fe1a844797edb08dd6a95e699%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638783914239603450%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=1sHnXoEV9QCUY4kp%2BQldoxqBdtBl8huBJk4HegU3ToA%3D&reserved=0')}, 'URI::https' ),
                 'http_cgiurl' => bless( do{\(my $o = 'https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fru.iiec.unam.mx%2Fcgi&data=05%7C02%7Ceprints-tech%40ecs.soton.ac.uk%7C34de740fe1a844797edb08dd6a95e699%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638783914239615488%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=zeSf0ZzQ83A9bkfu9v1n8ZdkTATsc4MvJ%2FrhxDBhMWg%3D&reserved=0')}, 'URI::http' ),

... But, even after restarting Apache,the links are still missing /cgi

What am I missing here?

Thanks again!

  – Gunnar.