Module: Gallery Remote Protocol 2

axis23

Joined: 2006-10-02
Posts: 8
Posted: Wed, 2011-11-02 11:39

Ok, this patch works well. The other problem was, that I have various subalbums with the same name. Gallery Remote doesn't recognize this. And the internet address and directory name must be the same.

Many thanks for all

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Wed, 2011-11-02 13:22

hi axis23!

please confirm that with the patch i sent before the mentioned problems still exist.
now only the slug should be used whereever feasible, so even multiple folders with the same name should not be an issue as these should be displayed with different names now.
also now that only the slug is used everywhere, there should be no need for directory name and internet address to be equal.
but i admit that probably some more testing is needed here :)

br,
the0ne

 
axis23

Joined: 2006-10-02
Posts: 8
Posted: Wed, 2011-11-02 14:20

No. With the same album name. The hierarchy doesn't display correctly. If internet address and directory name are different then photos upload is correct, but the album names must be different, in other case upload is not correct.

Many thanks

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Wed, 2011-11-02 15:56

hi axis23!

i have just sent another fix on top of the last one.
it contains enhancements concerning utf8 encoding (actually decoding) of album and image names.
it further contains a fix for a "strage behaviour" in the gallery3 implementation of conflicting slugs in combination with verification.
please verify and let me know if any errors occur!

br,
the0ne

 
axis23

Joined: 2006-10-02
Posts: 8
Posted: Wed, 2011-11-02 19:48

No. I have the same effect. And now with utf8_decode 'ñ' Spanish character appears as '?' in a black diamond.

Regards

 
kevjay

Joined: 2011-11-26
Posts: 1
Posted: Sat, 2011-11-26 16:56

Things seem to be working OK as far as connecting to my gallery 3 with GR. However, after a picture is finished uploading, I get a "failed to validate item" error and the picture does not persist in my gallery. I have tried many different pictures and sizes, all with the same results. Here's a network capture of the full response after the picture upload:

Quote:
#__GR2PROTO__
status=403
status_text=Failed to validate item P1020611.JPG: Array
(
[mime_type] => invalid
)

debug_gallery_version=3.0.2 (Coollanta)
debug_user=admin
debug_user_type=Gallery_User
debug_user_already_logged_in=1
server_version=2.15

I don't see any issues in the logs. I have no problem uploading photos through the normal web interface.

Any ideas?

 
Panikos

Joined: 2011-11-27
Posts: 1
Posted: Sun, 2011-11-27 01:52

Hi,

I am want to utilise this module in a script I am trying to create. I have setup gallery 3.02 with this module enabled as well as the .htaccess rewrite rule.

Visiting the page http://alcmene.dyndns.info/gallery3/gallery_remote2.php gives me a reply of #__GR2PROTO__ status=104 status_text= indicating that the rewrite and module are working.

Attempting to set a login POST via a curl (password changed below) I get what seems to me to be a correct request:

bash# curl --data "g2_controller=remote:GalleryRemote&protocol_version=2.3&cmd=login&uname=admin&password=somepass" http://alcmene.info/gallery3/gallery_remote2.php
#__GR2PROTO__
status=0
status_text=Login successful.
debug_gallery_version=3.0.2 (Coollanta)
debug_user=admin
debug_user_type=Gallery_User
debug_user_already_logged_in=
server_version=2.15

However I was expecting the authtoken as part of the reply as mentioned on http://codex.gallery2.org/Gallery_Remote:Protocol#authToken

Furthermore when I try the following the result is unexpected:
bash# curl --data "g2_controller=remote:GalleryRemote&protocol_version=2.3&cmd=fetch-albums&no_perms=yes" http://alcmene.info/gallery3/gallery_remote2.php
#__GR2PROTO__
status=202
status_text=
debug_gallery_version=3.0.2 (Coollanta)
debug_user=guest
debug_user_type=Gallery_User
debug_user_already_logged_in=
server_version=2.15

Can someone explain to me where I am making a mistake?

Thanks,
Panikos

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Sun, 2011-11-27 08:03

hi kevjay!

it seems that on your server neither the php function mime_content_type nor the file /etc/mime.types do exist.
please confirm!

