Leuchtfeuer / typo3-secure-downloads

Secure your assets and data from unwanted download. Apply TYPO3 access rights to ALL file assets (PDFs, TGZs or JPGs etc. - configurable) - protect them from direct access.
https://www.Leuchtfeuer.com
GNU General Public License v2.0
21 stars 35 forks source link

Traffic Statistic Backend Module stays empty #220

Open mrkbr opened 4 days ago

mrkbr commented 4 days ago

Problem: I have installed the ext, made the mounts, htaccess, corrected my fluid templates and the secured links work. But I also need the traffic statistics module and this module is empty. I changed TYPO3 context, caching, used other browsers, private windows, ... Where can I search for my mistakes or has someone the same problem?

Environment:

balasch commented 4 days ago

Have you also activated the log module? It is off by default. See: https://docs.typo3.org/p/leuchtfeuer/secure-downloads/main/en-us/Admin/ExtensionConfiguration/Index.html#log

mrkbr commented 4 days ago

Hi Marcus, yes I have activated the log. In the manual this tab is called "module" but in my system it is called "Logging" and the setting is accordingly called: Log Module (logging.log [boolean])

Maybe this is the problem? Is the setting in your system called module.log ? Where should this be logged in the db (table, column)?

balasch commented 4 days ago

After the log has been activated, you must update the database tables again. There should then be a table tx_securedownloads_domain_model_log in which the log data is stored. Can you see the table?

mrkbr commented 4 days ago

Yes the table is created. But it is empty.

balasch commented 4 days ago

I'm sorry. I currently have no idea what's wrong. Can you send me a configuration (the secure_downloads section from settings.php)?

mrkbr commented 4 days ago

Of course - here the part that you asked for:

'secure_downloads' => [ 'allowPublicAccess' => '1', 'cachetimeadd' => '3600', 'checkAccess' => '0', 'checkDirs' => '0', 'createFileStorage' => '1', 'documentRootPath' => '/', 'enableGroupCheck' => '0', 'excludeGroups' => '-1,0', 'forcedownload' => '1', 'forcedownloadtype' => 'odt|pptx?|docx?|xlsx?|zip|rar|tgz|tar|gz|pdf|jpg', 'groupCheckDirs' => '', 'linkPrefix' => 'securedl', 'log' => '1', 'outputFunction' => 'stream', 'protectedPath' => '', 'securedDirs' => 'fileadmin/download', 'securedFiletypes' => 'pdf|jpe?g|gif|png|odt|pptx?|docx?|xlsx?|zip|rar|tgz|tar|gz', 'skipCheckConfiguration' => '0', 'strictGroupCheck' => '0', 'tokenPrefix' => 'sdl-', ],

balasch commented 4 days ago

Then the only idea I have is that the .htaccess file in the fileadmin/download folder is not set correctly. But you say that the extension works otherwise, i.e. that the links are also encrypted accordingly, correct? The only difference to our test environment would be forcedownload, which is set to 1 here. Can you also set it to 0 as a test and see if the log then works?

mrkbr commented 4 days ago

Yes, I think the .htaccess is correct. I cannot access the links directly but the generated link is encrypted and works. I changed forcedownload to false as I also had a download tag in my link that already forced the download of the files. I now removed this tag, too. But all these changes don´t help with the problem. This is how my links look - maybe you can see something weird?

<a class="downloadlink" target="_blank" href="/securedl/sdl-eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3MzE5NDA1NjEsImV4cCI6MTczMTk3NDQwMCwidXNlciI6MCwiZ3JvdXBzIjpbMCwtMV0sImZpbGUiOiJmaWxlYWRtaW4vZWJpbHByby9kZW1vL2hpbGZlX3VuZF9zdXBwb3J0L2FubGVpdHVuZ2VuL0Fkb2JlU3RvY2tfMTc5MzM4Njg1LmpwZyIsInBhZ2UiOjQxfQ.2gbYqC240ed2uT241wBMAiopUxdL2AlaczBumnbH2ag/AdobeStock_179338685.jpg" data-modificationdate="2024_11_18" style="display: block;">
                        <img class="filetype_icon" src="/_assets/e7606f4aeaad45447e8458c8938a1501/Icons/pdf.svg" width="24" height="24" alt="">
</a>

This is the fluid part:

<a
    class="downloadlink"
    target="_blank"
    href="{file.publicUrl}"
    data-modificationdate="{file.properties.crdate -> f:format.date(format: '%Y_%m_%d')}">
    <img
        class="filetype_icon"
        src="/_assets/e7606f4aeaad45447e8458c8938a1501/Icons/pdf.svg"
        width="24"
        height="24"
        alt="" />
</a>
balasch commented 4 days ago

Unfortunately you are right, there is a bug in the logging of the downloads. Thanks for pointing it out. We will try to fix this with the next version.