filebrowser / caddy

:floppy_disk: File Browser Caddy plugins.
https://caddyserver.com/docs/http.filebrowser
Apache License 2.0
26 stars 11 forks source link

Can't use host:port/path on Caddyfile #21

Open aigooman opened 5 years ago

aigooman commented 5 years ago

I use filebrowser as caddy's plugin http.filebrower. My caddyfile is:

my.url {
    filebrowser / /home {
        database /home/www/file/file.db
    }
}

Then I run caddy with no error. But when I enter the url, the index is blank, there is no login web. However, I can still enter https://my.url/files to see my file. Did I do something wrong?

When I enter https://my.url , chrome shows:

image

hacdias commented 5 years ago

@aigooman hey! Sorry to hear that. Just to make sure: the path to the database file you indicate doesn't exist right? If it's from http.filemanager, please delete it.


Just tried the following Caddyfile (similar to yours):

localhost:8080

filebrowser / D:\teste {
  database D:\teste\db.db
}

And had no problem at all.


If deleting the DB doesn't work, please let me know and also take a screenshot at Network tab

oldiy commented 5 years ago

caddy

0.0.0.0:80/files { filebrowser / ./data }

Can't open index and login

aigooman commented 5 years ago

It works! Thank you for your help!

hacdias commented 5 years ago

That's awesome @aigooman!

@oldiy your issue might be a little different and I think I know why! I'll handle that

aigooman commented 5 years ago

It seems that you have to indicate the port 80 to run http.filebrowser. my.url:80 works but my.url doesn't.

hacdias commented 5 years ago

@aigooman can't reproduce that issue. If you don't set a port it is supposed to default to 80 as far as I know. Anyways, File Browser doesn't use the port for any port of the code so I don't really know why you are having issues.

aigooman commented 5 years ago

@hacdias If I use my.url directly, it will use https and it won't redirect to my.url/login?redirect=%2Ffiles%2F to show the login index, but when i set port 80 and set tls to be off,it runs well.

hacdias commented 5 years ago

Hmm... I will take a look at both your issues then 😄

aigooman commented 5 years ago

Thanks~