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

Respect $TR_AUTH like cli tool transmission-remote #34

Closed
doronbehar opened this issue Aug 2, 2017 · 18 comments
Closed

Respect $TR_AUTH like cli tool transmission-remote #34

doronbehar opened this issue Aug 2, 2017 · 18 comments

Comments

@doronbehar
Copy link

The official tool by the transmission team, transmission-remote, accepts an option -ne (or --authenv) which reads $TR_AUTH and gets authentication info from this environmental variable.
Could it be implemented in stig? That will enable me to remove the wrapper script I have in my dotfiles repository.

@rndusr
Copy link
Owner

rndusr commented Aug 2, 2017 via email

@doronbehar
Copy link
Author

Sounds great, even better than what official transmission-remote offers :)

@rndusr
Copy link
Owner

rndusr commented Dec 1, 2017

@doronbehar, I currently don't see the real benefit of reading $TR_AUTH. Why
don't put set srv.url user:password@host:port in your rc file?

@doronbehar
Copy link
Author

Well first of all, I think that having a password in plain text in a configuration file is a bad habit.

The way I set $TR_AUTH in my shell configuration files for transmission-remote is using pass just like this. I think it's much better than storing the password in the configuration file.
Another great solution would be to have something like srv.password_eval = pass transmission useful for people who use password managers like pass or gnome-keyring.

@rndusr
Copy link
Owner

rndusr commented Dec 1, 2017 via email

@doronbehar
Copy link
Author

Haha, I liked that :)

Reading the environmental variable is a great start but as for having an option like password_eval just like in this programs:

@rndusr
Copy link
Owner

rndusr commented Dec 1, 2017 via email

@doronbehar
Copy link
Author

What you said Yuck about is exactly what I'm doing in the .zsh_credentials file in my dotfiles repository.

@rndusr
Copy link
Owner

rndusr commented Dec 1, 2017 via email

@doronbehar
Copy link
Author

Oh now I understand, you were thinking of something similar to what they do in muttrc (as explained here: https://unix.stackexchange.com/a/20572).

Maybe you should enable splitting the srv.url into srv.host, srv.port, srv.user and optionally srv.password which could be interpreted with something similar to fetch. Then you won't have to worry to much about sub-shells and quotes, you could just make the fetch command by default interpreting a shell command. That's only one sub-shell if I'm correct.

@rndusr
Copy link
Owner

rndusr commented Dec 1, 2017 via email

@doronbehar
Copy link
Author

You are funny :),

I don't think It has to brake backwards compatibility, it might be possible to specify in the manual or something that srv.url is overriding srv.host, srv.port, srv.user and srv.password or the other way around but than you will still have to solve #24 elegantly. I guess it will be much easier for you to remove the srv.url and use only the above variables instead exactly as you said.

I'll agree with either of those choices :)

@rndusr
Copy link
Owner

rndusr commented Dec 1, 2017 via email

@doronbehar
Copy link
Author

Thanks for you reaching out your users 👍, Hope to see it in the next version.
Cheers!

@rndusr
Copy link
Owner

rndusr commented Jan 20, 2018

I've extended the 'set' command so that you can now append ':eval' to the name
of a setting to indicate that the value is a command:

set connect.password:eval pass transmission

@rndusr rndusr closed this as completed Jan 20, 2018
@doronbehar
Copy link
Author

Works great! Thanks!

@pschmitt
Copy link

Sorry for necrobumping but I wanted to share that this makes it possible to use env vars in the config 👍

set tui.theme:eval echo $XDG_CONFIG_HOME/stig/themes/stig_darker_theme.txt

@ralyodio
Copy link

how do i set username?

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

No branches or pull requests

4 participants