Removing old-style kapow.
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
POST /eval {
|
||||
(@raw:request/body) > @fifo:response/stream/lines
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
FROM kapow
|
||||
RUN apk add nmap
|
||||
COPY nmap.pow .
|
||||
CMD kapow nmap.pow
|
||||
@@ -1,3 +0,0 @@
|
||||
POST /list/{ip} {
|
||||
nmap -sL @value:request/match/ip > @fifo:response/body
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
GET /list/files {
|
||||
ls -la @value:request/params/path > @fifo:response/body
|
||||
}
|
||||
|
||||
GET /list/processes {
|
||||
ps -aux > @fifo:response/body
|
||||
}
|
||||
|
||||
GET /show/cpuinfo {
|
||||
cat /proc/cpuinfo > @fifo:response/body
|
||||
}
|
||||
|
||||
GET /show/memory {
|
||||
free -m > @fifo:response/body
|
||||
}
|
||||
|
||||
GET /show/disk {
|
||||
df -h > @fifo:response/body
|
||||
}
|
||||
|
||||
GET /show/connections {
|
||||
ss -pluton > @fifo:response/body
|
||||
}
|
||||
|
||||
GET /show/mounts {
|
||||
mount > @fifo:response/body
|
||||
}
|
||||
|
||||
GET /tail/dmesg {
|
||||
echo "text/plain" > @fifo:response/header/Content-Type
|
||||
dmesg -w > @fifo:response/stream/lines
|
||||
}
|
||||
|
||||
GET /tail/journal {
|
||||
echo "text/plain" > @fifo:response/header/Content-Type
|
||||
journalctl -f > @fifo:response/stream/lines
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
POST /convert/{from}/pdf {
|
||||
tmpfile=$(mktemp --suffix=.pdf)
|
||||
pandoc --from=@value:request/match/from \
|
||||
--to=pdf \
|
||||
--output=${tmpfile} \
|
||||
-t latex \
|
||||
@file:request/body
|
||||
if [ $? -eq 0 ]; then
|
||||
cat ${tmpfile} > @fifo:response/body
|
||||
echo "application/pdf" > @fifo:response/header/Content-Type
|
||||
echo 200 > @fifo:response/status
|
||||
else
|
||||
echo 500 > @fifo:response/status
|
||||
fi
|
||||
rm -f ${tmpfile}
|
||||
}
|
||||
|
||||
POST /convert/{from}/{to} {
|
||||
pandoc --from=@value:request/match/from \
|
||||
--to=@value:request/match/to \
|
||||
--output=@fifo:response/body \
|
||||
@file:request/body
|
||||
}
|
||||
|
||||
GET /formats/input {
|
||||
pandoc --list-input-formats > @fifo:response/body
|
||||
}
|
||||
|
||||
GET /formats/output {
|
||||
pandoc --list-output-formats | grep -v pdf > @fifo:response/body
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>PDF Editor</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/siimple/dist/siimple.min.css">
|
||||
<head>
|
||||
<body>
|
||||
<div class="siimple-content siimple-content--extra-large">
|
||||
<div class="siimple-grid">
|
||||
<div class="siimple-grid-row">
|
||||
<div class="siimple-grid-col siimple-grid-col--12">
|
||||
<div class="siimple-grid-col siimple-grid-col--6">
|
||||
<div class="siimple-form">
|
||||
<form action="/editor/pdf" method="post" target="result" id="editor">
|
||||
<div class="siimple-form-title">AWYSIWYG PDF Editor</div>
|
||||
<div class="siimple-form-field">
|
||||
<div class="siimple-form-field-label">InputFormat</div>
|
||||
<select name="from">
|
||||
<option value="markdown">Markdown</option>
|
||||
<option value="rst">ReStructuredText</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="siimple-form-field">
|
||||
<div class="siimple-form-field-label">InputFormat</div>
|
||||
<textarea class="siimple-textarea siimple-textarea--fluid" rows="25" name="content">Example text</textarea>
|
||||
</div>
|
||||
<div class="siimple-form-field">
|
||||
<div class="siimple-btn siimple-btn--blue" onclick="document.getElementById('editor').submit();">Preview!</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="siimple-grid-col siimple-grid-col--6">
|
||||
<iframe name="result" src="" style="height: 100%; width: 100%;"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
POST /editor/pdf {
|
||||
tmpfile=$(mktemp --suffix=.pdf)
|
||||
pandoc --from=@value:request/form/from \
|
||||
--to=pdf \
|
||||
--output=${tmpfile} \
|
||||
-t latex \
|
||||
@file:request/form/content
|
||||
if [ $? -eq 0 ]; then
|
||||
cat ${tmpfile} > @fifo:response/body
|
||||
echo "application/pdf" > @fifo:response/header/Content-Type
|
||||
echo 200 > @fifo:response/status
|
||||
else
|
||||
echo 500 > @fifo:response/status
|
||||
fi
|
||||
rm -f ${tmpfile}
|
||||
|
||||
}
|
||||
|
||||
GET / = index.html
|
||||
@@ -1,28 +0,0 @@
|
||||
GET / {
|
||||
echo "text/html" > @fifo:response/header/Content-Type
|
||||
cat > @fifo:response/body <<-HTML
|
||||
<html>
|
||||
<body>
|
||||
<a href='javascript: Array.from(document.querySelectorAll("a")).filter(x => x.href.indexOf("magnet") != -1 ).map(x => x.href = "http://localhost:8080/save/magnet?link="+encodeURI(x.href))'>Add me to your bookmarks!</a>
|
||||
</body>
|
||||
</html>
|
||||
HTML
|
||||
}
|
||||
|
||||
GET /save/magnet {
|
||||
set -x
|
||||
link=@value:request/param/link
|
||||
[ -z $link ] && echo 400 > @fifo:response/status && exit 0
|
||||
|
||||
watch_folder=/tmp
|
||||
cd $watch_folder
|
||||
[[ "$link" =~ xt=urn:btih:([^&/]+) ]] || exit;
|
||||
echo "d10:magnet-uri${#link}:${link}e" > "meta-${BASH_REMATCH[1]}.torrent"
|
||||
|
||||
echo 302 > @fifo:response/status
|
||||
echo "/torrent/list" > @fifo:response/header/Location
|
||||
}
|
||||
|
||||
GET /torrent/list {
|
||||
echo "..." > @fifo:response/body
|
||||
}
|
||||
Reference in New Issue
Block a user