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

wip: Trying to get webdav working #23

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

Blu-J
Copy link
Member

@Blu-J Blu-J commented Jun 22, 2022

No description provided.

@Blu-J Blu-J mentioned this pull request Jun 22, 2022
@gstrauss
Copy link

gstrauss commented Jun 26, 2022

Looks like lighttpd mod_proxy in your config handles all requests before lighttpd mod_webdav gets a chance.

proxy.server = (
    "" => (
        "80" => ( 
            "host" => "127.0.0.1",
            "port" => 8080
        )
    )
)

You might want something like the following, though you really ought to use the same webdav.sqlite-db-name for paths to the same root.

$HTTP["url"] =~ "^/webdav($|/)" {
    server.document-root = "/root/webdav/"
    webdav.activate = "enable"
    webdav.is-readonly = "disable"
    dir-listing.activate = "enable"
    webdav.sqlite-db-name = "/root/lighttpd.webdav_lock.db"
    auth.backend = "htpasswd"
    auth.backend.htpasswd.userfile = "/root/passwd.dav"
    auth.require = ( "" => ( "method" => "basic",
                                "realm" => "webdav",
                                "require" => "valid-user" ) )
}
else $HTTP["url"] =~ "^/dav($|/)" {
    server.document-root = "/root/webdav/"
    webdav.activate = "enable" 
    webdav.is-readonly = "enable" 
    webdav.sqlite-db-name = "/root/webdav.db" 
}
else {
    proxy.server = (
        "" => (
            "80" => ( 
                "host" => "127.0.0.1",
                "port" => 8080
            )
        )
    )
}

If only /api should go to the backend proxy, then you could instead use

  proxy.server = (
      "/api" => (
          "80" => ( 
              "host" => "127.0.0.1",
              "port" => 8080
          )
      )
  )

@Blu-J
Copy link
Member Author

Blu-J commented Jun 27, 2022

Tried to implement, but I can't seem to get anything working at the moment. It was a great idea @gstrauss
Going to work on other things until

Screenshot_20220627_110601

@Blu-J Blu-J closed this Jun 27, 2022
@Blu-J Blu-J reopened this Jun 27, 2022
@gstrauss
Copy link

Please check that you are testing with the latest version of lighttpd, currently lighttpd 1.4.65.

@Blu-J
Copy link
Member Author

Blu-J commented Jun 27, 2022

Previous version of thte lighttpd was version 1.4.64
Modified the docker to run with 1.4.65
Still can't get in. Not sure the that the version is the source of the issue.

@gstrauss
Copy link

FYI: I have a local development build of lighttpd 1.4.65 and when using a similar httpd.conf to what you have in this WIP, I had no problems connecting to a webdav share when using cadaver.

@Blu-J
Copy link
Member Author

Blu-J commented Jun 27, 2022

Thanks for the help. I have a feeling now that there could be something in the embassy-os that is restricting this dav, could be nginx or something about docker.
Was your test in a docker or just on a x86 linux?

@Blu-J
Copy link
Member Author

Blu-J commented Jun 27, 2022

@gstrauss Thanks for the sanity check, I'm assuming now that the lighttpd is right

@gstrauss
Copy link

Was your test in a docker or just on a x86 linux?

x86_64 linux with a direct connection from cadaver to lighttpd on localhost (and no intermediate proxies)

Yes, my intention was to help with a basic sanity check and let you know that things could work. Since a quick search turns up other github repos with docker configs for using lighttpd and mod_webdav, I think there is something specific to your config / embassy-os.

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.

2 participants