💡 Commandline

#Seppo being a CGI[1] program means, it is usually called by the webserver in a specific environment.

However, it is built to also be used from the commandline within a #Seppo directory on the server:

$ ./seppo.cgi 
seppo-Linux-x86_64-0.4_20240610.cgi: get help with -h

To e.g. post a note you might:

### change into the first directory with a seppo.cgi
$ cd "$(dirname "$(find . -name seppo.cgi | head -1)")"

### call it to check it's there and executable
$ ./seppo.cgi
seppo.cgi: get help with -h

### post a note
$ echo "Hello, #Fediverse!" \
| sudo -u "$(stat -c '%U' o/p/index.xml)" ./seppo.cgi note

Mind that seppo.cgi always should be run in the same user context. So we use whoever created the startpage.

Or to retrieve the entry for a certain url from storage, do e.g.

$ echo 'https://Seppo.mro.name/demo/o/p-24/#26' \
| ./seppo.cgi abs2id \
| ./seppo.cgi id2page \
| ./seppo.cgi page2s \
| ./seppo.cgi s2atom
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:wf="urn:ietf:rfc:7033" xml:base="https://Seppo.mro.name/demo/"><entry xml:lang="en">
    <id>https://Seppo.mro.name/demo/o/p-24/#26</id>
    <title type="text">🌞 Good Morning https://Seppo.mro.name!</title>
    <updated>2024-06-13T15:00:01+02:00</updated>
    <published>2024-06-13T15:00:01+02:00</published>
    <author>
      <name>@demo@Seppo.mro.name</name>
      <wf:uri>acct:demo@Seppo.mro.name</wf:uri>
      <uri>https://Seppo.mro.name/demo/</uri></author>
    <link rel="self" href="https://Seppo.mro.name/demo/o/p-24/#26"/>
    <link rel="edit" href="https://Seppo.mro.name/demo/seppo.cgi/edit?id=o/p-24/%2326"/>
    <link href="https://Seppo.mro.name/v/0.4+dc9cd99"/>
    <category label="Seppo" term="Seppo" scheme="https://Seppo.mro.name/demo/o/t/"/>
    <category label="Demo" term="Demo" scheme="https://Seppo.mro.name/demo/o/t/"/>
    <content type="text">#Seppo #Demo v0.4+dc9cd99 see https://Seppo.mro.name/downloads
</content>
  </entry></feed>

* * *

Footnotes

  1. RFC3875 The Common Gateway Interface (CGI), back^