summaryrefslogtreecommitdiffstats
path: root/cholerab/Reaktor
diff options
context:
space:
mode:
Diffstat (limited to 'cholerab/Reaktor')
-rw-r--r--cholerab/Reaktor/IRC-RPC32
-rw-r--r--cholerab/Reaktor/priviliged_functions24
2 files changed, 56 insertions, 0 deletions
diff --git a/cholerab/Reaktor/IRC-RPC b/cholerab/Reaktor/IRC-RPC
new file mode 100644
index 00000000..a5350534
--- /dev/null
+++ b/cholerab/Reaktor/IRC-RPC
@@ -0,0 +1,32 @@
+# Krebs IRC RPC
+
+ on :<from> PRIVMSG <target> :<handle>: <command> <argument>
+
+ if <handle> ∈ { nickname, "ALL" }
+ if <command> is a public command
+
+ path = $__public_command_directory/<command>
+ argv = []
+ envp = { from: <from>, argument: <argument> }
+
+ <code> = execve(path, argv, envp) → <stdout>, <stderr>
+
+ if <code> = 0
+ if <target> is channel
+ PRIVMSG <target> :<from>: <stdout>
+ PRIVMSG <from> :<stderr>
+ else
+ ; TODO assert <target> = <from>
+ PRIVMSG <from> :<stdout>
+ PRIVMSG <from> :Error: <stderr>
+ else
+
+ send all <.*> to the Ministerium
+
+ if <target> is channel
+ PRIVMSG <target> :<from>: <command> is broken ATM
+ else
+ PRIVMSG <target> :Error: <command> is broken ATM
+
+ else
+ PRIVMSG <target> :<from>: you are made of stupid
diff --git a/cholerab/Reaktor/priviliged_functions b/cholerab/Reaktor/priviliged_functions
new file mode 100644
index 00000000..a673267e
--- /dev/null
+++ b/cholerab/Reaktor/priviliged_functions
@@ -0,0 +1,24 @@
+Use Case 1: Request update on Host
+=================================
+
+< user> bot: update
+< bot> /whois user
+< bot> /msg user [CHALLENGE]
+< user> /msg bot [CHALLENGE-RESPONSE]
+< bot> updating...
+< bot> now on rev XXXXX
+
+Command Flow
+----------------
+The bot has a locally stored list of [trusted] hosts along with their public
+key, preferably from the tinc/retiolum directory.
+
+The bot encrypts a 1K Byte long message with the public key of the host
+retrieved by the /whois command.
+
+This challenge is sent to the user requesting the command via private message.
+The user then decrpyts the message with its own private key and sends the
+decrpyted message to the bot.
+
+The bot then executes the requested command if the challenge is answered
+correctly