💾 Archived View for gemlog.blue › users › ttocsneb › 1613086096.gmi captured on 2022-01-08 at 15:09:06. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-04)

-=-=-=-=-=-=-

I may or may not be procrastinating a big lab that is due tonight by working on my gemcaps server right now :)

I am very excited because I was able to figure out how to run python code from c through the python c-api. It was a little difficult to set up, but it also was my first time using python and c together.

I currently have the handlers setup to be loaded dynamically through shared object files. This will allow anyone to write a handler in c++ that could interface with whichever capsule backend they want. My first test of the python handler is to load a module and call a function on each request. The request has the format of:

def GSGI(schema: str, host: str, port: str, path: str, query: str) -> (int, str, str):
    """
    Process a gemini request

    :param schema: schema (should always be 'gemini')
    :param host: hostname
    :param port: port
    :param path: path
    :param query: query

    :return: (status, metadata, response [optional])
    """
    return (
        20, "text/gemini",
"""# Test python response
"""
    )

This format is loosely inspired by the WSGI system that python has for http servers. Being able to create servers this way will give people the ability to change how they server their files. This is honestly more useful with http servers, but I think it can also have its uses for gemini.

Say you want to have a high level server that you of course do not want to program in c++, but you want to serve some files very efficiently that are not involved directly with the server (static files are the most common use-case).

My goal with this project will be to create a capsule that takes full advantage of the features gemini has to offer. I remember seeing a livestream where someone was creating a twitter clone on gemini. This got me thinking about the request header size limits, and how I could use that to my advantage. Since gemini doesn't support uploading content through the protocol, the only way to upload things would be through http. This is a bummer, but it could be useful.

Maybe I could create a social media capsule that you cannot access through http, but if you want to make a post, then it will redirect you to an http site with some key to let the server know who you are, and what your action is. If the action is small enough, then it could handle your request completely through gemini. When you want to log in, you can supply your username and password, along with a client certificate that the server will save so that you don't need to login in the future.

I really like the idea of gemlogs that have been happening, but I want there to be more interaction. Maybe this app could work. Maybe the need to require http requests will make it fail. I don't know, but I want to try.