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

cmd: add parameters for configuration of WebDAV remotes #1617

Merged
merged 22 commits into from
Aug 6, 2020

Conversation

iksnagreb
Copy link
Contributor

This adds the documentation of configuration parameters for my proposed addition of WebDAV remotes.

Relates to iterative/dvc#1153, iterative/dvc#4256

You may disregard these recommendations if you used the Edit on GitHub button from dvc.org to improve a doc in place.

❗ Please read the guidelines in the Contributing to the Documentation list if you make any substantial changes to the documentation or JS engine.

🐛 Please make sure to mention Fix #issue (if applicable) in the description of the PR. This causes GitHub to close it automatically when the PR is merged.

Please choose to allow us to edit your branch when creating the PR.

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

@jorgeorpinel
Copy link
Contributor

Took a quick look. Looking good so far! Please let us know when this is ready for review.

@shcheklein shcheklein temporarily deployed to dvc-landing-webdav-3jvvvupgl9h July 23, 2020 22:06 Inactive
@iksnagreb iksnagreb marked this pull request as ready for review July 31, 2020 17:49
@skshetry skshetry requested a review from jorgeorpinel August 4, 2020 14:43
@shcheklein
Copy link
Member

@jorgeorpinel what is the status of this?

Comment on lines 628 to 638
- `cert_path` - path to certificate used for WebDAV server authentication.

```dvc
$ dvc remote modify myremote cert_path /path/to/cert
```

- `key_path` - path to private key to use to access a remote.

```dvc
$ dvc remote modify myremote key_path /path/to/key
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these alternatives to token and to user/password auth?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, according to the WebDAV client documentation (and that is also what I can infer from the implementation), these are additional parameters. But they are optional parameters, probably we should give this information.

Copy link
Contributor

Choose a reason for hiding this comment

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

No need to say they're optional. Most parameters except what's shown in the remote add reference are assumed to be optional. But ideally we should briefly explain what these are for, or link to some WebDAV documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added some explanation, is it enough? I don't know what I could link to, these are not really WebDAV specific options - they are just passed to the underlying requests API.

WebDAV seems to be the only remote having such options, even though HTTP is also based on requests it does not expose these option?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, that was more than enough. Thanks @iksnagreb!

Copy link
Contributor

Choose a reason for hiding this comment

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

WebDAV seems to be the only remote having such options, even though HTTP is also based on requests it does not expose these option?

Good question. TBH Idk but maybe @efiop, who I always pick on for these questions 😬, does.

`user/password` authentication.

```dvc
$ dvc remote modify --local myremote token mytoken
Copy link
Contributor

@jorgeorpinel jorgeorpinel Aug 5, 2020

Choose a reason for hiding this comment

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

Does it need quotes like other string params? I.e.:

Suggested change
$ dvc remote modify --local myremote token mytoken
$ dvc remote modify --local myremote token "<mytoken>"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know, thought it to be more like a variant of user, which has no quotes? But adding quotes should probably be fine. Are there guidelines what parameters are considered as strings/numerics/... and what formatting to apply to each?

Copy link
Contributor

@jorgeorpinel jorgeorpinel Aug 6, 2020

Choose a reason for hiding this comment

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

I think it's more of a command line parser thing. All strings can be wrapped with " but if they have special chars or spaces then you definitely need to wrap them. And in fact ' may be better... Idk. I'll just commit this!

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, have you tried this? I assume you tested all the WebDAV params so you can probably tell or double check whether quotes are needed.

Copy link
Contributor

@jorgeorpinel jorgeorpinel Aug 6, 2020

Choose a reason for hiding this comment

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

Or if you can rec a quick WebDAV server software to install and run locally for testing, please share 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I think you are right, it is better to wrap this in '. There seems to be no standard defining the content and structure of tokens for WebDAV (at least it should be some kind of string). What I can tell for the service I am using (it is basically an onwcloud): it supports OAuth 2.0, probably bearer tokens, which might already contain some basic punctuation characters.

Copy link
Contributor

@jorgeorpinel jorgeorpinel Aug 6, 2020

Choose a reason for hiding this comment

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

Thanks for the tip. Resolving Leaving unresolved for future ref.

Copy link
Member

Choose a reason for hiding this comment

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

Or if you can rec a quick WebDAV server software to install and run locally for testing, please share slightly_smiling_face

Check this link: https://doc.owncloud.com/server/admin_manual/installation/docker/#docker-compose-yaml-file

Copy-paste that into a docker-compose.yml file and then docker-compose up.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect, thanks @skshetry! Will try this next time its needed.

Copy link
Contributor

@jorgeorpinel jorgeorpinel left a comment

Choose a reason for hiding this comment

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

Looks good in general but i do have a bunch of small questions now that this is ready for review ☝️ (sorry for the delay, @iksnagreb).

jorgeorpinel added a commit that referenced this pull request Aug 6, 2020
jorgeorpinel added a commit that referenced this pull request Aug 6, 2020
@jorgeorpinel jorgeorpinel mentioned this pull request Aug 6, 2020
shcheklein pushed a commit that referenced this pull request Aug 6, 2020
* cmd: remove unnecessary commas in get and import

* cmd: fix typo in add

* cmd: remote copy edits
per #1617 (comment)

* guide: .dvcignore copy edit

* cmd: init copy edits
Copy link
Contributor

@jorgeorpinel jorgeorpinel left a comment

Choose a reason for hiding this comment

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

Great stuff 😄

@jorgeorpinel
Copy link
Contributor

Merging the Restyled PR, since the core PR is merged and this is approved 🙂

@jorgeorpinel jorgeorpinel merged commit 08f888f into iterative:master Aug 6, 2020
shcheklein pushed a commit that referenced this pull request Aug 8, 2020
* cmd: remove unnecessary commas in get and import

* cmd: fix typo in add

* cmd: remote copy edits
per #1617 (comment)

* guide: .dvcignore copy edit

* cmd: init copy edits

* clarify about dirs in import -o

* cmd: review get -o desc

* dvcignore: updates to guide and check-ignore ref.
per #1629 (review)
et al.

* cmd: update check-ignore -n
per iterative/dvc#4323 (comment)

* cmd: fix get.import -o descriptions
per #1673 (review)
and #1673 (review)

* cmd: copy edits to remote add/modify
Comment on lines +349 to +351
```dvc
$ dvc remote add -d myremote webdavs://example.com/public.php/webdav
```
Copy link
Contributor

Choose a reason for hiding this comment

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

We just realized that PHP is kind of a weird example to have (see #1695 (review)).

We'll be reviewing these sample URLs in #1706, in case you're interested @iksnagreb 🙂

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.

4 participants