diff --git a/pubsub/cli.go b/pubsub/cli.go index cb1e11df..d8196365 100644 --- a/pubsub/cli.go +++ b/pubsub/cli.go @@ -356,7 +356,7 @@ func WishMiddleware(handler *CliHandler) wish.Middleware { } else if cmd == "sub" { subCmd := flagSet("sub", sesh) public := subCmd.Bool("p", false, "Subscribe to a public topic") - keepAlive := subCmd.Bool("k", false, "Keep the subscription alive even after the publisher as died") + keepAlive := subCmd.Bool("k", false, "Keep the subscription alive even after the publisher has died") if !flagCheck(subCmd, topic, cmdArgs) { return } diff --git a/pubsub/html/marketing.page.tmpl b/pubsub/html/marketing.page.tmpl index 2a59c3c6..a9101926 100644 --- a/pubsub/html/marketing.page.tmpl +++ b/pubsub/html/marketing.page.tmpl @@ -29,7 +29,8 @@ user-defined topics. By default, topics are private to the authenticated ssh user. The default pubsub model is multicast with bidirectional blocking, meaning a publisher (pub) will send its message to all - subscribers (sub) on a topic. Further, both pub and + subscribers (sub) for a topic (channels). There can be many publishers + and many subscribers on a topic. Further, both pub and sub will wait for at least one event to be sent or received on the topic.

@@ -46,9 +47,9 @@
  • Configurable blocking for both pubs and subs
  • Paradigms for connecting to a topic:
      -
    1. Read (sub)
    2. -
    3. Write (pub)
    4. -
    5. Read & Write (pipe)
    6. +
    7. Read (sub)
    8. +
    9. Write (pub)
    10. +
    11. Read & Write (pipe)
  • @@ -102,7 +103,14 @@

    Pipe command output

    -

    Send command output through our pipe command.

    +

    + Send command output through our pipe command. The + pipe command is just like pub except it + is non-blocking and also acts like a sub. So a client + that can read and write to the topic. +

    +
    ssh {{.Site.Domain}} sub htop
    +
    htop | ssh {{.Site.Domain}} pipe htop
    Demo @@ -122,7 +130,10 @@

    Chat

    Use our pipe command to have a chat with someone.

    ssh {{.Site.Domain}} pipe mychan -p
    -

    Now anyone with a pico account can subscribe to this channel using the same command.

    +

    + Now anyone with a pico account can subscribe to this + topic using the same command and start typing! +

    Demo @@ -141,6 +152,8 @@

    Pipe reverse shell

    If you squint hard enough you can give users interactive access to your shell.

    +
    mkfifo /tmp/f; cat /tmp/f | /bin/sh -i 2>&1 | ssh {{.Site.Domain}} pipe myshell > /tmp/f
    +
    ssh {{.Site.Domain}} pipe myshell
    Demo @@ -158,6 +171,11 @@

    Simple CI/CD

    +

    + I'm always looking for easy ways to simplify deploying apps + automatically. Having an authenticated, zero-install event system + seems handy for this purpose. +

    ssh {{.Site.Domain}} sub myimg; docker pull myimg && docker up -d dev
    docker buildx build --push -t myimg .; ssh {{.Site.Domain}} pub myimg -e
    @@ -166,6 +184,13 @@

    Pubsub interactions

    Multiple subs

    +

    + Have many subscribers, they will all receive the message. +

    +
    ssh {{.Site.Domain}} sub foobar
    +
    ssh {{.Site.Domain}} sub foobar
    +
    while true; do echo "foobar1"; sleep 1; done | ssh {{.Site.Domain}} pub foobar
    +
    Demo