br,
the0ne

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Sun, 2011-11-27 08:15

hi panikos!

please note that this is a port of the gallery remote protocol only.
i think it would be better if you'd develop your script against the g1 implementation and check afterwards if your script works with this module. please don't expect any support on the gallery remote protocol in this thread.

you should possible think about using the new g3 rest interface by activating the "REST API Module" in your g3 installation when developing a new script.

br,
the0ne

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Wed, 2012-01-04 07:40

Hello theOne,

Thank you for this great module, I am using Remote on my G2 gallery very often and would not be able to live without it so I would love to be abel to do the same with G3.
Unfortunately, after updating the cookie.php and .htaccess, I still get the same error message as montlo02 :

"Gallery Remote can find no protocol implementation at the URL http://www.coquille.org/gallery3/.
Check with a web browser that http://www.coquille.org/gallery3/ is a valid Gallery URL."

And as you can see the URL is valid.

Could it be because it is the mac version ?

-------
Version: 3.0.2 (Coollanta)
Operating system: Linux 2.6.18-194.32.1.el5
Apache: Apache/2.2.3 (Red Hat)
PHP: 5.2.6
MySQL: 5.0.77
Graphics toolkit: gd
Gallery Remote 1.5.1-b46 for mac

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Wed, 2012-01-04 07:57

hi petri!

please make sure that
http://www.t-horner.com/gallery/gallery_remote2.php
and your installation
http://www.coquille.org/gallery3/gallery_remote2.php
deliver the same output message.

currently your page gallery_remote2.php seems to output a redirect to main.php which is incorrect.
for main.php your webserver already correctly returns the error 404 that is necessary to switch to the correct protocol version.

br,
the0ne

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Wed, 2012-01-04 09:08

Hi theOne,

thank you for your quick answer,

my gallery_remote2.php is

Quote:
<?
$_GET["kohana_uri"] = "/gallery_remote";
include("index.php");
?>

I m hosting gallery ( my current website : http://www.coquille.org/gallery ) and gallery3 (in custom phase) on the same level in the server. Could that be the problem ?

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Wed, 2012-01-04 10:30

hi petri!

as mentioned in my previous post:
currently your page gallery_remote2.php seems to output a redirect to main.php which is incorrect.
you need to figure out why your webserver redirects the request for gallery_remote2.php to main.php
you may find the answer in your .htaccess file.

br,
thomas

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Wed, 2012-01-04 10:49

Hi Thomas,

The problem is the only reference to main.php that I have in my .htaccess is in the code you provide on the module's page :

http://codex.gallery2.org/Gallery3:Modules:remote

Quote:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /gallery/
ErrorDocument 404 default
RewriteRule ^main.php(.*)$ / [QSA,L,R=404]
RewriteRule ^gallery_remote2.php(.*)$ index.php?kohana_uri=/gallery_remote$1 [QSA,PT,L]
</IfModule>

Appart from that, I don't have any other redirection to main.php anywhere else...

Should I change smth in this code ?

Sorry, unfortunately for me, I don't know much about coding...

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Wed, 2012-01-04 11:41

hi petri!

you should use
RewriteBase /gallery3/ instead of
RewriteBase /gallery/
in case your g3 installation is in /gallery3/ instead of /gallery/

for the redirect problem, did you ask your server administrator?

br,
the0ne

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Wed, 2012-01-04 12:15

of course.... could have guessed it myself....sorry :-), I guess that when redirected to my gallery folder, which is hosting G2, there is a redirect to main.php instead of index.php.

Now there is no more redirect... except that my gallery_remote2.php gives me a blank page :

http://www.coquille.org/gallery3/gallery_remote2.php

and Gallery Remote gives me the same error message...

 
CalgarySteve

Joined: 2012-01-11
Posts: 21
Posted: Wed, 2012-01-11 17:26

Hi,

I was very excited to stumble across this module for Gallery 3. I use Gallery Remote quite a bit (and love the auto-rotation based on EXIF information :-) ).

Gallery Remote is working fine EXCEPT for sub folders that have identical names. I notice there has been previous discussion about this and using the "slug" to differentiate.

I downloaded the ".tar.gz" from http://www.t-horner.com/g3_remote as of today.

