projectdiscovery/proxify

bug in -config flag

badrelmers opened this issue · 6 comments

Proxify version:

v0.0.9

Current Behavior:

proxify does not respect -config, when I do

proxify.exe -http-addr 127.0.0.1:18080 -config proxify_config

proxify will create cacert.pem and cakey.pem inside proxify_config, but he create config.yaml inside "%USERPROFILE%\.config\proxify"

Expected Behavior:

proxify should create and use config.yaml from proxify_config

Steps To Reproduce:

  1. Run
proxify.exe -http-addr 127.0.0.1:18080 -config proxify_config
  1. See config.yaml in %USERPROFILE%\.config\proxify

all this happen in win 7 64

I believe the config file in /.config/proxify is created upon downloading the proxify binary. You might need to delete the original config file before creating a new on in your specified directory.

@ehsandeep can you confirm?

@MetzinAround thank you for looking into this. I deleted the ~/.config/proxify but it is created again and my custom config is ignored always

I gone through the code and I found that it is still in "TODO" list.
Regardless of specified config directory, proxify uses config.yaml from ~/proxify and if it is not present the default config.yaml will be generated in ~/proxify/ directory.

Related files:

  • ./internal/runner/options.go
  • github.com/projectdiscovery/goflags@v0.1.8/path.go

make troubles using in docker
[FTL] failed to load open /root/.config/proxify/cakey.pem while saving private key got open /root/.config/proxify/cakey.pem: no such file or directory

upd. issue fixing here #340

@leros1337 @badrelmers fixed in the latest release.

@ehsandeep
I'm seeing in v0.0.12 that overriding config directory using -config-directory flag with custom path would still create the duplicate folder under $home/.config/proxify/ with a config.yaml file as hardcoded in goflags v0.1.16 https://github.com/projectdiscovery/goflags/blob/821b811e2254cd449cbc353a9a973ef4ff2f8cc1/path.go#L23
Wonder if this is still the case in dev branch and if it is the indended behaviour? Shouldn't there be a single folder for everything config-related?