Comment by ๐ฒ byte
Re: "Help me figure out titan please?"
@ps for now I just wrote this thing in the link (like "just press send in the dialog to delete"), but it seems like a workaround. Since links like "path/to/file;size=0" are for deletion only by design of the protocol, browsers should not promt for file upload in this case IMHO
2025-02-05 ยท 1 year ago
13 Later Comments โ
๐ป ps ยท 2025-02-05 at 00:54:
I think the server should never request the link like "path/to/file;size=0", but "path/to/file" instead.
The "size=0" is the client response part (but not sure as learning it too)
Maybe this request implementation would be helpful:
โ Client request builder in ggemini library
- the size there calculating from user input, and when the input match 0 bytes, it probably send the "empty" request.
๐ฒ byte [OP] ยท 2025-02-05 at 01:18:
I guess it's more helpful to take this discussion to the git for Lagrange
https://github.com/skyjake/lagrange/issues/717
๐ clseibold [๐] ยท 2025-02-05 at 01:22:
The ";size=0" is what the *client* is supposed to attach onto the url when it sends data to the server. So far I have never seen ";size=0" appended to Titan links themselves. I suppose that would be useful to be able to do though specifically for links to delete resources.
There is a difference between the URL in a Titan *request* and the URL in *links*. The spec talks about the URL in Titan requests, it *does not* explicitly talk about URLs of links in gemtext or other documents.
๐ skyjake [mod...] ยท 2025-02-05 at 08:03:
@clseibold is right, you don't include URL parameters in Titan link lines on Gemtext pages. At least Lagrange will strip any such parameters and just show you the Titan upload UI using which the user can provide the data and and token to send, if any.
When it comes to file deletion on serverside, yes the Titan specification does say that "size=0" should imply deletion. However, the specification implicitly assumes the server is being used for managing a set of editable resources. In that use case, deletion on "size=0" is a good way to do it. Titan can be used for other applications, too, so in the end the behavior is up to the Titan server implementation. Uploading something with size zero could be interpreted as deletion, or it could mean creation of an empty file, or something else. The token parameter could also be used here as a command/hint as to what the operation should be.
When it comes to Lagrange, the UI could be improved by adding a way to explicitly make an empty upload. Currently you have to submit a blank text field, and it'll include a mime parameter which may confuse the server.
๐ป ps ยท 2025-02-08 at 14:17:
@byte do you work on Imgur replacement?
If yes, I think you should provide Gemini link (with token in query) to delete the content recently published.
๐ฒ byte [OP] ยท 2025-02-08 at 19:18:
@ps ye that's the exact reason i'm doing titan implementation. I thought that size=0 would work, but now i see it's a gray area for interpetation
๐ป ps ยท 2025-02-08 at 19:38:
it's a gray area for interpetation
+1 same thoughts after first experience on client-side
I have some other questions, recently described here:
โ bbs.geminispace.org/s/Gemini/24978
imho - do not care about the deletion, I think for any public photo-hosting it's much important to auto-delete content without views (to not overload the server with dead content)
is this project opensource? could you share the reference to the repo if yes?
๐ฒ byte [OP] ยท 2025-02-08 at 19:47:
@ps it will be, for now it's just a semi-working draft, as I don't have too much time to make it work properly yet
๐ป ps ยท 2025-02-08 at 19:57:
@byte that's because I'm asking for, because would glad to participate (if that's Rust only)
๐ป ps ยท 2025-02-08 at 20:05:
@byte hey, I have recently added you to the moderators of /s/Ukrainians band!
๐ skyjake [mod...] ยท 2025-02-08 at 20:35:
@byte:
size=0 would work, but now i see it's a gray area for interpetation
The protocol does not define a way to set a client-side constraint on the data that the user is supposed to send in the request. So a Titan URL cannot include a "size=N" parameter, because the size is only determined based the data that the user chooses. One would have to extend the specification to allow for this.
๐ฒ byte [OP] ยท 2025-02-08 at 20:45:
@ps the titan handling code is currently here - https://git.sr.ht/~byte-/gabbro, and the imgur part will be a set of CGIs
๐ป ps ยท 2025-02-08 at 21:25:
thanks, just sr.ht gives me a headache, I don't know yet how to use it :)
Original Post
Help me figure out titan please? โ I wrote a link like titan://localhost/file;size=0; and according to the titan's specification this is supposed to mean "file deletion". And technically it works, but when I press the link in Lagrange it opens up the file upload dialog anyway. Is it a Lagrange-specific behavior or am I missing something?