Comment by 🦎 bluesman
I use Titan for all my BBS posts - at least since I added Titan support to Alhena. I also use it to edit my own capsule and gemlog (protected by a client cert). Other than uploading some test files to Osiris when that was online, I don't remember using it for any other purpose.
Oct 28 · 7 weeks ago
Poll Results
1. YES - I USE TITAN FOR LONG TEXT EDITS
████████████▁▁▁▁▁▁▁▁▁▁▁▁ 50%
2. NO - I USE THE BASIC EDIT
████████████▁▁▁▁▁▁▁▁▁▁▁▁ 50%
12 votes were cast.
3 Later Comments ↓
I never used Titan for editing stuff, I wonder if it's possible for me to use titan for Gmcapsule. (I'm still loking at the Gmcapsule user manual to help me with stuff) While I'm slowly adding more things to my Lafufu dolls face
For long messages, I usually use a separate text editor to write it in a separate file, and then will use "astroget" to send it using Titan.
SUCCESS!
This is so much better. Thank you. I somehow got it into my head that the titan links were strictly for upload and not download. I was failing to download raw segments early on because my script was not handling the ALPN or something.
I didn't figure out that was why and changed course to download the entire edit post page. Which failed with a 59 bad request until I found go-gemini client which relies on go package crpto/tls. This handled all of that for me:
`gemini.FetchWithCert(url, cert, key)`
I should note that my script is actually converting to a gemini:// url and then uploading to a titan:// url. From what I understand, the gemini protocol must be used for downloading the raw copy.
New Workflow
Now it just opens a text editor when the titan links are clicked. If it is a raw segment of existing text, it will open that text in the text editor. Much easier from the user perspective. A bit more overview of what I'm doing under the good follows.
Editing Raw Segment (Existing Text)
- Click titan://bbs.geminispace.org/raw-segment/99999;edit
- Executed handler script and pass this url as an argument
- Strip ";edit" from the url
- Convert url to gemini://bbs.geminispace.org/raw-segment/99999
- Download the raw segment contents using go-gemini
- Write it to a temporary text file and open text editor
- User edits, saves, and terminates text editor process
- Script resumes to upload the text to the titan raw segment url titan://bbs.geminispace.org/raw-segment/99999
Editing Long Text (New Post or Comment)
- Click add-text link titan://bbs.geminispace.org/edit/99999/add-text
- titan handler script opens a blank editor
- Handler script sends the text to the titan add-text url when the text editor is closed
Side Notes
For those restricted to text-based terminal (no gui approach)...
I mentioned in the OP that I chose a gui text editor because amphora would need to be closed or a new terminal would need to be opened to run an editor in the shell. Running a client like amphora in a terminal multiplexer is probably the best solution. tmux, for example, can maintain a persistent session for your gemini client while switching to a console-based text editor in the same terminal window.
In my case, sending the amphora process to the background and then back to the foreground was not a pretty sight. Wouldn't recommend it.
TLS and ALPN Handling
I didn't want to get into the whole TLS handshake part of this, but it's a necessary part of the script. It looks like there are a lot of libraries that support everything needed for that. I just settled on the first tool that I got working for downloads with go-gemini.
I have since confirmed this this works as well:
`openssl s_client -alpn gemini -quiet -cert "$CERT_PATH" -key "$KEY_PATH" -connect "$host:$port"`
For uploads over the titan protocol, ALPN is not currently required. Should it be?
Other Clients
I'll probably try some at some point. Starting with the ones recommended in the above comments. I was aware of Alhena and wanted to check that out. It looks awesome for desktop users.
Well... Let's see if this long ass comment is posted.
Original Post
Titan Post Edit Workflow — How do you currently draft and edit posts via titan? Here's my current workflow using the amfora client: Edit First Draft Using Titan This is pretty straightforward. In the .config.toml for amfora, I have a handler for titan urls. It looks something like this: `titan = ['/path/to/titan-edit-wrapper.sh']` I click the "Add long text" link in the draft page: titan://bbs.geminispace.org/edit/99999/add-text This is the only time I actually follow a titan link through...