I would be interested in testing the patch mentioned above:

Quote:
hi axis23!

i have just sent another fix on top of the last one.
it contains enhancements concerning utf8 encoding (actually decoding) of album and image names.
it further contains a fix for a "strage behaviour" in the gallery3 implementation of conflicting slugs in combination with verification.
please verify and let me know if any errors occur!

I am a programmer (though not that familiar with PHP.. C is more my area of expertise) so I can poke through things and help troubleshoot.

http://www.williamsitconsulting.com/gallery3

One thing to note (though I do not think it is relevant) is that this Gallery 3 implementation was imported from Gallery 2.

Thanks,
Steve Williams

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Thu, 2012-01-12 06:50

hi CalgarySteve!

did you try to reproduce the problem that previously existed?
in the current version the bug should no longer occur, although
i have to admit that the corresponding feedback from axis23 didn't come.

br,
the0ne

 
CalgarySteve

Joined: 2012-01-11
Posts: 21
Posted: Thu, 2012-01-12 16:35

Hi,

Yes, the problem still exists in the current codebase. I used to have a gallery2 install, so I put some debugging into gallery2 remote and gallery3 remote and compared the output that is sent to the Gallery Remote java client.

Gallery2
album.name.140=6335
album.title.140=Steve's Photos
album.summary.140=All of Steve's photos from Peru
album.parent.140=5585
album.perms.add.140=true
album.perms.write.140=true
album.perms.del_alb.140=true
album.perms.create_sub.140=true
album.info.extrafields.140=Summary,Description

Gallery 3

First entry with "Steve" in "album.name"
album.name.33=Steve
album.title.33=Steve's Photos
album.summary.33=All of Steve's photos from Peru
album.parent.33=peru-2009
album.resize_size.33=640
album.max_size.33=0
album.thumb_size.33=150
album.perms.add.33=true
album.perms.write.33=true
album.perms.del_item.33=true
album.perms.del_alb.33=true
album.perms.create_sub.33=true
album.info.extrafields.33=

Second entry that has "Steve" in the album.name

album.name.74=Steve
album.title.74=Steve's Photos
album.summary.74=
album.parent.74=selkirk-2010-1
album.resize_size.74=640
album.max_size.74=0
album.thumb_size.74=150
album.perms.add.74=true
album.perms.write.74=true
album.perms.del_item.74=true
album.perms.del_alb.74=true
album.perms.create_sub.74=true
album.info.extrafields.74=

I think that the problem for the Gallery Remote java client is that the album.name is not unique in the dataset. I did a quick hack to the gallery_remote.php:_fetch_albums_prune to use the logic followed in Gallery 2... ie: use the album/item id (which should be unique) as the album.name. This made the Gallery Remote java client display all folders properly, but none of the manipulation operations work properly because the php code is expecting the album.name to be the "slug", and not the id.

Quote:
private function _fetch_albums_prune(&$input, &$reply) {
$root = item::root();
$count = 0;

$perms = trim($input->post('no_perms'));
$use_permissions = ($perms != 'no');

$thumb_size = module::get_var('gallery', 'thumb_size');
$resize_size = module::get_var('gallery', 'resize_size');

$count++;
$reply->set('album.name.'.$count, $root->id);
$reply->set('album.title.'.$count, $root->title);
$reply->set('album.summary.'.$count, $root->description);
$reply->set('album.parent.'.$count, '0');
$reply->set('album.resize_size.'.$count, $resize_size);
$reply->set('album.max_size.'.$count, '0');
$reply->set('album.thumb_size.'.$count, $thumb_size);

if($use_permissions) {
$reply->set('album.perms.add.'.$count, access::can('add', $root) ? 'true':'false');
$reply->set('album.perms.write.'.$count, access::can('add', $root) ? 'true':'false');
$reply->set('album.perms.del_item.'.$count, access::can('edit', $root) ? 'true':'false');
$reply->set('album.perms.del_alb.'.$count, access::can('edit', $root) ? 'true':'false');
$reply->set('album.perms.create_sub.'.$count, access::can('add', $root) ? 'true':'false');
}
$reply->set('album.info.extrafields.'.$count, '');

foreach( $root->descendants(null, null, array(array("type", "=", "album"))) as $item )
{
if(!$use_permissions || access::can('view', $item))
{
$count++;

$reply->set('album.name.'.$count, $item->id);
$reply->set('album.title.'.$count, $item->title);
$reply->set('album.summary.'.$count, $item->description);
$reply->set('album.parent.'.$count, $item->parent()->id);

Obviously the logic of using the album id rather than the slug in the "album.name" would have to be implemented in all of the gallery_remote.php code. For example, in:

Quote:
private function _album_properties(&$input, &$reply) {
$album = trim($input->post('set_albumName'));
$resize_size = module::get_var('gallery', 'resize_size');

if($album=='0') $parent = item::root();
else $parent = ORM::factory("item")->where("slug", "=", $album)->find();

I am curious why the design decision was made to the "slug" in the album.name rather than the "album id" as in the code in the gallery 2

Thanks,
Steve Williams

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Thu, 2012-01-12 16:50

hi steve!

the current implementation is based on
http://codex.gallery2.org/Gallery_Remote:Protocol
and what my g1 setup sends to the client.

i think it should be pretty straightforward
to change all occurrences of slug to id.

br,
the0ne

 
CalgarySteve

Joined: 2012-01-11
Posts: 21
Posted: Thu, 2012-01-12 17:54

Hi,

It's interesting that you have a g1 setup and were working from documentation.

When I look at the Gallery 2 Remote code:

Quote:
foreach ($albums as $album) {
/* Use id because path component is not unique */
$response->setProperty('album.name.' . $i, $album->getId());

which would imply that someone back in G2 days ran into the same problem.

If I attempt the changes of "slug" to "id" and get it working, would you be interested in incorporating the changes into the codebase?

Cheers,
Steve W.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2012-01-12 18:28

I'd be interested in the changes regardless :-) !!!

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Thu, 2012-01-12 18:56

hi!

once you guys confirm the download i sent to you via pm
is working i'll update the zip file and provide it for download.

br,
the0ne

 
CalgarySteve

Joined: 2012-01-11
Posts: 21
Posted: Thu, 2012-01-12 19:30

Hi,

Thanks very much for the fast turnaround on this! The new update displays all my folders properly and allows creating a new album and uploading a photo (that's all I tested so far).

There is one very subtle difference between using the Gallery Remote Java client with G2 vs. G3.

In G2, when first opening the Gallery Remote Java client, there is a "root" folder called "Gallery" with a + sign beside it that needs to be expanded to view all the albums.

In G3, when first opening the Gallery Remote Java client, there is NO "root" folder, and all the albums are listed in the main window.

In the G2 output fed to the Gallery Remote Java client, this root folder is represented by the following entry:

album.name.61=7
album.title.61=Gallery
album.summary.61=
album.parent.61=0
album.perms.add.61=true
album.perms.write.61=true
album.perms.del_alb.61=true
album.perms.create_sub.61=true
album.info.extrafields.61=Summary,Description

I do not think this is a big deal as the full functionality of the Gallery Remote Java client is available in G3, and for that I thank you very much!

I started to do some screen snapshots comparing G2 with G3, but then realized I had no way to get them to you. If you are interested in the screen snapshots, PM me with an email address & I'll send something off to you.

Thanks very much, once again!

Cheers,
Steve W.

 
CalgarySteve

Joined: 2012-01-11
Posts: 21
Posted: Thu, 2012-01-12 19:36

Hi,

I hate to follow up on my own post, but I did find a problem with the missing "Gallery" album.

It is not possible to add a new folder (album) at the main level. Adding sub-albums to existing albums does work.

I get an error message when I create a new gallery at the main level (by selecting "Gallery Main Page" in the parent album drop down). Error: "Failed to load album with name rootalbum"

The album appears to be created, but when I try to add a photo to the album, I get an error back:
Upload error: Failed to load album with name Testing"

I think we are very close though...

Cheers,
Steve W.

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Thu, 2012-01-12 20:11

hi steve!

please test the new version sent via pm.

br,
the0ne

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2012-01-12 20:24

I'll await the later version after testing. (I deleted older from here and the copy is on my other computer at work)

 
CalgarySteve

Joined: 2012-01-11
Posts: 21
Posted: Thu, 2012-01-12 21:44

Hi,

This version works 100% from the testing I threw at it.

At Root folder,
1. create sub folder
2. add photos to sub folder
2. add photos to root folder

Create a new sub folder in existing root folder

Add photos to new sub-folder in existing root folder

Add photos to existing folder.

Looking at the final code vs. what I did for debugging, the only comment I can make is that this line:
$reply->set('album.title.'.$count, 'Gallery');
could be changed to (from my original debugging file):
$reply->set('album.title.'.$count, $item->title);

My original debugging indicated that the "root" folder had a $root->title="Gallery". This would avoid having to hard code anything, but really, not a big deal.

From my testing, I feel that this code provides 100% of the functionality that the integration with G2 provided.

THANKS VERY MUCH!

Cheers,
Steve

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Fri, 2012-01-13 01:19

Working for me as well, all same tests as above, all good results :) Nice work.

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Fri, 2012-01-13 02:10

I had the same bug as CalgarySteve, looking forward to test the new version...

thanks for the update !

:-)

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Fri, 2012-01-13 06:36

by the way, this thread is not the official one listed in the modules admin page....

the other one has a "page not found" URL :

http://gallery.menalto.com/forum_module_remote

 
CalgarySteve

Joined: 2012-01-11
Posts: 21
Posted: Fri, 2012-01-13 06:52

Hi,

One cause of the 500 error code that I encountered is that I am running Apache 1.3.29.

ErrorDocument 404 default

RewriteRule ^main.php(.*)$ / [QSA,L,R=404]

are only for Apache 2.

As long as the Gallery3 installation returns a "404" error code when the "main.php" is accessed, it should not be a problem to comment out these two lines if you are running Apache 1.x (at least, for me it works).

Cheers,
Steve

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2012-01-13 07:04
petri wrote:
by the way, this thread is not the official one listed in the modules admin page....

the other one has a "page not found" URL :

http://gallery.menalto.com/forum_module_remote

Fixed

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Fri, 2012-01-13 08:25

hi!

downloads have been updated to include the latest enhancements.
@dave: thanks for providing the fixed url.

br,
the0ne

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Fri, 2012-01-13 11:47

Hi...

thank you for updating...

I always get a problem downloading from the github : https://github.com/the0ne/gallery3-contrib/tree/remote

I don't know if it's because I am doing it with a mac, but everytime I want the zip file I get a 502 Bad Gateway error...

I was wondering if the modules I find at : http://www.gallerymodules.com/ were automatically updated from the ones in the github

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Fri, 2012-01-13 13:07

hi petri!

i think downloading from github should only be done via git.
as the most of the users don't use git i always provide the
latest and greatest software version as .tar.gz and zip at
http://www.t-horner.com/g3_remote

i have no idea what the gallerymodules.com website is for and
i had to notice that they show a donate button there.
please note that donating there will not donate for the module
but for the 'hosting cost' of the gallerymodules.com website
which doesn't even host the module e.g. in case of g1_import.
very strange website. the owner doesn't seem to be an official
gallery developer ...

anyway, please download from http://www.t-horner.com/g3_remote

br,
the0ne

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Sat, 2012-01-14 06:26

aha

ok that is why...

I have some bad news but still good news, I just upgraded my mac from Snow Leopard to Lion and Power PC app do not work on it anymore, so no more Gallery Remote :-(, I will try to use the Aperture for G3 plugin as from now on.
BUt will keep testing your GR module on my old laptop..

so I'll keep you posted...

 
CalgarySteve

Joined: 2012-01-11
Posts: 21
Posted: Sat, 2012-01-14 07:35

Hi,

Gallery Remote is a Java application. All you need is a Java installation for your "Lion" operating system and Gallery Remote should work fine. It's likely you would need to re-install the Gallery Remote software in order for it to find the "proper" Java Virtual Machine (JVM).

I did a quick google and found:
http://support.apple.com/kb/DL1421

I hope that helps you a bit!

Cheers,
Steve

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Sat, 2012-01-14 10:00

Hi Steve

thank you for the tip, the OSX app is not working anymore but the pure java is, I just tried it, created folders and sub-folders, uploaded photos and everything seems to work fine.

THANK YOU theONE !! :-)

btw : G3 for aperture plugin does not work ;-) for me at least so thank god I still have the java GR

 
Marcus_77

Joined: 2008-08-04
Posts: 15
Posted: Wed, 2012-03-07 18:23

HHello to all

I have the same Problem !

When i write in my htaccess
i get the Error 500

i have the Galery at http://www.mathe-chilled.at/gallery/

What canb i do else, to take the Gallery remote !

i have the Remote Version 1.5

Can any one help me, please

 
CalgarySteve

Joined: 2012-01-11
Posts: 21
Posted: Wed, 2012-03-07 21:07

Hi,

Are you running Apache httpd? If so, what version of Apache are you running?

Cheers,
Steve

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Wed, 2012-03-07 21:52

hi!

from your server's output i can see that you didn't change the gallery installation as required to successfully run the gallery remote plugin. the gallery remote module settings page states:

Quote:
To use GalleryRemote 1.5.1 you need to edit modules/gallery/config/cookie.php and change line
$config['httponly'] = true;
to line
$config['httponly'] = false;

please change the value accordingly.

br,
the0ne

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Sat, 2012-04-07 06:04

Hello there,

I just changed my gallery folder from "gallery3" (test version) to "gallery", changed the name of the URL in the GR prefs but I can't connect anymore, I get the :

"Gallery Remote can find no protocol implementation at the URL .... Check with a web browser that http.... is a valid Gallery URL"

gallery3 was working fine....

any idea ?

------
Gallery 3 URL = http://www.coquille.org/gallery
Version: 3.0.2 (Coollanta)
Operating system: Linux 2.6.18-194.32.1.el5
Apache: Apache/2.2.3 (Red Hat)
PHP: 5.2.6
MySQL: 5.0.77
Server load: 1.31 1.58 1.53
Graphics toolkit: gd
-------

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Sat, 2012-04-07 09:40

hi!

please make sure that all entries in .htaccess are changed from
RewriteBase /gallery3/
to
RewriteBase /gallery/

br,
the0ne

 
petri
petri's picture

Joined: 2005-12-15
Posts: 253
Posted: Thu, 2012-04-12 13:23

very strange, the url_rewrite code was not even activated and it was working before I changed the name...

Now even if I activate the code :

Quote:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /gallery
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
RewriteRule ^index.php/(.*) $1 [QSA,R,L]
</IfModule>

it does not work, but I could not find any URL rewrite module to install for G3, so maybe this is the reason why but where is that URL rewrite module ?
appart from this I don't have any other gallery3 or even gallery mentioned.

UPDATE :

the code listed above is not the one you have in Remote's admin, I made it wrong.... the right code is :

Quote:
<IfModule mod_rewrite.c>
     Options +FollowSymLinks
     RewriteEngine On
     RewriteBase /gallery/
     ErrorDocument 404 default
     RewriteRule ^main.php(.*)$ / [QSA,L,R=404]
     RewriteRule ^gallery_remote2.php(.*)$ index.php?kohana_uri=/gallery_remote$1 [QSA,PT,L]
</IfModule>

sorry.... :-)

now it works fine !

------
Gallery 3 URL = http://www.coquille.org/gallery
Version: 3.0.2 (Coollanta)
Operating system: Linux 2.6.18-194.32.1.el5
Apache: Apache/2.2.3 (Red Hat)
PHP: 5.2.6
MySQL: 5.0.77
Server load: 1.31 1.58 1.53
Graphics toolkit: gd
-------

 
flxfxp

Joined: 2012-05-19
Posts: 8
Posted: Fri, 2012-06-29 10:05

Has anyone got this working with nginx? My Gallery3 is installed at root (http://example.com) and I use the following:

if (!-e $request_filename) {
        # /index.php/rest -> /rest/
        rewrite ^/index.php/rest/(.*)$ /rest/$1;
        # gallery remote compatibility
        rewrite ^/main.php(.*)$ /;
        rewrite ^/gallery_remote2.php(.*)$ /index.php?kohana_uri=/gallery_remote$1;
        # main rewrite for kohana framework
        rewrite ^/(.+)$ /index.php?kohana_uri=$1 last;
}

The http://www.example.com/gallery_remote2.php shows up as a white page and http://www.example.com/main.php shows the gallery album index. Gallery Remote complains about "Server contacted, but Gallery not found at this URL (http://www.example.com/main.php).

Any idea?

Thanks!
Dennis

edit: also no errors in any of the logs.

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Fri, 2012-06-29 10:22

hi flxfxp!

please note that a call to /main.php should return an error 404.
in case it's not possible with nginx to return an error 404 using a webserver rule i propose to create a file named main.php with the following content:
<?php header("HTTP/1.0 404 Not Found"); ?>
in this case you should also remove the rule "rewrite ^/main.php(.*)$ /;" from your nginx configuration.

br,
the0ne

 
lightxx

Joined: 2010-12-02
Posts: 28
Posted: Wed, 2012-07-25 08:38

thank you very much for this module!

i installed and configured everything as per the manual.
connecting and browsing my gallery3 works flawlessly.

however, when i try to upload a picture i get a 403 status.

however, there's no 403 error in the apache logs. weird.

i'm using the latest versions of the module (from git) and the latest version of gallery remote (1.5.1-b46)

-- gallery remote log

17832|INFO |GalComm2 |Preparing to upload...
17832|TRACE|GalComm2 |add-item parameters: [HTTPClient.NVPair[name=cmd,value=add-item], HTTPClient.NVPair[name=protocol_version,value=2.3], HTTPClient.NVPair[name=set_albumName,value=5379], HTTPClient.NVPair[name=caption,value=test.jpg], HTTPClient.NVPair[name=force_filename,value=test.jpg], null]
17837|TRACE|GalComm2 |Connecting to: http://gallery.t-h.cc/gallery_remote2.php
17837|TRACE|GalComm2 |Path: /gallery_remote2.php
17837|TRACE|GalComm2 |Extra headers: [HTTPClient.NVPair[name=Connection,value=close], HTTPClient.NVPair[name=User-Agent,value=Gallery Remote 1.5.1-b46]]
17838|TRACE|GalComm |Sending cookie: g3sid=fc39572be5edd43a25b66c259288ed7af04c7fe0%7E1i24p5g3s4d0vibgs2hh8k92t5; expires=Wed Aug 01 10:09:39 CEST 2012; path=/; domain=.gallery.t-h.cc
17838|TRACE| |gallery.t-h.cc - XXX - true - true
17839|TRACE|StatusBar |level: 0 - 1 pictures / 762 K - 0
18032|TRACE|GalComm |Accepting cookie: g3sid=1i24p5g3s4d0vibgs2hh8k92t5; expires=Wed Aug 01 10:09:54 CEST 2012; path=/; domain=.gallery.t-h.cc
18032|TRACE|GalComm |Accepting cookie: g3sid=fc39572be5edd43a25b66c259288ed7af04c7fe0%7E1i24p5g3s4d0vibgs2hh8k92t5; expires=Wed Aug 01 10:09:54 CEST 2012; path=/; domain=.gallery.t-h.cc
18032|TRACE|GalComm2 |Content-type: text/html; charset=UTF-8
18032|TRACE|GalComm2 |#__GR2PROTO__
status=403
status_text=Failed to add item test.jpg.
debug_gallery_version=3.0.4 (Ricochet)
debug_user=XXX
debug_user_type=Gallery_User
debug_user_already_logged_in=1
server_version=2.15
18033|INFO |GalComm2 |Upload error: Failed to add item test.jpg.
18049|TRACE| |gallery.t-h.cc - XXX - true - true
18050|TRACE|StatusBar |level: 0 - 1 pictures / 762 K - 0

 
the0ne
the0ne's picture

Joined: 2011-05-02
Posts: 83
Posted: Thu, 2012-07-26 06:13

hi lightxx!

some days ago i have by chance set up a new gallery for a friend of mine and i noticed the same.
i have already created a fix for the problem two days ago but i want to do some additional testing.
i hope i find the time soon so i can afterwards release the update.

br,
the0ne

 
lightxx

Joined: 2010-12-02
Posts: 28
Posted: Fri, 2012-07-27 07:46

thanks for your feedback.

glad to know it's not my gallery install.