Merge remote-tracking branch 'origin/develop' into server-as-subcommand

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-06-05 10:15:35 +02:00
14 changed files with 311 additions and 90 deletions
Regular → Executable
View File
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env sh
curl -X POST --data-binary @- http://localhost:8080/eval <<EOF
touch /tmp/kapow_was_here
EOF
echo 'Proof of success:'
ls -l /tmp/kapow_was_here
+1 -1
View File
@@ -3,4 +3,4 @@ RUN apk update && apk add nmap
COPY nmap.pow /tmp/
RUN cd /tmp && pipenv install --system --deploy
ENTRYPOINT ["/usr/bin/kapow"]
CMD ["/tmp/nmap.pow"]
CMD ["server", "/tmp/nmap.pow"]
Regular → Executable
+1 -1
View File
@@ -16,4 +16,4 @@
# limitations under the License.
#
kapow route add -X GET '/list/{ip}' -c 'nmap -sL $(request /match/ip) | response /body'
kapow route add -X GET '/list/{ip}' -c 'nmap -sL $(request /matches/ip) | response /body'
+3 -3
View File
@@ -16,7 +16,7 @@
# limitations under the License.
#
kapow route add /list/files -c 'ls -la $(request /param/path) | response /body'
kapow route add /list/files -c 'ls -la $(request /params/path) | response /body'
kapow route add /list/processes -c 'ps -aux | response /body'
@@ -31,11 +31,11 @@ kapow route add /show/connections -c 'ss -pluton | response /body'
kapow route add /show/mounts -c 'mount | response /body'
kapow route add /tail/dmesg - <<-'EOF'
response /header/Content-Type text/plain
response /headers/Content-Type text/plain
dmesg -w | response /stream
EOF
kapow route add /tail/journal - <<-'EOF'
response /header/Content-Type text/plain
response /headers/Content-Type text/plain
journalctl -f | response /stream
EOF
+2 -2
View File
@@ -17,8 +17,8 @@
#
kapow route add -X POST --entrypoint '/bin/zsh -c' '/convert/{from}/{to}' - <<-'EOF'
pandoc --from=$(request /match/from) \
--to=$(request /match/to) \
pandoc --from=$(request /matches/from) \
--to=$(request /matches/to) \
--output=>(response /body) \
=(request /body)
EOF
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env sh
curl -X POST --data-binary @- http://localhost:8080/convert/markdown/man <<EOF
# This is not a pipe
1. hello
1. goodbye
EOF
+1 -1
View File
@@ -17,4 +17,4 @@
#
kapow route add -X POST --entrypoint ./topdf '/editor/pdf'
kapow route add / -c 'response /header/Content-Type text/html && response /body < pdfeditor.html'
kapow route add / -c 'response /headers/Content-Type text/html && response /body < pdfeditor.html'
+1 -1
View File
@@ -19,7 +19,7 @@
tmpfile=$(mktemp --suffix=.pdf)
pandoc --from=$(request /form/from) --to=pdf --output=${tmpfile} -t latex =(request /form/content)
if [ $? -eq 0 ]; then
response /header/Content-Type application/pdf
response /headers/Content-Type application/pdf
response /body < ${tmpfile}
response /status 200
else
Regular → Executable
+3 -3
View File
@@ -17,7 +17,7 @@
#
kapow route add / - <<-'EOF'
response /header/Content-Type text/html
response /headers/Content-Type text/html
response /body <<-HTML
<html>
<body>
@@ -28,7 +28,7 @@ kapow route add / - <<-'EOF'
EOF
kapow route add /save/magnet -e '/bin/bash -c' - <<-'EOF'
link=$(request /param/link)
link=$(request /params/link)
[ -z $link ] && response /status 400 && exit 0
watch_folder=/tmp
@@ -37,7 +37,7 @@ kapow route add /save/magnet -e '/bin/bash -c' - <<-'EOF'
echo "d10:magnet-uri${#link}:${link}e" > "meta-${BASH_REMATCH[1]}.torrent"
response /status 302
response /header/Location /torrent/list
response /headers/Location /torrent/list
EOF
kapow route add /torrent/list -c 'response /body "Not Implemented Yet"'