💾 Archived View for bbs.geminispace.org â€ē u â€ē gritty â€ē 14443 captured on 2024-06-16 at 15:51:05. Gemini links have been rewritten to link to archived content

View Raw

More Information

âŦ…ī¸ Previous capture (2024-05-26)

➡ī¸ Next capture (2024-08-18)

🚧 View Differences

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

Comment by 🍀 gritty

Re: "How does one use CGI for a root page?"

In: s/GmCapsule

I think if you want your entire capsule dynamic, use the cgi.* entry and set path to "/"

🍀 gritty

Jan 29 ¡ 5 months ago

4 Later Comments ↓

🐐 satch [OP] · Jan 29 at 03:53:

@gritty perhaps this will work, but what if I want just one static page? I have to write a CGI for it if I want the root page to be CGI? That seems a little silly.

🕹ī¸ skyjake [mod...] ¡ Jan 29 at 05:34:

GmCapsule does not support CGI index pages at the moment. Index pages (i.e., "index.gmi" in some directory) are only served via the "static" module, and they have to be regular text files.

To make some URL respond with dynamic content, the CGI entry point needs to be configured manually in the config file. You can either configure a single specific URL for this, or as @gritty implies, use a wildcard to assign an entire directory tree under a URL to respond with CGI.

Bubble is implemented as a GmCapsule extension module, so it does not use CGI. (CGI is a more limited/slow interface.) However, it still adds a "/*" wildcard entrypoint for handling requests.

What you probably want to do is something like this in your config file:

[cgi.my-dynamic-root]
path = / /index.gmi
command = {shell command for running the CGI program}

The `path` parameter here registers both / and /index.gmi as the CGI entrypoints, as the client may request either one to access the root index.

🕹ī¸ skyjake [mod...] ¡ Jan 29 at 05:41:

Added an issue:

— /s/GmCapsule-Issues/9

🐐 satch [OP] · Jan 29 at 16:19:

I got my server config working the way I want. Thank you so much for your help! @skyjake @gritty

Original Post

🌒 s/GmCapsule

How does one use CGI for a root page? — What the title says. I have managed to break Lagrange trying to do this but haven't figured it out yet. It's obviously being done here at bbs.geminispace.org, so I'm rather confused.

đŸ’Ŧ satch ¡ 5 comments ¡ Jan 28 ¡ 5 months ago