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

add read-only webdav support #1415

Merged
merged 1 commit into from
Feb 6, 2025
Merged

add read-only webdav support #1415

merged 1 commit into from
Feb 6, 2025

Conversation

ahti
Copy link
Contributor

@ahti ahti commented May 13, 2024

Adds read-only webdav support by (when indexing isn't disabled) routing OPTIONS/PROPFIND requests to a DavHandler from the webdav-server crate. Hidden files are excluded via a custom DavFileSystem.

@ahti ahti force-pushed the webdav branch 5 times, most recently from c6a083c to 6f082ad Compare May 14, 2024 02:04
@ahti ahti changed the title draft: add read-only webdav support add read-only webdav support May 24, 2024
Copy link
Owner

@svenstaro svenstaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The webdav functionality should likely be put behind a flag. I suppose most people wouldn't want to run it with webdav activated.

Also, can you produce a test that shows that webdav at least works in some fashion?

@svenstaro
Copy link
Owner

Please rebase this!

@ahti ahti force-pushed the webdav branch 3 times, most recently from a533dd3 to ee763fd Compare January 11, 2025 05:58
Copy link
Owner

@svenstaro svenstaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see you use a real webdav client to check whether this does something useful. I think reqwest_dav would be suitable. Also I'd like to see you handle:

  • Single file serving mode (new_file seems to easily handle this)
  • --route-prefix/--random-route
  • --no-symlinks

Copy link
Owner

@svenstaro svenstaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work, merging as-is!

Comment on lines +98 to +107
// Make symlinks
let symlink_directory_str = "symlink_directory";
let symlink_directory = server.path().join(symlink_directory_str);
let symlinked_direcotry = server.path().join(DIRECTORIES[0]);
symlink_dir(symlinked_direcotry, symlink_directory).unwrap();

let symlink_filename_str = "symlink_file";
let symlink_filename = server.path().join(symlink_filename_str);
let symlinked_file = server.path().join(FILES[0]);
symlink_file(symlinked_file, symlink_filename).unwrap();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memo to self: Maybe just refactor the integration tests dir fixtures in fixtures/mod.rs to always have symlinks? Would likely allow us to cut a few lines from some tests.

@svenstaro svenstaro merged commit 41ccc9f into svenstaro:master Feb 6, 2025
17 checks passed
svenstaro added a commit that referenced this pull request Feb 6, 2025
@ahti ahti deleted the webdav branch February 6, 2025 03:24
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