novafacile / novagallery

novaGallery - a beautiful and and ease to use php image gallery for your photos - flat file - no database required - modern responsive design
https://novagallery.org
GNU Affero General Public License v3.0
74 stars 11 forks source link

Intended use of URL field? #43

Open rsend opened 11 months ago

rsend commented 11 months ago

Hi, I just installed this gallery on my home server. What is the intended use for the URL field, if, for example, I want to test this on the LAN only?

Thanks R

david-novafacile commented 11 months ago

Hi,

it depends on your network and server configuration. You should use the local Domain or IP (with http:// or https://) of you homeserver an the path and/or the port where novaGallery is running. Use in the config just the url, where you reach novagallery.

Some examples:

rsend commented 11 months ago

Ok, got it. That part seems to work - but now I get this error:

`Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /jffs/www/nova-base/core/Site.php on line 23

Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /jffs/www/nova-base/core/Router.php on line 47

Fatal error: Uncaught Error: Undefined constant "GLOB_BRACE" in /jffs/www/nova-base/lib/novaGallery.php:53 Stack trace: #0 /jffs/www/nova-base/lib/novaGallery.php(28): novaGallery->getImages('/jffs/www/galle...') #1 /jffs/www/nova-base/app/pages/home.php(16): novaGallery->__construct('/jffs/www/galle...', true, 60) #2 /jffs/www/nova-base/app/router.php(6): require('/jffs/www/nova-...') #3 /jffs/www/nova-base/core/Router.php(108): {closure}() #4 /jffs/www/nova-base/app/router.php(42): Router::run('') #5 /jffs/www/nova-base/init.php(60): require('/jffs/www/nova-...') #6 /jffs/www/index.php(11): require_once('/jffs/www/nova-...') #7 {main} thrown in /jffs/www/nova-base/lib/novaGallery.php on line 53`

Any ideas what that is related to?

EDIT: In the php manual, I do see this: "Note: The GLOB_BRACE flag is not available on some non GNU systems, like Solaris or Alpine Linux. " I'm running on an embedded router (dd-wrt). Could that be the problem?

david-novafacile commented 11 months ago

EDIT: In the php manual, I do see this: "Note: The GLOB_BRACE flag is not available on some non GNU systems, like Solaris or Alpine Linux. " I'm running on an embedded router (dd-wrt). Could that be the problem?

This is sad, this might be the problem... It needs a fix, to check if GLOB_BRACE is available and if not, every filetype has to be searched separately... I will try that it is added soon.

rsend commented 11 months ago

I've inquired with the dd-wrt maintainers to see if it is my mistake in installing something or not, I'll update once I get an answer. But in the meantime, if it really is not available, how difficult WOULD it be to make the changes you mentioned?

david-novafacile commented 11 months ago

It should be quite simple. It's the same solution like in Open Cart project (https://github.com/opencart/opencart/pull/7614/commits/fd2e4b8ae8888fec44608e03b9f616a98f40c43b) --> first commit change with image files.

The method protected function getImages($dir) on line 52 in nova-base/lib/novaGallery.php must be extended with something like this.

rsend commented 11 months ago

Done it, that improved things.

However, something must be wrong with my setup. I now get broken thumbnails, and clicking on an item gets a 404 error.

The paths for the latter look like: [URL]//NovaGallery/galleries//cache/2000/sn853983.jpg - but that folder does not exist. If I modify the URL to remove /cache/2000, then the image loads correctly.

My server is running lighttpd, by the way. I've set the lighttpd config root folder to the /NovaGallery subdirectory, and mod_rewrite is enabled. It is possible my GD module is not working correctly, I'm investigating that separately - but that should only affect the Thumbnails, not the cache, right?

david-novafacile commented 11 months ago

It looks like missing write rights for the webserver in galleries folder.

rsend commented 11 months ago

Hmm, as far as I know write permission works fine. I tested this by deleting the "files.php" inside the cache folder, and when I touch the content of the gallery and reload, that file is regenerated with the correct list of new filenames inside (i.e write to the directory works) - except there are no thumbnails or other files in the folder.

Is there a way to check what is throwing an error? Loading the Gallery just gives a 404 (as before) - but not WHY...

david-novafacile commented 11 months ago

Okay, if files.php is created, than writing rights are correct. Which kind of 404 error ist shown? It's an error by the server or by novaGallery?

In most cases a 404 error is caused by missing mod rewrite or wrong rewrite rules.

rsend commented 11 months ago

Well, it looks like this. I'm guessing it's because that cache file doesn't exist. Also I noticed the double / after the "galleries", is that correct or do I have a typo in some config?

image