Giter Site home page Giter Site logo

Comments (13)

dausruddin avatar dausruddin commented on May 30, 2024

I solved the file not found error.
I looked into nginx log and found that nginx does not have permission to acess the file. The error is like below:

2015/05/02 18:48:42 [error] 5175#0: *49 open() "/root/openseedbox/complete//d9be6909325d28912f400fcb324005dd5861e49f/crunchbang-11-20130506-amd64.iso" failed (13: Permission denied), client: 192.xxx.xxx.xxx, server: be1.domain.com, request: "GET /download/d9be6909325d28912f400fcb324005dd5861e49f?name=crunchbang-11-20130506-amd64.iso HTTP/1.1", upstream: "http://127.0.0.1:9001/download/d9be6909325d28912f400fcb324005dd5861e49f?name=crunchbang-11-20130506-amd64.iso", host: "be1.domain.com", referrer: "http://seedbox.domain.com/client?group=Ungrouped"

The solution is to add user root into nginx config. It turns that if that line does not exist, nginx worker process will run as nobody

from openseedbox.

dausruddin avatar dausruddin commented on May 30, 2024

I still can't solve the zip issue. It returns text like this on the webpage.

C84790F5 774897664 %2Fprotected%2Fd9be6909325d28912f400fcb324005dd5861e49f%2F%2Fcrunchbang-11-20130506-amd64.iso /crunchbang-11-20130506-amd64.iso

EDIT: I discovered that it displayed the text from _ngx_manifest.txt

from openseedbox.

erindru avatar erindru commented on May 30, 2024

@psycholyzern running nginx as root is not recommended for security purposes, although it will work. The more secure way is to give the user "nobody" access to your openseedbox complete folder, or run nginx as your normal user.

The way zip downloads work is, openseedbox-server sends an X-Archive-Files header along with the manifest, which nginx sees and triggers mod_zip

If its not working, whats the output of 2>&1 nginx -V | tr -- - '\n' | grep _zip ?

Also, whats the value of backend.download.ngxzip in your openseedbox-server config file?

from openseedbox.

dausruddin avatar dausruddin commented on May 30, 2024

oh.. So what I need to do is giver permission to nobody so it can access the folder.. I will configure it later.

The command give me this

module=/src/mod_zip/

I dont feel right with this but I dont know what should I put. So I leave it with default value.

backend.download.ngxzip.path=/protected

I saw a block in nginx in the sample, location /protected
So I think leave the default value is ok.

from openseedbox.

dausruddin avatar dausruddin commented on May 30, 2024

@erindru does X-Archive-Files will be sent through browser?
Because I looked at my http header in firefox, there is no X-Archive-Files header.

I want to try apache, but I fear that apache will give me worst problem because there is no guide on setup it with openseedbox.

from openseedbox.

erindru avatar erindru commented on May 30, 2024

Nope, headers_more removes it before it gets to the browser

If you remove the "more_clear_headers" part of nginx.conf, it should make
its way through to the browser

from openseedbox.

dausruddin avatar dausruddin commented on May 30, 2024

I don't know what is wrong. It just print the text in the manifest.
There is no log I can refer to. Nginx error log print nothing.

from openseedbox.

dausruddin avatar dausruddin commented on May 30, 2024

I setup another backend. Only download are working. Zip is not working T_T
I dont know what is the problem

from openseedbox.

dausruddin avatar dausruddin commented on May 30, 2024

@erindru I tried to remove more_clear_headers and analyze my browser HTTP request.

HTTP/1.1 200 OK
Server: nginx/1.8.0
Date: Tue, 05 May 2015 12:17:21 GMT
Content-Type: text/plain; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Generated-In: 2
Last-Modified: Tue, 05 May 2015 11:36:16 GMT
Set-Cookie: PLAY_FLASH=;Expires=Tue, 5-May-15 12:17:21 GMT;Path=/
PLAY_ERRORS=;Expires=Tue, 5-May-15 12:17:21 GMT;Path=/
PLAY_SESSION=;Expires=Tue, 5-May-15 12:17:21 GMT;Path=/
Cache-Control: no-cache
Content-Encoding: gzip

You said in the comment above (#19 (comment)), the X-Archive-Files header will make a way to my browser if more_clear_headers removed. But I can't see it.

from openseedbox.

dausruddin avatar dausruddin commented on May 30, 2024

I compared both regular download and Zip http header.

regular download

HTTP/1.1 200 OK
Server: nginx/1.8.0
Date: Tue, 05 May 2015 15:31:30 GMT
Content-Type: application/octet-stream
Content-Length: 774897664
Last-Modified: Tue, 05 May 2015 15:27:53 GMT
Connection: keep-alive
Content-Disposition: attachment; filename="crunchbang-11-20130506-amd64.iso"
Set-Cookie: PLAY_FLASH=;Expires=Tue, 5-May-15 15:31:30 GMT;Path=/
Set-Cookie: PLAY_ERRORS=;Expires=Tue, 5-May-15 15:31:30 GMT;Path=/
Set-Cookie: PLAY_SESSION=;Expires=Tue, 5-May-15 15:31:30 GMT;Path=/
Cache-Control: no-cache
ETag: "5548e179-2e300000"
Accept-Ranges: bytes

Zip

HTTP/1.1 200 OK
Server: nginx/1.8.0
Date: Tue, 05 May 2015 15:34:44 GMT
Content-Type: text/plain; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Generated-In: 2
Last-Modified: Tue, 05 May 2015 15:34:41 GMT
Set-Cookie: PLAY_FLASH=;Expires=Tue, 5-May-15 15:34:44 GMT;Path=/
Set-Cookie: PLAY_ERRORS=;Expires=Tue, 5-May-15 15:34:44 GMT;Path=/
Set-Cookie: PLAY_SESSION=;Expires=Tue, 5-May-15 15:34:44 GMT;Path=/
Cache-Control: no-cache
Content-Encoding: gzip

Don't you think something is missing in the zip http header?

from openseedbox.

erindru avatar erindru commented on May 30, 2024

Ok im not sure what is going on, you'll have to dig into the code at this point :)

from openseedbox.

dausruddin avatar dausruddin commented on May 30, 2024

Is there any log I can refer to? I found the code which send the header. But I dont know what to do.
I know php but not java. I will try to understand it.

from openseedbox.

dausruddin avatar dausruddin commented on May 30, 2024

I found my mistakes. In README, you stated backend.download.ngxzip.manifestonly - 'true' or 'false', only set to true for debugging purposes
I left the value as default which is true. Zip download is working when I changed backend.download.ngxzip.manifestonly to false

I realized my mistake when I look into openseedbox-server/app/controllers/Download.java.

if (!Config.isNgxZipManifestOnly()) {
            response.setHeader("X-Archive-Files", "zip");
            response.setHeader("Content-Disposition", "attachment; filename=\"" + name + ".zip" + "\"");
        }       

Thanks for your effort. My problems solved :)

from openseedbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.