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

support custom config dir #341

Merged
merged 6 commits into from
Aug 12, 2023
Merged

support custom config dir #341

merged 6 commits into from
Aug 12, 2023

Conversation

dogancanbakir
Copy link
Member

@dogancanbakir dogancanbakir commented Aug 2, 2023

Proposed changes

This PR fixes custom config dir support -same functionality as nuclei. Closes #323 .

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@dogancanbakir dogancanbakir self-assigned this Aug 2, 2023
@dogancanbakir dogancanbakir linked an issue Aug 2, 2023 that may be closed by this pull request
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

Implementation: lgtm

suggesting a minor aesthetic change to remove panic from internals on sporadic config file read error

internal/runner/options.go Outdated Show resolved Hide resolved
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

I'm getting this error (test folder doesn't exist):

$ go run . -config test
...
[INF] Current proxify version 0.0.11 (latest)
[FTL] failed to load open test/cakey.pem while saving private key got open test/cakey.pem: no such file or directory
exit status 1

I think we need O_CREATE|O_TRUNC also in

kf, err := os.OpenFile(keyFile, os.O_WRONLY, 0600)
or just use os.Create(...)

@dogancanbakir
Copy link
Member Author

@Mzack9999 Fixed in #340

Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

lgtm!

Screenshot 2023-08-03 at 15 54 06

Copy link
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

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

to overwrite config dir, we should use a dedicated and separate option like in nuclei as this conflicts with -config option, which is generally used to specify the custom tool config file across all the tools.

we can make changes to make sure these cases are covered.

./proxify -config test/custom_config.yaml
./proxify -config-directory custom_dir_to_store_config_files
   -cdir, -config-directory string      directory to store/read proxify cert/config files ($HOME/.config/proxify)

@ehsandeep ehsandeep merged commit 24c9a60 into dev Aug 12, 2023
8 checks passed
@ehsandeep ehsandeep deleted the support_custom_config_dir branch August 12, 2023 19:57
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.

bug in -config flag
3 participants