Commit graph

27 commits

Author SHA1 Message Date
m0xEE
34a61406f0 Update image inlining 2025-01-17 13:54:57 -05:00
96aba4fdc1 Add inline image support 2025-01-11 05:19:22 -05:00
32c87fbc39 Add new flags for robots.txt and URL rewrites 2025-01-10 07:24:45 -05:00
c36b3b6cb0 Fix deprecation 2025-01-10 07:19:12 -05:00
e4781e7f37 Add portal flag
Proxing all small web through /x/ might not be desirable. In this commit I am adding a new argument, -p, that allows proxing all external requests using a third party proxy, like Portal (https://portal.mozz.us).

By proding a value for this parameter any request made to `/x/` whose host does not match the root host will be rejected.
2025-01-08 08:31:56 -05:00
nytpu
857f8c97eb Generate anchor links for headings
This will generate `id` attributes for all heading levels.  The labels
are generated using steps 1-4 of the gitlab flavored markdown algorithm
which seems to be pretty standard for generating anchors:
https://docs.gitlab.com/ee/user/markdown.html#header-ids-and-links

A unique ID isn't appended to avoid having to store a list of previous
headers to compare against.
2021-11-05 10:32:15 +01:00
mbays
a8c54c1a32 Serve robots.txt disallowing all robots
This overrides any robots.txt file in the proxied gemini capsule, on the
basis that this is intended for gemini robots (which can be expected to
follow the robots.txt companion spec) rather than web robots.

The main purpose though for disallowing web robots is to prevent them
from crawling the proxied cross-site geminispace under /x/, since web
robots won't know even to read the robots.txt files for other capsules
proxied this way.
2021-08-25 13:02:55 +02:00
nytpu
988a00f126 Add -e flag to place a stylesheet externally rather than loading it inline
By default, kineto loads a stylesheet given to -s from disk and places
it inline with the HTML in a <style>...</style> block.  This patch adds
a -e flag to load a stylesheet externally.  When the -e flag is passed
with a URI (relative or absolute), the given link is placed in the href
of a <link rel="stylesheet"...> tag.  This helps facilitate caching
which can *significantly* reduce request overhead, particularly when the
stylesheet is large (>= the size of the page content).

The given URI is not validated, and if it is invalid the browser will
404 when requesting it and the page will have no style.
2021-05-31 17:05:38 -06:00
Adnan Maolood
edd4fe31f1 Update go-gemini dependency 2021-02-25 08:52:22 -05:00
Adnan Maolood
60109be26f Implement input prompts on external domains 2021-02-25 08:52:21 -05:00
Adnan Maolood
fa95eaf041 Use fmt.Fprintf instead of Write and Sprintf 2021-02-25 08:52:04 -05:00
Adnan Maolood
c2f510eb79 Implement support for "lang" media type parameter 2021-02-25 08:51:58 -05:00
Adnan Maolood
a584df6afa Display an error on charsets other than UTF-8
This prevents the proxy from sending invalid UTF-8 to the client.
2021-02-25 08:51:45 -05:00
Adnan Maolood
6d23d00a6f Fix relative redirects
Setting next.Host before setting next.Path breaks relative redirects on
external sites, where next.Host != r.URL.Host.
2021-02-25 08:51:38 -05:00
José Mota
1975525eeb Add support for custom CSS. 2021-02-16 08:34:19 -05:00
Adnan Maolood
9d507dcaac Update go-gemini dependency
Version 0.1.12 fixes a bug where the client Timeout was not applied when
dialing, causing the client to hang when a host was down.
2021-01-15 14:41:32 -05:00
Drew DeVault
44390b2513 Use POST request to respond to input requests 2020-11-08 12:41:56 -05:00
Drew DeVault
cf33ad12e5 Fix URLs with legit query strings in them 2020-11-08 12:34:07 -05:00
Drew DeVault
6531cf3930 Implement input and redirect responses 2020-11-08 10:27:29 -05:00
Adnan Maolood
0ee3c853f3 Fix response status switch statement 2020-11-06 10:13:07 -05:00
Adnan Maolood
030a76c270 Update go-gemini dependency 2020-11-06 10:13:07 -05:00
Byron Torres
1074d434d2 Add dark mode user preference with CSS media query 2020-11-02 11:44:05 -05:00
Drew DeVault
adfe6e92c5 Reduce li margin to 0.5rem 2020-11-01 13:39:28 -05:00
Drew DeVault
633432ef9a Add spacing between li's 2020-11-01 13:38:18 -05:00
Drew DeVault
916bdc617d Fix style of proxy link at bottom of page 2020-10-28 14:01:52 -04:00
Drew DeVault
c96ae6b80f Add ⇒ before links 2020-10-26 12:30:55 -04:00
Drew DeVault
8527505573 Initial commit 2020-10-11 13:43:39 -04:00