Closed arashmo closed 4 years ago
Only Darwin (MacOS) supports getting credentials from a keyring. Other platforms prompt for your password on the terminal, so this will not work from a systemd unit as there is no terminal on which to read the password.
I'm not sure what you meant by passing the password as an argument, because it does not have one.
Basically I created a module for alpaca that will store the password in such secure format using AES encryption and will share it here , it works just fine but when i run alpaca as binary but when it comes to systemd it does not , the issue is not the password I'll share the logs tomorrow
found the issue, I was reading the current user whoam function in main.go now i need to implement a method to pass user from configuration file
why it does not work :( i just saved my username in a plane text file and passwd it to the flag.String but it didn't work while whoAmI() works
func Getusername() string { content, err := ioutil.ReadFile(ufile) text = string(text) return text }
username := flag.String("u", Getusername(), "username of the proxy account (for NTLM auth)")
This is not really the right forum for you to debug your private changes to alpaca. Do you have a repo you can share perhaps? If you want to upstream the changes later in a PR, I may be able to help. There is also the #alpaca channel on the gophers slack (https://app.slack.com/client/T029RQSE6/CQWGVQ0RG) if you want to chat there.
My initial suspicion of your problem is that there is a newline at the end of your username in the file. You may want to do text := string(content).TrimSpace()
.
yes you were right ioutil adds a blank space, when i was debugging it on my local terminal it was not obvious, trimed that this way
bb, _ := ioutil.ReadFile(ufile) dd := string(bb) text := strings.TrimSuffix(dd, "\n") return text
Glad you've got it working. I'm going to close this issue now, as there is nothing to fix/change in alpaca.
I created a systemd service unit file and started Alpaca as service and passed all the argument like username and password, for direct connection it works fine for proxied connection i get site unavailable error on browser, the app does not show any error or or logs