[GH-ISSUE #559] Usage with Fritz Fon #808

Closed
opened 2026-03-15 15:34:25 +03:00 by kerem · 5 comments
Owner

Originally created by @hbarthel on GitHub (Dec 21, 2024).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/559

Originally assigned to: @sadok-f on GitHub.

I today found and tried flyimg to extract a part of the image of my surveillance camera. I want to use it as preview image on my AVM FritzFon C6 (FritzFons are very popular in Germany) when somebody rings the door bell. Does anybody use flyimg with a FritzFon as Live Image and/or knows what could be the reason why the phone always shows only "Das Bild ist nicht mehr verfügbar" (German, in English something like "The image is not yet available anymore"). I think it's maybe because the URL does not have the ending .jpg or maybe it's caused by the size of the image.

edit: it seems to be caused by the URL length. Is there a chance to reduce the length without running a proxy? I can imagine to configure a parameter set (with origin URL, settings for extraction, ...) that can be accessed with a short url...

Cheers, Heiko

Originally created by @hbarthel on GitHub (Dec 21, 2024). Original GitHub issue: https://github.com/flyimg/flyimg/issues/559 Originally assigned to: @sadok-f on GitHub. I today found and tried flyimg to extract a part of the image of my surveillance camera. I want to use it as preview image on my AVM FritzFon C6 (FritzFons are very popular in Germany) when somebody rings the door bell. Does anybody use flyimg with a FritzFon as Live Image and/or knows what could be the reason why the phone always shows only "Das Bild ist nicht mehr verfügbar" (German, in English something like "The image is not yet available anymore"). I think it's maybe because the URL does not have the ending .jpg or maybe it's caused by the size of the image. edit: it seems to be caused by the URL length. Is there a chance to reduce the length without running a proxy? I can imagine to configure a parameter set (with origin URL, settings for extraction, ...) that can be accessed with a short url... Cheers, Heiko
kerem 2026-03-15 15:34:25 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@Shivox commented on GitHub (Dec 22, 2024):

Hello @hbarthel, I have a couple of questions to clarify the issue, so you're running everything locally? the origin URL of the video surveillance camera is local as well?

Also, can you please post the final URL you're using as your FritzFon's Live Image? (ofc you can anonymize the domain name(s)/hostname(s) if you think that's sensitive, just make sure to keep the length the same)

<!-- gh-comment-id:2558452988 --> @Shivox commented on GitHub (Dec 22, 2024): Hello @hbarthel, I have a couple of questions to clarify the issue, so you're running everything locally? the origin URL of the video surveillance camera is local as well? Also, can you please post the final URL you're using as your FritzFon's Live Image? (ofc you can anonymize the domain name(s)/hostname(s) if you think that's sensitive, just make sure to keep the length the same)
Author
Owner

@hbarthel commented on GitHub (Dec 22, 2024):

Hi @Shivox,

yes everything is local, I do not expose my home to the internet :) I would like to have a short URL for the FritzFon like "http://192.168.130.56:8555/door". Behind port 8555 is flyimg, that should internally rewrite it to something like "http://192.168.130.56:8555/upload/e_100,p1x_1200,p1y_150,p2x_1920,rf_1,p2y_1110/http%3A%2F%2Fcam.local%2Fcgi-bin%2Fapi.cgi%3Fcmd%3DSnap%26user%3Dblubb"

I already tried with my little knowledge of nginx to configure a rewrite rule for "/door" like so in file "/etc/nginx/conf.d/flyimage.conf":

server {
    listen  80;
    root  /var/www/html/web;

    location / {
        # try to serve file directly, fallback to index.php
        try_files $uri /index.php$is_args$args;
    }

    location /door {
        rewrite /door /index.php/upload/e_100,p1x_1200,p1y_150,p3x_1920,rf_1,p2y_1110/http%3A%2F%2Fcam.local%2Fcgi-bin%2Fapi.cgi%3Fcmd%3DSnap%26user%3Dblubb;
    }

    location ~ ^/index.php(/|$) {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        proxy_read_timeout 300;
    }
}

Maybe you have an idea, is my location on the wrong position? I get the following error:
flyimg | [2024-12-22T20:32:13.096263+00:00] flyimg.ERROR: {"error":"No route found for \"GET http://192.168.130.56:8555/door\"","file":"/var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php:149","uri":"http://192.168.130.56:8555/door","user_agent":"Mozilla/5.0 (Windows NT 10.0; rv:130.0) Gecko/20100101 Firefox/130.0","http_client_ip":null} []

So long, Heiko

