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

oneflow-template does not support URL with sub path for --server option #5768

Closed
7 tasks done
baby-gnu opened this issue Mar 11, 2022 · 0 comments · Fixed by OpenNebula/docs#2836 or OpenNebula/docs#2837
Closed
7 tasks done

Comments

@baby-gnu
Copy link
Contributor

baby-gnu commented Mar 11, 2022

Description

We setup OneFlow behind an nginx reverse proxy under /oneflow path but it can't be used by the oneflow* CLI commands.

To Reproduce

  1. Make OneFlow listen on 127.0.0.1 only

  2. Setup an nginx reverse proxy with

    the following configuration

    # Opennebula Sunstone
    upstream oned {
        server 127.0.0.1:2633;
    }
    
    upstream sunstone {
        server unix:/run/one/sunstone.socket;
    }
    
    upstream onegate {
        server 127.0.0.1:5030;
    }
    
    upstream oneflow {
        server 127.0.0.1:2474;
    }
    
    upstream websocketproxy {
        server 127.0.0.1:29876;
    }
    
    # Workaround https://github.com/OpenNebula/addon-context-linux/issues/218
    map $http_x_onegate_token $one_frontend {
        "~.+" "onegate";
        default "sunstone";
    }
    
    # SSL reverse-proxy
    server {
        listen 80 default_server;
    
        root /usr/lib/one/sunstone/public;
        index index.html index.htm;
    
        server_name one.example.net;
    
        access_log  /var/log/nginx/opennebula-sunstone-access.log;
        error_log  /var/log/nginx/opennebula-sunstone-error.log;
    
        client_max_body_size 50G;
        proxy_hide_header "X-Content-Type-Options";
    
        location / {
            try_files $uri @sunstone;
        }
    
        location /RPC2 {
            include proxy_params;
            proxy_pass http://oned;
        }
    
        location /onegate/ {
            include proxy_params;
            proxy_pass http://onegate/;
        }
    
        location /oneflow {
            include proxy_params;
            proxy_pass http://oneflow/;
        }
    
        location /websockify {
            include proxy_params;
            proxy_pass http://websocketproxy;
            proxy_buffering off;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_send_timeout 30m;
            proxy_read_timeout 30m;
        }
    
        location @sunstone {
            include proxy_params;
            proxy_pass_request_headers on;
            proxy_pass http://$one_frontend;
        }
    }
  3. Try to list OneFlow template

    $ oneflow-template list --server http://localhost/oneflow
    csrftoken
    

Expected behavior

The list of OneFlow templates should be returned, the --server option should set the URL path prefix but it seems that only the host part is used.

Details

  • Affected Component: CLI
  • Hypervisor: KVM
  • Version: 6.2.0-1.ce

Additional context

This problem was discovered by trying to execute the oneflow* commands from another host than the frontend.

Progress Status

  • Branch created
  • Code committed to development branch
  • Testing - QA
  • Documentation
  • Release notes - resolved issues, compatibility, known issues
  • Code committed to upstream release/hotfix branches
  • Documentation committed to upstream release/hotfix branches
km4rcus added a commit to km4rcus/docs that referenced this issue Feb 7, 2024
Signed-off-by: Marco Mancini <mmancini@opennebula.io>
km4rcus added a commit to km4rcus/docs that referenced this issue Feb 7, 2024
Signed-off-by: Marco Mancini <mmancini@opennebula.io>
km4rcus added a commit to km4rcus/docs that referenced this issue Feb 7, 2024
…he http request path

Signed-off-by: Marco Mancini <mmancini@opennebula.io>
km4rcus added a commit to km4rcus/docs that referenced this issue Feb 7, 2024
…he http request path

Signed-off-by: Marco Mancini <mmancini@opennebula.io>
@tinova tinova closed this as completed Feb 7, 2024
tinova pushed a commit to OpenNebula/docs that referenced this issue Feb 9, 2024
adding uri prefix path to the http request path 

Signed-off-by: Marco Mancini <mmancini@opennebula.io>
tinova added a commit to OpenNebula/docs that referenced this issue Feb 9, 2024
adding uri prefix path to the http request path

Signed-off-by: Marco Mancini <mmancini@opennebula.io>
Co-authored-by: Tino Vázquez <cvazquez@opennebula.io>
@tinova tinova reopened this Feb 9, 2024
@tinova tinova closed this as completed Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants