xunholy / go-proxy

CNTLM Proxy CLI written in GOLANG to assist with managing proxy configuration
GNU General Public License v3.0
18 stars 4 forks source link

GolangCI Build Status Coverage Status Maintainability License

CNTLM Proxy Configuration Tool

This project is a CLI for managing proxy configuring on a local dev machine. To configure CTNLM and other dev tools can be troublesome and time consuming.

This tool will be able to dynamically set proxy configuration within CNTLM and other supported tools that have tool specific proxy support.

Contents

Installing

Use the following to be able to install on MacOS via Homebrew:

Running the below command will add the homebrew tap to our repository

brew tap xUnholy/homebrew-proxy

Now you've added our custom tap, you can download with the following command:

brew install proxy

To upgrade your proxy to the latest stable release use the following command:

brew upgrade proxy

Note: Should the upgrade fail you may be required to remove the previous binary, the output will print what file to remove

Commands

The following is a list of all available commands:

Start

Usage example:

proxy start [flags]
Flags:
  -h, --help        help for start
      --port PORT   set custom CNTLM PORT (default 3128)

Stop

Usage example:

proxy stop [flags]
Flags:
      --all    unset all proxy configuration (default true)
  -h, --help   help for stop

Set

Usage example:

proxy set [command]

Subcommand options:

Available Commands:
  domain      This command will update the domain value in your CNTLM.conf file
  git         This command will set the GIT global proxy values. Both http.proxy and https.proxy will be set
  npm         This command will set the NPM proxy values. Both https-proxy and proxy will be set
  password    This command will update the Password value in your CNTLM.conf file
  username    This command will update the Username value in your CNTLM.conf file

All subcommands have the following options:

Flags:
  -h, --help   help for set

To be able to set the CNTLM authentication password the password subcommand can be used. EG:

proxy set password

Once the password is entered and then encrypted, it will be stored in cntlm.conf.

Unset

Usage example:

  proxy unset [command]

Subcommand options:

Available Commands:
  git         This command will unset the GIT global proxy values. Both http.proxy and https.proxy will be unset
  npm         This command will unset the NPM proxy values. Both https-proxy and proxy will be unset

All subcommands have the following options:

Flags:
  -h, --help   help for unset

Config

Usage example:

  proxy config [command]

Subcommand options:

Available Commands:
  list        This command will print the proxy configuration profile
  load        This command will load a custom proxy profile
  save        This command will save the proxy configuration to a profile

All subcommands have the following options:

Flags:
  -h, --help   help for unset

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing.

Prerequisites

What things you need to install:

Running Tests

Use the following steps to execute the test suite:

go test -v  ./...

OR

make test

Note: The test suite will require you to have the supported tools installed and available locally.

Build And Package

To be able to package this tool, use one of the following below command:

go build -o proxy .

OR

make build

Once you have packaged the application the compiled binary can be executed with the following:

proxy [command options] [arguments...]

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the GPL License - see the LICENSE.md file for details

Acknowledgments

Wish to acknowledge the following people for their inspiration, and guidance with this project and/or in general: