https://github.com/guangie88/httpose
A quick and dirty secret hosting webserver meant for Docker build.
https://github.com/guangie88/httpose
docker rust webserver
Last synced: about 2 months ago
JSON representation
A quick and dirty secret hosting webserver meant for Docker build.
- Host: GitHub
- URL: https://github.com/guangie88/httpose
- Owner: guangie88
- License: mit
- Created: 2019-10-17T10:52:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-17T01:21:14.000Z (almost 3 years ago)
- Last Synced: 2023-03-11T16:08:14.930Z (about 2 years ago)
- Topics: docker, rust, webserver
- Language: Rust
- Size: 69.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# `httpose`
[]( https://g.codefresh.io/pipelines/httpose/builds?repoOwner=guangie88&repoName=httpose&serviceName=guangie88%2Fhttpose&filter=trigger:build~Build;branch:master;pipeline:5da908bcba23a425e23f2d3f~httpose)
A quick and dirty solution to "HTTP-expose" secret meant for Docker build.
**Caveat**: This does not employ any SSL over HTTP, and assumes the working
networking environment is safe without encryption (e.g. `localhost`).## Get Started
Simply run
```bash
# stdin
## Serves at `127.0.0.1:2048` by default
./httpose (secret will be consumed via stdin)
## (CTRL-C to terminate)## Pipe in also works
echo xxx | ./httpose
## (CTRL-C to terminate)# env var
HTTPOSE_SECRET=xxx ./httpose
## (CTRL-C to terminate)# by file
echo xxx > /tmp/secret
./httpose -f /tmp/secret
## (CTRL-C to terminate)
rm /tmp/secret## Serves at 0.0.0.0 interface and port 12345
## Not recommended to serve out of 127.0.0.1 unless within Docker bridge mode
./httpose -a 0.0.0.0:12345## Help details
./httpose -h
```You can get the secret value by `curl`-ing or `wget` when the service is up:
```bash
# curl
curl -s http://127.0.0.1:2048/# wget
wget -qO - http://127.0.0.1:2048/
```## Changelogs
See [CHANGELOG.md](CHANGELOG.md) for more details.
## Cargo build
You will need to install `cargo` and `rustc`. See (`rustup`)[
for more information.To build in release mode via `cargo`, simply run:
```bash
cargo build --release
```To execute, simply run:
```bash
cargo run --release -- [args...]
```## Docker build
To build the image, simply run:
```bash
docker build . -t httpose# Host network mode for simplicity
docker run --rm -it --net host httpose# Bridge mode, requires changing of listening address
docker run --rm -it -p 2048:2048 httpose -a "0.0.0.0:2048"# Secret by env var (not recommended because docker inspect can see the secret)
docker run -e HTTPOSE_SECRET=xxx --rm -it --net host httpose# Secret by file
docker run -v "`pwd`/xxx:/xxx" --rm -it --net host httpose -f "/xxx"# Help details
docker run --rm -it httpose -h
```