OAuth2Commander
Bridge the gap between command-line and web interfaces with OAuth2Commander. This tool transforms CLI workflows into web actions while leveraging the security of OAuth2.0 and OIDC.
Features
-
Your CLI on the Web: Convert command-line tasks into web actions, making powerful commands accessible to non-tech-savvy users.
-
Robust Security: OAuth2.0 and OIDC integration ensure the secure execution of web-based commands.
-
Dynamic Endpoints: The server adapts web endpoints to commands via a JSON configuration, ensuring flexibility without altering the core code.
-
Interactive Feedback: Get HTML feedback for every command executed through the web, enhancing the user experience.
Why Choose OAuth2Commander?
-
Simplify for Users: Make intricate tasks user-friendly by transitioning them from the CLI to the web.
-
Unified Command Management: Update commands centrally, maintaining consistency for all users.
-
Safety First: OAuth2 and OIDC-backed authentication ensure the safety of every command.
-
Scalable: Seamlessly incorporate new CLI tasks into the web interface via dynamic endpoints.
Consider OAuth2Commander if you're looking to expand your CLI operations to a wider audience securely and efficiently.
Quickstart:
For those who like a straightforward setup without the need for containerization, here's a guide to quickly get oauth2commander
operational:
Step 1: Install oauth2commander
You have two options:
Option A: From GitHub Releases
- Visit the GitHub releases page.
- Depending on your operating system and architecture, download the appropriate release asset. For instance:
- For macOS with arm64:
oauth2commander_Darwin_arm64.tar.gz
- For Linux with x86_64:
oauth2commander_Linux_x86_64.tar.gz
... and so on.
- Extract the downloaded file.
- Move the binary to a location in your system's
$PATH
, or you can execute it directly from the extracted folder.
Option B: Using Go
If you have Go installed, you can directly install the package:
go install github.com/miguelangel-nubla/oauth2commander@latest
Ensure your $GOPATH/bin
directory is in your $PATH
to run the installed binary from anywhere.
Step 2: Set Up Configuration
In the directory where oauth2commander
is installed or your working directory, you'll find a sample config.json
configuration file. Tailor this file to your environment:
Ensure you update the OAuth2 endpoint URLs, client credentials, and define any custom commands as needed.
Use the provided /public endpoint that runs echo Hello world!
as a starting point.
Step 3: Launch oauth2commander
With everything configured, you can start oauth2commander
:
oauth2commander
Step 4: Access the Web Interface
Open a browser and navigate to the oauth2commander
web interface:
http://localhost:8080 # Make sure to adjust the port if you've modified it in config.json
Then, follow the on-screen guidance to authenticate and execute your defined commands.
Docker Deployment
Sample config.json is provided in the repository. Deploy with:
docker run \
-p 8080:8080 \
-v $PWD/config.json:/config.json \
ghcr.io/miguelangel-nubla/oauth2commander:latest
In scenarios where oauth2commander
's custom commands require special tools or setups, you can introduce an initialization script that runs before the main program.
-
Prepare your initialization script. For instance, name it custom-init.sh
.
-
Launch the Docker container, mounting your script and setting `INIT_SCRIPT_PATH``:
docker run \
-p 8080:8080 \
-v $PWD/config.json:/config.json \
-v /path/to/your/custom-init.sh:/custom-init.sh \
-e INIT_SCRIPT_PATH=/custom-init.sh \
ghcr.io/miguelangel-nubla/oauth2commander
Your script will execute before oauth2commander
, ensuring the necessary tools or configurations are in place.
Custom CA Certificates
OAuth2Commander
might interact with services using certificates from a private/internal CA. For smooth, secure interactions, trust these certificates.
For Docker deployments, mount your CA certificates at /trusted-ca-certs
:
docker run \
-p 8080:8080 \
-v $PWD/config.json:/config.json \
-v /path/to/your/ca/certs:/trusted-ca-certs \
ghcr.io/miguelangel-nubla/oauth2commander
Contributing
Enhance OAuth2Commander through documentation improvements, added features, or issue resolutions. Your contributions are valued!