solved Data / Log Folder

jimmyk
jimmyk
@jimmy
8 years ago
514 posts
I was trying to figure out how to trigger JR to create something in the data/logs folder. I'm testing out a Nginx location block and the folder is empty.

Is there something I can do to trigger the creation of a file in this folder?

Thanks!
updated by @jimmy: 09/11/16 01:26:04AM
brian
@brian
8 years ago
10,148 posts
This is for the PHP Error and Debug Log files. you can add an fdebug() call into PHP code - i.e.
fdebug('log this');
and it will show in the data/logs/debug_log file.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
Thanks!
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
Brian,

I should allow access to data/media/0/0/ right? See the sprites in there, if I prohibit direct access the folder icon images don't show up in the profile.

I'm restricting access to all other folders in data/media/. It seem to work because I can't see image via direct link to 1/1/some_image_I_uploaded_to_a_blog but can see them in the JR blog post I created.
updated by @jimmy: 05/24/16 05:36:19PM
michael
@michael
8 years ago
7,715 posts
even if access is restricted to the user directly viewing the files via a web browser, as long as the server can access those locations to deliver the file then it should be right.

Like the image functionm your image is not stored at:
https://www.jamroom.net/user/image/user_image/78/icon/crop=portrait/_v=1443910743

That url runs the 'user_image' function that goes and gets your image from wherever its stored and delivers it if appropriate.

Accessing the files directly takes away the ability to over-ride it by a module.
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
michael:
even if access is restricted to the user directly viewing the files via a web browser, as long as the server can access those locations to deliver the file then it should be right.
Like the image functionm your image is not stored at:https://www.jamroom.net/user/image/user_image/78/icon/crop=portrait/_v=1443910743
That url runs the 'user_image' function that goes and gets your image from wherever its stored and delivers it if appropriate.
Accessing the files directly takes away the ability to over-ride it by a module.

Right now the way I have the config file setup, the format of the image link you posted above shows up, but the direct link doesn't work.

I'm assuming that the "Vault" folder in the data/media is for selling items? It had a .htaccess file it in so I setup a location block for that folder too.

I think I have the Centmin Mod Nginx config all finished up.

https://gist.github.com/zeronug/d6511c0e7e451b8b925b
updated by @jimmy: 05/25/16 04:12:10AM
brian
@brian
8 years ago
10,148 posts
jimmyk:
I should allow access to data/media/0/0/ right? See the sprites in there, if I prohibit direct access the folder icon images don't show up in the profile.
Correct - the data/media/0/0 directory is a "special" directory that contains items that need to be web accessible.
Quote:
I'm restricting access to all other folders in data/media/. It seem to work because I can't see image via direct link to 1/1/some_image_I_uploaded_to_a_blog but can see them in the JR blog post I created.
Correct - you want to restrict access to the other media directories.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
@brian I found a couple more .htaccess files in the jrCore/root/data/ sub-folder(s). Most are just denies which are easy adds to the conf file. But in the jrCore/root/data/media file there is an .htaccess file which contents includes:

# This file protects your media files - leave in place
RewriteEngine On
RewriteRule !0/0 - [F,L]


Are folders going to be created in this folder like the root /data/media/ folder? Should I block or allow the 0/0/ folder?

Right now I set it up to block the folder 0/0 but since I haven't populated my dev site, I'm not sure exactly what is going to be created in the folder.

I can block the folder for everyone but the system:

location ~* ^/modules/jrCore/root/data/media/0/0/ {
        allow 127.0.0.1;
        deny all;
        try_files $uri $uri/ @rewrite;
}

or allow everyone into that folder and block everything else in the media folder:

location ~* ^/modules/jrCore/root/data/media/0/0/ {
        allow all;
}
location ~* ^/modules/jrCore/root/data/media/ {
        allow 127.0.0.1;
        deny all;
        try_files $uri $uri/ @rewrite;
}
brian
@brian
8 years ago
10,148 posts
The second one - you want 0/0 to be accessible.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
@brian Thanks! :)
updated by @jimmy: 06/12/16 08:33:32AM
brian
@brian
8 years ago
10,148 posts
jimmyk:

@brian Thanks!

No problem! :)


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags