Bridge the gap between command-line and web interfaces with OAuth2-WebActions (O2WA).
This tool transforms CLI workflows into web actions while leveraging the security of OAuth2.0 and OIDC.
-
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.
-
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 O2WA if you're looking to expand your CLI operations to a wider audience securely and efficiently.
For those who like a straightforward setup without the need for containerization, here's a guide to quickly get a O2WA server operational:
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:
O2WA_Darwin_arm64.tar.gz
- For Linux with x86_64:
O2WA_Linux_x86_64.tar.gz
... and so on.
- For macOS with arm64:
- 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/o2wa@latest
Ensure your $GOPATH/bin
directory is in your $PATH
to run the installed binary from anywhere.
In the directory where o2wa
is installed or your working directory, you'll find a sample config.example.yaml
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.
With everything configured, you can start o2wa
:
o2wa
Open a browser and navigate to the o2wa
web interface:
http://localhost:8080 # Make sure to adjust the port if you've modified it in config.yaml
Then, follow the on-screen guidance to authenticate and execute your defined commands.
Sample config.example.yaml is provided in the repository. Deploy with:
docker run \
-p 8080:8080 \
-v $PWD/config.yaml:/config.yaml \
ghcr.io/miguelangel-nubla/o2wa:latest
In scenarios where o2wa
'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.yaml:/config.yaml \ -v /path/to/your/custom-init.sh:/custom-init.sh \ -e INIT_SCRIPT_PATH=/custom-init.sh \ ghcr.io/miguelangel-nubla/o2wa
Your script will execute before o2wa
, ensuring the necessary tools or configurations are in place.
o2wa
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.yaml:/config.yaml \
-v /path/to/your/ca/certs:/trusted-ca-certs \
ghcr.io/miguelangel-nubla/o2wa
Enhance O2WA through documentation improvements, added features, or issue resolutions. Your contributions are valued!