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

.netrc support #116

Open
eribertomota opened this issue Sep 25, 2017 · 2 comments · May be fixed by #244
Open

.netrc support #116

eribertomota opened this issue Sep 25, 2017 · 2 comments · May be fixed by #244

Comments

@eribertomota
Copy link
Collaborator

From Debian[1]:

Axel should try to use the .netrc file when trying to login to an FTP server.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=127074

Regards,

Eriberto

@ismaell ismaell added this to the v3.0 milestone Oct 9, 2017
@ismaell ismaell changed the title Axel does not support .netrc files .netrc support Jul 18, 2019
ismaell added a commit that referenced this issue Jul 18, 2019
- Metalink:
  <#225>
- .netrc support:
  <#116>

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
@davidpolverari
Copy link
Contributor

I would like to try to implement this feature, as I already have implemented a (somewhat naive, but working) simple .netrc parser in a few lines. But before I finish that, I would like the feedback on some points:

  • I thought about only enabling .netrc parsing through a command-line option, not as a default behavior, as not to break the existing user experience, scripts, etc. What do you think about it?
  • The long option could be something along the lines of --netrc[=filename]. If the option was used, it would parse the $HOME/.netrc file or an optional user-provided filename. I don't know which letter would be more appropriate for the short option. Suggestions are welcome.
  • Other doubt is whether the code should be compiled by default along the rest of axel, or be conditionally compiled using the pre-processor. I don't think it will have such an impact on code size, but I wanted to know the opinions on it.

Thanks in advance.

davidpolverari added a commit to davidpolverari/axel that referenced this issue Oct 18, 2019
This implementation parses the $HOME/.netrc (or a file specified by the
user) through the `--netrc[=file]` or `-R[file]` options.

It uses a simple FSM in order to parse the file and find the credentials
corresponding to the FTP host, or uses the "default" entry otherwise,
if any, according to the specification found on [1]. Tokens not
applicable to axel usage were not considered.

[1] https://docs.oracle.com/cd/E19455-01/806-0633/6j9vn6q5f/index.html

Closes: axel-download-accelerator#116

Signed-off-by: David Polverari <david.polverari@gmail.com>
@davidpolverari davidpolverari linked a pull request Oct 18, 2019 that will close this issue
@davidpolverari
Copy link
Contributor

I submitted a PR that implements the feature. I intend to enhance some points of the implementation in the future, but for now it seemed to work for me. Tests are welcome.

I purposefully didn't change any of the .po files because of my ignorance of internationalization issues, so the new messages added to print_help() do not appear at the moment, in spite of the options being functional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants