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

Use redirect URL in share link if env variable set #3334

Merged

Conversation

cesnietor
Copy link
Collaborator

@cesnietor cesnietor commented May 7, 2024

needs: minio/minio#19683
fixes: #3331

Uses MINIO_BROWSER_REDIRECT_URL to generate the share URL link if it's set.

Screenshot 2024-05-06 at 5 37 40 PM
  • Includes unittests

Test Steps with Ngnix

Assuming we are exposing the console under http://localhost:8000/console/subpath/

  1. Build MinIO with this change with this branch of console
  2. Start MinIO for a given Subpath
CI=true;MINIO_BROWSER_REDIRECT_URL=http://localhost:8000/console/subpath/;MINIO_SERVER_URL=http://localhost:9000 minio --console-address ":9090"
  1. Start nginx with the following configuraiton
events { worker_connections 1024; }

http {

server {
    listen 8000;

    location /console/subpath/ {
        rewrite   ^/console/subpath/(.*) /$1 break;
        proxy_pass http://localhost:9090;
        
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        
        # This allows WebSocket connections
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
}

with the command

nginx -c /PATH/TO/nginx.conf -g "daemon off;"
  1. Go to bucket(create if needed), e.g. http://localhost:8000/console/subpath/browser/bucket1
  2. Click on a file and click Share
  3. URL generated should contain the Subpath

api/user_objects_test.go Outdated Show resolved Hide resolved
@harshavardhana harshavardhana merged commit a8c043c into minio:master May 8, 2024
33 checks passed
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

Successfully merging this pull request may close these issues.

Share URL Returns 403
4 participants