Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background --> Random Images --> (Local) Photo Library #259

Open
K-J-VV opened this issue Feb 10, 2024 · 11 comments
Open

Background --> Random Images --> (Local) Photo Library #259

K-J-VV opened this issue Feb 10, 2024 · 11 comments

Comments

@K-J-VV
Copy link

K-J-VV commented Feb 10, 2024

Would it be possible to have include a radio button in the random images options that connects to a local photo library?

The idea is to drop our own images into a folder (e.g., /data/backgrounds ) so that we can set Hubley's to alternate backgrounds to a personal/local photo library

@knrdl
Copy link
Owner

knrdl commented Feb 25, 2024

The edge tag image should now create a wallpaper folder on startup where you can drop your photos.
Then go to settings → background → random images → wallpaper collection & save.

@knrdl knrdl closed this as completed Mar 24, 2024
@K-J-VV
Copy link
Author

K-J-VV commented May 4, 2024

wallpaper collection

@knrdl Haven't been able to test this request (rebuilt server..), but I don't see the 'wallpaper collection' option? I've tried both edge & the 0.3.2 release

@knrdl knrdl reopened this May 5, 2024
@knrdl
Copy link
Owner

knrdl commented May 5, 2024

I ve updated the readme. You have to create the wallpaper folder yourself. The option will appear if there are images in the folder.

@K-J-VV
Copy link
Author

K-J-VV commented May 5, 2024

Hmm, seem to have some kind of forwarding problem on my end? The Wallpapers option is there now, but the pages aren't displaying.

When I choose to 'Download the image, I am taken to: https://hubleys.example.com/background/wallpaper/image1.jpg

But the error on the webpage is:

{
    "message": "forward auth not configured"
}

@knrdl
Copy link
Owner

knrdl commented May 18, 2024

it works for me, please check your setup

@K-J-VV
Copy link
Author

K-J-VV commented May 19, 2024

Hmm, I can't seem to figure it out. But definitely possible it is just an issue with my own setup. It seems like for some reason the reverse proxy/auth is not working beyond the secondary directory (i.e., /background/wallpaper/*) considering everything up to the secondary directory is working fine (e.g. /settings/background)

@knrdl
Copy link
Owner

knrdl commented May 20, 2024

If you send me your reverse proxy config, I'll have a look

@K-J-VV
Copy link
Author

K-J-VV commented May 21, 2024

I'd really appreciate it!

I'm using NPM (NGINX Proxy Manager) and OAuth2. The following is in the 'Advanced' section of the proxy's config:

real_ip_header X-Forwarded-For;
### OAuth Snippet Start ----------------------------------------------------
  location /oauth2/ {
    proxy_pass       http://10.10.10.10:1008;
    proxy_set_header Host                    $host;
    proxy_set_header X-Real-IP               $remote_addr;
    proxy_set_header X-Scheme                $scheme;
    proxy_set_header X-Auth-Request-Redirect $request_uri;
  }

  location = /oauth2/auth {
    proxy_pass       http://10.10.10.10:1008;
    proxy_set_header Host             $host;
    proxy_set_header X-Real-IP        $remote_addr;
    proxy_set_header X-Scheme         $scheme;
    ### nginx auth_request includes headers but not body
    proxy_set_header Content-Length   "";
    proxy_pass_request_body           off;
 }
 
  location / {
    auth_request /oauth2/auth;
    error_page 401 = /oauth2/sign_in;
    ### pass information via X-User and X-Email headers to backend,
    ### requires running with --set-xauthrequest flag
    #auth_request_set $user   $upstream_http_x_auth_request_user;
    #auth_request_set $email  $upstream_http_x_auth_request_email;
    #proxy_set_header X-User  $user;
    #proxy_set_header X-Email $email;
    auth_request_set $user $upstream_http_x_auth_request_email;
    auth_request_set $name $upstream_http_x_auth_request_preferred_username;
    auth_request_set $email  $upstream_http_x_auth_request_preferred_username;
    auth_request_set $groups $upstream_http_x_auth_request_groups;
    proxy_set_header REMOTE-USER $user;
    proxy_set_header REMOTE-NAME $name;
    proxy_set_header REMOTE-EMAIL $email;
    proxy_set_header REMOTE-GROUPS $groups;

    ### if you enabled --cookie-refresh, this is needed for it to work with auth_request
    auth_request_set $auth_cookie $upstream_http_set_cookie;
    add_header Set-Cookie $auth_cookie;

   ### Proxy!
    include conf.d/include/proxy.conf;
  }
  ### Oauth Snippet End ----------------------------------------------------------

@knrdl
Copy link
Owner

knrdl commented May 21, 2024

Nothing remarkable to see ... What's about the conf.d/include/proxy.conf?

@K-J-VV
Copy link
Author

K-J-VV commented May 22, 2024

add_header       X-Served-By $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto  $scheme;
proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP          $remote_addr;
proxy_pass       $forward_scheme://$server:$port$request_uri;

@knrdl
Copy link
Owner

knrdl commented Jun 2, 2024

I've tested this with dummy values and it works as expected for me:

        proxy_set_header REMOTE-USER "johndoe";
        proxy_set_header REMOTE-NAME "John Doe";
        proxy_set_header REMOTE-EMAIL "email";
        proxy_set_header REMOTE-GROUPS "groups";

So I guess it's a problem with your OAuth2 provider config?

For debugging purpose, you can also add the REMOTE-* headers to the final response and check their values in the browser (developer tools → network requests):

        add_header REMOTE-USER $user;
        add_header REMOTE-NAME $name;
        add_header REMOTE-EMAIL $email;
        add_header REMOTE-GROUPS $groups;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants