Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

public_url prefixed with http://bin/ #205

Open
kitzberger opened this issue Feb 24, 2023 · 4 comments
Open

public_url prefixed with http://bin/ #205

kitzberger opened this issue Feb 24, 2023 · 4 comments

Comments

@kitzberger
Copy link

Hey guys,

we're using this extension in combination with solrfal and we're getting wrong filePublicUrl and url when indexing access protected file storages.

screenshot-intranet hs-osnabrueck de vm_18983-2023 02 24-11_36_38

This is a similar issue as #40, I guess. But we're on different versions and there's no EXT:realurl in the mix anymore.

  • TYPO3 10.4
  • fal_securedownload 3.0.2
  • solr 11.2.1
  • solrfal 10.0.0
  • solrconsole 10.0.0

We've set up the file index queue as described in the manual: Misc/Index.rst#extsolrfal-support

I adjusted the patch here (#40 (comment)) to the post-domain-records world and found out that the only thing we need before creating the public URL is flushing the internal runtime cache:

         $this->publicUrlAspect->setEnabled(false);
+        GeneralUtility::flushInternalRuntimeCaches();
         $metadata['public_url'] = $item->getFile()->getPublicUrl();
         $this->publicUrlAspect->setEnabled(true);

Not exactly sure whether it's a EXT:fal_securedownloads or a EXT:solrfal issue but I thought I'd start the conversation here ;-)

As a workaround I've tweaked the indexing config by simply replacing the bad part of the URL:

plugin.tx_solr.index.queue._FILES.default {
            url = TEXT
            url.field = public_url
            url.replacement.10.search = http://bin/
            url.replacement.10.replace = /
}
@baschny
Copy link

baschny commented May 12, 2023

Workaround v2, because on another server the url was being prefixed with http://var/www/htdocs/:

plugin.tx_solr.index.queue._FILES.default {
            url = TEXT
            url.field = public_url
            url.replacement.10 {
                useRegExp = 1
                search = #http://.*/index\.php#
                replace = /index.php
            }
}

@BenjaminBeck
Copy link

I had a similar issue with a Cronjob.
The domain appears in the url if you set the env var HTTP_HOST = yourdomain.com before calling the TYPO3 scheduler.
But for the wrong path my solution looks similar ..

@sgrossberndt
Copy link
Contributor

I also stumbled upon this issue, as a reference here a link to the TYPO3 core issue I created.

@FamousWolf
Copy link
Contributor

This seems to be a core bug indeed. I also made a bug report for what seems to be the same issue a few months ago: https://forge.typo3.org/issues/100361

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants