spc476 / glv-1.12556 Goto Github PK
View Code? Open in Web Editor NEWThe First Gemini Protocol Server
License: GNU General Public License v3.0
The First Gemini Protocol Server
License: GNU General Public License v3.0
GLV-1.12556: The First Gemini Protocol Server It's named after the NASA designation for Gemini 1, which is fitting, because it's the first Gemini protocol server written. Features: * Serves any type of document * Configurable filenames for default Gemini index files * Configurable extension for Gemini index files * Will create a Gemini index file for directories sans a Gemini index file * Support for CGI * Gemini-specific CGI scripts * HTTP-specific CGI scripts * Support for SCGI * Gemini-specific SCGI programs * HTTP-specific SCGI programs * Support for user directories * Support for multiple directories per host * Support for serving up single files * Support for vitual hosting (multiple domains) * Support for specifying MIME type per file extension * Support for files in multiple human languages * Support for specifying non-UTF-8 character sets * Support for rewriting URLs internally * Authentication by client certificates * Easily extensible with support for custom handlers Prerequisites: * Lua >= 5.3 (Lua 5.2 might work, but not fully tested) * Lpeg >= 1.0.0 * libretls >= 3.3.4 or LibreSSL >= 2.5.0 * GNU libmagic (NOTE: This is NOT image manipulation, but file identification) * A whole bunch of Lua modules, availble at: * https://github.com/spc476/lua-conmanorg * https://github.com/spc476/LPeg-Parsers Installation: This will require some work. You will need to download the modules listed above from Github and get them installed. Out once you have all the prerequisites installed, the server should just work. Bulding: Just type "make" (there's one C module that might be required, depending upon your desired configuration). If you have the Lua include files in a non-standard location, you may need to do: make LUA_INCDIR=/path/to/Lua/includes You can do "make install" if you want to install the server onto the system: make install This will install files in the following locations: /usr/local/bin/GLV-1.12556 # server /usr/local/lib/lua/5.3/GLV-1 # server modules (written in C) /usr/local/share/lua/5.3/GLV-1 # server modules (written in Lua) To fine tune, you can from the command line: make [location] install The various [location] options are (multiple can be specified) prefix=target-dir target-dir/bin/GLV-1.12556 target-dir/lib/lua/5.3/GLV-1 target-dir/share/lua/5.3/GLV-1 LUADIR=target-dir target-dir/GLV-1 # modules written in Lua LIBDIR=target-dir target-dir/GLV-1 # modules written in C BINDIR=target-dir target-dir/GLV-1.12556 # server program If the Lua include files are in a non-standard location, you can specify: make LUA_INCDIR=/path/to/lua/includes But you do not need to install anything if you run GLV-1.12556.lua directly in the Lua subdirectory. The program requires a single argument, the location of the configuration file. Configuration: You will need to generate a certificate, as the protocol requires the use of TLS. There are plenty of on-line tortorials about generating a self-signed certificate, or you could use a certificate from Let's Encrypt. The file "minimal-conf.lua" is the bare minimum configuration file you'll need to serve up files from a directory, but do look at the sample-conf.lua file as that has extensive comments about each section and what is required, and what isn't. It will help to know some Lua, especially Lua string patterns (its form of regex) as various sections of the configuration are applied to requests via pattern matching of the request. To run CGI scripts, you'll need to include the cgi section in the configuration file, After that, any file that the filesystem handler encounters that is marked executable will be treated as a CGI script and run. If CGI is NOT enabled, the server will simply return a temporary error (and log the condition via syslog()).
If I send a URL like //gemini.conman.org
to the gemini.conman.org server, I get back a status 53. But the spec states that URLs without a scheme should have a scheme of Gemini implied, even for server requests.
Files that are larger then 11,466 bytes aren't served up. Files that have 11,466 bytes or less are served up. I'm not sure exactly where the issue lies---it's most likely with the TLS wrapper module in org.conman.nfl.tls, but this project is where the bug was first noticed.
Looks good now. The table in the initial PR didn't format correctly (I was trying to keep it centered).
I also staged it back in my fork of the patch2, so I'm not sure if it's actually part of the PR I made for you, pls advise, and I can fix that later if you like the PR and new formatting of the README.md
Finally, I'm happy to start working on docs/manual too, running stuff by and collaborating w/you on what will/should be included in those docs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.