-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix provider config file not used in library mode #864
Conversation
Hi @ehsandeep , please review my pull request |
Hi @tarunKoyalwar and @dogancanbakir, To allow library users to load their own |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @nth347. I just left some comments for you.
Hi @dogancanbakir after spending some time debugging, it turns out that the new func main() {
options := &runner.Options{
ResultCallback: func(s *resolve.HostEntry) { // Callback function to execute for available host
log.Println(s.Host, s.Source)
},
ProviderConfig: "/path/to/provider-config.yaml", // Will take effect if you call runner.Init
Config: "/path/to/config.yaml", // Will take effect if you call runner.Init
Domain: []string{"tesla.com"},
}
parsedOptions := runner.Init(options)
newRunner, err := runner.NewRunner(parsedOptions)
if err != nil {
gologger.Fatal().Msgf("Could not create runner: %s\n", err)
}
err = newRunner.RunEnumeration()
if err != nil {
gologger.Fatal().Msgf("Could not run enumeration: %s\n", err)
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nth347 thanks for flagging the issue and creating PR to fix that
I simplified the logic so there is no need to invoke another function like Init() and the updated example for using subfinder as library is available at https://github.com/nth347/subfinder/blob/02f520a0b1926224b8fbf57501a8112d1a7112ee/v2/examples/main.go#L12-L50
Hi @tarunKoyalwar, thank you for your fix! I noticed the problem, but I'm still working on improving my coding skills to address it. Your solution is greatly appreciated, and you did an excellent job! |
@nth347 , no worries also don't hesitate to raise PR thinking about coding skills / being up to the mark . pd-team will help you with PRs as much as we can , just create a draft PR and tag anyone from pdteam |
Proposed Changes