beefsack / webify Goto Github PK
View Code? Open in Web Editor NEWTurn shell commands into web services
License: MIT License
Turn shell commands into web services
License: MIT License
I cannot seem to be able to make the following minimal example run:
cat <<EOF > demo.sh
#!/bin/sh
VAR="\$(< /dev/stdin)"
echo \$VAR
EOF
sudo chmod +x demo.sh
docker run -it --rm -p 8080:80 -v $(realpath demo.sh):/script beefsack/webify:latest
and then:
curl http://localhost:8080 -d $(date '+%Y-%m-%d')
Am I doing something wrong? Expected output is the current date. Actual is a blank line.
I would like to help with extending webify
if this is a missing feature and I find the time.
When the client closes the connection, we see errors in the server stderr such as:
2020/08/29 21:09:56 error writing response body: write tcp [::1]:8080->[::1]:50044: write: broken pipe
These aren't useful errors and should be suppressed. These errors have the value syscall.EPIPE
.
The examples in the README aren't useful. Implement a more realistic minimal example and update documentation to clarify what webify should and shouldn't be used for.
命令行下不方便,怎么展现到web上。
本来执行的代码:
pyspark
sql='select * from table2'
spark.sql(sql).show()
我想实现的效果是,写一个python函数,传入不同的页面,在web上展示sql的结果。
You might put a word about security :-)
Like "Make sure your machine is not accessible from Internet when exposing shell commands".
is the project still active?
Hi,
I'm searching for a solution to replace a project i use : https://github.com/eoli3n/shellcast
It's a nodejs app, that I didn't maintain, but which works well.
It is kind of webify but with those features:
I'm still looking for a tool to replace it. I need same features but i can skip the js realtime shell output part.
If i don't find anything, i will maybe upgrade shellcast and fix vulnerabilities.
I would like to webify a service for encrypting files (oversimplification, but let's just say they are short yaml
files to be encrypted).
The way I envision interacting with webify
is to curl it with:
key
to be used in encryption (a separate file).yaml
to be encrypted.Something like:
curl \
-F "key=@/home/me/key" \
-F "input_yaml=@/home/me/input.yaml" \
localhost:8080
How do I store the key
and input.yaml
files on the backend side to start the process?
Add support for runtimes:
webify [--runtime=docker|azure|aws|gcloud|localhost] <command>
Running docker run -it -v script.sh:/script ...
does not work unless:
-v
does not seem to work on macOS)docker run
command is being executed (often not the case; I am on macOS and use docker-machine).The idea is for this to be a stepping stone to building docker images that can run as Azure Functions or other "serverless" runtimes.
Also keeps webify pure in that --runtime
can default to "localhost" (i.e. just run webify locally as now).
docker run -it --rm <image>
?No idea yet, but https://github.com/Azure-Samples/functions-custom-handlers/tree/master/go might be a starting point
Using webify in docker, I'm seeing cached values for simple text:
script.sh
:
#!/bin/sh
echo foo
docker run -d --rm -p 8080:80 -v $(realpath script.sh):/script beefsack/webify
If I change foo
to bar
, curl http://localhost:8080
still displays the old value.
This only occurs in Docker, if I run webify on baremetal, the updated value bar
is displayed.
Really Nice , would be even better if it serves on websockets. Accepting user input on the fly. It will then become a true terminal in browser.
I like the idea that webify can quickly turning a cli command into a http service.
I wrote a ruby script to implement it with 6 lines of codes using pure ruby.
here is the gist: https://gist.github.com/rainchen/3a91ef481e78ad38d51c91da0ab40e7f
have fun~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.