Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

gemini server

NotificationsYou must be signed in to change notification settings

wrclark/gem

Repository files navigation

gemini server with TLS and script for generating working TLS certs

Supports

  • mime types
  • directory listing
  • chunked file transfer
  • passes most gemini-diagnostics tests
  • user-defined charset/lang meta attributes

Directory listing as seen in Lagrange

build

To build you may need to installlibssl-dev

$ sudo apt install libssl-dev$ make ssl$ make$ sudo setcap cap_sys_chroot+ep gem

Last step is required forchroot (or you can run as root/sudo)

Program options

-c [pub cert path]   ex: -c "gem.crt"     (tls/server.crt default)-k [priv key path]   ex: -k "gem.key"     (tls/server.key default)-h [HOSTNAME]        ex: -h "example.com" (localhost default)-p [PORT]            ex: -p 1965          (default)-d [DOC ROOT]        ex: -d "/var/gemini"-i [INDEX FILE]      ex: -i "index.gmi"   (default)-e  enumerate directories without an index file-a  permit requests with a different hostname-v  print request information

Run with./gem -d capsule -aev

Run gem somewhere other than the git project

The options-c for the certificate file (pub key) and-k for the private key can be used for this purpose.

# example setup$ ./gem -aev -d~/gemini/capsule -c server.crt -k secret.key

SSL cert

To use your own domain name you have to replace/CN=localhost in thessl make target to your domain: egexample.com =>/CN=example.com.

Then you must also specify the domain as the hostname when running the program:

./gem -h"example.com" -d capsule -aev

The-a flag can be useful for accessing the server over IP (perhaps over LAN) without a DNS name.

The-d flag must always be specified.

meta header lang/charset attribute

These are optional, special attributes in the gemini header that define the charset and language used on the page.

language

To define the language for all the text files in a directory, simply create a.lang file with anISO 639 2-letter-code optionally followed by by anISO 3166-1 country code.

Examples:

en-GBen-USrues-MXsv-FIja

charset

Character encoding.utf-8 should be enough but some text may require any of the following to render properly:

ISO-8859-1Windows-1251Windows-1252GB2312Shift_JIS

These 'rules' apply for all the files in that directory. Also make sure it is enabled (1) inconfig.h.

capsule/├── .charset      <--- "utf-8"├── dog.png├── index.gmi├── .lang         <--- "en-GB"└── misc    ├── 🦊🐦🦉🐞🦓    │   ├── 🦩.gmi    │   ├── 🐅.gmi    │   ├── 🐧.gmi    │   ├── 🐬.gmi    │   └── 🐺.gmi    ├── jp    │   ├── .charset      <--- "Shift_JIS"    │   ├── .lang         <--- "ja"    │   └── samurai_text_shift_jis.txt    └── міжнародний        ├── Sultan'ın garaj uzmanı        ├── документ на русском языке.txt        ├── คำสารภาพ        └── 中国

Misc

Great development tool:

https://github.com/michael-lazar/gemini-diagnostics

Test gemini client:

echo"gemini://localhost"| openssl s_client -quiet -crlf -connect localhost:1965

[8]ページ先頭

©2009-2025 Movatter.jp