<!-- gh-comment-id:2558595880 --> @hbarthel commented on GitHub (Dec 22, 2024): Hi @Shivox, yes everything is local, I do not expose my home to the internet :) I would like to have a short URL for the FritzFon like "http://192.168.130.56:8555/door". Behind port 8555 is flyimg, that should internally rewrite it to something like "http://192.168.130.56:8555/upload/e_100,p1x_1200,p1y_150,p2x_1920,rf_1,p2y_1110/http%3A%2F%2Fcam.local%2Fcgi-bin%2Fapi.cgi%3Fcmd%3DSnap%26user%3Dblubb" I already tried with my little knowledge of nginx to configure a rewrite rule for "/door" like so in file "/etc/nginx/conf.d/flyimage.conf": ``` server { listen 80; root /var/www/html/web; location / { # try to serve file directly, fallback to index.php try_files $uri /index.php$is_args$args; } location /door { rewrite /door /index.php/upload/e_100,p1x_1200,p1y_150,p3x_1920,rf_1,p2y_1110/http%3A%2F%2Fcam.local%2Fcgi-bin%2Fapi.cgi%3Fcmd%3DSnap%26user%3Dblubb; } location ~ ^/index.php(/|$) { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; proxy_read_timeout 300; } } ``` Maybe you have an idea, is my location on the wrong position? I get the following error: `flyimg | [2024-12-22T20:32:13.096263+00:00] flyimg.ERROR: {"error":"No route found for \"GET http://192.168.130.56:8555/door\"","file":"/var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php:149","uri":"http://192.168.130.56:8555/door","user_agent":"Mozilla/5.0 (Windows NT 10.0; rv:130.0) Gecko/20100101 Firefox/130.0","http_client_ip":null} []` So long, Heiko
Author
Owner

@Shivox commented on GitHub (Dec 22, 2024):

My intuition is telling me that the issue might be that Nginx configuration changes aren't being applied unless Nginx is restarted.

Are you changing the configuration from within the container, by any chance?

If so, the best option might be to override the Nginx config file when starting the container. Here's how you can do that (make sure to run this command from a directory containing your local copy of the Nginx config file, named flyimage.conf):

docker run -itd -p 8555:80 -v $(pwd)/flyimage.conf:/etc/nginx/conf.d/flyimage.conf

<!-- gh-comment-id:2558636573 --> @Shivox commented on GitHub (Dec 22, 2024): My intuition is telling me that the issue might be that Nginx configuration changes aren't being applied unless Nginx is restarted. Are you changing the configuration from within the container, by any chance? If so, the best option might be to override the Nginx config file when starting the container. Here's how you can do that (make sure to run this command from a directory containing your local copy of the Nginx config file, named `flyimage.conf`): `docker run -itd -p 8555:80 -v $(pwd)/flyimage.conf:/etc/nginx/conf.d/flyimage.conf`
Author
Owner

@hbarthel commented on GitHub (Dec 23, 2024):

I checked it: the config is reloaded when I restart the docker container.
A friend of mine found the solution and I want to share it with you. The idea is to set the fastcgi parameter "REQUEST_URI":

server {
    listen  80;
    root  /var/www/html/web;

    set $request_url $request_uri;
    if ($request_uri ~ ^/door) {
        set $request_url /upload/rf_1,e_1,p1x_1200,p1y_150,p2x_1920,p2y_870/http://cam.local/cgi-bin/api.cgi%3Fcmd%3DSnap%26user%3Dblubb;
    }

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location ~ ^/index.php(/|$) {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;

        fastcgi_param REQUEST_URI $request_url;

        fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
        proxy_read_timeout 300;
    }
}

Now it works like a charm. I just have to make this change permanent.

<!-- gh-comment-id:2559360334 --> @hbarthel commented on GitHub (Dec 23, 2024): I checked it: the config is reloaded when I restart the docker container. A friend of mine found the solution and I want to share it with you. The idea is to set the fastcgi parameter "REQUEST_URI": ``` server { listen 80; root /var/www/html/web; set $request_url $request_uri; if ($request_uri ~ ^/door) { set $request_url /upload/rf_1,e_1,p1x_1200,p1y_150,p2x_1920,p2y_870/http://cam.local/cgi-bin/api.cgi%3Fcmd%3DSnap%26user%3Dblubb; } location / { try_files $uri /index.php$is_args$args; } location ~ ^/index.php(/|$) { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param REQUEST_URI $request_url; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param DOCUMENT_ROOT $realpath_root; proxy_read_timeout 300; } } ``` Now it works like a charm. I just have to make this change permanent.
Author
Owner

@sadok-f commented on GitHub (Dec 26, 2024):

Thank you @hbarthel for opening this issue.
It is great that you made it work for your setup.

<!-- gh-comment-id:2562592323 --> @sadok-f commented on GitHub (Dec 26, 2024): Thank you @hbarthel for opening this issue. It is great that you made it work for your setup.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flyimg#808
No description provided.